1
0
Fork 0
Commit Graph

20230 Commits (redonkable)

Author SHA1 Message Date
Tzung-Bi Shih f9f47ef869 ASoC: max98090: remove msleep in PLL unlocked workaround
[ Upstream commit acb874a7c0 ]

It was observed Baytrail-based chromebooks could cause continuous PLL
unlocked when using playback stream and capture stream simultaneously.
Specifically, starting a capture stream after started a playback stream.
As a result, the audio data could corrupt or turn completely silent.

As the datasheet suggested, the maximum PLL lock time should be 7 msec.
The workaround resets the codec softly by toggling SHDN off and on if
PLL failed to lock for 10 msec.  Notably, there is no suggested hold
time for SHDN off.

On Baytrail-based chromebooks, it would easily happen continuous PLL
unlocked if there is a 10 msec delay between SHDN off and on.  Removes
the msleep().

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20191122073114.219945-2-tzungbi@google.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-01 13:17:22 +02:00
Russell King d9adb4deef ASoC: kirkwood: fix IRQ error handling
[ Upstream commit 175fc92819 ]

Propagate the error code from request_irq(), rather than returning
-EBUSY.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/E1iNIqh-0000tW-EZ@rmk-PC.armlinux.org.uk
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-01 13:17:13 +02:00
Andrey Zhizhikin ee7b6ad15b This is the 5.4.67 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl9rJlYACgkQONu9yGCS
 aT6WbRAAga6QVKrO6R4NeKk0fPqKQQoQeTK+phBOFA7jAoX/rIRKyob2Si9BwhBA
 F77vZ6HIZ7+e/o35JJQYQbffbHYs0ANuS1oHGqe0vgbh+72Viaan6g7lFOhpx8qf
 y0YS7q+hw4WLZB0gGlBM7nkPXRiis32IrEVabQW+t8hmT2lWyutY8E2yFAU60tvI
 Tvjm2c2pvHEcHz9MrjEd/jIVxMFnIl42FBTx9bGsbDUCDzBwEvPArS4bNioP7EFJ
 O+rrGCNvwtiv0DuKzX1UIZzQ88IROmU3ZjsIlgOwla7xJWv4QDgmPfyAyRI48QhH
 PAZQmSntz+y+MP6B3z3ZBrxc2Fx0kCDtugn2P9+2RVUEpheANJ293vUgYTKN9Roy
 dHdWHFWNTO9IYpIN0cZjc25db4ULdjerWQrKcCr6ZO8+Ep/0mSzx3lkWjfuUP8Hr
 L2RD6rAm259OpPq8xhAcJpJvoQLwGxaBHyr4QYUmRgmNVURoqe9Q0MTZuiyGsXhm
 rtcNky9WvmyyI1lJgXi4A+vmsIThCHEstEMycgTejfJ4itIVA9e1ctJVVomWULCn
 9oNStBJpmHw0myDCohbKNjeO1UX/erdF9NaoGto5bnfIhcSae1YQEjRB8zKmzbg1
 DpgC1f7IZ7q53vfrDGsAjInOcuEwAn/Y5JMLJOL4mdA9j3XlX2o=
 =Ot99
 -----END PGP SIGNATURE-----

Merge tag 'v5.4.67' into 5.4-2.2.x-imx

This is the 5.4.67 stable release

This updates the kernel present in the NXP release imx_5.4.47_2.2.0 to the
latest patchset available from stable korg.

Base stable kernel version present in the NXP BSP release is v5.4.47.

Following conflicts were recorded and resolved:
- arch/arm/mach-imx/pm-imx6.c
NXP version has a different PM vectoring scheme, where the IRAM bottom
half (8k) is used to store IRAM code and pm_info. Keep this version to
be compatible with NXP PM implementation.

- arch/arm64/boot/dts/freescale/imx8mm-evk.dts
- arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts
NXP patches kept to provide proper LDO setup:
imx8mm-evk.dts: 975d8ab07267ded741c4c5d7500e524c85ab40d3
imx8mn-ddr4-evk.dts: e8e35fd0e759965809f3dca5979a908a09286198

- drivers/crypto/caam/caamalg.c
Keep NXP version, as it already covers the functionality for the
upstream patch [d6bbd4eea2]

- drivers/gpu/drm/imx/dw_hdmi-imx.c
- drivers/gpu/drm/imx/imx-ldb.c
- drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c
Port changes from upstream commit [1a27987101], which extends
component lifetime by moving drm structures allocation/free from
bind() to probe().

- drivers/gpu/drm/imx/imx-ldb.c
Merge patch [1752ab50e8] from upstream to disable both LVDS channels
when Enoder is disabled

- drivers/mmc/host/sdhci-esdhc-imx.c
Fix merge fuzz produced by [6534c897fd].

- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
Commit d1a00c9bb1 from upstream solves the issue with improper error
reporting when qdisc type support is absent. Upstream version is merged
into NXP implementation.

- drivers/net/ethernet/freescale/enetc/enetc.c
Commit [ce06fcb6a6] from upstream merged,
base NXP version kept

- drivers/net/ethernet/freescale/enetc/enetc_pf.c
Commit [e8b86b4d87] from upstream solves
the kernel panic in case if probing fails. NXP has a clean-up logic
implemented different, where the MDIO remove would be invoked in any
failure case. Keep the NXP logic in place.

- drivers/thermal/imx_thermal.c
Upstream patch [9025a5589c] adds missing
of_node_put call, NXP version has been adapted to accommodate this patch
into the code.

- drivers/usb/cdns3/ep0.c
Manual merge of commit [be8df02707] from
upstream to protect cdns3_check_new_setup

- drivers/xen/swiotlb-xen.c
Port upstream commit cca58a1669 to NXP tree, manual hunk was
resolved during merge.

- sound/soc/fsl/fsl_esai.c
Commit [53057bd4ac] upstream addresses the problem of endless isr in
case if exception interrupt is enabled and tasklet is scheduled. Since
NXP implementation has tasklet removed with commit [2bbe95fe6c],
upstream fix does not match the main implementation, hence we keep the
NXP version here.

- sound/soc/fsl/fsl_sai.c
Apply patch [b8ae2bf5cc] from upstream, which uses FIFO watermark
mask macro.

Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2020-09-26 20:54:42 +00:00
Jerome Brunet b12029411b ASoC: meson: axg-toddr: fix channel order on g12 platforms
[ Upstream commit 9c4b205a20 ]

On g12 and following platforms, The first channel of record with more than
2 channels ends being placed randomly on an even channel of the output.

On these SoCs, a bit was added to force the first channel to be placed at
the beginning of the output. Apparently the behavior if the bit is not set
is not easily predictable. According to the documentation, this bit is not
present on the axg series.

Set the bit on g12 and fix the problem.

Fixes: a3c23a8ad4 ("ASoC: meson: axg-toddr: add g12a support")
Reported-by: Nicolas Belin <nbelin@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200828151438.350974-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-23 12:40:39 +02:00
Dinghao Liu f6d4afd008 ASoC: qcom: common: Fix refcount imbalance on error
[ Upstream commit c1e6414cdc ]

for_each_child_of_node returns a node pointer np with
refcount incremented. So when devm_kzalloc fails, a
pairing refcount decrement is needed to keep np's
refcount balanced.

Fixes: 16395ceee1 ("ASoC: qcom: common: Fix NULL pointer in of parser")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20200820042828.10308-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-23 12:40:39 +02:00
Stephan Gerhold 911c69245a ASoC: qcom: Set card->owner to avoid warnings
[ Upstream commit 3c27ea23ff ]

On Linux 5.9-rc1 I get the following warning with apq8016-sbc:

WARNING: CPU: 2 PID: 69 at sound/core/init.c:207 snd_card_new+0x36c/0x3b0 [snd]
CPU: 2 PID: 69 Comm: kworker/2:1 Not tainted 5.9.0-rc1 #1
Workqueue: events deferred_probe_work_func
pc : snd_card_new+0x36c/0x3b0 [snd]
lr : snd_card_new+0xf4/0x3b0 [snd]
Call trace:
 snd_card_new+0x36c/0x3b0 [snd]
 snd_soc_bind_card+0x340/0x9a0 [snd_soc_core]
 snd_soc_register_card+0xf4/0x110 [snd_soc_core]
 devm_snd_soc_register_card+0x44/0xa0 [snd_soc_core]
 apq8016_sbc_platform_probe+0x11c/0x140 [snd_soc_apq8016_sbc]

