OSDN Git Service

tomoyo/tomoyo-test1.git
15 months agoASoC: SOF: Intel: hda-mlink: introduce helpers for 'extended links' PM
Pierre-Louis Bossart [Tue, 4 Apr 2023 10:41:17 +0000 (13:41 +0300)]
ASoC: SOF: Intel: hda-mlink: introduce helpers for 'extended links' PM

Add helpers to program SPA/CPA bits, using a mutex to access the
shared LCTL register if required.

All links are managed with the same LCTLx.SPA bits. However there are
quite a few implementation details to be aware of:

Legacy HDaudio multi-links are powered-up when exiting reset, which
requires the ref_count to be manually set to one when initializing the
link.

Alternate links for SoundWire/DMIC/SSP need to be explicitly
powered-up before accessing the SHIM/IP/Vendor-Specific SHIM space for
each sublink. DMIC/SSP/SoundWire are all different cases with a
different device/dai/hlink relationship.

SoundWire will handle power management with the auxiliary device
resume/suspend routine. The ref_count is not necessary in this case.

The DMIC/SSP will by contrast handle the power management from DAI
.startup and .shutdown callbacks.

The SSP has a 1:1 mapping between sublink and DAI, but it's
bidirectional so the ref_count will help avoid turning off the sublink
when one of the two directions is still in use.

The DMIC has a single link but two DAIs for data generated at
different sampling frequencies, again the ref_count will make sure the
two DAIs can be used concurrently.

And last the SoundWire Intel require power-up/down and bank switch to
be handled with a lock already taken, so the 'eml_lock' is made
optional with the _unlocked versions of the helpers.

Note that the _check_power_active() implementation is similar to
previous helpers in sound/hda/ext, with sleep duration and timeout
aligned with hardware recommendations. If desired, this helper could
be modified in a second step with .e.g. readl_poll_timeout()

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230404104127.5629-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda-mlink: special-case HDaudio regular links
Pierre-Louis Bossart [Tue, 4 Apr 2023 10:41:16 +0000 (13:41 +0300)]
ASoC: SOF: Intel: hda-mlink: special-case HDaudio regular links

For backwards compatibility, HDaudio/iDISP links are powered-on when
exiting reset, and the existing driver forces them to be powered-off
when entering S0ix. In addition, the get/put helpers are invoked
directly by the ASoC codec drivers, which a historical layering
violation.

Extended links are powered-on by software only, during the probe and
DAI startup phases. This calls for a different handling of the
'regular' and 'extended' audio links.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230404104127.5629-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda-mlink: add structures to parse ALT links
Pierre-Louis Bossart [Tue, 4 Apr 2023 10:41:15 +0000 (13:41 +0300)]
ASoC: SOF: Intel: hda-mlink: add structures to parse ALT links

Extend hdac_ext_link to store information needed for ALT
links. Follow-up patches will include more functional patches for
power-up and down.

Note that this patch suggests the use of an 'eml_lock' to serialize
access to shared registers. SoundWire-specific sequence require the
lock to be taken at a higher level, as a result the helpers added in
follow-up patches will provide 'unlocked' versions when needed.

Also note that the low-level sequences with the 'hdaml_' prefix are
taken directly from the hardware specifications - naming conventions
included. The code will be split in two, with locking and linked-list
management handled separately to avoid mixing required hardware setup
and Linux-based resource management.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230404104127.5629-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda-mlink: move to a dedicated module
Pierre-Louis Bossart [Tue, 4 Apr 2023 10:41:14 +0000 (13:41 +0300)]
ASoC: SOF: Intel: hda-mlink: move to a dedicated module

Some of the functions will be used for SoundWire enumeration and power
management, to avoid cycles in module dependencies and simplify
integration all the HDaudio multi-link needs to move to a dedicated
module.

Drop no longer needed headers at the same time.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230404104127.5629-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda-mlink: add return value for hda_bus_ml_get_capabilities()
Pierre-Louis Bossart [Tue, 4 Apr 2023 10:41:13 +0000 (13:41 +0300)]
ASoC: SOF: Intel: hda-mlink: add return value for hda_bus_ml_get_capabilities()

Add return value - this will need additional work in the caller.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230404104127.5629-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda-mlink: improve hda_bus_ml_free() helper
Pierre-Louis Bossart [Tue, 4 Apr 2023 10:41:12 +0000 (13:41 +0300)]
ASoC: SOF: Intel: hda-mlink: improve hda_bus_ml_free() helper

Use list_for_each_entry_safe() instead of open-coding.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230404104127.5629-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoALSA: hda: add HDaudio Extended link definitions
Pierre-Louis Bossart [Tue, 4 Apr 2023 10:41:11 +0000 (13:41 +0300)]
ALSA: hda: add HDaudio Extended link definitions

Add new definitions for the HDaudio Extended link support,
specifically new registers for SoundWire, Intel DMIC and INTEL SSP
interfaces.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230404104127.5629-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoDocumentation: sound: add description of Intel HDaudio multi-links
Pierre-Louis Bossart [Tue, 4 Apr 2023 10:41:10 +0000 (13:41 +0300)]
Documentation: sound: add description of Intel HDaudio multi-links

Add description of 'Skylake' multi-link structure added in 2015 and
recent extensions to support SoundWire/DMIC/SSP interfaces.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230404104127.5629-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: qcom: fixes for Click/Pop Noise
Mark Brown [Thu, 6 Apr 2023 15:02:24 +0000 (16:02 +0100)]
ASoC: qcom: fixes for Click/Pop Noise

Merge series from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

Click/Pop Noise was a long pending issue with WSA Codecs which are prone
to accumlate DC when ports are active but without any data streams.
There are multiple places in the current setup, where this could happen
in both startup as well as shutdown path.

