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>
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>
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>
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.
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.
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.
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.
^ /* 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.
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.
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.
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).
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.
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>
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>
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>
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>
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.
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.
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.
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.
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>
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.
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.
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.
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.
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
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").
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.
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.
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.
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.
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>
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.