linux-2.6-block.git
5 months agoASoC: SOF: Intel: hda: Clear Soundwire node ID during BE DAI hw_free
Ranjani Sridharan [Tue, 2 Apr 2024 15:18:23 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda: Clear Soundwire node ID during BE DAI hw_free

When an xrun happens, the BE DAI hw_params doesn't get invoked before
the stream restarts with a prepare. In this case, clearing the node ID
when the DAI widget is freed and unprepared will result in an error when
it is re-initialized. In order to avoid this, move the code to clear the
node ID to the BE DAI hw_free op to keep it balanced with the BE DAI
hw_params.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda: move helper to static inline
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:22 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda: move helper to static inline

To allow using widget_to_sdev() in other files, move it as static inline
in shared header file.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: IPC4: extend dai_data with node_id
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:21 +0000 (10:18 -0500)]
ASoC: SOF: IPC4: extend dai_data with node_id

The node_id value needs to be handled specifically for ALH.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda: extend signature of sdw_hda_dai_hw_params()
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:20 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda: extend signature of sdw_hda_dai_hw_params()

Add intel_alh_id to set the expected gateway node_id in a follow-up
patch.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: set the DMA TLV device as dai_index
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:19 +0000 (10:18 -0500)]
ASoC: SOF: Intel: set the DMA TLV device as dai_index

We've already defined the value for dai_index, let's use it instead of
open-coding the same thing. No functionality change.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda-dai: add helpers to set dai config
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:18 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda-dai: add helpers to set dai config