15 months agoASoC: qcom: sdw: do not restart soundwire ports for every prepare
Srinivas Kandagatla [Thu, 23 Mar 2023 16:44:01 +0000 (16:44 +0000)]
ASoC: qcom: sdw: do not restart soundwire ports for every prepare

unpreparing/disabling and preparing/reenabling soundwire ports is not required
for every prepare call, this add lots of click and pop noise if we do this in
middle of playback or capture.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230323164403.6654-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: qcom: q6apm-lpass-dai: close graphs before opening a new one
Srinivas Kandagatla [Thu, 23 Mar 2023 16:44:00 +0000 (16:44 +0000)]
ASoC: qcom: q6apm-lpass-dai: close graphs before opening a new one

On multiple prepare calls, its possible that the playback graphs are
not unloaded from the DSP, which can have some wierd side-effects,
one of them is that the data not consumed without any errors.

Fixes: c2ac3aec474d("ASoC: qcom: q6apm-lpass-dai: unprepare stream if its already prepared")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230323164403.6654-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: rt712-sdca: Add RT712 SDCA driver for Mic topology
Shuming Fan [Thu, 6 Apr 2023 08:55:35 +0000 (16:55 +0800)]
ASoC: rt712-sdca: Add RT712 SDCA driver for Mic topology

This is the initial codec driver for rt712 SDCA (Mic topology).
The host should connect with rt712 SdW2 interface.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20230406085535.52002-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: soc-dapm.c: tidyup dapm_connect_dai_pair()
Kuninori Morimoto [Wed, 5 Apr 2023 22:57:55 +0000 (22:57 +0000)]
ASoC: soc-dapm.c: tidyup dapm_connect_dai_pair()

dapm_connect_dai_pair() handles
"Normal/Codec2Codec" x "CPU/Codec" x "Playback/Capture".

(A) is "Codec2Codec" case of "CPU"   widget x "Playback/Capture",
(B) is "Normal"      case of "CPU"   widget x "Playback/Capture",
(C) is each          case of "Codec" widget.

(X) is handling "Playback" case DAI connecting,
(Y) is handling "Capture"  case DAI connecting.

static void dapm_connect_dai_pair(...)
{
...

(A) if (dai_link->params) {
playback_cpu = ...
capture_cpu = ...
(B) } else {
playback_cpu = ...
capture_cpu = ...
}

 ^ /* connect BE DAI playback if widgets are valid */
 | stream = SNDRV_PCM_STREAM_PLAYBACK;
 | (C) codec = codec_dai->playback_widget;
 |
 | if (playback_cpu && codec) {
(X) if (dai_link->params && !rtd->c2c_widget[stream]) {
 | ...
 | }
 |
 | (z) dapm_connect_dai_routes(...);
 v }

capture:
 ^ /* connect BE DAI capture if widgets are valid */
 | stream = SNDRV_PCM_STREAM_CAPTURE;
 | (C) codec = codec_dai->capture_widget;
 |
 | if (codec && capture_cpu) {
(Y) if (dai_link->params && !rtd->c2c_widget[stream]) {
 | ...
 | }
 |
 | (z) dapm_connect_dai_routes(...);
 v }
}

(X) part and (Y) part are almost same.
Main purpose of these parts (and this function) is calling
dapm_connect_dai_routes() (= z) on each cases.
The difference is "parameter"
(= Normal/Codec2Codec x CPU/Codec x Playback/Capture).

This patch cleanup these, but nothing changed for meaning.

Link: https://lore.kernel.org/r/87ilen6ni4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877cuqvswc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: clarify Codec2Codec params
Mark Brown [Wed, 5 Apr 2023 15:35:09 +0000 (16:35 +0100)]
ASoC: clarify Codec2Codec params

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

ASoC is supporting Codec2Codec, but its parameter name is
"params" and "num_params" which are very unclear naming.

This patch-set clarifies it by replacing to c2c_params / num_c2c_params.

15 months agoASoC: dt-bindings: wm8510: Convert to dtschema
Saalim Quadri [Wed, 5 Apr 2023 11:16:05 +0000 (16:46 +0530)]
ASoC: dt-bindings: wm8510: Convert to dtschema

Convert the WM8510 audio CODEC bindings to DT schema

Signed-off-by: Saalim Quadri <danascape@gmail.com>
Link: https://lore.kernel.org/r/20230405111605.5250-1-danascape@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: soc.h: remove unused params/num_params
Kuninori Morimoto [Sun, 2 Apr 2023 23:00:17 +0000 (23:00 +0000)]
ASoC: soc.h: remove unused params/num_params

No drivers are using params/num_params any more.
Let's remove these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87iledc2ke.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: samsung: switch to use c2c_params instead of params
Kuninori Morimoto [Sun, 2 Apr 2023 23:00:07 +0000 (23:00 +0000)]
ASoC: samsung: switch to use c2c_params instead of params

ASoC is now using c2c_params instead of params. This patch replace it.
num_c2c_params (was num_params) was not mandatory before,
but let's set it by this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87jzytc2kp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: meson: switch to use c2c_params instead of params
Kuninori Morimoto [Sun, 2 Apr 2023 22:59:57 +0000 (22:59 +0000)]
ASoC: meson: switch to use c2c_params instead of params

ASoC is now using c2c_params instead of params. This patch replace it.
num_c2c_params (was num_params) was not mandatory before,
but let's set it by this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lej9c2ky.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: audio-graph-card2: switch to use c2c_params instead of params
Kuninori Morimoto [Sun, 2 Apr 2023 22:59:45 +0000 (22:59 +0000)]
ASoC: audio-graph-card2: switch to use c2c_params instead of params

ASoC is now using c2c_params instead of params. This patch replace it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mt3pc2la.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: soc.h: clarify Codec2Codec params
Kuninori Morimoto [Sun, 2 Apr 2023 22:59:35 +0000 (22:59 +0000)]
ASoC: soc.h: clarify Codec2Codec params