This warning was introduced in
commit 81033c6b58 ("ALSA: core: Warn on empty module").
It looks like we are supposed to set card->owner to THIS_MODULE.

Fix this for all the qcom ASoC drivers.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Fixes: 79119c7986 ("ASoC: qcom: Add Storm machine driver")
Fixes: bdb052e81f ("ASoC: qcom: add apq8016 sound card support")
Fixes: a6f933f63f ("ASoC: qcom: apq8096: Add db820c machine driver")
Fixes: 6b1687bf76 ("ASoC: qcom: add sdm845 sound card support")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20200820154511.203072-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-23 12:40:39 +02:00
Sylwester Nawrocki 957066143e ASoC: wm8994: Avoid attempts to read unreadable registers
[ Upstream commit f082bb59b7 ]

The driver supports WM1811, WM8994, WM8958 devices but according to
documentation and the regmap definitions the WM8958_DSP2_* registers
are only available on WM8958. In current code these registers are
being accessed as if they were available on all the three chips.

When starting playback on WM1811 CODEC multiple errors like:
"wm8994-codec wm8994-codec: ASoC: error at soc_component_read_no_lock on wm8994-codec: -5"
can be seen, which is caused by attempts to read an unavailable
WM8958_DSP2_PROGRAM register. The issue has been uncovered by recent
commit "e2329ee ASoC: soc-component: add soc_component_err()".

This patch adds a check in wm8958_aif_ev() callback so the DSP2 handling
is only done for WM8958.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200731173834.23832-1-s.nawrocki@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-03 11:26:59 +02:00
Qiushi Wu fd5908860a ASoC: tegra: Fix reference count leaks.
[ Upstream commit deca195383 ]

Calling pm_runtime_get_sync increments the counter even in case of
failure, causing incorrect ref count if pm_runtime_put is not called in
error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails.

Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20200613204422.24484-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-03 11:26:42 +02:00
Qiushi Wu 7d60cd2a6e ASoC: img-parallel-out: Fix a reference count leak
[ Upstream commit 6b9fbb0736 ]

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code, causing incorrect ref count if
pm_runtime_put_noidle() is not called in error handling paths.
Thus call pm_runtime_put_noidle() if pm_runtime_get_sync() fails.

Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Link: https://lore.kernel.org/r/20200614033344.1814-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-03 11:26:42 +02:00
Qiushi Wu 8150a0e3d7 ASoC: img: Fix a reference count leak in img_i2s_in_set_fmt
[ Upstream commit c4c59b95b7 ]

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code, causing incorrect ref count if
pm_runtime_put_noidle() is not called in error handling paths.
Thus call pm_runtime_put_noidle() if pm_runtime_get_sync() fails.

Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Link: https://lore.kernel.org/r/20200614033749.2975-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-03 11:26:41 +02:00
Dinghao Liu 503176f5dc ASoC: intel: Fix memleak in sst_media_open
[ Upstream commit 062fa09f44 ]

When power_up_sst() fails, stream needs to be freed
just like when try_module_get() fails. However, current
code is returning directly and ends up leaking memory.

Fixes: 0121327c1a ("ASoC: Intel: mfld-pcm: add control for powering up/down dsp")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813084112.26205-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-26 10:41:03 +02:00
Srinivas Kandagatla 8aeb112d58 ASoC: msm8916-wcd-analog: fix register Interrupt offset
[ Upstream commit ff69c97ef8 ]

For some reason interrupt set and clear register offsets are
not set correctly.
This patch corrects them!

Fixes: 585e881e5b ("ASoC: codecs: Add msm8916-wcd analog codec")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20200811103452.20448-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-26 10:41:03 +02:00
Srinivas Kandagatla ece9ca5840 ASoC: q6routing: add dummy register read/write function
[ Upstream commit 796a58fe2b ]

Most of the DAPM widgets for DSP ASoC components reuse reg field
of the widgets for its internal calculations, however these are not
real registers. So read/writes to these numbers are not really
valid. However ASoC core will read these registers to get default
state during startup.

With recent changes to ASoC core, every register read/write
failures are reported very verbosely. Prior to this fails to reads
are totally ignored, so we never saw any error messages.

To fix this add dummy read/write function to return default value.

Fixes: e3a33673e8 ("ASoC: qdsp6: q6routing: Add q6routing driver")
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200811120205.21805-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-26 10:40:59 +02:00
Srinivas Kandagatla aaa6e691b9 ASoC: q6afe-dai: mark all widgets registers as SND_SOC_NOPM
[ Upstream commit 56235e4bc5 ]

Looks like the q6afe-dai dapm widget registers are set as "0",
which is a not correct.

As this registers will be read by ASoC core during startup
which will throw up errors, Fix this by making the registers
as SND_SOC_NOPM as these should be never used.

With recent changes to ASoC core, every register read/write
failures are reported very verbosely. Prior to this fails to reads
are totally ignored, so we never saw any error messages.

Fixes: 24c4cbcfac ("ASoC: qdsp6: q6afe: Add q6afe dai driver")
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200811120205.21805-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-26 10:40:59 +02:00
Daniel Baluta 70f83dcfaf MLK-24263-9 ASoC: SOF: imx: Fix PM runtime handlers
Commit 89d64ed05d ("MLK-24263-8 ASoC: SOF: Add support for system /
runtime PM on i.MX8") introduced runtime PM handlers for i.MX8QM but
forgot to add the same handlers for i.MX8QXP.

Do it now!

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit c1513d6b7bc54e9de2a0a99987e4c6e98a05deb6)
2020-08-21 19:54:58 +03:00
Daniel Baluta 4dffe80591 MLK-24255-2 ASoC: SOF: Introduce POST_PROCESS component type
POST_PROCESS component takes care of processing algorithms. For now,
we intend to use this component for decoding/encoding library algorithms
from Cadence.

Current implementation assumes that we will still use ALSA PCM
interface. The heavy part is done on firmware side with the help
of topology files.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-08-20 14:09:36 +03:00
Shengjiu Wang b8ae2bf5cc ASoC: fsl_sai: Fix value of FSL_SAI_CR1_RFW_MASK
[ Upstream commit 5aef1ff239 ]

The fifo_depth is 64 on i.MX8QM/i.MX8QXP, 128 on i.MX8MQ, 16 on
i.MX7ULP.

Original FSL_SAI_CR1_RFW_MASK value 0x1F is not suitable for
these platform, the FIFO watermark mask should be updated
according to the fifo_depth.

Fixes: a860fac420 ("ASoC: fsl_sai: Add support for imx7ulp/imx8mq")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1596176895-28724-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19 08:16:18 +02:00
Jerome Brunet 115da6e650 ASoC: meson: axg-tdm-formatters: fix sclk inversion
[ Upstream commit 0d3f01dcdc ]

After carefully checking, it appears that both tdmout and tdmin require the
rising edge of the sclk they get to be synchronized with the frame sync
event (which should be a rising edge of lrclk).

TDMIN was improperly set before this patch. Remove the sclk_invert quirk
which is no longer needed and fix the sclk phase.

Fixes: 1a11d88f49 ("ASoC: meson: add tdm formatter base driver")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200729154456.1983396-4-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19 08:16:18 +02:00
Jerome Brunet 0cc88bf694 ASoC: meson: axg-tdmin: fix g12a skew
[ Upstream commit 80a254394f ]

After carefully checking the result provided by the TDMIN on the g12a and
sm1 SoC families, the TDMIN skew offset appears to be 3 instead of 2 on the
axg.

Fixes: f01bc67f58 ("ASoC: meson: axg-tdm-formatter: rework quirks settings")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200729154456.1983396-3-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19 08:16:18 +02:00
Jerome Brunet a9d54ebf8d ASoC: meson: axg-tdm-interface: fix link fmt setup
[ Upstream commit 6878ba91ce ]

The .set_fmt() callback of the axg tdm interface incorrectly
test the content of SND_SOC_DAIFMT_MASTER_MASK as if it was a
bitfield, which it is not.

Implement the test correctly.

Fixes: d60e4f1e4b ("ASoC: meson: add tdm interface driver")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200729154456.1983396-2-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19 08:16:18 +02:00
Jing Xiangfeng c537bd0732 ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback
[ Upstream commit bd054ece7d ]