We need to be able to set the dai config differently for SoundWire.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda-dai: set dma_stream_channel_map device
Bard Liao [Tue, 2 Apr 2024 15:18:17 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda-dai: set dma_stream_channel_map device

sof_ipc4_dma_config_tlv{} is required for ACE2.x. The patch follow the
convention to set the dma_stream_channel_map.mapping device as
"link_id << 8 | pdi_id".
And the mapping in sof_ipc4_alh_configuration_blob{} should be the same
as dma_stream_channel_map.mapping in sof_ipc4_dma_config{}.
The purposes of device id is to map DMA tlv.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda-dai: set lowest N bits in ch_mask
Bard Liao [Tue, 2 Apr 2024 15:18:16 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda-dai: set lowest N bits in ch_mask

We always use the lowest N channels of stream. So, set ch_mask to
GENMASK(params_channels(params) - 1, 0).

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: make dma_config_tlv be an array
Bard Liao [Tue, 2 Apr 2024 15:18:15 +0000 (10:18 -0500)]
ASoC: SOF: make dma_config_tlv be an array

Each stream needs a dma_config_tlv. We will handle multi dma_config_tlv
in the follow up commits.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoRevert "ASoC: SOF: Intel: hda-dai-ops: only allocate/release streams for first CPU...
Bard Liao [Tue, 2 Apr 2024 15:18:14 +0000 (10:18 -0500)]
Revert "ASoC: SOF: Intel: hda-dai-ops: only allocate/release streams for first CPU DAI"

This reverts commit f8ba62ac863c33fc0d8ac3f1270985c2b77f4377.

The SoundWire aggregated solution was to use one DMA on multiple links.
But, the solution changed to use one DMA for each link. It means that
we should assign HDaudio stream_tag for each cpu_dai.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoRevert "ASoC: SOF: Intel: hda-dai-ops: reset device count for SoundWire DAIs"
Bard Liao [Tue, 2 Apr 2024 15:18:13 +0000 (10:18 -0500)]
Revert "ASoC: SOF: Intel: hda-dai-ops: reset device count for SoundWire DAIs"

This reverts commit 699e146d9ebf42ee2a5d4e4e28f7a49c4aef0105.
Don't reset device_count as we will use the multi-gateway firmware
configuration.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda-dai: fix channel map configuration for aggregated dailink
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:12 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda-dai: fix channel map configuration for aggregated dailink

The existing code derives the channel map used to program the HDaudio
link DMA from the hw_params, but that is not quite right in the case
of aggregation. The code in soc-pcm.c splits the hw_params depending
on the codec_ch_map, and we need to reconstruct the channel-map to
insert the data in the right places.

This issue is seen only on amplifier feedback capture where the data
from the second amplifier was replaced by that of the first amplifier.

Note that the loop iterator of the macro for_each_rtd_cpu_dais() is
reused in a following loop. This is different to all existing usages
of that macro, hence the use of a boolean flag to avoid an access to
an uninitialized variable.

Fixes: 2960ee5c4814 ("ASoC: SOF: Intel: hda-dai: add helpers for SoundWire callbacks")
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: nau8325: Modify driver code and dtschema.
Mark Brown [Fri, 29 Mar 2024 01:32:12 +0000 (01:32 +0000)]
ASoC: nau8325: Modify driver code and dtschema.

Merge series from Seven Lee <wtli@nuvoton.com>:

Add a driver for the Nuvoton NAU88325.

5 months agoASoC: Intel: boards: updates for 6.10 - part3
Mark Brown [Fri, 29 Mar 2024 01:32:01 +0000 (01:32 +0000)]
ASoC: Intel: boards: updates for 6.10 - part3

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This last part is the continuation of Brent Lu's cleanups. Multiple
quirks have been removed to use "default" configurations and
ACPI-based detection of codecs and selection of topology files.

This cleanup has been done in multiple steps/phases since Fall 2023,
thanks Brent for this contribution!

5 months agoarm64: dts: imx8qxp add asrc and sai
Mark Brown [Fri, 29 Mar 2024 01:31:51 +0000 (01:31 +0000)]
arm64: dts: imx8qxp add asrc and sai

Merge series from Frank Li <Frank.Li@nxp.com>:

Update binding doc to avoid warning.

5 months agoASoC: drop driver owner assignment
Mark Brown [Fri, 29 Mar 2024 01:31:40 +0000 (01:31 +0000)]
ASoC: drop driver owner assignment

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

Core for several drivers already sets the driver.owner, so driver does
not need to.  Simplify the drivers.

5 months agoASoC: kirkwood: Fix potential NULL dereference
Aleksandr Mishin [Thu, 28 Mar 2024 17:33:37 +0000 (20:33 +0300)]
ASoC: kirkwood: Fix potential NULL dereference

In kirkwood_dma_hw_params() mv_mbus_dram_info() returns NULL if
CONFIG_PLAT_ORION macro is not defined.
Fix this bug by adding NULL check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: bb6a40fc5a83 ("ASoC: kirkwood: Fix reference to PCM buffer address")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://msgid.link/r/20240328173337.21406-1-amishin@t-argos.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl-sai: allow only one dma-names
Frank Li [Thu, 28 Mar 2024 14:51:35 +0000 (10:51 -0400)]
ASoC: dt-bindings: fsl-sai: allow only one dma-names

Some sai only connect one direction dma (rx/tx) in SOC. For example:
imx8qxp sai5 only connect tx dma channel. So allow only one "rx" or "tx"
for dma-names.

Remove description under dmas because no user use index to get dma channel.
All user use 'dma-names' to get correct dma channel. dma-names already in
'required' list.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://msgid.link/r/20240328-asrc_8qxp-v8-3-801cd6bb5be2@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl,imx-asrc: update max interrupt numbers
Frank Li [Thu, 28 Mar 2024 14:51:34 +0000 (10:51 -0400)]
ASoC: dt-bindings: fsl,imx-asrc: update max interrupt numbers

fsl,imx8qxp-spdif and fsl,imx8qm-spdif have 2 interrupts. Other platforms
have 1 interrupt.

Increase max interrupt number to 2 and add restriction for platforms except
i.MX8QXP and i.MX8QM.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://msgid.link/r/20240328-asrc_8qxp-v8-2-801cd6bb5be2@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl,imx-asrc/spdif: Add power-domains property
Frank Li [Thu, 28 Mar 2024 14:51:33 +0000 (10:51 -0400)]
ASoC: dt-bindings: fsl,imx-asrc/spdif: Add power-domains property

Add power-domains property for asrc and spdif since fsl,imx8qm-asrc/spdif
and fsl,imx8qxp-asrc/spdif require 'power-domains'.

Set 'power-domains' as required property for compatible string
fsl,imx8qm-asrc/spdif and fsl,imx8qxp-asrc/spdif.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://msgid.link/r/20240328-asrc_8qxp-v8-1-801cd6bb5be2@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: nau8325: new driver
Seven Lee [Wed, 27 Mar 2024 07:57:55 +0000 (15:57 +0800)]
ASoC: nau8325: new driver

The driver is for amplifiers NAU8325 of Nuvoton Technology Corporation.
The NAU8325 is a stereo high efficiency filter-free Class-D audio
amplifier, which is capable of driving a 4ohm load with up to 3W output
power.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://msgid.link/r/20240327075755.3410381-3-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: Added schema for "nuvoton,nau8325"
Seven Lee [Wed, 27 Mar 2024 07:57:54 +0000 (15:57 +0800)]
ASoC: dt-bindings: Added schema for "nuvoton,nau8325"

Add a DT schema for describing nau8325 audio amplifiers. The key features
are as follows:
  - Low SPK_VDD Quiescent Current
  - Gain Setting with 2-wire interface
  - Powerful Stereo Class-D Amplifier
  - Low Output Noise
  - Low Current Shutdown Mode
  - Click-and Pop Suppression

More resources :
https://www.nuvoton.com/products/smart-home-audio/audio-amplifiers/class-d-series/nau8325yg/

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://msgid.link/r/20240327075755.3410381-2-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_cs42l42: add mtl_cs42l42_def for mtl boards
Brent Lu [Wed, 27 Mar 2024 16:24:08 +0000 (11:24 -0500)]
ASoC: Intel: sof_cs42l42: add mtl_cs42l42_def for mtl boards

Add the board config mtl_cs42l42_def to cs42l42 machine driver for all
mtl boards using default SSP port allocation (headphone codec on SSP2,
speaker amplifiers on SSP0, and BT offload on SSP1).

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_cs42l42: add rpl_cs42l42_def for rpl boards
Brent Lu [Wed, 27 Mar 2024 16:24:07 +0000 (11:24 -0500)]
ASoC: Intel: sof_cs42l42: add rpl_cs42l42_def for rpl boards

Add the board config rpl_cs42l42_def to cs42l42 machine driver for all
rpl boards using default SSP port allocation (headphone codec on SSP0,
speaker amplifiers on SSP1, and BT offload on SSP2).

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_cs42l42: mach cleanup for adl boards
Brent Lu [Wed, 27 Mar 2024 16:24:06 +0000 (11:24 -0500)]
ASoC: Intel: sof_cs42l42: mach cleanup for adl boards

Add a common entry in enumeration table for all cs42l42 boards
with/without speaker amplifier. All other adl_cs42l42_def entries
become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_cs42l42: board id cleanup for adl boards
Brent Lu [Wed, 27 Mar 2024 16:24:05 +0000 (11:24 -0500)]
ASoC: Intel: sof_cs42l42: board id cleanup for adl boards

Introduce "adl_cs42l42_def" for adl boards which implement headphone
codec on SSP0 and speaker amplifiers on SSP1.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: mach cleanup for mtl boards
Brent Lu [Wed, 27 Mar 2024 16:24:04 +0000 (11:24 -0500)]
ASoC: Intel: sof_rt5682: mach cleanup for mtl boards

Add two common entries in enumeration table for all rt5682/rt5650
boards with/without speaker amplifier. All other mtl_rt5682_def
entries become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: mach cleanup for rpl boards
Brent Lu [Wed, 27 Mar 2024 16:24:03 +0000 (11:24 -0500)]
ASoC: Intel: sof_rt5682: mach cleanup for rpl boards

Add two common entries in enumeration table for all rt5682/rt5650
boards with/without speaker amplifier. All other rpl_rt5682_def
entries become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: mach cleanup for adl boards
Brent Lu [Wed, 27 Mar 2024 16:24:02 +0000 (11:24 -0500)]
ASoC: Intel: sof_rt5682: mach cleanup for adl boards

Add two common entries in enumeration table for all rt5682/rt5650
boards with/without speaker amplifier. All other adl_rt5682_def
entries become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: mach cleanup for tgl boards
Brent Lu [Wed, 27 Mar 2024 16:24:01 +0000 (11:24 -0500)]
ASoC: Intel: sof_rt5682: mach cleanup for tgl boards

Add a common entry in enumeration table for all rt5682 boards
with/without speaker amplifier. All other tgl_rt5682_def entries
become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_nau8825: add mtl_nau8825_def for mtl boards
Brent Lu [Wed, 27 Mar 2024 16:24:00 +0000 (11:24 -0500)]
ASoC: Intel: sof_nau8825: add mtl_nau8825_def for mtl boards

Add the board config mtl_nau8825_def to nau8825 machine driver for all
mtl boards using default SSP port allocation (headphone codec on SSP2,
speaker amplifiers on SSP0, and BT offload on SSP1).

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_nau8825: mach cleanup for rpl boards
Brent Lu [Wed, 27 Mar 2024 16:23:59 +0000 (11:23 -0500)]
ASoC: Intel: sof_nau8825: mach cleanup for rpl boards

Add a common entry in enumeration table for all nau8825 boards
with/without speaker amplifier. All other rpl_nau8825_def entries
become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_nau8825: mach cleanup for adl boards
Brent Lu [Wed, 27 Mar 2024 16:23:58 +0000 (11:23 -0500)]
ASoC: Intel: sof_nau8825: mach cleanup for adl boards

Add a common entry in enumeration table for all nau8825 boards
with/without speaker amplifier. All other adl_nau8825_def entries
become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: support tplg suffix detection
Brent Lu [Wed, 27 Mar 2024 16:23:57 +0000 (11:23 -0500)]
ASoC: SOF: Intel: support tplg suffix detection

Add new flags to tplg_quirk_mask to detect and append codec/amplifier
tplg suffix to topology file name at runtime. With this feature we
could implement an enumeration entry for all boards which implement
same headphone codec regardless the speaker amplifier type.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: ssp-common: get codec tplg suffix function
Brent Lu [Wed, 27 Mar 2024 16:23:56 +0000 (11:23 -0500)]
ASoC: Intel: ssp-common: get codec tplg suffix function

Add helper functions to get tplg suffix string for specific headphone
codec or speaker amplifier. The string could be used to compose the
default topology file name for specific headphone codec and speaker
amplifier combination.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: ssp-common: delete module
Brent Lu [Wed, 27 Mar 2024 16:23:55 +0000 (11:23 -0500)]
ASoC: Intel: ssp-common: delete module

Moving all code to snd-soc-acpi-intel-match module and remove the
snd-soc-acpi-intel-ssp-common module.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: ssp-common: module name change
Brent Lu [Wed, 27 Mar 2024 16:23:54 +0000 (11:23 -0500)]
ASoC: Intel: ssp-common: module name change

As we applied new naming convention to functions and structures,
changing module name as well to reflect the new naming.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: ssp-common: naming convention change
Brent Lu [Wed, 27 Mar 2024 16:23:53 +0000 (11:23 -0500)]
ASoC: Intel: ssp-common: naming convention change

As we moved ssp-common files to new locations with new names, changing
the naming convention from sof_ssp_ to snd_soc_acpi_intel_.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: ssp-common: relocate header file
Brent Lu [Wed, 27 Mar 2024 16:23:52 +0000 (11:23 -0500)]
ASoC: Intel: ssp-common: relocate header file

Moving ssp-common header file from sound/soc/intel/common directory to
include/sound directory and rename the file. Keep file content
unchanged for tracking purpose.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: ssp-common: relocate source file
Brent Lu [Wed, 27 Mar 2024 16:23:51 +0000 (11:23 -0500)]
ASoC: Intel: ssp-common: relocate source file

Moving ssp-common source and header files from sound/soc/intel/boards
directory to sound/soc/intel/common directory and rename the source
file. Keep file content unchanged for tracking purpose.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: sdw-mockup: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:53 +0000 (18:44 +0100)]
ASoC: sdw-mockup: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-18-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt722-sdca-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:52 +0000 (18:44 +0100)]
ASoC: rt722-sdca-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-17-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt715-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:51 +0000 (18:44 +0100)]
ASoC: rt715-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-16-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt715-sdca-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:50 +0000 (18:44 +0100)]
ASoC: rt715-sdca-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-15-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt712-sdca-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:49 +0000 (18:44 +0100)]
ASoC: rt712-sdca-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-14-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt712-sdca-dmic: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:48 +0000 (18:44 +0100)]
ASoC: rt712-sdca-dmic: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-13-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt711-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:47 +0000 (18:44 +0100)]
ASoC: rt711-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-12-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt711-sdca-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:46 +0000 (18:44 +0100)]
ASoC: rt711-sdca-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-11-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt700-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:45 +0000 (18:44 +0100)]
ASoC: rt700-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-10-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt5682-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:44 +0000 (18:44 +0100)]
ASoC: rt5682-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-9-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt1318-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:43 +0000 (18:44 +0100)]
ASoC: rt1318-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-8-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt1316-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:42 +0000 (18:44 +0100)]
ASoC: rt1316-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-7-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt1308-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:41 +0000 (18:44 +0100)]
ASoC: rt1308-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-6-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt1017-sdca-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:40 +0000 (18:44 +0100)]
ASoC: rt1017-sdca-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-5-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: max98373-sdw: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:39 +0000 (18:44 +0100)]
ASoC: max98373-sdw: drop driver owner assignment

Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-4-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: tlv320aic3x-spi: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:38 +0000 (18:44 +0100)]
ASoC: tlv320aic3x-spi: drop driver owner assignment