snd_soc_dai_link has params/num_params, but it is unclear that
params for what. This patch clarify it is params for Codec2Codec.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o7o5c2lk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: ak4458: Convert to dtschema
Saalim Quadri [Tue, 28 Mar 2023 09:18:31 +0000 (14:48 +0530)]
ASoC: dt-bindings: ak4458: Convert to dtschema

Convert the AK4458 audio DAC bindings to DT schema.

Signed-off-by: Saalim Quadri <danascape@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230328091831.55690-1-danascape@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: core/Intel: Introduce DSPless mode
Mark Brown [Tue, 4 Apr 2023 17:40:48 +0000 (18:40 +0100)]
ASoC: SOF: core/Intel: Introduce DSPless mode

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

This series will add support for SOF Linux stack to run without using the DSP.

DSPless mode provides a good tool for verification that the hardware itself
works correctly by taking the DSP use out from the picture.
It can only work with interfaces which supports this mode: Intel HDA at the
moment but with LNL it could be possible to support other audio interfaces.

The main driver for this mode is to be able to test programming sequences,
low-level code and for low-level verification of a platform.

The feature is not targetted for end-users and it will not make the SOF stack
to work on hardware without DSP, but it is giving us a tool to debug and enable
platforms earlier (when for example t he firmware is not mature enough).

15 months agoASoC: tegra20_ac97: Add missing unwind goto in tegra20_ac97_platform_probe()
Zihao Wang [Tue, 4 Apr 2023 08:46:22 +0000 (16:46 +0800)]
ASoC: tegra20_ac97: Add missing unwind goto in tegra20_ac97_platform_probe()

Smatch Warns:
sound/soc/tegra/tegra20_ac97.c:321 tegra20_ac97_platform_probe()
warn: missing unwind goto?

The goto will set the "soc_ac97_ops" and "soc_ac97_bus" operations to
NULL.  But they are already NULL at this point so it is a no-op.
However, just for consistency, change the direct return to a goto.  No
functional change.

Signed-off-by: Zihao Wang <u202012060@hust.edu.cn>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/20230404084622.1202-1-u202012060@hust.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: pci-tgl: Allow DSPless mode
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:15 +0000 (12:21 +0300)]
ASoC: SOF: Intel: pci-tgl: Allow DSPless mode

set the dspless_mode_supported flag to true for tgl/adl family to allow
DSPless mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-13-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: pci-skl: Allow DSPless mode
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:14 +0000 (12:21 +0300)]
ASoC: SOF: Intel: pci-skl: Allow DSPless mode

set the dspless_mode_supported flag to true for skl family to allow
DSPless mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-12-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: pci-mtl: Allow DSPless mode
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:13 +0000 (12:21 +0300)]
ASoC: SOF: Intel: pci-mtl: Allow DSPless mode

set the dspless_mode_supported flag to true for mtl family to allow
DSPless mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: pci-icl: Allow DSPless mode
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:12 +0000 (12:21 +0300)]
ASoC: SOF: Intel: pci-icl: Allow DSPless mode

set the dspless_mode_supported flag to true for icl/jsl family to allow
DSPless mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: pci-cnl: Allow DSPless mode
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:11 +0000 (12:21 +0300)]
ASoC: SOF: Intel: pci-cnl: Allow DSPless mode

set the dspless_mode_supported flag to true for cnl/cfl/cml family to
allow DSPless mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: pci-apl: Allow DSPless mode
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:10 +0000 (12:21 +0300)]
ASoC: SOF: Intel: pci-apl: Allow DSPless mode

set the dspless_mode_supported flag to true for apl family to allow
DSPless mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda: make DSPless mode work with DSP disabled in BIOS
Pierre-Louis Bossart [Tue, 4 Apr 2023 09:21:09 +0000 (12:21 +0300)]
ASoC: SOF: Intel: hda: make DSPless mode work with DSP disabled in BIOS

When the DSP is disabled in the BIOS, the DSP_BAR and PP_BAR cannot be
accessed.

One possible objection noted in initial reviews is that this patch
adds a number of branches. However the number of branches is actually
limited in probe/suspend/resume routines mostly, so there isn't really
a degradation in terms of readability and maintainability. Adding yet
another level of abstraction/ops/callbacks would increase complexity
and not really help in terms of code reuse or readability and
maintainability. A split between controller and DSP driver would be
even more invasive.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda: Add support for DSPless mode
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:08 +0000 (12:21 +0300)]
ASoC: SOF: Intel: hda: Add support for DSPless mode

Via the SOF_DBG_DSPLESS_MODE sof_debug flag the SOF stack can be asked to
not use the DSP for audio.

The use of DSPless mode is governed by the sdev->dspless_mode_selected
flag which is only going to be set if the user sets sof_debug=0x8000 and
the platform advertises that the DSPless mode is supported on them.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda: Skip interfaces not supported on a platform
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:07 +0000 (12:21 +0300)]
ASoC: SOF: Intel: hda: Skip interfaces not supported on a platform

Not all interfaces (SSP/DMIC/HDA/SDW) are available on all platforms.
If the interface is not even supported then there is no point in executing
a probe or query for that interface.

Introduce a simple function (hda_get_interface_mask) to query the
interfaces supported on the platform.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Add support for DSPless mode
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:06 +0000 (12:21 +0300)]
ASoC: SOF: Add support for DSPless mode

Via the SOF_DBG_DSPLESS_MODE sof_debug flag the SOF stack can be asked to
not use the DSP for audio.

The core's support for DSPless mode is only going to be enabled if the
platform reports that it can be used without DSP.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Add flag and state which will be used for DSP-less mode
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:05 +0000 (12:21 +0300)]
ASoC: SOF: Add flag and state which will be used for DSP-less mode

