1
0
Fork 0
Commit Graph

20230 Commits (redonkable)

Author SHA1 Message Date
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
Shengjiu Wang 6572404242 MLK-24084-3: ASoC: fsl_easrc_m2m: reset in_filled_len on suspend
in_filled_len need to be reset on suspend, for suspend, every state
will go back to initilization state.

Fixes: 3e87108614d1 ("MLK-24044: ASoC: fsl_easrc_m2m: Fix output length not accurate")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-21 18:45:35 +08:00
Shengjiu Wang 3a467c53a7 MLK-24084-2: ASoC: fsl_easrc_m2m: Fix kernel panic in m2m stress test
initilize the m2m->complete in open() to avoid the NULL pointer in suspend
because the suspend can be called before initilizing m2m->complete in convert

[  591.006691] Filesystems sync: 0.084 seconds
[  591.012292] Freezing user space processes ... (elapsed 0.001 seconds) done.
[  591.020768] OOM killer disabled.
[  591.024016] Freezing remaining freezable tasks ... (elapsed 0.105 seconds) done.
[  591.809374] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[  591.818160] Mem abort info:
[  591.820949]   ESR = 0x96000004
[  591.824000]   EC = 0x25: DABT (current EL), IL = 32 bits
[  591.829307]   SET = 0, FnV = 0
[  591.832356]   EA = 0, S1PTW = 0
[  591.835493] Data abort info:
[  591.838369]   ISV = 0, ISS = 0x00000004
[  591.842200]   CM = 0, WnR = 0
[  591.845165] user pgtable: 4k pages, 48-bit VAs, pgdp=00000001b033e000
[  591.851600] [0000000000000000] pgd=0000000000000000
[  591.856476] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[  591.862043] Modules linked in:
[  591.865097] CPU: 2 PID: 867 Comm: rtcwakeup.out Not tainted 5.4.24-04892-g8b7eb66 #911
[  591.873009] Hardware name: NXP i.MX8MPlus EVK board (DT)
[  591.878317] pstate: a0000085 (NzCv daIf -PAN -UAO)
[  591.883110] pc : __wake_up_common+0x58/0x170
[  591.887377] lr : __wake_up_locked+0x18/0x20
[  591.891555] sp : ffff8000120b3a00
[  591.894866] x29: ffff8000120b3a00 x28: ffff800011b84000
[  591.900174] x27: 0000000000000000 x26: 0000000000000000
[  591.905482] x25: 0000000000000003 x24: 0000000000000000
[  591.910791] x23: 0000000000000001 x22: 0000000000000000
[  591.916099] x21: ffff000171369420 x20: ffff000171369418
[  591.921407] x19: ffff000171369410 x18: 0000000000000000
[  591.926715] x17: 0000000000000000 x16: 0000000000000000
[  591.932023] x15: 0000000000000000 x14: ffff0001760daa00
[  591.937331] x13: ffff80016dbdc000 x12: 0000000034d4d91d
[  591.942639] x11: 0000000000000000 x10: 00000000000009c0
[  591.947948] x9 : ffff000171a30470 x8 : 00000000ffffffff
[  591.953256] x7 : ffff8000120b3a38 x6 : ffffffffffffffe8
[  591.958564] x5 : 0000000000000000 x4 : 0000000000000000
[  591.963871] x3 : 0000000000000000 x2 : 0000000000000001
[  591.969179] x1 : 0000000000000003 x0 : 0000000000000000
[  591.974487] Call trace:
[  591.976931]  __wake_up_common+0x58/0x170
[  591.980851]  __wake_up_locked+0x18/0x20
[  591.984683]  complete+0x48/0x68
[  591.987823]  fsl_easrc_suspend+0x84/0x100
[  591.991831]  dpm_run_callback.isra.0+0x38/0xd8
[  591.996271]  __device_suspend+0xfc/0x3c8
[  592.000191]  dpm_suspend+0xf0/0x1e8
[  592.003676]  dpm_suspend_start+0x98/0xa0
[  592.007596]  suspend_devices_and_enter+0xec/0x5b8
[  592.012297]  pm_suspend+0x2f8/0x340
[  592.015781]  state_store+0x88/0x108
[  592.019267]  kobj_attr_store+0x14/0x28
[  592.023015]  sysfs_kf_write+0x40/0x50
[  592.026674]  kernfs_fop_write+0xf8/0x210
[  592.030594]  __vfs_write+0x18/0x40
[  592.033992]  vfs_write+0xdc/0x1c8
[  592.037303]  ksys_write+0x68/0xf0
[  592.040615]  __arm64_sys_write+0x18/0x20
[  592.044536]  el0_svc_common.constprop.0+0x68/0x160
[  592.049324]  el0_svc_handler+0x20/0x80
[  592.053070]  el0_svc+0x8/0xc
[  592.055950] Code: 54000700 a90153f3 2a0203f7 52800018 (f9400cd3)
[  592.062040] ---[ end trace a36c1a42637c268e ]---

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-21 18:45:35 +08:00
Shengjiu Wang 857284dc23 MLK-24084-1: ASoc: fsl_asrc_m2m: Fix kernel panic in m2m stress test
initilize the m2m->complete in open() to avoid the NULL pointer in suspend
because the suspend can be called before initilizing m2m->complete in convert

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-21 18:45:35 +08:00
Adrian Alonso 8fb5fb0a66 MLK-24059: sound: soc: fsl add imx-ak5552 compatible
Add fsl,imx-audio-ak5552 to imx-ak5558 machine ASoC
driver, limit actual number of channels for ak5552
ADC support

Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
2020-05-19 13:51:00 -05:00
Shengjiu Wang b020954c94 MLK-24044: ASoC: fsl_easrc_m2m: Fix output length not accurate
We need to accumulate the input data length for calculating the
output length because there are data need to be prefilled in
the beginning. If the fraction part beyond the integrity of
sample is not considered in calculating, which may cause the
output task timeout.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-15 17:24:52 +08:00
Viorel Suman a4f24900c3 MLK-23146-1: ASoC: fsl_spdif: add intermediate RX rates for iMX8MM.
Add intermediate RX rates for iMX8MM.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-15 11:46:24 +03:00
Viorel Suman ae30f694da MLK-24043-2: ASoC: fsl_xcvr: do not rise M0+ SPDIF TX interrupt
At SPDIF TX interrupt the firmware running on M0+ core
overwrites TX DPATH BYPASS FEM bit which turns the
expected PHY DMAC TX PLL clock 2*bitclock instead of
expected 10*bitclock if SAI PLL is used as PHY DMAC TX
PLL.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-15 10:15:43 +03:00
Viorel Suman 1634635098 MLK-24043-1: ASoC: fsl_xcvr: fix shutdown for full duplex mode
The existing "shutdown" callback does not consider
full duplex mode, fix this.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-15 10:15:24 +03:00
Adrian Alonso 7238c03e56 MLK-23921: sound: soc: imx-pdm: update driver constrains
Update drivers constrains, limit sample rates to
[8Khz - 64Khz] and up to 8 channels.
Use SND_SOC_DAIFMT_PDM format type and remove
tdm slot settings to allow capture from multiple
SAI_RxD pins.

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
2020-05-12 13:20:34 -05:00
Viorel Suman db31c447ee MLK-23991: ASoC: fsl_xcvr: drop eARC -> ARC fallback
The criteria used to drop eARC mode into ARC mode
makes eARC function to fail. Drop it for now.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-12 16:13:15 +03:00
Shengjiu Wang 464e926718 MLK-23975: ASoC: imx-dsp: Remove wrong dapm route
With route "Playback" -> "Playback", dapm will enable
the "Playback" widget to be power on, there is this same
widget for codec component, then codec will enter
the SND_SOC_BIAS_ON level, then mclk is enabled