axg_card_add_tdm_loopback() misses to call kfree() in an error path. We
can use devm_kasprintf() to fix the issue, also improve maintainability.
So use it instead.

Fixes: c84836d7f6 ("ASoC: meson: axg-card: use modern dai_link style")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200717082242.130627-1-jingxiangfeng@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19 08:16:13 +02:00
Pierre-Louis Bossart d92cc98b74 ASoC: Intel: bxt_rt298: add missing .owner field
[ Upstream commit 88cee34b77 ]

This field is required for ASoC cards. Not setting it will result in a
module->name pointer being NULL and generate problems such as

cat /proc/asound/modules
 0 (efault)

Fixes: 76016322ec ('ASoC: Intel: Add Broxton-P machine driver')
Reported-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19 08:16:08 +02:00
Pierre-Louis Bossart a1773c8b04 ASoC: SOF: nocodec: add missing .owner field
[ Upstream commit 8753889e27 ]

This field is required for ASoC cards. Not setting it will result in a
module->name pointer being NULL and generate problems such as

cat /proc/asound/modules
 0 (efault)

Fixes: 8017b8fd37 ('ASoC: SOF: Add Nocodec machine driver support')
Reported-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19 08:16:08 +02:00
Bing Song c731ea37ee MLK-24501-5 dsp: add lpa pcm support.
Use reserved memory as PCM mode need more memory.
Use ping-pong buffer for PCM LPA playback to avoid underrun.

Signed-off-by: Bing Song <bing.song@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-08-14 16:48:50 +08:00
Bing Song 5ae911fd64 MLK-24501-4 dsp: disable mxc_hifi4 when LPA.
FW is locate on OCRAM_A when lpa. core decoder can't put in reserved
memory as HIFI4 has 1G memory limitation. Disable DSP wrapper decoder
when lpa. lpa PCM mode will use SW decoder.

Signed-off-by: Bing Song <bing.song@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-08-14 16:48:44 +08:00
Bing Song 0581bdbb6d MLK-24501-3 dsp: interrupt suspend when lpa.
Input buffer maybe return when suspending. Interrupt suspend if
MU from DSP to ARM core.

Signed-off-by: Bing Song <bing.song@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-08-14 16:48:38 +08:00
Bing Song f0520eee03 MLK-24501-1 dsp: change input buffer size for lpa.
Enlarge the buffer size to 128K. So ARM can sleep longer time for
MP3 LPA playback.

Signed-off-by: Bing Song <bing.song@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-08-14 16:47:56 +08:00
Zhang Peng 9be4f0ea58 MLK-24462 ASoC: fsl_dsp: Fix build error when add pause
Coding error cause build error, now fix it.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2020-08-04 10:35:05 +08:00
Zhang Peng 14a1f3afd3 MLK-24453 ASoC: fsl_dsp: Add pause&pause_release in dsp
Add dsp support pause and pause_release cmd.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2020-08-03 19:32:57 +08:00
Shengjiu Wang e17ee871b9 MLK-24444-1: ASoC: fsl_dsp: Support PCM format for compress sound card
For PCM format the supported format is mono/stereo, S16_LE/S32_LE,
and 8KHz-192kHz frequency.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-07-30 09:54:07 +08:00
Pierre-Louis Bossart 2ca71b8073 ASoC: topology: fix tlvs in error handling for widget_dmixer
commit 8edac489e7 upstream.

we need to free all allocated tlvs, not just the one allocated in
the loop before releasing kcontrols - other the tlvs references will
leak.

Fixes: 9f90af3a99 ('ASoC: topology: Consolidate and fix asoc_tplg_dapm_widget_*_create flow')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200707203749.113883-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-29 10:18:45 +02:00
Pierre-Louis Bossart a4fd00dd82 ASoC: topology: fix kernel oops on route addition error
commit 6f0307df83 upstream.

When errors happens while loading graph components, the kernel oopses
while trying to remove all topology components. This can be
root-caused to a list pointing to memory that was already freed on
error.

remove_route() is already called on errors and will perform the
required cleanups so there's no need to free the route memory in
soc_tplg_dapm_graph_elems_load() if the route was added to the
list. We do however want to free the routes allocated but not added to
the list.

Fixes: 7df04ea7a3 ('ASoC: topology: modify dapm route loading routine and add dapm route unloading')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200707203749.113883-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-29 10:18:45 +02:00
Geert Uytterhoeven e60e53e685 ASoC: qcom: Drop HAS_DMA dependency to fix link failure
commit b6aa06de77 upstream.

When building on allyesconfig kernel for a NO_DMA=y platform (e.g.
Sun-3), CONFIG_SND_SOC_QCOM_COMMON=y, but CONFIG_SND_SOC_QDSP6_AFE=n,
leading to a link failure:

    sound/soc/qcom/common.o: In function `qcom_snd_parse_of':
    common.c:(.text+0x2e2): undefined reference to `q6afe_is_rx_port'

While SND_SOC_QDSP6 depends on HAS_DMA, SND_SOC_MSM8996 and SND_SOC_SDM845
don't, so the following warning is seen:

    WARNING: unmet direct dependencies detected for SND_SOC_QDSP6
      Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && QCOM_APR [=y] && HAS_DMA [=n]
      Selected by [y]:
      - SND_SOC_MSM8996 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && QCOM_APR [=y]
      - SND_SOC_SDM845 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && QCOM_APR [=y] && CROS_EC [=y] && I2C [=y] && SOUNDWIRE [=y]

Until recently, this warning was harmless (from a compile-testing
point-of-view), but the new user of q6afe_is_rx_port() turned this into
a hard failure.

As the QDSP6 driver itself builds fine if NO_DMA=y, and it depends on
QCOM_APR (which in turns depends on ARCH_QCOM || COMPILE_TEST), it is
safe to increase compile testing coverage.  Hence fix the link failure
by dropping the HAS_DMA dependency of SND_SOC_QDSP6.

Fixes: a212008925 ("ASoC: qcom: common: set correct directions for dailinks")
Fixes: 6b1687bf76 ("ASoC: qcom: add sdm845 sound card support")
Fixes: a6f933f63f ("ASoC: qcom: apq8096: Add db820c machine driver")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20200629122443.21736-1-geert@linux-m68k.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-29 10:18:45 +02:00
Hans de Goede 8f64dc9e1d ASoC: rt5670: Add new gpio1_is_ext_spk_en quirk and enable it on the Lenovo Miix 2 10
commit 85ca6b17e2 upstream.

The Lenovo Miix 2 10 has a keyboard dock with extra speakers in the dock.
Rather then the ACL5672's GPIO1 pin being used as IRQ to the CPU, it is
actually used to enable the amplifier for these speakers
(the IRQ to the CPU comes directly from the jack-detect switch).

Add a quirk for having an ext speaker-amplifier enable pin on GPIO1
and replace the Lenovo Miix 2 10's dmi_system_id table entry's wrong
GPIO_DEV quirk (which needs to be renamed to GPIO1_IS_IRQ) with the
new RT5670_GPIO1_IS_EXT_SPK_EN quirk, so that we enable the external
speaker-amplifier as necessary.

Also update the ident field for the dmi_system_id table entry, the
Miix models are not Thinkpads.

Fixes: 67e03ff3f3 ("ASoC: codecs: rt5670: add Thinkpad Tablet 10 quirk")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1786723
Link: https://lore.kernel.org/r/20200628155231.71089-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-29 10:18:45 +02:00
Jing Xiangfeng e2e31a0bf7 ASoC: Intel: bytcht_es8316: Add missed put_device()
[ Upstream commit b3df80ab6d ]

snd_byt_cht_es8316_mc_probe() misses to call put_device() in an error
path. Add the missed function call to fix it.

Fixes: ba49cf6f8e ("ASoC: Intel: bytcht_es8316: Add quirk for inverted jack detect")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200714080918.148196-1-jingxiangfeng@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-07-29 10:18:32 +02:00
Hans de Goede f668e82295 ASoC: rt5670: Correct RT5670_LDO_SEL_MASK
commit 5cacc6f576 upstream.

The RT5670_PWR_ANLG1 register has 3 bits to select the LDO voltage,
so the correct mask is 0x7 not 0x3.

Because of this wrong mask we were programming the ldo bits
to a setting of binary 001 (0x05 & 0x03) instead of binary 101
when moving to SND_SOC_BIAS_PREPARE.