The DSPless mode of the ASoC/SOF driver can be used for hardware
verification and debug on platforms with HDaudio codecs. The DSP mode is
still needed on existing platforms for SSP, DMIC, SoundWire interfaces
managed by the GP-DMA.

This mode is also helpful to compare the legacy HDaudio driver with the
ASoC/SOF driver wrt. codec management and handling. In theory we use the
same code but differences are sometimes seen on jack detection and event
handling.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda-stream: Do not dereference hstream until it is safe
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:04 +0000 (12:21 +0300)]
ASoC: SOF: Intel: hda-stream: Do not dereference hstream until it is safe

Only access hext_stream->hstream after it has been checked for NULL pointer

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230404092115.27949-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mediatek: mt8186: Move some prints to debug level
Allen-KH Cheng [Wed, 29 Mar 2023 08:04:18 +0000 (16:04 +0800)]
ASoC: mediatek: mt8186: Move some prints to debug level

There are many log messages scattered throughout the mt8186 sound
drivers, and they are frequently triggered.

To avoid spamming the console, move these messages to the debug level.

Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
Link: https://lore.kernel.org/r/20230329080418.1100-1-allen-kh.cheng@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: amd: refactor dmic codec platform device creation
Vijendar Mukunda [Mon, 3 Apr 2023 07:16:46 +0000 (12:46 +0530)]
ASoC: SOF: amd: refactor dmic codec platform device creation

Under snd_sof_dev device scope, create platform device for dmic
codec.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/168050621098.26.7486882101201297853@mailman-core.alsa-project.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: amd: refactor error checks in probe call
Vijendar Mukunda [Mon, 3 Apr 2023 07:16:45 +0000 (12:46 +0530)]
ASoC: SOF: amd: refactor error checks in probe call

Refactor error checks code in probe() callback.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230403071651.919027-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: amd: refactor get_chip_info callback
Vijendar Mukunda [Mon, 3 Apr 2023 07:16:44 +0000 (12:46 +0530)]
ASoC: SOF: amd: refactor get_chip_info callback

Move get_chip_info callback to the start of API.
This should be first check in probe() call.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230403071651.919027-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: amd: remove unused variables
Vijendar Mukunda [Mon, 3 Apr 2023 07:16:43 +0000 (12:46 +0530)]
ASoC: SOF: amd: remove unused variables

Remove unused variables - i2s_mode, i2s_pin_config_offset from code.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230403071651.919027-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: amd: remove acp_dai_probe() function
Vijendar Mukunda [Mon, 3 Apr 2023 07:16:42 +0000 (12:46 +0530)]
ASoC: SOF: amd: remove acp_dai_probe() function

ACP SOF driver supports different audio configurations.
Explicit condition check for I2S configuration will break
other audio endpoint configurations.

acp_dai_probe() function is not required as we have
machine select logic to select the exact machine.

Remove acp_dai_probe() from existing AMD PCI driver code base.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230403071651.919027-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: amd: remove unused code
Vijendar Mukunda [Mon, 3 Apr 2023 07:16:41 +0000 (12:46 +0530)]
ASoC: SOF: amd: remove unused code

During initial SOF driver bring up on AMD platforms, only DMIC
support was added. As of today, we have a complete SOF solution for
I2S endpoints along with DMIC endpoint.
This code is no longer required.
Remove unused code from RMB and RN platform ACP PCI driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230403071651.919027-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: maxim,max98371: Convert to DT schema
André Morishita [Sat, 1 Apr 2023 18:19:29 +0000 (15:19 -0300)]
ASoC: dt-bindings: maxim,max98371: Convert to DT schema

Convert the Maxim Integrated MAX98371 audio codec bindings to DT schema.

Signed-off-by: André Morishita <andremorishita@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230401181930.533067-1-andremorishita@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: amd: yc: Add DMI entries to support HP OMEN 16-n0xxx (8A42)
Prajna Sariputra [Sat, 1 Apr 2023 15:21:30 +0000 (02:21 +1100)]
ASoC: amd: yc: Add DMI entries to support HP OMEN 16-n0xxx (8A42)

This model requires an additional detection quirk to enable the internal microphone.

Signed-off-by: Prajna Sariputra <putr4.s@gmail.com>
Link: https://lore.kernel.org/r/2283110.ElGaqSPkdT@n0067ax-linux62
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agofirmware: cs_dsp: Add a debugfs entry containing control details
Simon Trimmer [Tue, 28 Mar 2023 13:10:18 +0000 (14:10 +0100)]
firmware: cs_dsp: Add a debugfs entry containing control details

The file named 'controls' in the DSP's debugfs root contains a
formatted table describing the controls defined within the loaded DSP
firmware, it is of the form

  name: len region:offset addr fwname algid ctltype flags en dirty

Where flags is represented as a character for each flag if set, or '-',
enabled is whether the control is enabled or disabled and dirty is
whether the control value is set in the cache but not the hardware.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230328131018.6820-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: amd: ps: update the acp clock source.
Syed Saba Kareem [Fri, 31 Mar 2023 05:20:23 +0000 (10:50 +0530)]
ASoC: amd: ps: update the acp clock source.

Updating the clock source from ACLK to default clock

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/20230331052102.2211115-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: max98363: add soundwire amplifier
Ryan Lee [Thu, 30 Mar 2023 23:43:19 +0000 (16:43 -0700)]
ASoC: dt-bindings: max98363: add soundwire amplifier

Add dt-bindings information for Analog Devices MAX98363 SoundWire Amplifier

Signed-off-by: Ryan Lee <ryans.lee@analog.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230330234319.6841-2-ryan.lee.analog@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: max98363: add soundwire amplifier driver
Ryan Lee [Thu, 30 Mar 2023 23:43:18 +0000 (16:43 -0700)]
ASoC: max98363: add soundwire amplifier driver

