Commit Graph

34172 Commits

Author SHA1 Message Date
Daniel Baluta e041fbd14e MLK-23560-4 ASoC: SOF: Fix maybe used unitialized warning
This fixes the following compilation warning:

sound/soc/sof/imx/imx8.c: In function ‘imx8_probe’:
sound/soc/sof/imx/imx8.c:210:6: warning: ‘i’ may be used uninitialized
in this function [-Wmaybe-uninitiali

Warning introduce with commit commit 352ad24ec
("MLK-23350-1 ASoC: sof: Skip power domain handline when num_domains")

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-13 17:04:47 +02:00
Pierre-Louis Bossart 5ef38ba2f6 MLK-23560-3 ASoC: SOF: define INFO_ flags in dsp_ops
Currently the INFO_ flags such as PAUSE/NO_PERIOD_WAKEUP are defined
in the SOF PCM core, which doesn't scale. To account for platform
variations, these flags need to be set in DSP ops.

This patch only moves the definitions and does not change any
functionality.

Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191024210318.30068-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 17:04:47 +02:00
Daniel Baluta f2e7784028 MLK-23560-2: ASoC: SOF: Enable PM support
We need to provide PM macros in order for the SOF core
to suspend/resume the DSP.

PM support on the DSP side is quite limited and we are mostly
doing PM for ARM core.

Without this patch DSP won't be restarted after a resume causing
SOF driver calls to time out.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-13 17:04:47 +02:00
Zhang Peng 98bba4c56d MLK-23570i fsl: fsl_dsp: Fix dsp suspend issue on imx.mp board
1. Add check pm runtime state to decide send suspend msg to dsp when
call fsl_dsp_suspend.
2. Set proxy->dsp_mu_init be zero in fsl_dsp_suspend for imx.mp.

Signed-off-by: Zhang Peng <peng_zhang_8@nxp.com>
(cherry picked from commit 10abba22b3)
2020-03-13 15:41:32 +08:00
Viorel Suman 8a7e1d19a8 MLK-23567-3: ASoC: fsl_xcvr: add TX CS control
TX CS control is needed for SPDIF/eARC TX function,
so add it. Aside of this separate TX controls from
RX controls so that controls can be added as function
of RX/TX flags of "fsl,xcvr-mode" DTS variable.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 69a1a919b9)
2020-03-10 11:28:52 +02:00
Viorel Suman f90d88fe40 MLK-23567-2: ASoC: fsl_xcvr: use same format for both RX and TX
The only supported XCVR format is IEC958_SUBFRAME_LE, so use it
for both RX and TX.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit e40f7a6b1a)
2020-03-10 11:28:51 +02:00
Viorel Suman 827ce6bc96 MLK-23313-14: ASoC: fsl: imx_xcvr: remove dummy codec params adjustment hack
The hack was added to allow XCVR to record data at high FS rate,
remove it since it impacts other drivers such as MICFIL.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 514647d585)
2020-02-26 10:58:32 +02:00
Daniel Baluta 88f7d643ad MLK-23350-12: ASoC: SOF: Kconfig: Fix typo in config symbols name
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 2f9fda1072)
2020-02-26 10:45:59 +02:00
Viorel Suman 5062cbd6e8 MLK-23313-11: ASoC: fsl_xcvr: use fsl,xcvr-mode to enable TX/RX
Enable playback and capture as function of fsl,xcvr-mode.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 758605d6d4)
2020-02-25 09:24:49 +02:00
Daniel Baluta 7ce1ff3ee2 MLK-23350-10 ASoC: SOF: Allow SOF IMX8 support to be build as a module
This is necessary for several reasons:
	- SOF FW is not available at boot time so compiling the modules
	as built in will complicate FW booting.
	- decrease Image size

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-21 17:22:10 +02:00
Pierre-Louis Bossart 1750be151e MLK-23350-9 ASoC: SOF: imx: fix undefined reference issue
make.cross ARCH=mips allyesconfig fails with the following error:

sound/soc/sof/sof-of-dev.o:(.data.sof_of_imx8mp_desc+0x40): undefined
reference to `sof_imx8m_ops'

This seems to be a Makefile order issue, solve by using the same
structure as for Intel platforms.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-02-21 17:22:10 +02:00
Pierre-Louis Bossart 452aee67ca MLK-23350-8 ASoC: SOF: imx: fix compilation with allyesconfig
make ARCH=mips allyesconfig generates this error:

sound/soc/sof/imx/imx8m.o:(.data.dsp_ops+0x0): multiple definition of
`dsp_ops'
sound/soc/sof/imx/imx8.o:(.data.dsp_ops+0x0): first defined here

Fix by making the definitions static

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-02-21 17:22:10 +02:00
Daniel Baluta efb390e6c7 MLK-23350-6 ASoC: SOF: Add i.MX8MP device descriptor
Add SOF device and DT descriptor for i.MX8MP platform.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-21 17:22:09 +02:00
Daniel Baluta 3f23312c74 MLK-23350-5 ASoC: SOF: imx: Add i.MX8M HW support
There is one notable difference between i.MX8M and i.MX8, which
doesn't allow us to reuse HW support from imx8.c file designed for i.MX8.

On i.MX8M resources (clocks, power, pinctrl, etc) are managed by the
Linux kernel while on i.MX8 resources are managed by a separate
System Controller Firmware. This makes the interface to those
resources completely different.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-21 17:22:09 +02:00
Daniel Baluta e503940db4 MLK-23350-2 ASoC: fsl: Export imx_audiomix_dsp_start symbol
So that it can be used by SOF module.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-21 17:22:09 +02:00
Daniel Baluta 352ad24ecb MLK-23350-1 ASoC: sof: Skip power domain handline when num_domains = 1
This case case is already handled by the PM core.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-21 17:22:09 +02:00
Viorel Suman bf133eb854 MLK-23313-4: ASoC: fsl: Add Audio XCVR machine driver
This patch implements Audio XCVR machine driver for NXP iMX8 SOCs.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-02-20 12:58:12 +02:00
Viorel Suman c7aa3b9266 MLK-23313-3: ASoC: fsl: Add Audio XCVR CPU DAI driver.
The patch implements Audio XCVR CPU DAI driver for NXP iMX8 SOCs.
Audio XCVR is a on-chip functional module and implements
HDMI 2.1 spec eARC, ARC and SPDIF modes.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-02-20 12:57:57 +02:00
Viorel Suman b48e28774a MLK-23314-1: ASoC: ak5558: add support for ak5552
AK5552 is a 32-bit 2ch ADC and has the same register
map as AK5558.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-02-20 12:57:19 +02:00
Shengjiu Wang 92601d2f59 LF-908-1: fsl_ssi: fix noise issue for master and mono mode
The driver will switch to normal mode for 1 channel, so the slot width
is not fixed to 32 bit in this mode, and even in mono mode, the slot
number is 2.
But if the bit clock calulation still use the bit width=32, and slot
number=1, then it cause the output frameclock is not correct. So there
will be noise in output sound.

This patch is to change the bit clock formula of mono mode to be
2channels * params_width * sample rate.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-02-18 19:11:36 +08:00
Daniel Baluta 79f66d8f52 MLK-23255-4: ASoC: fsl_dsp: Select SND_SOC_FSL_DSP_AUDIOMIX
This is needed by DSP driver on i.MX8MP. Need to find an elegant
way to only select it on this board.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-13 19:26:38 +08:00
Daniel Baluta d9e26ed3a5 MLK-23255-3: ASoC: fsl_dsp: Add support i.MX8MP
1. Introduce new board type and compatible string in preparation for
i.MX8MP board.

2. Add support configure and start DSP for i.MX8MP.

3. Add clocks for i.MX8MP, and do special process when suspend and
resume because dsp haven't independent power.

4. Add special handle for i.MX8MP, because in imx8mp there is audiomix
power domains, and only one power domain.

Signed-off-by: Zhang Peng <peng_zhang_8@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-13 19:26:37 +08:00
Daniel Baluta a504bca19c MLK-23255-2: ASoC: fsl_dsp: Refactor fsl_dsp to prepare support i.MX8MP
1. Factor out SCU configuration from fsl_dsp_probe because
i.MX8 MP which doesn't have an SCU.