According to the datasheet 001 is a reserved value, so no idea
what it did, since the driver was working fine before I guess we
got lucky and it does something which is ok.

Fixes: 5e8351de74 ("ASoC: add RT5670 CODEC driver")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200628155231.71089-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-29 10:18:30 +02:00
Viorel Suman edfae0f3a6 MLK-24413: ASoC: fsl_xcvr: fix SPDIF RX/TX sequence issue
In SPDIF full duplex mode in order to get both RX and TX working we
need to start RX first, and TX second, fix this by porting SPDIF RX
configuration code from XCVR FW into Kernel driver and avoid using
M0+ core for SPDIF configuration.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-07-28 14:02:27 +03:00
Viorel Suman 025891eaa5 MLK-24430: ASoC: fsl_xcvr: reverse the order of Channel Status bits
The Channel Status bits must be reversed.

Fixes: 86401d592b ("MLK-23725-1: ASoC: fsl_xcvr: reimplement CS read function")
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-07-21 09:38:32 +03:00
Adrian Alonso cdfd304a32 MLK-24423: sound: soc: fsl: imx pdm: fixed mclk improve voice
Add fixed sai mclk for PDM software decimation improve
libimxswpdm conversion algorithm performance for
voice applications by using exact division ratios for
clock configurations mclk, bitclk.

Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-07-20 11:02:44 -05:00
Adrian Alonso de79414d59 MLK-24422: sound: soc: fsl: imx pdm: over sampling ratio control
Add Over sample ratio kcontrol interface, allow user
to specify over sample ratio

amixer -c1 cget numid=1
numid=1,iface=MIXER,name='over sampling ratio'
  ; type=ENUMERATED,access=rw------,values=1,items=5
  ; Item #0 'OSR_4x12'
  ; Item #1 'OSR_4x16'
  ; Item #2 'OSR_4x24'
  ; Item #3 'OSR_4x32'
  ; Item #4 'OSR_4x48'
  : values=0

Set different OSR
amixer -c1 cset numid=1 2

Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-07-20 11:02:29 -05:00
Viorel Suman 50698e4d7b MLK-24412: ASoC: fsl_xcvr: remove support for S24_LE TX
There is no need for S24_LE support on TX since IEC958 ALSA
plugin is now configured to cover this function.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-07-17 12:13:52 +03:00
Pierre-Louis Bossart 04197a8184 ASoC: SOF: Intel: add PCI ID for CometLake-S
[ Upstream commit 258fb4f4c3 ]

Mirror ID added for legacy HDaudio

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200617164755.18104-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-07-16 08:16:33 +02:00
Bing Song 3e26378f53 MLK-24365-11 dsp: wait DSP idle before close it.
Wait DSP to idle before gate OCRAM_A clock as FW code locate on
OCRAM_A when LPA. Or DSP will hang.

Signed-off-by: Bing Song <bing.song@nxp.com>
2020-07-10 16:48:12 +08:00
Bing Song 3e415d0fad MLK-24365-10 codec: support lpa in audio codec.
Audio codec need ignore suspend/resume for LPA.

Signed-off-by: Bing Song <bing.song@nxp.com>
2020-07-10 16:48:12 +08:00
Bing Song 7c5ec722f0 MLK-24365-8 dsp: ignore suspend/resume.
ignore suspend/resume when LPA mode.

Signed-off-by: Bing Song <bing.song@nxp.com>
2020-07-10 16:48:11 +08:00
Bing Song 9ebecb7a7b MLK-24365-7 dsp: add dsp mu interrupt into wakeup source.
Add dsp mu interrupt into wakeup source when LPA mode.
So the interrupt will wakeup A core when DSP consumed
all audio bitstream data.

Signed-off-by: Bing Song <bing.song@nxp.com>
2020-07-10 16:48:11 +08:00
Bing Song 14a5a9ace5 MLK-24365-6 dsp: enlarge the audio bitstream buffer.
The buffer is share between A core and DSP. Enlarge it, so A core will
suspend longer when DSP is playbacking audio.

Signed-off-by: Bing Song <bing.song@nxp.com>
2020-07-10 16:48:11 +08:00
Bing Song 777b92ecd0 MLK-24365-5 dsp: setup memory for dsp.
LPA only use OCRAM as DRAM will in retention mode when LPA.

Signed-off-by: Bing Song <bing.song@nxp.com>
2020-07-10 16:48:11 +08:00
Bing Song 23219672c1 MLK-24365-4 dsp: enable dsp lpa.
One big buffer shared between A core and DSP to buffer audio
bitstram. So A core can sleep more time when DSP is playing
buffered audio bit stream.

Signed-off-by: Bing Song <bing.song@nxp.com>
2020-07-10 16:48:11 +08:00
Bing Song 3818e25a7f MLK-24365-2 dsp: manage audiomix clock in dsp driver.
IMX8MP_CLK_AUDIO_ROOT and IMX8MP_CLK_AUDIO_AXI_DIV will gated when
suspend even if dsp driver ignored suspend when low power audio offload
playback. The root cause is the two clocks is controlled when audiomix
power on/off. Add the two clocks in dsp driver, so driver will add
one ref count when useing dsp, so the two clocks don't be gated when
A core suspend during low power audio playback.

Signed-off-by: Bing Song <bing.song@nxp.com>
2020-07-10 16:48:11 +08:00
Viorel Suman 71e9774899 ASoC: fsl_micfil: fix PDM root clock frequency
Depending on sample rate the PDM must be clocked at either 24.576MHz or
22.5792MHz. CLK_DIV is later calculated as function of PDM root clock
frequency and FS. Setting PDM root clock = FS * 1024 is wrong because
for low sample rate such as 8000 the PDM root clock will be 8000 * 1024
= 8192000 Hz so PDM will be underclocked for this sample rate.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2020-07-02 11:13:26 +03:00
Qiushi Wu 9e89c2d5da ASoC: rockchip: Fix a reference count leak.
[ Upstream commit f141a42215 ]

Calling pm_runtime_get_sync increments the counter even in case of
failure, causing incorrect ref count if pm_runtime_put is not called in
error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails.

Fixes: fc05a5b222 ("ASoC: rockchip: add support for pdm controller")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20200613205158.27296-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-30 15:36:57 -04:00
Shengjiu Wang b59ed5668c ASoC: fsl_ssi: Fix bclk calculation for mono channel
[ Upstream commit ed1220df6e ]

For mono channel, SSI will switch to Normal mode.

In Normal mode and Network mode, the Word Length Control bits
control the word length divider in clock generator, which is
different with I2S Master mode (the word length is fixed to
32bit), it should be the value of params_width(hw_params).

The condition "slots == 2" is not good for I2S Master mode,
because for Network mode and Normal mode, the slots can also
be 2. Then we need to use (ssi->i2s_net & SSI_SCR_I2S_MODE_MASK)
to check if it is I2S Master mode.

So we refine the formula for mono channel, otherwise there
will be sound issue for S24_LE.

Fixes: b0a7043d5c ("ASoC: fsl_ssi: Caculate bit clock rate using slot number and width")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/034eff1435ff6ce300b6c781130cefd9db22ab9a.1592276147.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-30 15:36:55 -04:00
Srinivas Kandagatla 1fa2741805 ASoC: qcom: common: set correct directions for dailinks
[ Upstream commit a212008925 ]

Currently both FE and BE dai-links are configured bi-directional,
However the DSP BE dais are only single directional,
so set the directions as supported by the BE dais.

Fixes: c25e295cd7 (ASoC: qcom: Add support to parse common audio device nodes)
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200612123711.29130-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-30 15:36:54 -04:00
Srinivas Kandagatla 47c7ae0ca9 ASoc: q6afe: add support to get port direction
[ Upstream commit 4a95737440 ]

This patch adds support to q6afe_is_rx_port() to get direction
of DSP BE dai port, this is useful for setting dailink
directions correctly.

Fixes: c25e295cd7 (ASoC: qcom: Add support to parse common audio device nodes)
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200612123711.29130-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-30 15:36:54 -04:00
Srinivas Kandagatla e50cf858d1 ASoC: q6asm: handle EOS correctly
[ Upstream commit 6476b60f32 ]

Successful send of EOS command does not indicate that EOS is actually
finished, correct event to wait EOS is finished is EOS_RENDERED event.
EOS_RENDERED means that the DSP has finished processing all the buffers
for that particular session and stream.