Added Analog Devices MAX98363 SoundWire Amplifier Driver.
The MAX98363 is a SoundWire peripheral device that supports
MIPI SoundWire v1.2-compatible digital interface for audio and
control data.

Signed-off-by: Ryan Lee <ryans.lee@analog.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230330234319.6841-1-ryan.lee.analog@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: qcom,lpass-va-macro: Add missing NPL clock
Krzysztof Kozlowski [Thu, 30 Mar 2023 11:34:05 +0000 (13:34 +0200)]
ASoC: dt-bindings: qcom,lpass-va-macro: Add missing NPL clock

Several devices (e.g. SC8280XP and SM8450) expect a NPL (Near Pad Logic)
clock.  Add the clock and customize allowed clocks per each variant.
The clocks are also required by ADSP in all variants.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230330113405.55722-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: qcom,lpass-rx-macro: correct minItems for clocks
Krzysztof Kozlowski [Thu, 30 Mar 2023 07:13:33 +0000 (09:13 +0200)]
ASoC: dt-bindings: qcom,lpass-rx-macro: correct minItems for clocks

The RX macro codec comes on some platforms in two variants - ADSP
and ADSP bypassed - thus the clock-names varies from 3 to 5.  The clocks
must vary as well:

  sc7280-idp.dtb: codec@3200000: clocks: [[202, 8], [202, 7], [203]] is too short

Fixes: 852fda58d99a ("ASoC: qcom: dt-bindings: Update bindings for clocks in lpass digital codes")
Cc: <stable@vger.kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230330071333.24308-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: alc5632: Convert to dtschema
Saalim Quadri [Mon, 27 Mar 2023 21:16:29 +0000 (02:46 +0530)]
ASoC: dt-bindings: alc5632: Convert to dtschema

Convert the ALC5632 audio codec bindings to DT schema.

Signed-off-by: Saalim Quadri <danascape@gmail.com>
Link: https://lore.kernel.org/r/20230327211629.28643-1-danascape@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SoundWire codecs: simplify/fix set_stream
Mark Brown [Thu, 30 Mar 2023 00:26:47 +0000 (01:26 +0100)]
ASoC: SoundWire codecs: simplify/fix set_stream

Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

Simplify set_stream in SoundWire codecs.

15 months agoASoC: dapm: Sort speakers after other outputs
Mark Brown [Fri, 24 Mar 2023 16:33:28 +0000 (16:33 +0000)]
ASoC: dapm: Sort speakers after other outputs

Currently we sequence speakers with line and headphone outputs in DAPM.
This works well when speakers are integrate into a CODEC but when there is
an external speaker driver connected to a line or headphone output it can
mean that the speaker driver ends up getting sequenced such that it picks
up pops and clicks from the CODEC. Mask this by moving speakers after the
other outputs in DAPM.

We may want to consider doing this for headphones too but separate drivers
are less common there and headphone drivers often also function as line
outputs so the situation is less clear.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230324-asoc-dapm-spk-v1-1-e1f27f766505@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: Merge fixes
Mark Brown [Wed, 29 Mar 2023 23:14:00 +0000 (00:14 +0100)]
ASoC: Merge fixes

So they can be used as a basis for new work.

15 months agoASoC: dt-bindings: qcom,lpass-va-macro: Add SM8550 VA macro
Krzysztof Kozlowski [Mon, 27 Mar 2023 13:22:52 +0000 (15:22 +0200)]
ASoC: dt-bindings: qcom,lpass-va-macro: Add SM8550 VA macro

Add the VA macro codec on Qualcomm SM8550, which comes without NPL clock
exposed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230327132254.147975-9-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: soc-topology.c: dai_link->platform again
Kuninori Morimoto [Wed, 29 Mar 2023 00:21:03 +0000 (00:21 +0000)]
ASoC: soc-topology.c: dai_link->platform again

On SOF, many topology is assuming dai_link->platform exists, and is
allowed to be overwritten on each link_load().
This patch restore the removed dai_link->platform for SOF, and add
the comment.

Fixes: e7098ba9b378 ("ASoC: soc-topology.c: remove unnecessary dai_link->platform")
Reported-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/87jzz7jczp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/87v8ikcsr5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: rt5682-sdw: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:44:08 +0000 (09:44 +0800)]
ASoC: codecs: rt5682-sdw: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-14-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: rt715-sdca: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:44:07 +0000 (09:44 +0800)]
ASoC: codecs: rt715-sdca: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-13-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: rt715: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:44:06 +0000 (09:44 +0800)]
ASoC: codecs: rt715: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-12-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: rt712-sdca: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:44:05 +0000 (09:44 +0800)]
ASoC: codecs: rt712-sdca: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-11-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: rt711-sdca: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:44:04 +0000 (09:44 +0800)]
ASoC: codecs: rt711-sdca: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-10-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: rt711-sdw: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:44:03 +0000 (09:44 +0800)]
ASoC: codecs: rt711-sdw: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-9-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: rt700-sdw: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:44:02 +0000 (09:44 +0800)]
ASoC: codecs: rt700-sdw: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-8-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: rt1318-sdw: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:44:01 +0000 (09:44 +0800)]
ASoC: codecs: rt1318-sdw: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: rt1316-sdw: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:44:00 +0000 (09:44 +0800)]
ASoC: codecs: rt1316-sdw: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: rt1308-sdw: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:43:59 +0000 (09:43 +0800)]
ASoC: codecs: rt1308-sdw: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: max98373-sdw: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:43:58 +0000 (09:43 +0800)]
ASoC: codecs: max98373-sdw: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: sdw-mockup: simplify set_stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:43:57 +0000 (09:43 +0800)]
ASoC: codecs: sdw-mockup: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: cs42l42-sdw: clear stream
Pierre-Louis Bossart [Fri, 24 Mar 2023 01:43:56 +0000 (09:43 +0800)]
ASoC: codecs: cs42l42-sdw: clear stream