Core in spi_register_driver() already sets the .owner, so driver
does not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-3-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: tlv320aic32x4-spi: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:37 +0000 (18:44 +0100)]
ASoC: tlv320aic32x4-spi: drop driver owner assignment

Core in spi_register_driver() already sets the .owner, so driver
does not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-2-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: loongson: i2s/pci: drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:44:36 +0000 (18:44 +0100)]
ASoC: loongson: i2s/pci: drop driver owner assignment

PCI core in pci_register_driver() already sets the .owner, so driver
does not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-1-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: sun8i-codec: Fix build with CONFIG_SND_JACK_INPUT_DEV disabled
Ondrej Jirman [Wed, 27 Mar 2024 08:05:34 +0000 (09:05 +0100)]
ASoC: sun8i-codec: Fix build with CONFIG_SND_JACK_INPUT_DEV disabled

When CONFIG_SND_JACK_INPUT_DEV is disabled, struct snd_jack doesn't
have 'type' field. We can't rely on this field being always present,
so store the jack_type in the codec driver itself.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403261243.kcXCPAYs-lkp@intel.com/
Link: https://msgid.link/r/20240327080542.3649840-1-megi@xff.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: boards: updates for 6.10 - part2
Mark Brown [Tue, 26 Mar 2024 20:21:16 +0000 (20:21 +0000)]
ASoC: Intel: boards: updates for 6.10 - part2

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This second part provides SoundWire-related cleanups and extensions
required by Realtek RT722 and Cirrus Logic codecs.