This patch fixes EOS handling!

Fixes: 68fd8480bb ("ASoC: qdsp6: q6asm: Add support to audio stream apis")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200611124159.20742-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-30 15:36:53 -04:00
Hans de Goede ea8837b943 ASoC: rt5645: Add platform-data for Asus T101HA
[ Upstream commit 79d4f823a0 ]

The Asus T101HA uses the default jack-detect mode 3, but instead of
using an analog microphone it is using a DMIC on dmic-data-pin 1,
like the Asus T100HA. Note unlike the T100HA its jack-detect is not
inverted.

Add a DMI quirk with the correct settings for this model.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200608204634.93407-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:42 +02:00
Hans de Goede ebc448eb2d ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT10-A tablet
[ Upstream commit 199a5e8fda ]

The Toshiba Encore WT10-A tablet almost fully works with the default
settings for Bay Trail CR devices. The only issue is that it uses a
digital mic. connected the the DMIC1 input instead of an analog mic.

Add a quirk for this model using the default settings with the input-map
replaced with BYT_RT5640_DMIC1_MAP.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200608204634.93407-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:42 +02:00
Pierre-Louis Bossart 69367d9f1f ASoC: SOF: nocodec: conditionally set dpcm_capture/dpcm_playback flags
[ Upstream commit ba4e5abc6c ]

With additional checks on dailinks, we see errors such as

[ 3.000418] sof-nocodec sof-nocodec: CPU DAI DMIC01 Pin for rtd
NoCodec-6 does not support playback

It's not clear why we set the dpcm_playback and dpcm_capture flags
unconditionally, add a check on number of channels for each direction
to avoid invalid configurations.

Fixes: 8017b8fd37 ('ASoC: SOF: Add Nocodec machine driver support')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200608194415.4663-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:42 +02:00
Bard Liao 7b31ec2a01 ASoC: core: only convert non DPCM link to DPCM link
[ Upstream commit 607fa205a7 ]

Additional checks for valid DAIs expose a corner case, where existing
BE dailinks get modified, e.g. HDMI links are tagged with
dpcm_capture=1 even if the DAIs are for playback.

This patch makes those changes conditional and flags configuration
issues when a BE dailink is has no_pcm=0 but dpcm_playback or
dpcm_capture=1 (which makes no sense).

As discussed on the alsa-devel mailing list, there are redundant flags
for dpcm_playback, dpcm_capture, playback_only, capture_only. This
will have to be cleaned-up in a future update. For now only correct
and flag problematic configurations.

Fixes: 218fe9b7ec ("ASoC: soc-core: Set dpcm_playback / dpcm_capture")
Suggested-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200608194415.4663-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:42 +02:00
Xiyu Yang 1957ac8d1b ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed
[ Upstream commit 36124fb19f ]

fsl_asrc_dma_hw_params() invokes dma_request_channel() or
fsl_asrc_get_dma_channel(), which returns a reference of the specified
dma_chan object to "pair->dma_chan[dir]" with increased refcnt.

The reference counting issue happens in one exception handling path of
fsl_asrc_dma_hw_params(). When config DMA channel failed for Back-End,
the function forgets to decrease the refcnt increased by
dma_request_channel() or fsl_asrc_get_dma_channel(), causing a refcnt
leak.

Fix this issue by calling dma_release_channel() when config DMA channel
failed.

Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Link: https://lore.kernel.org/r/1590415966-52416-1-git-send-email-xiyuyang19@fudan.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:36 +02:00
Qiushi Wu 87b3dca712 ASoC: fix incomplete error-handling in img_i2s_in_probe.
[ Upstream commit 25bf943e4e ]

Function "pm_runtime_get_sync()" is not handled by "pm_runtime_put()"
if "PTR_ERR(rst) == -EPROBE_DEFER". Fix this issue by adding
"pm_runtime_put()" into this error path.

Fixes: f65bb92ca1 ("ASoC: img-i2s-in: Add runtime PM")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Link: https://lore.kernel.org/r/20200525055011.31925-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:34 +02:00
Hans de Goede 0e03324737 ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT8-A tablet
[ Upstream commit 0e0e10fde0 ]

The Toshiba Encore WT8-A tablet almost fully works with the default
settings for non-CR Bay Trail devices. The only problem is that its
jack-detect switch is not inverted (it is active high instead of
the normal active low).

Add a quirk for this model using the default settings +
BYT_RT5640_JD_NOT_INV.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518072416.5348-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:29 +02:00
Christophe JAILLET 5248114b9b ASoC: ti: omap-mcbsp: Fix an error handling path in 'asoc_mcbsp_probe()'
[ Upstream commit 03990fd58d ]

If an error occurs after the call to 'omap_mcbsp_init()', the reference to
'mcbsp->fclk' must be decremented, as already done in the remove function.

This can be achieved easily by using the devm_ variant of 'clk_get()'
when the reference is taken in 'omap_mcbsp_init()'

This fixes the leak in the probe and has the side effect to simplify both
the error handling path of 'omap_mcbsp_init()' and the remove function.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Peter Ujfalusi <peter.ujflausi@ti.com>
Link: https://lore.kernel.org/r/20200512134325.252073-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:26 +02:00
Christophe JAILLET 5acfef9964 ASoC: ux500: mop500: Fix some refcounted resources issues
[ Upstream commit 4e8748fcae ]

There are 2 issues here:
   - if one of the 'of_parse_phandle' fails, calling 'mop500_of_node_put()'
     is a no-op because the 'mop500_dai_links' structure has not been
     initialized yet, so the referenced are not decremented
   - The reference stored in 'mop500_dai_links[i].codecs' is refcounted
     only once in the probe and must be decremented only once.

Fixes: 39013bd60e ("ASoC: Ux500: Dispose of device nodes correctly")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20200512100705.246349-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:26 +02:00
Yongbo Zhang b0ccdd2fdd SoC: rsnd: add interrupt support for SSI BUSIF buffer
[ Upstream commit 66c705d07d ]

SSI BUSIF buffer is possible to overflow or underflow, especially in a
hypervisor environment. If there is no interrupt support, it will eventually
lead to errors in pcm data.
This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.

Reported-by: Chen Li <licheng0822@thundersoft.com>
Signed-off-by: Yongbo Zhang <giraffesnn123@gmail.com>
Tested-by: Chen Li <licheng0822@thundersoft.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200512093003.28332-1-giraffesnn123@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:26 +02:00
Wei Yongjun 6544b95bd7 ASoC: SOF: core: fix error return code in sof_probe_continue()
[ Upstream commit 7d8785bc7a ]

Fix to return negative error code -ENOMEM from the IPC init error
handling case instead of 0, as done elsewhere in this function.

Fixes: c16211d622 ("ASoC: SOF: Add Sound Open Firmware driver core")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200509093337.78897-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:25 +02:00
Yong Zhi a45fc52449 ASoC: max98373: reorder max98373_reset() in resume
[ Upstream commit 1a446873d7 ]

During S3 test, the following error was observed:

[ 726.174237] i2c_designware i2c_designware.0: platform_pm_resume+0x0/0x3d returned 0 after 0 usecs
[ 726.184187] max98373 i2c-MX98373:00: calling max98373_resume+0x0/0x30 [snd_soc_max98373] @ 12698, parent: i2c-11
[ 726.195589] max98373 i2c-MX98373:00: Reset command failed. (ret:-16)

When calling regmap_update_bits(), since map->reg_update_bits is NULL,
_regmap_read() is entered with the following logic:

	if (!map->cache_bypass) {
		ret = regcache_read(map, reg, val);
		if (ret == 0)
			return 0;
	}

	if (map->cache_only)
		return -EBUSY;

regcache_read() hits -EINVAL because MAX98373_R2000_SW_RESET is volatile,
as map->cache_only is set by codec suspend, thus -EBUSY is returned.
Fix by moving max98373_reset() after cache_only set to false in max98373_resume().

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Link: https://lore.kernel.org/r/1588376661-29799-1-git-send-email-yong.zhi@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:23 +02:00
Pavel Machek (CIP) efdb1bf81a ASoC: meson: add missing free_irq() in error path
[ Upstream commit 3b8a299a58 ]

free_irq() is missing in case of error, fix that.

Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>

Link: https://lore.kernel.org/r/20200606153103.GA17905@amd
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:19 +02:00
John Stultz 211836827a ASoC: qcom: q6asm-dai: kCFI fix
[ Upstream commit a6b675a89e ]