The API requires the stream info to be cleared when the argument is
NULL.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: avoid a NULL dereference with unsupported widgets
Guennadi Liakhovetski [Wed, 29 Mar 2023 11:38:28 +0000 (14:38 +0300)]
ASoC: SOF: avoid a NULL dereference with unsupported widgets

If an IPC4 topology contains an unsupported widget, its .module_info
field won't be set, then sof_ipc4_route_setup() will cause a kernel
Oops trying to dereference it. Add a check for such cases.

Cc: stable@vger.kernel.org # 6.2
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230329113828.28562-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: lpass-wsa-macro: add support for SM8550
Krzysztof Kozlowski [Mon, 27 Mar 2023 13:22:54 +0000 (15:22 +0200)]
ASoC: codecs: lpass-wsa-macro: add support for SM8550

Add support for the WSA macro codec on Qualcomm SM8550.  SM8550 does not
use NPL clock, thus add flags allowing to skip it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230327132254.147975-11-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: qcom,lpass-wsa-macro: Add SM8550 WSA macro
Krzysztof Kozlowski [Mon, 27 Mar 2023 13:22:53 +0000 (15:22 +0200)]
ASoC: dt-bindings: qcom,lpass-wsa-macro: Add SM8550 WSA macro

Add the WSA macro codec on Qualcomm SM8550, which comes without NPL clock
exposed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230327132254.147975-10-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: qcom,lpass-va-macro: Add SM8550 VA macro
Krzysztof Kozlowski [Mon, 27 Mar 2023 13:22:52 +0000 (15:22 +0200)]
ASoC: dt-bindings: qcom,lpass-va-macro: Add SM8550 VA macro

Add the VA macro codec on Qualcomm SM8550, which comes without NPL clock
exposed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230327132254.147975-9-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: lpass-tx-macro: add support for SM8550
Krzysztof Kozlowski [Mon, 27 Mar 2023 13:22:50 +0000 (15:22 +0200)]
ASoC: codecs: lpass-tx-macro: add support for SM8550

Add support for the TX macro codec on Qualcomm SM8550.  SM8550 does not
use NPL clock, thus add flags allowing to skip it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230327132254.147975-7-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: lpass-rx-macro: add support for SM8550
Krzysztof Kozlowski [Mon, 27 Mar 2023 13:22:47 +0000 (15:22 +0200)]
ASoC: codecs: lpass-rx-macro: add support for SM8550

Add support for the RX macro codec on Qualcomm SM8550.  SM8550 does not
use NPL clock, thus add flags allowing to skip it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230327132254.147975-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: soc-topology.c: dai_link->platform again
Kuninori Morimoto [Wed, 29 Mar 2023 00:21:03 +0000 (00:21 +0000)]
ASoC: soc-topology.c: dai_link->platform again

On SOF, many topology is assuming dai_link->platform exists, and is
allowed to be overwritten on each link_load().
This patch restore the removed dai_link->platform for SOF, and add
the comment.

Fixes: e7098ba9b378 ("ASoC: soc-topology.c: remove unnecessary dai_link->platform")
Reported-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/87jzz7jczp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/87v8ikcsr5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: add audio digital codecs for Qualcomm SM8550
Mark Brown [Tue, 28 Mar 2023 16:40:35 +0000 (17:40 +0100)]
ASoC: add audio digital codecs for Qualcomm SM8550

Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Hi,

Dependencies
============
For va-macro bindings:
https://lore.kernel.org/r/20221118071849.25506-2-srinivas.kandagatla@linaro.org

NOT a dependency
================
The patchset can be applied independently of my previous fix:
https://lore.kernel.org/linux-arm-msm/20230310100937.32485-1-krzysztof.kozlowski@linaro.org/T/#u

Logically, better if they were together, but code will work fine other way.

Changes since v1
================
1. Move the flag define to common header.

Best regards,
Krzysztof

Krzysztof Kozlowski (9):
  ASoC: dt-bindings: qcom,lpass-rx-macro: narrow clocks per variants
  ASoC: dt-bindings: qcom,lpass-rx-macro: Add SM8550 RX macro
  ASoC: codecs: lpass-rx-macro: add support for SM8550
  ASoC: dt-bindings: qcom,lpass-tx-macro: narrow clocks per variants
  ASoC: dt-bindings: qcom,lpass-tx-macro: Add SM8550 TX macro
  ASoC: codecs: lpass-tx-macro: add support for SM8550
  ASoC: dt-bindings: qcom,lpass-va-macro: Add SM8550 VA macro
  ASoC: dt-bindings: qcom,lpass-wsa-macro: Add SM8550 WSA macro
  ASoC: codecs: lpass-wsa-macro: add support for SM8550

 .../bindings/sound/qcom,lpass-rx-macro.yaml   | 76 +++++++++++++----
 .../bindings/sound/qcom,lpass-tx-macro.yaml   | 81 +++++++++++++++----
 .../bindings/sound/qcom,lpass-va-macro.yaml   | 18 +++++
 .../bindings/sound/qcom,lpass-wsa-macro.yaml  | 23 +++++-
 sound/soc/codecs/lpass-macro-common.h         |  3 +
 sound/soc/codecs/lpass-rx-macro.c             | 36 +++++++--
 sound/soc/codecs/lpass-tx-macro.c             | 35 ++++++--
 sound/soc/codecs/lpass-wsa-macro.c            | 37 +++++++--
 8 files changed, 252 insertions(+), 57 deletions(-)

--
2.34.1

15 months agoASoC: wm8903: Remove outdated DMIC comment
Charles Keepax [Tue, 28 Mar 2023 09:58:19 +0000 (10:58 +0100)]
ASoC: wm8903: Remove outdated DMIC comment