When the mclk is bound with a power domain, the power
domain will be enabled always.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Peng Zhang <peng.zhang_8@nxp.com>
2020-05-11 17:44:04 +08:00
Shengjiu Wang cacd4e1389 MLK-23970: ASoC: fsl_dsp: workaround for no reset controller
On imx8mp, there is no dedicated reset controller for DSP and
there is no dedicated power domain for DSP.

The power of DSP is bound with audiomix, so we need to check
the DSP status for judging the audiomix is reset or not.

We use the PID register for status check, after reset, it will
be set to zero, when DSP is used we set it to 1.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Peng Zhang <peng.zhang_8@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-11 14:50:55 +08:00
Shengjiu Wang 6d730b27cc MLK-23965: ASoC: fsl_dsp: Fix the error handler in probe
Fix the error handler in probe. otherwise the resource
can't be release when error happen.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Peng Zhang <peng.zhang_8@nxp.com>
2020-05-11 10:51:16 +08:00
Viorel Suman e8bc5163ce ASoC: fsl_xcvr: use SAI PLL for SPDIF playback
Use SAI PLL for SPDIF playback in order to allow
full duplex mode.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-10 22:12:29 +03:00
Matthias Blankertz 0560b7c3ba ASoC: rsnd: Fix "status check failed" spam for multi-SSI
[ Upstream commit 54cb622168 ]

Fix the rsnd_ssi_stop function to skip disabling the individual SSIs of
a multi-SSI setup, as the actual stop is performed by rsnd_ssiu_stop_gen2
- the same logic as in rsnd_ssi_start. The attempt to disable these SSIs
was harmless, but caused a "status check failed" message to be printed
for every SSI in the multi-SSI setup.
The disabling of interrupts is still performed, as they are enabled for
all SSIs in rsnd_ssi_init, but care is taken to not accidentally set the
EN bit for an SSI where it was not set by rsnd_ssi_start.

Signed-off-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200417153017.1744454-3-matthias.blankertz@cetitec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:27 +02:00
Matthias Blankertz 883d34cdef ASoC: rsnd: Don't treat master SSI in multi SSI setup as parent
[ Upstream commit 0c258657dd ]

The master SSI of a multi-SSI setup was attached both to the
RSND_MOD_SSI slot and the RSND_MOD_SSIP slot of the rsnd_dai_stream.
This is not correct wrt. the meaning of being "parent" in the rest of
the SSI code, where it seems to indicate an SSI that provides clock and
word sync but is not transmitting/receiving audio data.

Not treating the multi-SSI master as parent allows removal of various
special cases to the rsnd_ssi_is_parent conditions introduced in commit
a09fb3f28a ("ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode").
It also fixes the issue that operations performed via rsnd_dai_call()
were performed twice for the master SSI. This caused some "status check
failed" spam when stopping a multi-SSI stream as the driver attempted to
stop the master SSI twice.

Signed-off-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200417153017.1744454-2-matthias.blankertz@cetitec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:26 +02:00
Amadeusz Sławiński b2978c3076 ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry
[ Upstream commit 326b509238 ]

If we don't find any pcm, pcm will point at address at an offset from
the the list head and not a meaningful structure. Fix this by returning
correct pcm if found and NULL if not. Found with coccinelle.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20200415162849.308-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:25 +02:00
Matthias Blankertz f9c3a17786 ASoC: rsnd: Fix HDMI channel mapping for multi-SSI mode
[ Upstream commit b94e164759 ]

The HDMI?_SEL register maps up to four stereo SSI data lanes onto the
sdata[0..3] inputs of the HDMI output block. The upper half of the
register contains four blocks of 4 bits, with the most significant
controlling the sdata3 line and the least significant the sdata0 line.

The shift calculation has an off-by-one error, causing the parent SSI to
be mapped to sdata3, the first multi-SSI child to sdata0 and so forth.
As the parent SSI transmits the stereo L/R channels, and the HDMI core
expects it on the sdata0 line, this causes no audio to be output when
playing stereo audio on a multichannel capable HDMI out, and
multichannel audio has permutated channels.

Fix the shift calculation to map the parent SSI to sdata0, the first
child to sdata1 etc.

Signed-off-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200415141017.384017-3-matthias.blankertz@cetitec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:24 +02:00
Matthias Blankertz 26500b980b ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode
[ Upstream commit a09fb3f28a ]