Fixes the following kCFI crash seen on db845c, caused
by the function prototypes not matching the callback
function prototype.

[   82.585661] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000001
[   82.595387] Mem abort info:
[   82.599463]   ESR = 0x96000005
[   82.602658]   EC = 0x25: DABT (current EL), IL = 32 bits
[   82.608177]   SET = 0, FnV = 0
[   82.611829]   EA = 0, S1PTW = 0
[   82.615369] Data abort info:
[   82.618751]   ISV = 0, ISS = 0x00000005
[   82.622641]   CM = 0, WnR = 0
[   82.625774] user pgtable: 4k pages, 39-bit VAs, pgdp=0000000174259000
[   82.632292] [0000000000000001] pgd=0000000000000000, pud=0000000000000000
[   82.639167] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[   82.644795] Modules linked in: hci_uart btqca xhci_plat_hcd xhci_pci_renesas xhci_pci xhci_hcd wcn36xx wcnss_ctrl wcd934x vctrl_regulator ufs_qcom syscon_reboot_e
[   82.644927]  qcom_apcs_ipc_mailbox q6asm_dai q6routing q6asm q6afe_dai q6adm q6afe q6core q6dsp_common pm8941_pwrkey pm8916_wdt platform_mhu pinctrl_spmi_mpp pine
[   82.812982] CPU: 3 PID: 240 Comm: kworker/u16:4 Tainted: G        W         5.6.0-rc7-mainline-00960-g0c34353d11b9-dirty #1
[   82.824201] Hardware name: Thundercomm Dragonboard 845c (DT)
[   82.829937] Workqueue: qcom_apr_rx apr_rxwq [apr]
[   82.834698] pstate: 80c00005 (Nzcv daif +PAN +UAO)
[   82.839553] pc : __cfi_check_fail+0x4/0x1c [q6asm_dai]
[   82.844754] lr : __cfi_check+0x3a8/0x3b0 [q6asm_dai]
[   82.849767] sp : ffffffc0105f3c20
[   82.853123] x29: ffffffc0105f3c30 x28: 0000000000000020
[   82.858489] x27: ffffff80f4588400 x26: ffffff80f458ec94
[   82.863854] x25: ffffff80f458ece8 x24: ffffffe3670c7000
[   82.869220] x23: ffffff8094bb7b34 x22: ffffffe367137000
[   82.874585] x21: bd07909b332eada6 x20: 0000000000000001
[   82.879950] x19: ffffffe36713863c x18: ffffff80f8df4430
[   82.885316] x17: 0000000000000001 x16: ffffffe39d15e660
[   82.890681] x15: 0000000000000001 x14: 0000000000000027
[   82.896047] x13: 0000000000000000 x12: ffffffe39e6465a0
[   82.901413] x11: 0000000000000051 x10: 000000000000ffff
[   82.906779] x9 : 000ffffffe366c19 x8 : c3c5f18762d1ceef
[   82.912145] x7 : 0000000000000000 x6 : ffffffc010877698
[   82.917511] x5 : ffffffc0105f3c00 x4 : 0000000000000000
[   82.922877] x3 : 0000000000000000 x2 : 0000000000000001
[   82.928243] x1 : ffffffe36713863c x0 : 0000000000000001
[   82.933610] Call trace:
[   82.936099]  __cfi_check_fail+0x4/0x1c [q6asm_dai]
[   82.940955]  q6asm_srvc_callback+0x22c/0x618 [q6asm]
[   82.945973]  apr_rxwq+0x1a8/0x27c [apr]
[   82.949861]  process_one_work+0x2e8/0x54c
[   82.953919]  worker_thread+0x27c/0x4d4
[   82.957715]  kthread+0x144/0x154
[   82.960985]  ret_from_fork+0x10/0x18
[   82.964603] Code: a8c37bfd f85f8e5e d65f03c0 b40000a0 (39400008)
[   82.970762] ---[ end trace 410accb839617143 ]---
[   82.975429] Kernel panic - not syncing: Fatal exception

Signed-off-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Patrick Lai <plai@codeaurora.org>
Cc: Banajit Goswami <bgoswami@codeaurora.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Todd Kjos <tkjos@google.com>
Cc: Alistair Delva <adelva@google.com>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: alsa-devel@alsa-project.org
Link: https://lore.kernel.org/r/20200529213823.98812-1-john.stultz@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:18 +02:00
Daniel Baluta 376ef9d7ee ASoC: SOF: Do nothing when DSP PM callbacks are not set
[ Upstream commit c26fde3b15 ]

This provides a better separation between runtime and PM sleep
callbacks.

Only do nothing if given runtime flag is set and calback is not set.

With the current implementation, if PM sleep callback is set but runtime
callback is not set then at runtime resume we reload the firmware even
if we do not support runtime resume callback.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200515135958.17511-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:14 +02:00
Xiyu Yang a1359b9fdd ASoC: davinci-mcasp: Fix dma_chan refcnt leak when getting dma type
[ Upstream commit a697ae6ea5 ]

davinci_mcasp_get_dma_type() invokes dma_request_chan(), which returns a
reference of the specified dma_chan object to "chan" with increased
refcnt.

When davinci_mcasp_get_dma_type() returns, local variable "chan" becomes
invalid, so the refcount should be decreased to keep refcount balanced.

The reference counting issue happens in one exception handling path of
davinci_mcasp_get_dma_type(). When chan device is NULL, the function
forgets to decrease the refcnt increased by dma_request_chan(), causing
a refcnt leak.

Fix this issue by calling dma_release_channel() when chan device is
NULL.

Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/1587818916-38730-1-git-send-email-xiyuyang19@fudan.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:10 +02:00
Shengjiu Wang 53057bd4ac ASoC: fsl_esai: Disable exception interrupt before scheduling tasklet
[ Upstream commit 1fecbb71fe ]

Disable exception interrupt before scheduling tasklet, otherwise if
the tasklet isn't handled immediately, there will be endless xrun
interrupt.

Fixes: 7ccafa2b38 ("ASoC: fsl_esai: recover the channel swap after xrun")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/a8f2ad955aac9e52587beedc1133b3efbe746895.1587968824.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:09 +02:00
YueHaibing 2e714a547e ASoC: SOF: imx8: Fix randbuild error
[ Upstream commit fe17e6cdc0 ]

when do randconfig like this:
CONFIG_SND_SOC_SOF_IMX8_SUPPORT=y
CONFIG_SND_SOC_SOF_IMX8=y
CONFIG_SND_SOC_SOF_OF=y
CONFIG_IMX_DSP=m
CONFIG_IMX_SCU=y

there is a link error:

sound/soc/sof/imx/imx8.o: In function 'imx8_send_msg':
imx8.c:(.text+0x380): undefined reference to 'imx_dsp_ring_doorbell'

Select IMX_DSP in SND_SOC_SOF_IMX8_SUPPORT to fix this

Fixes: f9ad754684 ("ASoC: SOF: imx: fix reverse CONFIG_SND_SOC_SOF_OF dependency")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20200409071832.2039-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:08 +02:00
Dmitry Osipenko 30e82a3edd ASoC: tegra: tegra_wm8903: Support nvidia, headset property
[ Upstream commit 3ef9d5073b ]

The microphone-jack state needs to be masked in a case of a 4-pin jack
when microphone and ground pins are shorted. Presence of nvidia,headset
tells that WM8903 CODEC driver should mask microphone's status if short
circuit is detected, i.e headphones are inserted.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20200330204011.18465-3-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:08 +02:00
Daniel Baluta 3edaea57a8 MLK-24263-8 ASoC: SOF: imx8m: Implement reset callback
Resume common flow (System PM / Runtime PM) is like this:

sof_resume
  -> specific device resume
  -> snd_sof_load_firmware
     -> snd_sof_dsp_reset (1)
     -> load_modules()
  -> snd_sof_run_firmware (2)

We need to implement dsp_reset callback (1) that will actually reset the
DSP but keep it stalled.

In order to implement this we do the following:
	-> put DSP into reset (assert CoreReset bit from PWRCTL)
	-> stall the DSP using RunStall bit from AudioDSP_REG2 Audiomix
	-> take DSP out of reset (de-assert CoreReset bit from PWRCTL)

At this moment the DSP is taken out of reset and Stalled! This means
that we can load the firmware and then start the DSP (2).