2. Factor out DSP start function operation in a separate function
in preparation for adding support for i.MX8MP.

Signed-off-by: Zhang Peng <peng_zhang_8@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-13 19:26:37 +08:00
Daniel Baluta fb29abcd7a MLK-23255-1: ASoC: fsl_dsp: Add Audio MIX DSP helper
This is a subdevice of audiomix MFD device, exposing
access to DSP control register from AudioMIX subsystem.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-13 19:26:37 +08:00
Shengjiu Wang 7fcdf7d7e3 MLK-23287-1: ASoC: fsl_aud2htx: Add aud2htx module driver
The AUD2HTX is a digital module that provides a bridge between
the Audio Subsystem and the HDMI RTX Subsystem. This module
includes intermediate storage to queue SDMA transactions prior
to being synchronized and passed to the HDMI RTX Subsystem over
the Audio Link.

The AUD2HTX contains a DMA request routed to the SDMA module.
This DMA request is controlled based on the watermark level in
the 32-entry sample buffer.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-02-11 18:07:02 +08:00
Pierre-Louis Bossart 1722478144 ASoC: SOF: imx: fix reverse CONFIG_SND_SOC_SOF_OF dependency
updated solution to the problem reported with randconfig:

CONFIG_SND_SOC_SOF_IMX depends on CONFIG_SND_SOC_SOF, but is in
turn referenced by the sof-of-dev driver. This creates a reverse
dependency that manifests in a link error when CONFIG_SND_SOC_SOF_OF
is built-in but CONFIG_SND_SOC_SOF_IMX=m:

sound/soc/sof/sof-of-dev.o:(.data+0x118): undefined reference to `sof_imx8_ops'

use def_trisate to propagate the right settings without select.

Fixes: f4df4e4042 ("ASoC: SOF: imx8: Fix COMPILE_TEST error")
Fixes: 202acc565a ("ASoC: SOF: imx: Add i.MX8 HW support")
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191101173045.27099-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-10 17:01:58 +02:00
Daniel Baluta a6f61fb451 LF-537-15: ASoC: core: Don't override platform name is of_node is set
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-10 17:01:57 +02:00
Paul Olaru b7ecbc7149 LF-537-13: sound: soc: sof: imx: Add i.MX8QM device descriptor
Add SOF device and DT descriptors for i.MX8QM platform.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-02-10 17:01:57 +02:00
Paul Olaru 7364defe42 LF-537-12 sound: soc: sof: Add ops for i.MX8QM
i.MX8QM and i.MX8QXP are mostly identical platforms with minor hardware
differences. One of these differences affects the firmware boot process,
requiring the run operation to differ. All other ops are reused.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-02-10 17:01:57 +02:00
Paul Olaru 4299ac03ce LF-537-11 sound: soc: sof: Rename i.MX8 platform to i.MX8X
i.MX8 and i.MX8X platforms are very similar and were treated the same.
Anyhow, we need to account for the differences somehow.

Current supported platform is i.MX8QXP which is from i.MX8X family.
Rename i.MX8 platform to i.MX8X to prepare for future i.MX8 platforms.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-02-10 17:01:56 +02:00
Shengjiu Wang 27198be03f MLK-23242-4: ASoC: fsl_sai: Add support for imx8mp
In imx8mp there is audiomix power domains, and only
one power domain, that we don't need to call
dev_pm_domain_attach_by_id, which should return the EEXIST.

And we need to enable the MCLK output even it is in slave
mode.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-01-20 17:08:20 +08:00
Shengjiu Wang 1de3e8edd9 MLK-23242-2: ASoC: fsl_micfil: Add support for imx8mp
The new features are:
1. The output is 24 more significative bits in 32bit slot
2. The fifo depth is 32 entries.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-01-20 17:08:13 +08:00
Robin Gong 93a53a2f8b MLK-23242-1: ASoC: fsl_easrc: request dma channel from specific controller
Request dma channel from specific dma controller instead of generic dma
controller list, otherwise, may get the wrong dma controller if there are
multi dma controllers such as i.mx8mp.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
2020-01-20 17:08:03 +08:00
Shengjiu Wang 0885728776 MLK-22620: ASoC: imx-ak5558: Force tdm mode for ASRC case
In order to support the odd channels for ASRC case, we
force to enable TDM mode. In non-tdm case, we enable
multi lane to support multi channels, but limitation
is odd multi channels can't be supported.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-12-29 13:26:32 +08:00
Shengjiu Wang de1a87b02a MLK-23104: ASoC: fsl_rpmsg_i2s: Add constraint for supported rate
In imx8mn, M7 image has poor quality for 8kHz ~ 22kHz sample rate
case, but M7 side don't want to fix this issue in their image, so
we remove these sample rate in supported list.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-12-23 14:56:08 +08:00
Daniel Baluta 77255cbb70 LF-537-10: ASoC: SOF Fix unused variable ‘mach’ warning
mach is only used now in nocodec usecase, so properly
guard it to avoid compiler warning.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-12-18 23:17:33 +02:00
Daniel Baluta da85e842dc LF-537-10 ASoC: simple-card: Don't create separate link when platform is present
In normal sound case all DAIs are detected as CPU-Codec.
simple_dai_link_of supports the presence of a platform but it counts
it as a CPU DAI resulting in the creation of an extra link.

Adding a platform property to a link description like:

simple-audio-card,dai-link {
	cpu {
		sound-dai = <&sai1>;
	};
	plat {
		sound-dai = <&dsp>;
	};
	codec {
		sound-dai = <&wm8960>;
	}

will result in the creation of two links:
	* sai1 <-> wm8960
	* dsp  <-> wm8960

which is obviously not what we want. We just want one single link
with:
	* sai1 <-> wm8960 (and platform set to dsp).

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20191209135353.17427-1-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-18 11:39:24 +02:00
Daniel Baluta 4fe325ff10 LF-537-6 ASoC: SOF: imx8: Fix dsp_box offset
dsp_box is used to keep DSP initiated messages. The value of dsp_offset
is set by the DSP with the first message, so we need a way to boostrap
it in order to get the first message.

We do this by setting the correct default dsp_box offset which on i.MX8
is not zero.

Very interesting is why it has worked until now.

On i.MX8, DSP communicates with ARM core using a shared SDRAM memory
area. Actually, there are two shared areas:
	* SDRAM0 - starting at 0x92400000, size 0x800000
	* SDRAM1 - starting at 0x92C00000, size 0x800000

SDRAM0 keeps the data sections, starting with .rodata. By chance
fw_ready structure was placed at the beginning of .rodata.

dsp_box_base is defined as SDRAM0 + dsp_box_offset and it is placed
at the begining of SDRAM1 (dsp_box_offset should be 0x800000). But
because it is zero initialized by default it points to SDRAM0 where
by chance the fw_ready was placed in the SOF firmware.

Anyhow, SOF commit 7466bee378dd811b ("clk: make freq arrays constant")
fw_ready is no longer at the beginning of SDRAM0 and everything shows
how lucky we were until now.

Fix this by properly setting the default dsp_box offset.

Fixes 202acc565a ("ASoC: SOF: imx: Add i.MX8 HW support")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-12-18 11:38:50 +02:00
Karol Trzcinski c1364b5b4a LF-537-5 ASoC: SOF: log compiler name and version information
Log information about used compilator and optimization level
in sof firmware to host system.
It will be helful to catch some compiler dependent bugs.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-12-18 11:38:39 +02:00
Karol Trzcinski 4109d0ed20 LF-537-3 ASoC: SOF: fix snd_sof_fw_parse_ext_data
An error occurs during parsing more than one ext_data from the mailbox, because
of invalid data offset handling. Fix by removing the incorrect duplicate
increment of the offset.

The return value is also reset in the switch case. This does not change the
behavior but improves readability - there is no longer a need to check what the
return value of get_ext_windows is.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-12-18 11:38:28 +02:00
Karol Trzcinski 8e260d958e LF-537-2 ASoC: SOF: snd_sof_fw_parse_ext_data log warning on unknown header
Added warning log when found some unknown FW boot ext header,
to improve debuggability.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-12-18 11:38:23 +02:00
Daniel Baluta 0b4813a18e LF-537-1 ASoC: SOF: Introduce machine driver name
ACPI creates tables with information about the machine driver.
With DT there is no need for such tables because we can directly
get all the information needed from DT file.

This patch introduces machine driver property inside dsp node.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-12-18 11:38:03 +02:00
Shengjiu Wang 57ec9315e6 ASoC: soc-pcm: check symmetry before hw_params
This reverts commit 957ce0c6b8 (ASoC: soc-pcm: check symmetry after
hw_params).

That commit cause soc_pcm_params_symmetry can't take effect.
cpu_dai->rate, cpu_dai->channels and cpu_dai->sample_bits
are updated in the middle of soc_pcm_hw_params, so move
soc_pcm_params_symmetry to the end of soc_pcm_hw_params is
not a good solution, for judgement of symmetry in the function
is always true.

FIXME:
According to the comments of that commit, I think the case
described in the commit should disable symmetric_rates
in Back-End, rather than changing the position of
soc_pcm_params_symmetry.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1573555602-5403-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-17 17:58:21 +08:00
Jason Liu 622141309f This is the 5.4.3 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl3zQekACgkQONu9yGCS
 aT4v0xAAi39hk/9NMVQkOVJEAw7KtrqaidZ21c8DIZKwEEdmh5cgVTKjuF+PggXR
 VrSPSMuvCK9Xp4p4ZUPNr6WFYATxfUINZFvRc5gh1c9XtHrxjlWX9oi4XQ4a3zWC
 56Ak17gCt42eWcArHUslPQLFnq3XBDARs7qK8gv+6Vxt8w/3EaPkm4MKB8nGkdnK
 ItfkxGWnkKyUnwsE/01p1iR+LrbxnALXS+OM1izWBBA6ex2Zl6QDmmwZXXgKHOVt
 RAdO04t8k9jKrydo43DF/icUrYZuLbpIHaKIV6T0YH1Hco5qTZAz5+REmZelcEDH
 /vBNVxTVma5vAdYQsztEITv+qKNEkM2i+xoSoGierE8EPbRqo/ed3tDNdNxTmMcq
 zku+yztWm5VGicSbsGKRElwXt8+eyduIyEHyGKt5AON7n0NRDBmGl+HCnEU7Agoy
 XKJ+aDHjWK4AAYZL9osZ0MQ3QF55Dpaylijjnihc9VlMTVOTDY49MD8XSfoj0VFq
 pOdH7NWNDvh5eJfd+DQQHMtlMxN2dMppRlclh/ecXZ+2r6oKB/E11D9lzCguFZtQ
 HR1vDHl6HpnP08MXn++AZj0/hCx+zS/GzXJccGqjP5GWH10BAA+Kfig+ooo/t9We
 SJc8WcySU+0lmJN8yegcEintDyv/HkPQzJApRw3P0iL0t8oN8Ac=
 =8yzT
 -----END PGP SIGNATURE-----

Merge linux-5.4.y tag 'v5.4.3' into lf-5.4.y

This is the 5.4.3 stable release

 Conflicts:
	drivers/cpufreq/imx-cpufreq-dt.c
	drivers/spi/spi-fsl-qspi.c

The conflict is very minor, fixed it when do the merge. The imx-cpufreq-dt.c
is just one line code-style change, using upstream one, no any function change.

The spi-fsl-qspi.c has minor conflicts when merge upstream fixes: c69b17da53
spi: spi-fsl-qspi: Clear TDH bits in FLSHCR register

After merge, basic boot sanity test and basic qspi test been done on i.mx

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
2019-12-16 14:38:10 +08:00
Takashi Iwai 0d4e867e0c ALSA: hda - Fix pending unsol events at shutdown
[ Upstream commit ca58f55108fee41d87c9123f85ad4863e5de7f45 ]

This is an alternative fix attemp for the issue reported in the commit
caa8422d01 ("ALSA: hda: Flush interrupts on disabling") that was
reverted later due to regressions.  Instead of tweaking the hardware
disablement order and the enforced irq flushing, do calling
cancel_work_sync() of the unsol work early enough, and explicitly
ignore the unsol events during the shutdown by checking the
bus->shutdown flag.

Fixes: caa8422d01 ("ALSA: hda: Flush interrupts on disabling")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://lore.kernel.org/r/s5h1ruxt9cz.wl-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-13 08:43:27 +01:00
Takashi Iwai d050d28073 ALSA: hda: Modify stream stripe mask only when needed
commit e38e486d66e2a3b902768fd71c32dbf10f77e1cb upstream.

The recent commit in HD-audio stream management for changing the
stripe control seems causing a regression on some platforms.  The
stripe control is currently used only by HDMI codec, and applying the
stripe mask unconditionally may lead to scratchy and static noises as
seen on some MacBooks.

For addressing the regression, this patch changes the stream
management code to apply the stripe mask conditionally only when the
codec driver requested.

Fixes: 9b6f7e7a29 ("ALSA: hda: program stripe bits for controller")
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204477
Tested-by: Michael Pobega <mpobega@neverware.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191202074947.1617-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-13 08:42:39 +01:00
Kai-Heng Feng feebcef2fd ALSA: hda - Add mute led support for HP ProBook 645 G4
commit e190de6941db14813032af87873f5550ad5764fe upstream.

Mic mute led does not work on HP ProBook 645 G4.
We can use CXT_FIXUP_MUTE_LED_GPIO fixup to support it.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191120082035.18937-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-13 08:42:38 +01:00
Takashi Iwai d2d135cba8 ALSA: pcm: oss: Avoid potential buffer overflows
commit 4cc8d6505ab82db3357613d36e6c58a297f57f7c upstream.

syzkaller reported an invalid access in PCM OSS read, and this seems
to be an overflow of the internal buffer allocated for a plugin.
Since the rate plugin adjusts its transfer size dynamically, the
calculation for the chained plugin might be bigger than the given
buffer size in some extreme cases, which lead to such an buffer
overflow as caught by KASAN.

Fix it by limiting the max transfer size properly by checking against
the destination size in each plugin transfer callback.

Reported-by: syzbot+f153bde47a62e0b05f83@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191204144824.17801-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-13 08:42:38 +01:00
Takashi Iwai b8cc281681 ALSA: hda/realtek - Fix inverted bass GPIO pin on Acer 8951G
commit 336820c4374bc065317f247dc2bb37c0e41b64a6 upstream.

We've added the bass speaker support on Acer 8951G by the commit
00066e9733 ("Add Acer Aspire Ethos 8951G model quirk"), but it seems
that the GPIO pin was wrongly set: while the commit turns off the bit
to power up the amp, the actual hardware reacts other way round,
i.e. GPIO bit on = amp on.

So this patch fixes the bug, turning on the GPIO bit 0x02 as default.
Since turning on the GPIO bit can be more easily managed with
alc_setup_gpio() call, we simplify the quirk code by integrating the
GPIO setup into the existing alc662_fixup_aspire_ethos_hp() and
dropping the whole ALC669_FIXUP_ACER_ASPIRE_ETHOS_SUBWOOFER quirk.

Fixes: 00066e9733 ("Add Acer Aspire Ethos 8951G model quirk")
Reported-and-tested-by: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191128202630.6626-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-13 08:42:37 +01:00
Kailang Yang e3743f4311 ALSA: hda/realtek - Dell headphone has noise on unmute for ALC236
commit e1e8c1fdce8b00fce08784d9d738c60ebf598ebc upstream.

headphone have noise even the volume is very small.
Let it fill up pcbeep hidden register to default value.
The issue was gone.

Fixes: 4344aec84b ("ALSA: hda/realtek - New codec support for ALC256")
Fixes: 736f20a706 ("ALSA: hda/realtek - Add support for ALC236/ALC3204")
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/9ae47f23a64d4e41a9c81e263cd8a250@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-13 08:42:36 +01:00