The parent SSI of a multi-SSI setup must be fully setup, started and
stopped since it is also part of the playback/capture setup. So only
skip the SSI (as per commit 203cdf51f2 ("ASoC: rsnd: SSI parent cares
SWSP bit") and commit 597b046f0d ("ASoC: rsnd: control SSICR::EN
correctly")) if the SSI is parent outside of a multi-SSI setup.

Signed-off-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200415141017.384017-2-matthias.blankertz@cetitec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:24 +02:00
Amadeusz Sławiński ab182c06fc ASoC: topology: Fix endianness issue
[ Upstream commit 26d8788159 ]

As done in already existing cases, we should use le32_to_cpu macro while
accessing hdr->magic. Found with sparse.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20200415162435.31859-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:24 +02:00
Sebastian Reichel ae975c8e10 ASoC: sgtl5000: Fix VAG power-on handling
[ Upstream commit aa7812737f ]

As mentioned slightly out of patch context in the code, there
is no reset routine for the chip. On boards where the chip is
supplied by a fixed regulator, it might not even be resetted
during (e.g. watchdog) reboot and can be in any state.

If the device is probed with VAG enabled, the driver's probe
routine will generate a loud pop sound when ANA_POWER is
being programmed. Avoid this by properly disabling just the
VAG bit and waiting the required power down time.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Fabio Estevam <festivem@gmail.com>
Link: https://lore.kernel.org/r/20200414181140.145825-1-sebastian.reichel@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:23 +02:00
Amadeusz Sławiński a5dec15686 ASoC: topology: Check return value of soc_tplg_dai_config
[ Upstream commit dd8e871d4e ]

Function soc_tplg_dai_config can fail, check for and handle possible
failure.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200327204729.397-7-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:23 +02:00
Amadeusz Sławiński fd8f4a3be5 ASoC: topology: Check return value of pcm_new_ver
[ Upstream commit b3677fc3d6 ]

Function pcm_new_ver can fail, so we should check it's return value and
handle possible error.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200327204729.397-6-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:23 +02:00
Amadeusz Sławiński 0d452c7e30 ASoC: topology: Check soc_tplg_add_route return value
[ Upstream commit 6856e887ea ]

Function soc_tplg_add_route can propagate error code from callback, we
should check its return value and handle fail in correct way.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200327204729.397-5-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:22 +02:00
Amadeusz Sławiński 76336d4fa8 ASoC: topology: Check return value of soc_tplg_*_create
[ Upstream commit 2ae548f30d ]

Functions soc_tplg_denum_create, soc_tplg_dmixer_create,
soc_tplg_dbytes_create can fail, so their return values should be
checked and error should be propagated.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200327204729.397-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:22 +02:00
Amadeusz Sławiński db80b7cb17 ASoC: topology: Check return value of soc_tplg_create_tlv
[ Upstream commit 482db55ae8 ]

Function soc_tplg_create_tlv can fail, so we should check if it succeded
or not and proceed appropriately.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200327204729.397-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:22 +02:00
Shengjiu Wang d1be673ae5 MLK-23958: ASoC: fsl_dsp: Fix the power issue with dsp
Need to use pm_runtime_get_sync & pm_runtime_put_sync in probe
to bind the attached power domain with device.

Fixes: ee1a47b87f ("MLK-23618-6: ASoC: fsl_dsp: refine handling of multi power domain")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Peng Zhang <peng.zhang_8@nxp.com>
2020-05-09 17:47:00 +08:00
Viorel Suman f801089134 ASoC: fsl_spdif: add support for 88200 and 176400 rates
Add support for 88200 Hz and 17600 Hz.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-08 11:58:07 +03:00
Shengjiu Wang 4316b08138 MLK-23906-4: ASoC: fsl_micfil: Don't bind clock with regmap
The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
      - clk_pm_runtime_get()

Cause the power domain of ipg clock always be enabled.
which impact the power consumption.

so we can't bind clock with regmap, but explicitly enable
clock when using.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-07 17:17:50 +08:00
Shengjiu Wang b35c0a202e MLK-23906-3: ASoC: fsl_easrc: Don't bind clock with regmap
The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
      - clk_pm_runtime_get()

Cause the power domain of mem clock always be enabled.
which impact the power consumption.

so we can't bind clock with regmap, but explicitly enable
clock when using.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-07 17:17:45 +08:00
Shengjiu Wang 7cdd916faa MLK-23906-2: ASoC: fsl_aud2htx: Switch to imx-pcm-dma-v2
With imx-pcm-dma, the dma channel is created in probe, when
there is power domain attached with dma device, the power
domain will be enabled when channel is created, then the
power of the domain will be always enabled from beginning.

So switch to imx-pcm-dma-v2, then the dma channel will be
created when playback or capture really started.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-07 17:17:42 +08:00
Shengjiu Wang 4ac1cd1136 MLK-23906-1: ASoC: fsl_aud2htx: Don't bind clock with regmap
The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
      - clk_pm_runtime_get()

Cause the power domain of bus clock always be enabled.
which impact the power consumption.

So we can't bind clock with regmap, then explicitly enable
clock when using.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-07 17:17:27 +08:00
Greg Kroah-Hartman 5a54c69c4e Revert "ASoC: meson: axg-card: fix codec-to-codec link setup"
This reverts commit 005aa9f0af which is
commit 1164284270 upstream.

It should not have been backported, I only looked at the "Fixes:" tag,
not the changelog text itself, my fault.

Reported-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 17:26:47 +02:00
Olivier Moysan 4e7fb753e8 ASoC: stm32: spdifrx: fix regmap status check
commit a168dae5ea upstream.

Release resources when exiting on error.

Fixes: 1a5c0b28fc ("ASoC: stm32: spdifrx: manage identification registers")

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20200318144125.9163-2-olivier.moysan@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 08:49:01 +02:00
Pierre-Louis Bossart 4104faaeed ASoC: soc-core: disable route checks for legacy devices
commit a22ae72b86 upstream.

v5.4 changes in soc-core tightened the checks on soc_dapm_add_routes,
which results in the ASoC card probe failing.

Introduce a flag to be set in machine drivers to prevent the probe
from stopping in case of incomplete topologies or missing routes. This
flag is for backwards compatibility only and shall not be used for
newer machine drivers.

Example with an HDaudio card with a bad topology:

[ 236.177898] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to
add route iDisp1_out -> direct -> iDisp1 Tx

[ 236.177902] skl_hda_dsp_generic skl_hda_dsp_generic:
snd_soc_bind_card: snd_soc_dapm_add_routes failed: -19

with the disable_route_checks set:

[ 64.031657] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to
add route iDisp1_out -> direct -> iDisp1 Tx

[ 64.031661] skl_hda_dsp_generic skl_hda_dsp_generic:
snd_soc_bind_card: disable_route_checks set, ignoring errors on
add_routes

Fixes: daa480bde6 ("ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200309192744.18380-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-05-02 08:49:01 +02:00
Shengjiu Wang 1157d97cfa ASoC: wm8960: Fix wrong clock after suspend & resume
commit 1e060a453c upstream.

After suspend & resume, wm8960_hw_params may be called when
bias_level is not SND_SOC_BIAS_ON, then wm8960_configure_clocking
is not called. But if sample rate is changed at that time, then
the output clock rate will be not correct.

So judgement of bias_level is SND_SOC_BIAS_ON in wm8960_hw_params
is not necessary and it causes above issue.

Fixes: 3176bf2d7c ("ASoC: wm8960: update pll and clock setting function")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1587468525-27514-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 08:48:45 +02:00
Jerome Brunet 005aa9f0af ASoC: meson: axg-card: fix codec-to-codec link setup
commit 1164284270 upstream.

Since the addition of commit 9b5db05936 ("ASoC: soc-pcm: dpcm: Only allow
playback/capture if supported"), meson-axg cards which have codec-to-codec
links fail to init and Oops:

  Unable to handle kernel NULL pointer dereference at virtual address 0000000000000128
  Internal error: Oops: 96000044 [#1] PREEMPT SMP
  CPU: 3 PID: 1582 Comm: arecord Not tainted 5.7.0-rc1
  pc : invalidate_paths_ep+0x30/0xe0
  lr : snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
  Call trace:
   invalidate_paths_ep+0x30/0xe0
   snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
   dpcm_path_get+0x38/0xd0
   dpcm_fe_dai_open+0x70/0x920
   snd_pcm_open_substream+0x564/0x840
   snd_pcm_open+0xfc/0x228
   snd_pcm_capture_open+0x4c/0x78
   snd_open+0xac/0x1a8
   ...

While initiliazing the links, ASoC treats the codec-to-codec links of this
card type as a DPCM backend. This error eventually leads to the Oops.

Most of the card driver code is shared between DPCM backends and
codec-to-codec links. The property "no_pcm" marking DCPM BE was left set on
codec-to-codec links, leading to this problem. This commit fixes that.

Fixes: 0a8f1117a6 ("ASoC: meson: axg-card: add basic codec-to-codec link support")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200420114511.450560-2-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 08:48:45 +02:00
Philipp Puschmann 08865eb796 ASoC: tas571x: disable regulators on failed probe
commit 9df8ba7c63 upstream.

If probe fails after enabling the regulators regulator_put is called for
each supply without having them disabled before. This produces some
warnings like

WARNING: CPU: 0 PID: 90 at drivers/regulator/core.c:2044 _regulator_put.part.0+0x154/0x15c
[<c010f7a8>] (unwind_backtrace) from [<c010c544>] (show_stack+0x10/0x14)
[<c010c544>] (show_stack) from [<c012b640>] (__warn+0xd0/0xf4)
[<c012b640>] (__warn) from [<c012b9b4>] (warn_slowpath_fmt+0x64/0xc4)
[<c012b9b4>] (warn_slowpath_fmt) from [<c04c4064>] (_regulator_put.part.0+0x154/0x15c)
[<c04c4064>] (_regulator_put.part.0) from [<c04c4094>] (regulator_put+0x28/0x38)
[<c04c4094>] (regulator_put) from [<c04c40cc>] (regulator_bulk_free+0x28/0x38)
[<c04c40cc>] (regulator_bulk_free) from [<c0579b2c>] (release_nodes+0x1d0/0x22c)
[<c0579b2c>] (release_nodes) from [<c05756dc>] (really_probe+0x108/0x34c)
[<c05756dc>] (really_probe) from [<c0575aec>] (driver_probe_device+0xb8/0x16c)
[<c0575aec>] (driver_probe_device) from [<c0575d40>] (device_driver_attach+0x58/0x60)
[<c0575d40>] (device_driver_attach) from [<c0575da0>] (__driver_attach+0x58/0xcc)
[<c0575da0>] (__driver_attach) from [<c0573978>] (bus_for_each_dev+0x78/0xc0)
[<c0573978>] (bus_for_each_dev) from [<c0574b5c>] (bus_add_driver+0x188/0x1e0)
[<c0574b5c>] (bus_add_driver) from [<c05768b0>] (driver_register+0x74/0x108)
[<c05768b0>] (driver_register) from [<c061ab7c>] (i2c_register_driver+0x3c/0x88)
[<c061ab7c>] (i2c_register_driver) from [<c0102df8>] (do_one_initcall+0x58/0x250)
[<c0102df8>] (do_one_initcall) from [<c01a91bc>] (do_init_module+0x60/0x244)
[<c01a91bc>] (do_init_module) from [<c01ab5a4>] (load_module+0x2180/0x2540)
[<c01ab5a4>] (load_module) from [<c01abbd4>] (sys_finit_module+0xd0/0xe8)
[<c01abbd4>] (sys_finit_module) from [<c01011e0>] (__sys_trace_return+0x0/0x20)

Fixes: 3fd6e7d9a1 (ASoC: tas571x: New driver for TI TAS571x power amplifiers)
Signed-off-by: Philipp Puschmann <p.puschmann@pironex.de>
Link: https://lore.kernel.org/r/20200414112754.3365406-1-p.puschmann@pironex.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 08:48:45 +02:00
Stephan Gerhold e9058b4555 ASoC: q6dsp6: q6afe-dai: add missing channels to MI2S DAIs
commit 0c824ec094 upstream.

For some reason, the MI2S DAIs do not have channels_min/max defined.
This means that snd_soc_dai_stream_valid() returns false,
i.e. the DAIs have neither valid playback nor capture stream.

It's quite surprising that this ever worked correctly,
but in 5.7-rc1 this is now failing badly: :)

Commit 0e9cf4c452 ("ASoC: pcm: check if cpu-dai supports a given stream")
introduced a check for snd_soc_dai_stream_valid() before calling
hw_params(), which means that the q6i2s_hw_params() function
was never called, eventually resulting in:

    qcom-q6afe aprsvc:q6afe:4:4: no line is assigned

... even though "qcom,sd-lines" is set in the device tree.

Commit 9b5db05936 ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported")
now even avoids creating PCM devices if the stream is not supported,
which means that it is failing even earlier with e.g.:

    Primary MI2S: ASoC: no backend playback stream

Avoid all that trouble by adding channels_min/max for the MI2S DAIs.

Fixes: 24c4cbcfac ("ASoC: qdsp6: q6afe: Add q6afe dai driver")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200415150050.616392-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 08:48:45 +02:00
Olivier Moysan a74a5435a6 ASoC: stm32: sai: fix sai probe
commit e2bcb65782 upstream.

pcm config must be set before snd_dmaengine_pcm_register() call.

Fixes: 0d6defc7e0 ("ASoC: stm32: sai: manage rebind issue")

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20200417142122.10212-1-olivier.moysan@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 08:48:42 +02:00
Viorel Suman 698861f076 MLK-23618-17: fsl_sai: fix hang in probe at boot time
A power domain associated with a device may be disabled in
a separate thread by "genpd_power_off_work_fn" function in
case the device has no PM runtime enabled at that moment.
This will stop the parent clock of "bus" clk and hang
the probe in regmap read/write operation. In order to avoid
this PM runtime must be enabled before any regmap read/write
ops. Aside of this replace clk bus clocks with
pm_runtime_get/put_sync calls.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Fixes: c2641e1974 ("MLK-23618-9: ASoC: fsl_sai: Don't bind clock with regmap")
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-01 12:45:43 +03:00
Viorel Suman 18b2111684 MLK-23887: ASoC: fsl_xcvr: set regcache_cache_only true in probe
Set regmap to use regcache only in probe in order to avoid
issue on cat /sys/kernel/debug/regmap/30cc0000.xcvr/registers

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-01 12:45:43 +03:00
Gyeongtaek Lee f67f3317ce ASoC: dapm: fixup dapm kcontrol widget
commit ebf1474745 upstream.

snd_soc_dapm_kcontrol widget which is created by autodisable control
should contain correct on_val, mask and shift because it is set when the
widget is powered and changed value is applied on registers by following
code in dapm_seq_run_coalesced().

		mask |= w->mask << w->shift;
		if (w->power)
			value |= w->on_val << w->shift;
		else
			value |= w->off_val << w->shift;

Shift on the mask in dapm_kcontrol_data_alloc() is removed to prevent
double shift.
And, on_val in dapm_kcontrol_set_value() is modified to get correct
value in the dapm_seq_run_coalesced().

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/000001d61537$b212f620$1638e260$@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-29 16:33:18 +02:00
Kai Vehmanen ca958fe8af ASoC: SOF: trace: fix unconditional free in trace release
[ Upstream commit e6110114d1 ]

Check if DMA pages were successfully allocated in initialization
before calling free. For many types of memory (like sgbufs)
the extra free is harmless, but not all backends track allocation
state, so add an explicit check.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200124213625.30186-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-29 16:33:05 +02:00
Hans de Goede 578aa47612 ASoC: Intel: bytcr_rt5640: Add quirk for MPMAN MPWIN895CL tablet
[ Upstream commit c8b78f24c1 ]

The MPMAN MPWIN895CL tablet almost fully works with out default settings.
The only problem is that it has only 1 speaker so any sounds only playing
on the right channel get lost.

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

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/20200405133726.24154-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-29 16:33:03 +02:00
Hans de Goede 90a33c23aa ASoC: Intel: atom: Take the drv->lock mutex before calling sst_send_slot_map()
[ Upstream commit 81630dc042 ]

sst_send_slot_map() uses sst_fill_and_send_cmd_unlocked() because in some
places it is called with the drv->lock mutex already held.

So it must always be called with the mutex locked. This commit adds missing
locking in the sst_set_be_modules() code-path.

Fixes: 24c8d14192 ("ASoC: Intel: mrfld: add DSP core controls")
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/20200402185359.3424-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-29 16:32:59 +02:00
Zhang Peng 1a17334e71 MLK-23837 Asoc: fsl_dsp: Fix system crash when do dsp suspend test
The issue is GPU will crash when do dsp suspend test, and only
meet this issue when load GPU as module.
The reason is that dsp framework's global data set size little
than actul size. So dsp will touch the memory that not owned
dsp, then caused GPU crash.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2020-04-29 20:50:04 +08:00
Shengjiu Wang fe01a5d14b MLK-23642-3: ASoC: fsl: imx-cdnhdmi: support 6 channels
Add support 6 channels

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-04-29 18:35:51 +08:00
Shengjiu Wang 326442c327 MLK-23642-2: ASoC: hdmi-codec: Add iec958 kcontrol
Add iec958 controls, then user can set the AES from user space.
The command is "iecset", which is in alsa-utils.

For HBR test, we need do below steps
1. Generate iec61937 mat stream by ffmpeg.
   ffmpeg -i input.mlp -acodec copy -f spdif output.spd

2. Add iec60958 header by iec958 plugin in alsa-lib

<confdir:pcm/iec958.conf>

IMX-CDNHDMI.pcm.iec958.0 {
	@args [ CARD AES0 AES1 AES2 AES3 ]
	@args.CARD {
		type string
	}
	@args.AES0 {
		type integer
	}
	@args.AES1 {
		type integer
	}
	@args.AES2 {
		type integer
	}
	@args.AES3 {
		type integer
	}
	type iec958
	slave {
		format IEC958_SUBFRAME_LE
		pcm {
			type file
			slave.pcm null
			file "output.spd.iec958"
			format "raw"
		}
	}
	status [ $AES0 $AES1 $AES2 $AES3 ]
	preamble.z 0x1
	preamble.x 0x0
	preamble.y 0x0
}
aplay -Diec958:3,AES0=0x06,AES1=0x80,AES2=0x02,AES3=0x09 -r 192000 -c 2 -f S16_LE output.spd

3. Enable non-linear pcm.
   iecset -c 3 audio off

4. aplay -Dcdnhdmi8ch -r 192000 -c 8 -f S32_LE output.spd.iec958
pcm.cdnhdmi8ch {
        type dshare
        slave {
                pcm "hw:3,0"
                channels 8
                rate 192000
                format S32_LE
        }
        ipc_key 5144458
        bindings.0 0
        bindings.1 4
        bindings.2 1
        bindings.3 5
        bindings.4 2
        bindings.5 6
        bindings.6 3
        bindings.7 7
}

5. Test is finished, disable non-linear pcm
   iecset -c 3 audio on

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-04-29 18:35:44 +08:00
Daniel Baluta 5f2beb7ec6 MLK-23854-2 ASoC: SOF: Check correct return value
We need to check priv->pd_dev after allocating memory. Issue
detected by Coverity (CID9607920).

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-04-27 18:16:17 +03:00
Daniel Baluta 1cfb99c40e MLK-23854-1 ASoC: SOF: Remove unneeded header files
Unnecessary header files may slow down build performance.
Issue reported by coverity (CID9607920).

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-04-27 18:16:17 +03:00
Daniel Baluta cbe43f15a4 MLK-23350-11 ASoC: SOF: Add sdma3/sai3 clocks for DSP
In order to be able to access SAI3/SDMA3 registers
we need to enable SAI3_IPG and SDMA3_ROOT clocks.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-27 18:16:16 +03:00
Daniel Baluta b923181a17 MLK-23350-9: 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.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-27 18:16:16 +03:00
Dan Carpenter c9b4bd73c2 ASoC: SOF: Fix snd_sof_ipc_stream_posn()
We're passing "&posn" instead of "posn" so it ends up corrupting
memory instead of doing something useful.

Fixes: 53e0c72d98 ("ASoC: SOF: Add support for IPC IO between DSP and Host")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200303101858.ytehbrivocyp3cnf@kili.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-27 18:16:16 +03:00
Jaska Uimonen 3a316348aa ASoC: SOF: ipc: check ipc return value before data copy
In tx_wait_done the ipc payload is copied before the DSP transaction
error code is checked. This might lead to corrupted data in kernel side
even though the error would be handled later. It is also pointless to
copy the data in case of error. So change the order of error check and
copy.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Link: https://lore.kernel.org/r/20200228231850.9226-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-27 18:16:16 +03:00
Viorel Suman 660bbebb9c MLK-23567-3 ASoC: fsl_xcvr: release M0+ core prior raising interrupt
M0+ core must be released prior raising any interrupt
to M0+ core, otherwise interrupt will be lost.

Fixes: b164260078 ("MLK-23567-2 ASoC: fsl_xcvr: enable SPDIF TX")
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-04-27 14:43:37 +03:00
Zhang Peng dcf3272d11 MLK-23850 soc: fsl: Correct parameters getting from DSP
Before the parameters getting from dsp is not right, now correct it.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-27 15:03:16 +08:00
Viorel Suman 5e51d73901 MLK-23840-1 ASoC: fsl_xcvr: remove fsl,xcvr-mode from DTS
XCVR driver working mode is set by "fsl,xcvr-mode" DTS
property. Being static - it does not allow changing
XCVR driver mode at runtime. Rework the driver by replacing
static DTS property with amixer control.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-04-24 13:23:15 +03:00
Colin Ian King 549a48900d ASoC: Intel: mrfld: return error codes when an error occurs
commit 3025571edd upstream.

Currently function sst_platform_get_resources always returns zero and
error return codes set by the function are never returned. Fix this
by returning the error return code in variable ret rather than the
hard coded zero.

Addresses-Coverity: ("Unused value")
Fixes: f533a035e4 ("ASoC: Intel: mrfld - create separate module for pci part")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200208220720.36657-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-21 09:04:56 +02:00
Colin Ian King 86ec55651f ASoC: Intel: mrfld: fix incorrect check on p->sink
commit f5e056e1e4 upstream.

The check on p->sink looks bogus, I believe it should be p->source
since the following code blocks are related to p->source. Fix
this by replacing p->sink with p->source.

Fixes: 24c8d14192 ("ASoC: Intel: mrfld: add DSP core controls")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Copy-paste error")
Link: https://lore.kernel.org/r/20191119113640.166940-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-21 09:04:55 +02:00
Viorel Suman b164260078 MLK-23567-2 ASoC: fsl_xcvr: enable SPDIF TX
Enable XCVR SPDIF TX mode.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-04-17 15:49:23 +03:00
Viorel Suman 7882f7f139 MLK-23567-1 ASoC: fsl_xcvr: add TX CS bytes control
For IEC958 kcontrol type amixer tool returns just first 4 bytes,
add a byte array control so that we'll be able to set all 24 bytes
of TX CS by using amixer.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-04-17 15:49:16 +03:00
Julia Lawall 8dead2c275 ASoC: stm32: sai: Add missing cleanup
[ Upstream commit 7506baeed8 ]

The commit 0d6defc7e0 ("ASoC: stm32: sai: manage rebind issue")
converts some function calls to their non-devm equivalents.  The
appropriate cleanup code was added to the remove function, but not
to the probe function.  Add a call to snd_dmaengine_pcm_unregister
to compensate for the call to snd_dmaengine_pcm_register in case
of subsequent failure.

Fixes: commit 0d6defc7e0 ("ASoC: stm32: sai: manage rebind issue")
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

Acked-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/1586099028-5104-1-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-17 10:50:25 +02:00
이경택 9a8b1ba9d4 ASoC: topology: use name_prefix for new kcontrol
commit abca9e4a04 upstream.

Current topology doesn't add prefix of component to new kcontrol.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Link: https://lore.kernel.org/r/009b01d60804$ae25c2d0$0a714870$@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-17 10:50:06 +02:00
이경택 f467e054c0 ASoC: dpcm: allow start or stop during pause for backend
commit 21fca8bdbb upstream.

soc_compr_trigger_fe() allows start or stop after pause_push.
In dpcm_be_dai_trigger(), however, only pause_release is allowed
command after pause_push.
So, start or stop after pause in compress offload is always
returned as error if the compress offload is used with dpcm.
To fix the problem, SND_SOC_DPCM_STATE_PAUSED should be allowed
for start or stop command.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/004d01d607c1$7a3d5250$6eb7f6f0$@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-17 10:50:06 +02:00
이경택 af0b76f9f6 ASoC: dapm: connect virtual mux with default value
commit 3bbbb7728f upstream.

Since a virtual mixer has no backing registers
to decide which path to connect,
it will try to match with initial state.
This is to ensure that the default mixer choice will be
correctly powered up during initialization.
Invert flag is used to select initial state of the virtual switch.
Since actual hardware can't be disconnected by virtual switch,
connected is better choice as initial state in many cases.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Link: https://lore.kernel.org/r/01a301d60731$b724ea10$256ebe30$@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-17 10:50:06 +02:00
이경택 803db8a078 ASoC: fix regwmask
commit 0ab070917a upstream.

If regwshift is 32 and the selected architecture compiles '<<' operator
for signed int literal into rotating shift, '1<<regwshift' became 1 and
it makes regwmask to 0x0.
The literal is set to unsigned long to get intended regwmask.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Link: https://lore.kernel.org/r/001001d60665$db7af3e0$9270dba0$@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-17 10:50:06 +02:00
Shengjiu Wang 02d362f8d6 MLK-23792-1: ASoC: fsl_sai: Monitor spdif rx clock in imx8mm
As we use one spare sai instance to monitor the spdif rx
clock,  there isn't belong to a sound card, we can't access
the registers by amixer controls.

So remove the amixer controls, replace them with the device
attribute.

And add an additional device attribute for enablement of
monitorring spdif. This feature only be supported on imx8mm.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-04-17 12:06:39 +08:00
Viorel Suman ded5d94919 MLK-23799 fsl_xcvr: capabilities data structure support
Add an amixer interface which allows to load
capabilities data structure.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-04-16 15:45:10 +03:00
Paul Cercueil 9351dee1cc ASoC: jz4740-i2s: Fix divider written at incorrect offset in register
commit 9401d5aa32 upstream.

The 4-bit divider value was written at offset 8, while the jz4740
programming manual locates it at offset 0.

Fixes: 26b0aad80a ("ASoC: jz4740: Add dynamic sampling rate support to jz4740-i2s")
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200306222931.39664-2-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:48:09 +02:00
Zhang Peng 92d77a4619 MLK-23701-3 ASoc: fsl: Fill pcm_io_frames and sampling_rate
Get samplerate and consumed data from dsp when call
snd_compr_ops.pointer.

Signed-off-by: Zhang Peng <peng_zhang_8@nxp.com>
2020-04-07 12:48:18 +08:00
Zhang Peng d235be4b28 MLK-23701-2 ASoc:fsl: Add support cplay in mp board
1. Add clk necessary in dsp driver
2. Add renderer type for select sai or esai

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2020-04-07 12:48:18 +08:00
Zhang Peng 5e9570b387 MLK-23701-1 Asoc:fsl: Add to choose codec depend on dtb
Before fixed codec name cs42888, now also support wm8960 codec,
thus add to choose set codec name depend on enabled codec.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2020-04-07 12:48:18 +08:00
Viorel Suman 2513444554 MLK-23732: fsl_xcvr: implement eARC RX fallback mode
There are 2 configurable options for eARC RX fallback
to ARC mode: "ARC single ended" or "ARC common".
Add amixer control in order to allow setting it
from userspace.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-04-02 11:57:02 +03:00
Viorel Suman ca5fccb261 MLK-23734: ASoC: fsl_xcvr: remove sample bits constraint
Sample bits constraint is meaningless given that the only
supported format is SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2020-04-02 11:35:18 +03:00
Viorel Suman c336672cb0 MLK-23725-3: ASoC: fsl_xcvr: fix CS comment
Fix Channel Status comments.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-04-01 16:07:34 +03:00
Viorel Suman bbca32f615 MLK-23725-2: ASoC: fsl_xcvr: add RX CS bytes control
For IEC958 kcontrol type amixer tool returns just first 4 bytes,
add a byte array control so that we'll be able to see all 24 bytes
by using amixer.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-04-01 16:07:34 +03:00
Viorel Suman 86401d592b MLK-23725-1: ASoC: fsl_xcvr: reimplement CS read function
CS_DATA registers are supposed to be used by M0+
core, according to block guide host core must read
channel status structure from data memory.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-04-01 16:07:34 +03:00
Shengjiu Wang 3ace7799e9 MLK-23702-4: ASoC: imx-rpmsg: support rpmsg audio for i.MX8MP
in i.MX8MP, the audio codec is registered by DT, and we reserve
a memory in DT that we can allocate dma memory from the
reserved pool.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-03-31 15:04:10 +08:00
Shengjiu Wang ccb83f789e MLK-23702-3: ASoC: rpmsg_wm8960: Add i2c interface
rpmsg wm8960 also can be registered as an i2c device.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-03-31 15:04:07 +08:00
Shengjiu Wang 0bc59849c4 MLK-23702-2: ASoC: imx-pcm-rpmsg: Don't register codec driver if it is from DT
Don't register codec driver if it is from DT.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-03-31 15:04:03 +08:00
Shengjiu Wang ca2170e0fb MLK-23702-1: ASoC: fsl_rpmsg_i2s: Support rpmsg audio for i.MX8MP
in i.MX8MP, the audio codec is registered by DT. So we add
a new flag: codec_in_dt

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-03-31 15:04:00 +08:00
Viorel Suman a063fac437 MLK-23603-6: ASoC: fsl_xcvr: move clks management into suspend/resume
Move clocks prepare_enable and disable_unprepare calls
into runtime_resume and runtime_suspend respectively.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-03-25 10:49:09 +02:00
Viorel Suman 9c6b7f731a MLK-23603-5: ASoC: fsl_xcvr: move static IP config code into fw load
Move static XCVR IP configuration code into firmware load
method in order to avoid the need to have bus clock started
in "startup" callback.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-03-25 10:49:09 +02:00
Viorel Suman 6bd55541d4 MLK-23603-4: ASoC: fsl_xcvr: adjust watermark and max burst values
Set watermarks values at half FIFO size, and max burst to 1/8
of FIFO size.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-03-25 10:49:09 +02:00
Viorel Suman ff5a36241f MLK-23603-3: ASoC: fsl_xcvr: prepare for suspend/resume
"startup" callback is not called in a subsequent
"runtime_resume" sequence, so move IP init code
into "prepare" callback. Aside of this move
constraint check code from "prepare" to "startup"
since constraint checking is required once at stream
startup.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-03-25 10:49:09 +02:00
Viorel Suman 8a05c23ef2 MLK-23603-2: ASoC: fsl_xcvr: refactor constraint handling
Refactor constraint handling in order to facilitate
unimplemented cases, such as for ARC and SPDIF.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-03-25 10:49:09 +02:00
Viorel Suman 6a3380a43a MLK-23603-1: ASoC: fsl_xcvr: fix compliation warnings
Fix two compilation warnings.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-03-25 10:49:08 +02:00
Olivier Moysan af7dd05d7c ASoC: stm32: sai: manage rebind issue
[ Upstream commit 0d6defc7e0 ]

The commit e894efef9a ("ASoC: core: add support to card rebind")
allows to rebind the sound card after a rebind of one of its component.
With this commit, the sound card is actually rebound,
but may be no more functional. The following problems have been seen
with STM32 SAI driver.

1) DMA channel is not requested:

With the sound card rebind the simplified call sequence is:
stm32_sai_sub_probe
	snd_soc_register_component
		snd_soc_try_rebind_card
			snd_soc_instantiate_card
	devm_snd_dmaengine_pcm_register

The problem occurs because the pcm must be registered,
before snd_soc_instantiate_card() is called.

Modify SAI driver, to change the call sequence as follows:
stm32_sai_sub_probe
	devm_snd_dmaengine_pcm_register
	snd_soc_register_component
		snd_soc_try_rebind_card

2) DMA channel is not released:

dma_release_channel() is not called when
devm_dmaengine_pcm_release() is executed.
This occurs because SND_DMAENGINE_PCM_DRV_NAME component,
has already been released through devm_component_release().

devm_dmaengine_pcm_release() should be called before
devm_component_release() to avoid this problem.

Call snd_dmaengine_pcm_unregister() and snd_soc_unregister_component()
explicitly from SAI driver, to have the right sequence.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Message-Id: <20200304102406.8093-1-olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-03-25 08:25:48 +01:00
Shengjiu Wang 6a895a2c4c MLK-23650-2: ASoC: fsl_asrc_m2m: Fix oops error
Don't need to add one more buffer, if the buffer
size is same as ASRC_MAX_BUFFER_SIZE.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-03-23 17:48:15 +08:00
Shengjiu Wang 091d9d8e65 MLK-23650-1: ASoC: fsl_easrc_m2m: Fix oops error
swiotlb don't allow the buffer length is zero. So
we should not add one more buffer, if the buffer
size is same as max_buf_size.

[ 1853.382383] ------------[ cut here ]------------
[ 1853.387011] kernel BUG at kernel/dma/swiotlb.c:497!
[ 1853.391889] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[ 1853.397372] Modules linked in: crct10dif_ce flexcan can_dev
[ 1853.402950] CPU: 2 PID: 17298 Comm: easrc_testapp Not tainted 5.4.3-2.0.0+gfd263a3edd95 #1
[ 1853.411210] Hardware name: FSL i.MX8MP EVK (DT)
[ 1853.415739] pstate: 80000005 (Nzcv daif -PAN -UAO)
[ 1853.420535] pc : swiotlb_tbl_map_single+0x1fc/0x310
[ 1853.425413] lr : swiotlb_map+0x60/0x148
[ 1853.429245] sp : ffff800025fdba80
[ 1853.432557] x29: ffff800025fdba80 x28: 0000000000000000
[ 1853.437867] x27: ffff000177818638 x26: ffff800011b14000
[ 1853.443176] x25: ffff800011b149f8 x24: 0000000000000000
[ 1853.448485] x23: 00000001b1e0c000 x22: 0000000000000000
[ 1853.453793] x21: ffff0001763ef410 x20: 0000000000180000
[ 1853.459102] x19: ffff0001763ef410 x18: 0000000000000000
[ 1853.464411] x17: 0000000000000000 x16: 0000000000000000
[ 1853.469720] x15: 0000000000000000 x14: 001df82f001df82f
[ 1853.475029] x13: ffff00017f34e000 x12: 0000000000000018
[ 1853.480338] x11: 00000000001fffff x10: 0001000000000000
[ 1853.485646] x9 : 0000000000000000 x8 : 0000000000000000
All test[s  1p8a5s3s.e4d90 w95i5] x7 : 0000000000000000 x6 : 0000000000000000
h success
[ 1853.497911] x5 : 0000000000200000 x4 : 0000000000000000
[ 1853.504171] x3 : 0000000000000001 x2 : 00000001b1e0c000
[ 1853.509480] x1 : 00000000c0000000 x0 : 0000000000000000
[ 1853.514789] Call trace:
[ 1853.517237]  swiotlb_tbl_map_single+0x1fc/0x310
[ 1853.521766]  swiotlb_map+0x60/0x148
[ 1853.525253]  dma_direct_map_page+0xf0/0x130
[ 1853.529434]  dma_direct_map_sg+0x78/0xe0
[ 1853.533356]  fsl_easrc_dmaconfig+0x10c/0x398
[ 1853.537624]  fsl_easrc_ioctl+0xcf4/0x1490
[ 1853.541633]  do_vfs_ioctl+0x964/0xb48
[ 1853.545293]  ksys_ioctl+0x78/0xa8
[ 1853.548607]  __arm64_sys_ioctl+0x1c/0x28
[ 1853.552530]  el0_svc_common.constprop.0+0x68/0x160
[ 1853.557320]  el0_svc_handler+0x20/0x80
[ 1853.561067]  el0_svc+0x8/0xc
[ 1853.563949] Code: 912e4021 9417b69a a94363f7 17ffffd5 (d4210000)
[ 1853.570042] ---[ end trace 5e9c94fcfabda124 ]---

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-03-23 17:44:00 +08:00
Shengjiu Wang bb6511173a MLK-23651: ASoC: fsl_spdif: Fix hang issue in reboot
In reboot, system will try to access regisers through
the dai controls, but the clock is not bind with regmap,
then system hang.

So we enable regcache_cache_only in probe to fix this
issue.

Fixes: d55d453fdf ("MLK-23618-11: ASoC: fsl_spdif: Don't bind clock with regmap")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-03-23 17:43:48 +08:00
Shengjiu Wang d55d453fdf MLK-23618-11: ASoC: fsl_spdif: Don't bind clock with regmap
The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
      - clk_pm_runtime_get()

Cause the power domain of lpcg clock always be enabled.
which impact the power consumption.

So we can't bind clock with regmap, then explicitly enable
clock when using. As we already enable all clock in
pm_runtime_resume, so only need to enable clock in probe.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-18 15:42:07 +08:00
Shengjiu Wang d91068f322 MLK-23618-10: ASoC: fsl_esai: Don't bind clock with regmap
The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
      - clk_pm_runtime_get()

Cause the power domain of lpcg clock always be enabled.
which impact the power consumption.

So we can't bind clock with regmap, then explicitly enable
clock when using. As we already enable all clock in
pm_runtime_resume, so only need to enable clock in probe.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-18 15:42:03 +08:00
Shengjiu Wang c2641e1974 MLK-23618-9: ASoC: fsl_sai: Don't bind clock with regmap
The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
      - clk_pm_runtime_get()

Cause the power domain of lpcg clock always be enabled.
which impact the power consumption.

So we can't bind clock with regmap, then explicitly enable
clock when using. As we already enable all clock in
pm_runtime_resume, so only need to enable clock in probe.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-18 15:41:58 +08:00
Shengjiu Wang 45db541836 MLK-23618-8: ASoC: fsl_audmix: Don't bind clock with regmap
The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
      - clk_pm_runtime_get()

Cause the power domain of lpcg clock always be enabled.
which impact the power consumption.

So we can't bind clock with regmap, then explicitly enable
clock when using. As we already enable all clock in
pm_runtime_resume, so only need to enable clock in probe.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-18 15:41:54 +08:00
Shengjiu Wang 1d46a32f50 MLK-23618-7: ASoC: fsl_asrc: Don't bind clock with regmap
The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
     - clk_pm_runtime_get()

Cause the power domain of lpcg clock always be enabled.
which impact the power consumption.

So we can't bind clock with regmap, then explicitly enable
clock when using. As we already enable all clock in
pm_runtime_resume, so only need to enable clock in probe.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-18 15:41:50 +08:00
Shengjiu Wang ee1a47b87f MLK-23618-6: ASoC: fsl_dsp: refine handling of multi power domain
The attached multi power domain is enabled by device_link_add
So we need to disable them in probe, otherwise it may impact
the power consumption.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-18 15:41:46 +08:00
Shengjiu Wang c43a9a158c MLK-23618-5: Revert "ASoC: cs42xx8: support multi power domain"
This reverts commit 62e2861cf0.

The power domain of clock should be controlled by clock driver,
We don't need to control it in audio driver, so we don't
need to support multi power domain in audio driver.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-18 15:41:41 +08:00
Shengjiu Wang 529a1cb73d MLK-23618-4: Revert "ASoC: fsl_spdif:Support multi power domains"
This reverts commit bd7b26036e.

The power domain of clock should be controlled by clock driver,
We don't need to control it in audio driver, so we don't
need to support multi power domain in audio driver.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-18 15:41:36 +08:00