Until now we resetted the DSP by turning down the Audiomix PD. This
doesn't work for Runtime PM if another IP is keeping Audiomix PD up.

By introducing dsp_reset() we no longer rely on turning off the audiomix
to reset the DSP.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-06-19 17:01:30 +03:00
Daniel Baluta dd53cbb0fd MLK-24263-7 ASoC: fsl_dsp_audiomix: Introduce imx_audiomix_dsp_stall
This function is used to stall the DSP and it will be used
together with PWRCTL register in order to properly reset the
DSP to handle the Power Management use case.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-06-19 17:01:30 +03:00
Daniel Baluta b3adec224c MLK-24263-6 ASoC: fsl_dsp_audiomix: Remove hardcoded value
Use a meaningful named macro to represent RunStall bit from
AudioDSP_REG2 register.

This register is used to Run/Stall the DSP.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-06-19 17:01:30 +03:00
Jason Liu 5691e22711 Merge tag 'v5.4.47' into imx_5.4.y
* tag 'v5.4.47': (2193 commits)
  Linux 5.4.47
  KVM: arm64: Save the host's PtrAuth keys in non-preemptible context
  KVM: arm64: Synchronize sysreg state on injecting an AArch32 exception
  ...

 Conflicts:
	arch/arm/boot/dts/imx6qdl.dtsi
	arch/arm/mach-imx/Kconfig
	arch/arm/mach-imx/common.h
	arch/arm/mach-imx/suspend-imx6.S
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
	arch/powerpc/include/asm/cacheflush.h
	drivers/cpufreq/imx6q-cpufreq.c
	drivers/dma/imx-sdma.c
	drivers/edac/synopsys_edac.c
	drivers/firmware/imx/imx-scu.c
	drivers/net/ethernet/freescale/fec.h
	drivers/net/ethernet/freescale/fec_main.c
	drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
	drivers/net/phy/phy_device.c
	drivers/perf/fsl_imx8_ddr_perf.c
	drivers/usb/cdns3/gadget.c
	drivers/usb/dwc3/gadget.c
	include/uapi/linux/dma-buf.h

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
2020-06-19 17:32:49 +08:00
Pavel Dobias d4a13e6711 ASoC: max9867: fix volume controls
commit 8ba4dc3cff upstream.

The xmax values for Master Playback Volume and Mic Boost
Capture Volume are specified incorrectly (one greater)
which results in the wrong dB gain being shown to the user
in the case of Master Playback Volume.

Signed-off-by: Pavel Dobias <dobias@2n.cz>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200515120757.24669-1-dobias@2n.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-17 16:40:26 +02:00
Daniel Baluta 89d64ed05d MLK-24263-8 ASoC: SOF: Add support for system / runtime PM on i.MX8
Similar with commit a4c2646bc92 ("MLK-24263-5 ASoC: SOF: Add support for system / runtime PM")
this adds the system/runtime PM handlers.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-06-11 16:50:22 +03:00
Daniel Baluta f7b437ebaa MLK-24263-7 ASoC: SOF: Activate runtime PM with SOF OF device
SOF boots the DSP at probe and keeps it up all the time.
With this change, after booting if no one is using the DSP
the SOF core will turn off the DSP to save power.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-06-11 16:50:22 +03:00
Daniel Baluta 95ae3b68a0 MLK-24263-6 ASOC: SOF: Do not boot the DSP when no user requested it
SOF core will not call device specific System suspend
if the DSP is not booted (this is mostly because the way
PCI handles PM, which before system suspend it activates
the devices calling runtime resume).

So, in case we use OF we need to make sure that a simple
system suspend/resume cycle where the DSP is already off
will not turn on the DSP.

This part was completely re-written in the upstream kernel,
and this change is just a summary of the changes in upstream.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-06-11 16:50:22 +03:00
Daniel Baluta 6de9517788 MLK-24263-5 ASoC: SOF: Add support for system / runtime PM
We make use of common imx8m_suspend / imx8m_resume functions
for both system PM and runtime PM.

imx8m_suspend:
	- frees the MU channels
	- disables the clocks

imx8m_resume
	- enables the clocks
	- requests the MU channels

On i.MX8MP there is no dedicated functionality to put the DSP in reset.
The only way of doing this is to POWER DOWN the Audiomix domain.

We are able to do this because turning off the clocks and freeing the
channels makes the Audiomix to have no users thus PM kernel core turns
it down.

Now, care must be taken when handling system sleep. For this we
introduce a global variable to hold if the system was suspend or not via
system PM handlers.

SOF core will not call system PM suspend handler if the DSP is already down,
but at resume it will call the system PM resume. So, we need to keep track of
the state via the suspend variable.

Few insights on how SOF core handles the PM:
 - SOF core uses PM runtime autosuspend (with a timeout of 2 secs)
 - at probe, SOF core boots the DSP and lets the PM runtime suspend to
   turn it off, if there is no activity
 - when someone opens the ALSA sound card (aplay/arecord, etc) SOF core
   calls PM runtime resume to turn on the DSP
 - when the ALSA sound card is closed SOF core make use of PM subsystem
  to call PM runtime suspend and thus turning off the DSP.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-06-11 16:50:22 +03:00
Daniel Baluta 103eddadf8 MLK-24263-4 ASoC: SOF: Do nothing when DSP PM callbacks are not set
This provides a better separation between runtime and PM sleep
callbacks.

Only do nothing if given runtime flag is set and calback is not set.

With the current implementation, if PM sleep callback is set but runtime
callback is not set then at runtime resume we reload the firmware even
if we do not support runtime resume callback.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-06-11 16:50:22 +03:00
Viorel Suman bdf3474115 MLK-24276: ASoC: fsl_xcvr: fix SPDIF TX suspend/resume
SPDIF TX fails to play after resume because PHY is put in reset on suspend,
and is not re-initialized on resume. Move SPDIF TX configuration in "prepare"
callback since "prepare" is called after resume.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-06-11 12:42:50 +03:00
Peter Chen 65e9cfc5f0
MLK-24290-3 ASoC: imx-wm8960: change dev_err for dev_dbg for -EPROBE_DEFER case
For the -EPROBE_DEFER case, it is not real error, and just resource is
not ready. It needs to use debug message instead of error message for it.
It could avoid unexpected console message for every device's probe, eg
SD/USB devices plug in.

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2020-06-10 11:18:02 +08:00
Peter Chen 4e94c9e1a0
MLK-24290-2 ASoC: imx-wm8524: change dev_err for dev_dbg for -EPROBE_DEFER case
For the -EPROBE_DEFER case, it is not real error, and just resource is
not ready. It needs to use debug message instead of error message for it.
It could avoid unexpected console message for every device's probe, eg
SD/USB devices plug in.

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2020-06-10 11:17:30 +08:00
Peter Chen b22d33047d
MLK-24290-1 ASoC: imx-cs42888: change dev_err for dev_dbg for -EPROBE_DEFER case
For the -EPROBE_DEFER case, it is not real error, and just resource is
not ready. It needs to use debug message instead of error message for it.
It could avoid unexpected console message for every device's probe, eg
SD/USB devices plug in, suspend/resume process, etc.

SD device plug in:
mmc1: new high speed SDHC card at address aaaa
mmcblk1: mmc1:aaaa SA16G 14.8 GiB
imx-cs42888 sound-cs42888: failed to find codec platform device