Also included is a cleanup of the RT715-sdca DAI naming and new tables
for ACPI-based board detections.

5 months agoASoC: soc-jack: Get rid of legacy GPIO support
Andy Shevchenko [Tue, 26 Mar 2024 17:09:48 +0000 (19:09 +0200)]
ASoC: soc-jack: Get rid of legacy GPIO support

No more users.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240326171134.1414462-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Add support for cs42l43 optional speaker output
Charles Keepax [Tue, 26 Mar 2024 16:04:29 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Add support for cs42l43 optional speaker output

Add support for the optional speaker output on the cs42l43, this uses
the new SOF_CODEC_SPKR quirk to conditional include the speaker DAI
link. It is worth noting that currently no systems are included that
utilise this feature, but the feature is added as several systems are on
the horizon. As part of this SOF_SDW_MAX_DAI_NUM must be increased, it
is currently 3 but cs42l43 will now have 4 DAI links. This value is
increased to 8 to give some head room for future devices.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-35-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Add quirk for optional codec speakers
Charles Keepax [Tue, 26 Mar 2024 16:04:28 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Add quirk for optional codec speakers

Some codecs have speaker drivers that may or may not be used in a
given system. Add a quirk (SOF_CODEC_SPKR) that defines if a system
uses the codec speaker, this is kept generic such that any codec
with such a speaker DAI can reuse the quirk.

For implementation of this, add a quirk field into the
sof_sdw_dai_info structure. This field is not used to specify
if a system uses a particular quirk, that is still done through
the sof_sdw_quirk variable, this field is used to flag a DAI as
conditional on a certain quirk. This means the DAI will only be
included in the card if sof_sdw_quirk and the DAI quirk field have
a matching set bit.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-34-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Remove redundant initialisations
Charles Keepax [Tue, 26 Mar 2024 16:04:27 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Remove redundant initialisations

Unspecified fields are by default initialised to zero, remove redundant
init pointer initialisations.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-33-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Don't pass acpi_link_adr to init functions
Charles Keepax [Tue, 26 Mar 2024 16:04:26 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Don't pass acpi_link_adr to init functions

There is no need to pass the snd_soc_acpi_link_adr structure to the init
functions, it conveys no specific information about the codec. Remove
this parameter from the callbacks

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-32-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: change cs35l56 name_prefix
Bard Liao [Tue, 26 Mar 2024 16:04:25 +0000 (11:04 -0500)]
ASoC: Intel: change cs35l56 name_prefix

To use sequential amp numbers. I,e, AMP1, AMP2, AMP3, AMP4

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-31-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: change rt715-sdca dai name
Bard Liao [Tue, 26 Mar 2024 16:04:24 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: change rt715-sdca dai name

As rt715-sdca dai name has been changed in codec driver, we should
change it in machine driver, too. Changing the dai name in
codec_info_list[] also help sof_sdw_rtd_init() to run .rtd_init()
from the same codec.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-30-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt715-sdca: rename dai name with rt715-sdca prefix
Bard Liao [Tue, 26 Mar 2024 16:04:23 +0000 (11:04 -0500)]
ASoC: rt715-sdca: rename dai name with rt715-sdca prefix

The dai name are the same as rt715 codec. Rename them with rt715-sdca
prefix allow machine driver to distinguish rt715 and rt715-sdca from
dai name.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-29-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw_rt722_sdca: use rt_dmic_rtd_init
Bard Liao [Tue, 26 Mar 2024 16:04:22 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw_rt722_sdca: use rt_dmic_rtd_init

rt_dmic_rtd_init() can be used for rt722 dmic, too.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-28-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw_rt722_sdca: set rtd_init in codec_info_list[]
Bard Liao [Tue, 26 Mar 2024 16:04:21 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw_rt722_sdca: set rtd_init in codec_info_list[]

Add rt722 into rt_sdca_jack_rtd_init() supported list, and set
rtd_init callback directly in codec_info_list[]. No need to use a
init callback to set the rtd_init callback.
Besides, sof_sdw_rt_sdca_jack_init() doesn't set .rtd_init anymore.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-27-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: remove unused rt dmic rtd_init
Bard Liao [Tue, 26 Mar 2024 16:04:20 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: remove unused rt dmic rtd_init

Some Realtek SDW DMIC codecs use the generic rt_dmic_rtd_init callback now.
Remove unused rtd_init callbacks.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-26-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: use generic rtd_init function for Realtek SDW DMICs
Bard Liao [Tue, 26 Mar 2024 16:04:19 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: use generic rtd_init function for Realtek SDW DMICs

The only thing that the rt_xxx_rtd_init() functions do is to set
card->components. And we can set card->components with name_prefix
as rt712_sdca_dmic_rtd_init() does.
And sof_sdw_rtd_init() will always select the first dai with the
given dai->name from codec_info_list[]. Unfortunately, we have
different codecs with the same dai name. For example, dai name of
rt715 and rt715-sdca are both "rt715-aif2". Using a generic rtd_init
allow sof_sdw_rtd_init() run the rtd_init() callback from a similar
codec dai.

Fixes: 8266c73126b7 ("ASoC: Intel: sof_sdw: add common sdw dai link init")
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-25-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Factor out SoundWire DAI creation
Charles Keepax [Tue, 26 Mar 2024 16:04:18 +0000 (11:04 -0500)]
ASoC: intel: sof_sdw: Factor out SoundWire DAI creation

Factor out the creation of the SoundWire DAI links into a helper
function. No functional change.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-24-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move generation of DAI links to new parsing
Charles Keepax [Tue, 26 Mar 2024 16:04:17 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move generation of DAI links to new parsing

The only part left using the old parsing code is now the generation of
the actual DAI links. Move this generation over to being based on the
new parsing, which allows the removal of the last of the old parsing
code.

The new DAI link generation is a simple matter of creating a new DAI
link for each sof_sdw_dailink struct, and adding a cpu, a codec, and
a mapping for each sof_sdw_endpoint contained in that sof_sdw_dailink.
Note that the CPUs can be inferred as the endpoint list is iterated,
because the endpoints were added into the list sorted by link.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move append_dai_type to new parsing
Charles Keepax [Tue, 26 Mar 2024 16:04:16 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move append_dai_type to new parsing

append_dai_type should be set to true in any situation that would
result in multiple DAI links existing on a single SoundWire bus,
because the legacy naming used only the bus number to make things
unique. The current code handles this by looking for codecs with
multiple dai_info structs and looking for buses that include multiple
types of device on them. The first of these assumes that all DAIs on a
given device would be in use. The second, with dissimilar aggregation
now being supported, isn't really an accurate check either since those
devices could be aggregated into a single DAI link.

Move the handling for this flag over to the new parsing code and
simplify things a little by looking directly for SoundWire links
that will contain multiple DAI links to set the flag. These changes
should not cause any change in behaviour for any currently supported
systems.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move ignore_pch_dmic to new parsing
Charles Keepax [Tue, 26 Mar 2024 16:04:15 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move ignore_pch_dmic to new parsing

Trivial move of the handling of ignore_pch_dmic over to the new parsing
code.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move counting and codec_conf to new parsing
Charles Keepax [Tue, 26 Mar 2024 16:04:14 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move counting and codec_conf to new parsing

Use the output of the new snd_soc_acpi struct parsing for the purposes
of counting the number of SoundWire DAI links and physical devices
attached to the SoundWire. These counts are already returned by the
parser so those can just be used directly. But the population of the
codec_conf structures, is moved from the old parsing code over to the
new. As the two parsers currently co-exist it is better to not have
them both attempt to modify the same structures.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof-sdw: Add new code for parsing the snd_soc_acpi structs
Charles Keepax [Tue, 26 Mar 2024 16:04:13 +0000 (11:04 -0500)]
ASoC: Intel: sof-sdw: Add new code for parsing the snd_soc_acpi structs

The current machine driver code has a lot of loops parsing through
the ACPI structs (snd_soc_acpi_link_adr, snd_soc_acpi_adr_device,
snd_soc_acpi_endpoint), this makes it hard to understand exactly
what information is being extracted and for what purposes. As well
as being slightly inefficient, as the same information is looked
up multiple times. There are also some issues with the handling
of multiple endpoints on a single device, only the first of the
snd_soc_acpi_endpoint structures is currently fully processed by the
driver. This means doing things like aggregating the second endpoint
on a device with another device are not currently possible.

Add new parsing code that will count the devices and endpoints, parse
them into an intermediate datastructure, and then use that to create
the DAI links. This patch does not actually utilise the results of
the parsing, items will be moved across in the following patches.

This parsing is based around two new structures which are temporarily
allocated whilst parsing. Firstly, sof_sdw_endpoint, which represents
a specific endpoint for audio on a device and is more or less directly
equivalent to snd_soc_acpi_endpoint. Secondly, sof_sdw_dailink
which represents a DAI link and contains a linked list of one or
more sof_sdw_endpoints. A single trip through the snd_soc_acpi data
structures is used to populate these.

One important point to note here is the use of the num field in
snd_soc_acpi_endpoint to address sof_sdw_dai_info array in the
sof_sdw_codec_info struct. This expects a one to one mapping between
endpoints on a device and dai infos. It would be fine for a specific
system to not specify an endpoint for all of the dai infos available,
but two endpoints mapping to the same dai info would make not sense.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: soc-acpi: Add missing cs42l43 endpoints
Charles Keepax [Tue, 26 Mar 2024 16:04:12 +0000 (11:04 -0500)]
ASoC: intel: soc-acpi: Add missing cs42l43 endpoints

Currently the cs42l43 just specifies a single endpoint, as the current
machine driver only looks at the first endpoint specified. Future
refactoring will process all endpoints, as such proper specification
should be added for all the cs42l43 endpoints.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Remove no longer supported quirk
Charles Keepax [Tue, 26 Mar 2024 16:04:11 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Remove no longer supported quirk

The SOF_SDW_NO_AGGREGATION quirk is mostly for debug and no longer works
correctly with the current state of the machine driver. Remove it from
the code and add an error message if someone uses it.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: soc-acpi-intel-arl-match: Add rt711 sdca codec support
Balamurugan C [Tue, 26 Mar 2024 16:04:10 +0000 (11:04 -0500)]
ASoC: Intel: soc-acpi-intel-arl-match: Add rt711 sdca codec support

Adding rt711 sdca codec support for arl boards.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Factor out codec name generation
Charles Keepax [Tue, 26 Mar 2024 16:04:09 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Factor out codec name generation

In preparation for future refactoring pull out a helper specifically for
generating the codec name.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Factor out BlueTooth DAI creation
Charles Keepax [Tue, 26 Mar 2024 16:04:08 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Factor out BlueTooth DAI creation

Factor out the creation of the BlueTooth DAI links into a helper
function.  No functional change.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Factor out HDMI DAI creation
Charles Keepax [Tue, 26 Mar 2024 16:04:07 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Factor out HDMI DAI creation

Factor out the creation of the HDMI DAI links into a helper function.
No functional change.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Factor out DMIC DAI creation.
Charles Keepax [Tue, 26 Mar 2024 16:04:06 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Factor out DMIC DAI creation.

Factor out the creation of the DMIC DAI links into a helper function.
No functional change.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Factor out SSP DAI creation
Charles Keepax [Tue, 26 Mar 2024 16:04:05 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Factor out SSP DAI creation

Factor out the creation of the SSP DAI links into a helper function. No
functional change.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Use for_each_set_bit
Charles Keepax [Tue, 26 Mar 2024 16:04:04 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Use for_each_set_bit

Rather than open coding a loop to process each bit use for_each_set_bit.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Only pass dai_link pointer around
Charles Keepax [Tue, 26 Mar 2024 16:04:03 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Only pass dai_link pointer around

Rather than passing around a pointer to the dai_link array and
an index into this array, simply pass a pointer to the current
dai_link. Also move the DAI link pointer sanity check to the end
of the DAI link creation, and change it to a warn on. This check
should only be hit if there is a serious bug in the machine driver,
so checking it on each iteration is excessive.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move flags to private struct
Charles Keepax [Tue, 26 Mar 2024 16:04:02 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move flags to private struct

Move the flags ignore_pch_dmic and append_dai_type into the drivers
private structure rather than passing them around between functions.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move get_codec_dai_by_name() into sof_sdw itself
Charles Keepax [Tue, 26 Mar 2024 16:04:01 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move get_codec_dai_by_name() into sof_sdw itself

Currently sof_sdw relies on sof_board_helpers to provide
get_codec_dai_by_name(), but that is the only function from
sof_board_helpers it uses and no other machine driver requires
that function. There is no reason for sof_sdw to select SSP_COMMON
but more and more functions in sof_board_helpers are gaining
dependencies on functions that would require stubs for sof_sdw to
build without it.  Firstly it was sof_ssp_get_codec_name(), as was
fixed in commit c1469c3a8a30 ("ASoC: Intel: ssp-common: Add stub for
sof_ssp_get_codec_name"), now it is:

ERROR: modpost: "sof_ssp_detect_amp_type"
[sound/soc/intel/boards/snd-soc-intel-sof-board-helpers.ko] undefined!
ERROR: modpost: "sof_ssp_detect_codec_type"
[sound/soc/intel/boards/snd-soc-intel-sof-board-helpers.ko] undefined!

Rather than adding more stubs, simply move the affected function
to the sof_sdw machine driver itself and no longer select
SND_SOC_INTEL_SOF_BOARD_HELPERS at all. This should allow work on
SSP_COMMON to progress without affecting sof_sdw.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Set channel map directly from endpoints
Charles Keepax [Tue, 26 Mar 2024 16:04:00 +0000 (11:04 -0500)]
ASoC: intel: sof_sdw: Set channel map directly from endpoints

The current code evenly distributes the CODEC DAIs across the CPU
DAIs in the DAI link, but this is just an assumption about how the
devices are connected to the host. All the information about which
CODEC is connected to which CPU DAI is contained in the endpoints
datastructures and those structures are already parsed to work out
which CODECs to include in the DAI link. Simply fill in the mapping
from CPUs -> CODECs as we parse through the endpoints structures,
this will ensure that mapping matches the physical layout.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Only pass codec_conf pointer around
Charles Keepax [Tue, 26 Mar 2024 16:03:59 +0000 (11:03 -0500)]
ASoC: intel: sof_sdw: Only pass codec_conf pointer around

Rather than passing around a pointer to the codec_conf array, an index
into it and a size, simply pass around a pointer to the current codec_conf.
This reduces the amount of state moving around.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Make find_codec_info_dai() return a pointer
Charles Keepax [Tue, 26 Mar 2024 16:03:58 +0000 (11:03 -0500)]
ASoC: intel: sof_sdw: Make find_codec_info_dai() return a pointer

Rather than returning an index simply return a pointer to the
located codec info, this simplifies all the callers which only
want to access the codec info structure. Also remove the inline
specifier the function is fairly large for an inline function,
let the compiler decide. And move the function such that it is
located with the other find_codec_info_*() functions.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Make find_codec_info_acpi() return a pointer
Charles Keepax [Tue, 26 Mar 2024 16:03:57 +0000 (11:03 -0500)]
ASoC: intel: sof_sdw: Make find_codec_info_acpi() return a pointer

Rather than returning an index simply return a pointer to the
located codec info, this simplifies all the callers which only
want to access the codec info structure. Also remove the inline
specifier the function is fairly large for an inline function,
let the compiler decide.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Make find_codec_info_part() return a pointer
Charles Keepax [Tue, 26 Mar 2024 16:03:56 +0000 (11:03 -0500)]
ASoC: intel: sof_sdw: Make find_codec_info_part() return a pointer

Rather than returning an index simply return a pointer to the
located codec info, this simplifies all the callers which only
want to access the codec info structure. Also remove the inline
specifier the function is fairly large for an inline function,
let the compiler decide.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: Add RK3308 internal audio codec driver
Luca Ceresoli [Tue, 5 Mar 2024 14:36:31 +0000 (15:36 +0100)]
ASoC: codecs: Add RK3308 internal audio codec driver

Add driver for the internal audio codec of the Rockchip RK3308 SoC.

Initially based on the vendor kernel driver [0], with lots of cleanups,
fixes, improvements, conversion to DAPM and removal of some features.

[0] https://github.com/rockchip-linux/kernel/blob/develop-4.19/sound/soc/codecs/rk3308_codec.c

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://msgid.link/r/20240305-rk3308-audio-codec-v4-4-312acdbe628f@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: core: add SOC_DOUBLE_RANGE_TLV() helper macro
Luca Ceresoli [Tue, 5 Mar 2024 14:36:30 +0000 (15:36 +0100)]
ASoC: core: add SOC_DOUBLE_RANGE_TLV() helper macro

No macro currently allows handling a stereo control that has left and right
in the same register and whose minimum register value is not zero. Add one
that does that.

Note that even though the snd_soc_*_volsw_range() look more appropriate
given the _range suffix, they are not suitable because they don't honor the
two shift values. The snd_soc_*_volsw() look more generic and are suitable
for the task.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://msgid.link/r/20240305-rk3308-audio-codec-v4-3-312acdbe628f@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: Add Rockchip RK3308 internal audio codec
Luca Ceresoli [Tue, 5 Mar 2024 14:36:29 +0000 (15:36 +0100)]
ASoC: dt-bindings: Add Rockchip RK3308 internal audio codec

Add device tree bindings document for the internal audio codec of the
Rockchip RK3308 SoC.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://msgid.link/r/20240305-rk3308-audio-codec-v4-2-312acdbe628f@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoAdd support for jack detection to codec present in
Mark Brown [Tue, 26 Mar 2024 14:11:34 +0000 (14:11 +0000)]
Add support for jack detection to codec present in

Merge series from Ondřej Jirman <megi@xff.cz>:

This series adds support for jack detection to this codec. I used
and tested this on Pinephone. It works quite nicely. I tested it
against Android headset mic button resistor specification.

The patches are a rewritten and debugged version of the original
ones from Arnaud Ferraris and Samuel Holland, improved to better
handle headset button presses and with more robust plug-in/out
event debouncing, and to use set_jack API instead of sniffing
the sound card widget names, to detect the type of jack connector.

5 months agoASoC: codecs: ES8326: Reducin powerconsumption and
Mark Brown [Tue, 26 Mar 2024 14:11:23 +0000 (14:11 +0000)]
ASoC: codecs: ES8326: Reducin powerconsumption and

Merge series from Zhang Yi <zhangyi@everest-semi.com>:

We changed the configuration related to hibernation.
and delete the REG_SUPPLY to cover mute issue.