Support for DMICs was added in commit 97945c46a23d ("ASoC: WM8903:
Implement DMIC support"). Remove them from the TODO list at the top of
the driver.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230328095819.1632802-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: es8316: Handle optional IRQ assignment
Cristian Ciocaltea [Tue, 28 Mar 2023 09:49:01 +0000 (12:49 +0300)]
ASoC: es8316: Handle optional IRQ assignment

The driver is able to work fine without relying on a mandatory interrupt
being assigned to the I2C device. This is only needed when making use of
the jack-detect support.

However, the following warning message is always emitted when there is
no such interrupt available:

  es8316 0-0011: Failed to get IRQ 0: -22

Do not attempt to request an IRQ if it is not available/valid. This also
ensures the rather misleading message is not displayed anymore.

Also note the IRQ validation relies on commit dab472eb931bc291 ("i2c /
ACPI: Use 0 to indicate that device does not have interrupt assigned").

Fixes: 822257661031 ("ASoC: es8316: Add jack-detect support")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230328094901.50763-1-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: maxim,max9867: fix example
Richard Leitner [Tue, 28 Mar 2023 11:25:14 +0000 (13:25 +0200)]
ASoC: dt-bindings: maxim,max9867: fix example

Remove the common clock node from the example as suggested by
Krzysztof Kozlowski in [1].

[1] https://lore.kernel.org/lkml/45d306d3-8efb-12ac-0a83-f01ca2982b0a@linaro.org/

Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230328-max9867_dt_example_fix-v1-1-cdf31c3fdfc8@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: lpass-wsa-macro: add support for SM8550
Krzysztof Kozlowski [Mon, 13 Mar 2023 07:54:45 +0000 (08:54 +0100)]
ASoC: codecs: lpass-wsa-macro: add support for SM8550

Add support for the WSA macro codec on Qualcomm SM8550.  SM8550 does not
use NPL clock, thus add flags allowing to skip it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230313075445.17160-9-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: qcom,lpass-wsa-macro: Add SM8550 WSA macro
Krzysztof Kozlowski [Mon, 13 Mar 2023 07:54:44 +0000 (08:54 +0100)]
ASoC: dt-bindings: qcom,lpass-wsa-macro: Add SM8550 WSA macro

Add the WSA macro codec on Qualcomm SM8550, which comes without NPL clock
exposed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230313075445.17160-8-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: lpass-tx-macro: add support for SM8550
Krzysztof Kozlowski [Mon, 13 Mar 2023 07:54:42 +0000 (08:54 +0100)]
ASoC: codecs: lpass-tx-macro: add support for SM8550

Add support for the TX macro codec on Qualcomm SM8550.  SM8550 does not
use NPL clock, thus add flags allowing to skip it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230313075445.17160-6-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: qcom,lpass-tx-macro: Add SM8550 TX macro
Krzysztof Kozlowski [Mon, 13 Mar 2023 07:54:41 +0000 (08:54 +0100)]
ASoC: dt-bindings: qcom,lpass-tx-macro: Add SM8550 TX macro

Add the TX macro codec on Qualcomm SM8550, which comes without NPL clock
exposed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230313075445.17160-5-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: qcom,lpass-tx-macro: narrow clocks per variants
Krzysztof Kozlowski [Mon, 13 Mar 2023 07:54:40 +0000 (08:54 +0100)]
ASoC: dt-bindings: qcom,lpass-tx-macro: narrow clocks per variants

Currently the Qualcomm TX macro codec binding allows two different clock
setups - with (for ADSP) and without macro/dcodec entries (for ADSP
bypassed).  With more devices coming soon, this will keep growing, thus
rework the clocks/clock-names to be specific for each binding.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230313075445.17160-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: lpass-rx-macro: add support for SM8550
Krzysztof Kozlowski [Mon, 13 Mar 2023 07:54:39 +0000 (08:54 +0100)]
ASoC: codecs: lpass-rx-macro: add support for SM8550

Add support for the RX macro codec on Qualcomm SM8550.  SM8550 does not
use NPL clock, thus add flags allowing to skip it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230313075445.17160-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: qcom,lpass-rx-macro: Add SM8550 RX macro
Krzysztof Kozlowski [Mon, 13 Mar 2023 07:54:38 +0000 (08:54 +0100)]
ASoC: dt-bindings: qcom,lpass-rx-macro: Add SM8550 RX macro

Add the RX macro codec on Qualcomm SM8550, which comes without NPL clock
exposed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230313075445.17160-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: qcom,lpass-rx-macro: narrow clocks per variants
Krzysztof Kozlowski [Mon, 13 Mar 2023 07:54:37 +0000 (08:54 +0100)]
ASoC: dt-bindings: qcom,lpass-rx-macro: narrow clocks per variants

Currently the Qualcomm RX macro codec binding allows two different clock
setups - with (for ADSP) and without macro/dcodec entries (for ADSP
bypassed).  With more devices coming soon, this will keep growing, thus
rework the clocks/clock-names to be specific for each binding.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230313075445.17160-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: da7213.c: add missing pm_runtime_disable()
Duy Nguyen [Tue, 28 Mar 2023 00:03:03 +0000 (00:03 +0000)]
ASoC: da7213.c: add missing pm_runtime_disable()

da7213.c is missing pm_runtime_disable(), thus we will get
below error when rmmod -> insmod.

$ rmmod  snd-soc-da7213.ko
$ insmod snd-soc-da7213.ko
da7213 0-001a: Unbalanced pm_runtime_enable!"

[Kuninori adjusted to latest upstream]

Signed-off-by: Duy Nguyen <duy.nguyen.rh@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Khanh Le <khanh.le.xr@renesas.com>
Link: https://lore.kernel.org/r/87mt3xg2tk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: soc-core.c: add snd_soc_add_pcm_runtimes()
Kuninori Morimoto [Mon, 27 Mar 2023 00:34:26 +0000 (00:34 +0000)]
ASoC: soc-core.c: add snd_soc_add_pcm_runtimes()

Current ASoC supports snd_soc_add_pcm_runtime(), but user need to
call it one-by-one if it has multi dai_links.
This patch adds snd_soc_add_pcm_runtimes() which supports multi
dai_links.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h6u76nhq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: qcom: audioreach: drop stray 'get' from error message
Johan Hovold [Mon, 27 Mar 2023 14:55:55 +0000 (16:55 +0200)]
ASoC: qcom: audioreach: drop stray 'get' from error message

Drop the stray 'get', which appears to be a copy-paste error, from the
registration-failure error message.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230327145555.19351-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: audio-graph-card2-custom-sample.dtsi: use card->name to avoid long name
Kuninori Morimoto [Mon, 27 Mar 2023 04:33:41 +0000 (04:33 +0000)]
ASoC: audio-graph-card2-custom-sample.dtsi: use card->name to avoid long name

Current Card2 Custom Sample will be too long Card name, and be error

audio-graph-card2-custom-sample audio-graph-card2-custom-sample \
ASoC: driver name too long \
audio-graph-card2-custom-sample' -> 'audio-graph-car'

This patch uses short name to avoid it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bkke7qzf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: meson: Use the devm_clk_get_optional() helper
Christophe JAILLET [Sun, 26 Mar 2023 12:43:38 +0000 (14:43 +0200)]
ASoC: meson: Use the devm_clk_get_optional() helper

Use devm_clk_get_optional() instead of hand writing it.
This saves some loC and improves the semantic.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/8dab942d6ce47657a9c038295959be80bb2ee09e.1679834598.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: hdac_hdmi: use set_stream() instead of set_tdm_slots()
Jason Montleon [Fri, 24 Mar 2023 17:07:11 +0000 (13:07 -0400)]
ASoC: hdac_hdmi: use set_stream() instead of set_tdm_slots()

hdac_hdmi was not updated to use set_stream() instead of set_tdm_slots()
in the original commit so HDMI no longer produces audio.

Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/regressions/CAJD_bPKQdtaExvVEKxhQ47G-ZXDA=k+gzhMJRHLBe=mysPnuKA@mail.gmail.com/
Fixes: 636110411ca7 ("ASoC: Intel/SOF: use set_stream() instead of set_tdm_slots() for HDAudio")
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230324170711.2526-1-jmontleo@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: cs35l56: Remove redundant return statement in cs35l56_spi_probe()
Harshit Mogalapalli [Fri, 24 Mar 2023 14:55:35 +0000 (07:55 -0700)]
ASoC: cs35l56: Remove redundant return statement in cs35l56_spi_probe()

We have unreachable 'return ret' statement in cs35l56_spi_probe(),
delete it as its dead code..

This is found by static analysis with smatch.

Fixes: e49611252900 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230324145535.3951689-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: remove unnecessary dai_link->platform
Mark Brown [Fri, 24 Mar 2023 16:36:05 +0000 (16:36 +0000)]
ASoC: remove unnecessary dai_link->platform

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Current ASoC will ignore already connected component when binding Card.
This will happen mainly "CPU Component" is handled as "Platform Component",
which was needed before.

static int snd_soc_rtd_add_component(...)
{
...
for_each_rtd_components(rtd, i, comp) {
/* already connected */
if (comp == component)
return 0;
}
...
}

Some drivers are still using CPU or Dummy Component as Platform Component,
but these are no meaning or ignored.
This patch-set remove these.

15 months agoASoC: soc-compress: Inherit atomicity from DAI link for Compress FE
Daniel Baluta [Fri, 24 Mar 2023 12:40:19 +0000 (14:40 +0200)]
ASoC: soc-compress: Inherit atomicity from DAI link for Compress FE

After commit bbf7d3b1c4f40 ("ASoC: soc-pcm: align BE 'atomicity' with
that of the FE") BE and FE atomicity must match.

In the case of Compress PCM there is a mismatch in atomicity between FE
and BE and we get errors like this:

[   36.434566]  sai1-wm8960-hifi: dpcm_be_connect: FE is atomic but BE
is nonatomic, invalid configuration
[   36.444278]  PCM Deep Buffer: ASoC: can't connect SAI1.OUT

In order to fix this we must inherit the atomicity from DAI link
associated with current PCM Compress FE.

Fixes: bbf7d3b1c4f4 ("ASoC: soc-pcm: align BE 'atomicity' with that of the FE")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230324124019.30826-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: cs35l56: Fix an unsigned comparison which can never be negative
Jiapeng Chong [Fri, 24 Mar 2023 02:23:03 +0000 (10:23 +0800)]
ASoC: cs35l56: Fix an unsigned comparison which can never be negative

The variable 'rv' is defined as unsigned type, so the following if
statement is invalid, we can modify the type of rv to int.
if (rv < 0) {
dev_err(cs35l56->dev, "irq: failed to get pm_runtime:
%d\n", rv);
goto err_unlock;
}

./sound/soc/codecs/cs35l56.c:333:5-7: WARNING: Unsigned expression compared with zero: rv < 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4599
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230324022303.121485-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: simple-card.c: add missing of_node_put()
Kuninori Morimoto [Thu, 23 Mar 2023 22:56:08 +0000 (22:56 +0000)]
ASoC: simple-card.c: add missing of_node_put()

It is missing of_node_put() for platform.
This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ilerjcvr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: soc-topology.c: remove unnecessary dai_link->platform
Kuninori Morimoto [Thu, 23 Mar 2023 22:53:46 +0000 (22:53 +0000)]
ASoC: soc-topology.c: remove unnecessary dai_link->platform

dai_link->platform is no longer needed if CPU and Platform are
same Component. This patch removes unnecessary dai_link->platform.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87jzz7jczp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>