USB device plug in:
usb 2-1: USB disconnect, device number 2
usb 3-1: new SuperSpeed Gen 1 USB device number 2 using cdns-usb3
usb-storage 3-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 3-1:1.0
imx-cs42888 sound-cs42888: failed to find codec platform device
scsi 0:0:0:0: Direct-Access     SanDisk  Ultra            1.00 PQ: 0 ANSI: 6
sd 0:0:0:0: [sda] 60062500 512-byte logical blocks: (30.8 GB/28.6 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1
sd 0:0:0:0: [sda] Attached SCSI removable disk
imx-cs42888 sound-cs42888: failed to find codec platform device

Suspend/resume process:
OOM killer disabled.
Freezing remaining freezable tasks ... (elapsed 0.083 seconds) done.
printk: Suspending console(s) (use no_console_suspend to debug)
fec 5b040000.ethernet eth0: Link is Down
PM: suspend devices took 0.684 seconds
Disabling non-boot CPUs ...
CPU1: shutdown
psci: CPU1 killed (polled 4 ms)
CPU2: shutdown
psci: CPU2 killed (polled 0 ms)
CPU3: shutdown
psci: CPU3 killed (polled 0 ms)
Enabling non-boot CPUs ...
Detected VIPT I-cache on CPU1
GICv3: CPU1: found redistributor 1 region 0:0x0000000051b20000
CPU1: Booted secondary processor 0x0000000001 [0x410fd042]
CPU1 is up
Detected VIPT I-cache on CPU2
GICv3: CPU2: found redistributor 2 region 0:0x0000000051b40000
CPU2: Booted secondary processor 0x0000000002 [0x410fd042]
CPU2 is up
Detected VIPT I-cache on CPU3
GICv3: CPU3: found redistributor 3 region 0:0x0000000051b60000
CPU3: Booted secondary processor 0x0000000003 [0x410fd042]
CPU3 is up
imx-cs42888 sound-cs42888: failed to find codec platform device
PM: resume devices took 0.240 seconds
OOM killer enabled.
Restarting tasks ...

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2020-06-10 11:16:51 +08:00
Jaroslav Kysela 0734b58f84 ASoC: intel - fix the card names
[ Upstream commit d745cc1ab6 ]

Those strings are exposed to the user space as the
card name thus used in the GUIs. The common
standard is to avoid '_' here. The worst case
is 'sof-skl_hda_card' string.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191028164624.14334-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-07 13:18:49 +02:00
Adrian Alonso 251d8ae450 MLK-24232-2: sound: soc fsl: imx-pdm compute mclk performance mode
Compute mclk to allow low power and performance settings
based on sample_rate:
[ 8000 - 11025] low power mode
[16000 - 64000] performance mode
Update Copyright year.

Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-06-05 11:07:41 -05:00
Adrian Alonso 4169c352d3 MLK-24230: sound: soc fsl: imx pdm add dsd format constraints
Add DSD_U8, DSD_U16_LE and DSD_U32_LE format constrains
in order to use SAI DSD settings for handling multi
channel capture streams. One channel per dataline.

Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-06-05 10:22:19 -05:00
Adrian Alonso 8504adc81a MLK-24267: sound: soc: utils dummy codec dai DSD format support
Add dummy codec dai DSD_U8, DSD_U16_LE and DSD_U32_LE
format support to allow machine ASoC drivers that
support DSD formats to use snd-soc-dummy-dai

Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-06-05 10:20:16 -05:00
Viorel Suman 321894d403 MLK-24139-4 ASoC: fsl_xcvr: allow playback for SPDIF only
Allow playback for SPDIF only.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-29 12:40:39 +03:00
Viorel Suman c94af0b933 MLK-24139-3 ASoC: fsl_xcvr: add SPDIF constraints
Add missing SPDIF constraints.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-29 12:40:39 +03:00
Viorel Suman fbdea7bf8e MLK-24139-1 ASoC: fsl_xcvr: split resources for ram, regs and fifos
Split RAM, regs and FIFO resources in DTS.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-29 12:40:39 +03:00
Shengjiu Wang 2f07bac002 MLK-24175: ASoC: fsl_sai: instantiate snd_soc_dai_driver
instantiate snd_soc_dai_driver for independent symmetric control.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-27 16:55:06 +08:00
Viorel Suman eb01ee5109 MLK-22598: ASoC: fsl_micfil: fix a cherry-pick error
The original patch updates REG_MICFIL_STAT in fsl_micfil_reset
method, but not in configure_hwvad_interrupts, fix this.

Fixes: e12b0060cd ("MLK-22598: ASoC: fsl_micfil: Reset channel output
data Flag")
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-25 15:43:37 +03:00
Daniel Baluta 61031bfa4f MLK-23638: ASoC: fsl_dai: Make sure clocks are turned on during probe
During probe SOF driver loads the topology, which will send messages
to DSP to create the Audio components.

SOF DAI component at creation time calls probe() and touches DAI
registers thus we need to make sure DAI clocks are turned on during
probe.

Using pm_runtime_get_sync() we force resume to be called which will
enable all necessary clocks.

Later we call the pm_runtime_put_sync() and mark the device as
autosuspend. This will cause suspend to be called which will disable
all clocks to save power.

Later, when userspace uses the sound card (via aplay/arecord) or any
alsa-lib calls the normal runtime resume/suspend flow will happen.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-22 12:23:19 +03:00
Shengjiu Wang 466976dd76 MLK-24132: ASoC: fsl_micfil: Fix kernel panic when hwvad is disabled
The reason is that we access the register when power is disabled

reproduce command:
echo 8 > /sys/devices/platform/soc@0/30c00000.bus/30c00000.spba-bus/30ca0000.micfil/hwvad/enable

[  332.838518] SError Interrupt on CPU2, code 0xbf000002 -- SError
[  332.838521] CPU: 2 PID: 1383 Comm: sh Tainted: G           O      5.4.24-2.1.0+g2ad925d15481 #1
[  332.838523] Hardware name: NXP i.MX8MPlus EVK board (DT)
[  332.838525] pstate: 20000085 (nzCv daIf -PAN -UAO)
[  332.838526] pc : regcache_sync_block+0x7c/0x258
[  332.838528] lr : regcache_sync_block+0xf0/0x258
[  332.838531] sp : ffff800012bf3be0
[  332.838532] x29: ffff800012bf3be0 x28: 0000000000000000
[  332.838535] x27: 0000000000000000 x26: 0000000000000001
[  332.838541] x25: ffff00017753ed00 x24: 0000000000000000
[  332.838546] x23: ffff00017706d400 x22: 000000000000002b
[  332.838550] x21: ffff00017753f100 x20: ffff000177538c00
[  332.838554] x19: 0000000000000001 x18: 0000000000000000
[  332.838559] x17: 0000000000000000 x16: 0000000000000000
[  332.838564] x15: 0000000000000000 x14: 0000000000000000
[  332.838567] x13: 0000000000000000 x12: 0000000000000000
[  332.838572] x11: ffff800012bf3d50 x10: ffff000173c0e900
[  332.838577] x9 : ffff00017706d870 x8 : 0000000000000000
[  332.838582] x7 : 00000000000000a8 x6 : 0000000000000000
[  332.838587] x5 : 0000000000000000 x4 : ffff800010769d88
[  332.838592] x3 : ffff80001076d278 x2 : 0000000008000000
[  332.838597] x1 : ffff800023c10000 x0 : 0000000000000000
[  332.838603] Kernel panic - not syncing: Asynchronous SError Interrupt
[  332.838605] CPU: 2 PID: 1383 Comm: sh Tainted: G           O      5.4.24-2.1.0+g2ad925d15481 #1
[  332.838606] Hardware name: NXP i.MX8MPlus EVK board (DT)
[  332.838608] Call trace:
[  332.838609]  dump_backtrace+0x0/0x140
[  332.838612]  show_stack+0x14/0x20
[  332.838613]  dump_stack+0xb4/0xf8
[  332.838617]  panic+0x158/0x324
[  332.838618]  nmi_panic+0x84/0x88
[  332.838621]  arm64_serror_panic+0x74/0x80
[  332.838622]  do_serror+0x80/0x138
[  332.838623]  el1_error+0x84/0xf8
[  332.838627]  regcache_sync_block+0x7c/0x258
[  332.838628]  regcache_rbtree_sync+0x60/0xb0
[  332.838629]  regcache_sync+0xac/0x140
[  332.838633]  disable_hwvad+0x3c/0x1f0
[  332.838634]  micfil_hwvad_handler+0x78/0x170
[  332.838635]  kobj_attr_store+0x14/0x28
[  332.838637]  sysfs_kf_write+0x40/0x50
[  332.838640]  kernfs_fop_write+0xf8/0x210
[  332.838641]  __vfs_write+0x18/0x40
[  332.838642]  vfs_write+0xdc/0x1c8
[  332.838646]  ksys_write+0x68/0xf0
[  332.838647]  __arm64_sys_write+0x18/0x20
[  332.838648]  el0_svc_common.constprop.0+0x68/0x160
[  332.838651]  el0_svc_handler+0x20/0x80
[  332.838653]  el0_svc+0x8/0xc
[  332.838972] SMP: stopping secondary CPUs
[  332.838974] Kernel Offset: disabled
[  332.838975] CPU features: 0x0002,2000200c
[  332.838976] Memory Limit: none

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-22 15:03:29 +08:00