platform/kernel/linux-starfive.git
19 months agoASoC: dt-bindings: fsl-sai: Sort main section properties
Marek Vasut [Fri, 4 Nov 2022 16:03:15 +0000 (17:03 +0100)]
ASoC: dt-bindings: fsl-sai: Sort main section properties

Sort main section properties, no functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221104160315.213836-3-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: dt-bindings: fsl-sai: Use minItems 5 for i.MX8MN clock and similar
Marek Vasut [Fri, 4 Nov 2022 16:03:14 +0000 (17:03 +0100)]
ASoC: dt-bindings: fsl-sai: Use minItems 5 for i.MX8MN clock and similar

The i.MX8MN currently uses "bus", "mclk0", "mclk1", "mclk2", "mclk3"
clock, which adds up to 5 clock total. Use minItems 5 for this setup.

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221104160315.213836-2-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: dt-bindings: fsl-sai: Fix mx6ul and mx7d compatible strings
Marek Vasut [Fri, 4 Nov 2022 16:03:13 +0000 (17:03 +0100)]
ASoC: dt-bindings: fsl-sai: Fix mx6ul and mx7d compatible strings

Describe existing used combinations of compatible strings on MX6UL
and MX7D, which are backward compatible with MX6SX. Add the missing
imx7d-sai compatible string which is used on i.MX7 .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221104160315.213836-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: codecs: da7219: Do not export da7219_aad_jack_det()
Mark Brown [Thu, 10 Nov 2022 17:50:21 +0000 (17:50 +0000)]
ASoC: codecs: da7219: Do not export da7219_aad_jack_det()

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Goal of the series is to drop any usage of the internal function.

First, update all users to utilize component->set_jack() and then remove
the relevant EXPORT_SYMBOL_GPL.

19 months agoASoC: SOF: ipc4-topology: Add widget queue support
Mark Brown [Thu, 10 Nov 2022 17:50:14 +0000 (17:50 +0000)]
ASoC: SOF: ipc4-topology: Add widget queue support

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

with SOF topology2 for IPC4, widgets might have mutliple queues they can be
connected.
The queues to use between components are descibed in the topology file.

This series adds widget queue support (specify which pin to connect) for
ipc4-topology with topology2.

Note: currently queue 0 of a widget is used as hardwired default.

19 months agoASoC: simpe-card/audio-graph fixups
Mark Brown [Thu, 10 Nov 2022 17:50:07 +0000 (17:50 +0000)]
ASoC: simpe-card/audio-graph fixups

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

These are simpe-card/audio-graph fixup patches.

19 months agoAdjust usage of rt5682(s) power supply properties
Mark Brown [Thu, 10 Nov 2022 17:50:00 +0000 (17:50 +0000)]
Adjust usage of rt5682(s) power supply properties

Merge series from Nícolas F. R. A. Prado <nfraprado@collabora.com>:

This series sets straight the usage of power supply properties for the
rt5682 and rt5682s audio codecs.

These properties were already being used by sc7180-trogdor.dtsi (and
derived DTs like sc7180-trogdor-kingoftown.dtsi).

We start by documenting the power supplies that are already in use and
then add few others that were missing to the bindings.

Then we update the drivers to also support the new supplies.

Finally we update the trogdor DTs so they have the newly added but
required supplies and remove a superfluous one that was causing
warnings.

19 months agoASoC: SOF: get pipeline instance id from pipe_widget->instance_id
Mark Brown [Thu, 10 Nov 2022 17:49:54 +0000 (17:49 +0000)]
ASoC: SOF: get pipeline instance id from pipe_widget->instance_id

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

Currently we set pipeline instance id = swidget->pipeline_id, but
pipeline_id is from topology and can be any number. In fact, the
number of pipelines is limited. This patch use ida to allocate pipeline
instance id and will be used for pipeline instance id in the IPC
message.

19 months agoASoC: SOF: Intel: update D0i3 registers for MTL
Mark Brown [Thu, 10 Nov 2022 17:49:48 +0000 (17:49 +0000)]
ASoC: SOF: Intel: update D0i3 registers for MTL

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

MeteorLake relies on a different register for D0i3 configuration, add
a platform-specific callback to abstract the differences.

19 months agoASoC: mediatek: Register machine drivers to module device table
Mark Brown [Thu, 10 Nov 2022 17:49:41 +0000 (17:49 +0000)]
ASoC: mediatek: Register machine drivers to module device table

Merge series from Nícolas F. R. A. Prado <nfraprado@collabora.com>:

Some ASoC machine drivers for MediaTek platforms were not being
registered to the module device table, preventing them to be
automatically loaded when built as modules. This series adds the missing
registration to the drivers.

19 months agoASoC: mediatek: mt8195-mt6359: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:37 +0000 (11:04 -0500)]
ASoC: mediatek: mt8195-mt6359: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-10-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: mt8192-mt6359: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:36 +0000 (11:04 -0500)]
ASoC: mediatek: mt8192-mt6359: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-9-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: mt8186-rt5682: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:35 +0000 (11:04 -0500)]
ASoC: mediatek: mt8186-rt5682: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-8-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: mt8186-da7219: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:34 +0000 (11:04 -0500)]
ASoC: mediatek: mt8186-da7219: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-7-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: mt8183-mt6358: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:33 +0000 (11:04 -0500)]
ASoC: mediatek: mt8183-mt6358: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-6-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: mt8183-da7219: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:32 +0000 (11:04 -0500)]
ASoC: mediatek: mt8183-da7219: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-5-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: mt6797-mt6351: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:31 +0000 (11:04 -0500)]
ASoC: mediatek: mt6797-mt6351: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-4-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: mt2701-wm8960: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:30 +0000 (11:04 -0500)]
ASoC: mediatek: mt2701-wm8960: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-3-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: mt2701-cs42448: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:29 +0000 (11:04 -0500)]
ASoC: mediatek: mt2701-cs42448: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-2-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: ipc4: get pipeline instance id from pipe_widget->instance_id
Bard Liao [Tue, 8 Nov 2022 00:29:10 +0000 (08:29 +0800)]
ASoC: SOF: ipc4: get pipeline instance id from pipe_widget->instance_id

Currently we set pipeline instance id = swidget->pipeline_id, but
pipeline_id is from topology and can be any number. In fact, the
number of pipelines is limited. This patch use ida to allocate pipeline
instance id and will be used for pipeline instance id in the IPC
message.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221108002910.2819709-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: ipc4-loader: get max pipeline number
Bard Liao [Tue, 8 Nov 2022 00:29:09 +0000 (08:29 +0800)]
ASoC: SOF: ipc4-loader: get max pipeline number

Get max pipeline number from firmware configuration.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221108002910.2819709-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: ipc4-topology: rename sof_ipc4_widget_free_comp
Bard Liao [Tue, 8 Nov 2022 00:29:08 +0000 (08:29 +0800)]
ASoC: SOF: ipc4-topology: rename sof_ipc4_widget_free_comp

sof_ipc4_widget_free_comp is dedicated to pipeline. Rename it
to sof_ipc4_widget_free_comp_pipeline.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221108002910.2819709-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: Intel: set d0i3 register with d0i3_offset
Rander Wang [Mon, 7 Nov 2022 16:41:54 +0000 (10:41 -0600)]
ASoC: SOF: Intel: set d0i3 register with d0i3_offset

Set the d0i3 with d0i3_offset for different platforms

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221107164154.21925-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: Intel: add d0i3_offset in chip_info
Rander Wang [Mon, 7 Nov 2022 16:41:53 +0000 (10:41 -0600)]
ASoC: SOF: Intel: add d0i3_offset in chip_info

MTL has different d0i3 offset compared to cavs platforms.
Use d0i3_offset to unify the setting.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221107164154.21925-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: Intel: add d0i3 definition for MTL
Rander Wang [Mon, 7 Nov 2022 16:41:52 +0000 (10:41 -0600)]
ASoC: SOF: Intel: add d0i3 definition for MTL

MTL has a different offset of d0i3 compared to cavs platforms.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221107164154.21925-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: rt5682: Support DBVDD and LDO1-IN supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:20:00 +0000 (14:20 -0400)]
ASoC: rt5682: Support DBVDD and LDO1-IN supplies

Add support for the DBVDD and LDO1-IN supplies.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20221102182002.255282-7-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: rt5682s: Support DBVDD and LDO1-IN supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:19:59 +0000 (14:19 -0400)]
ASoC: rt5682s: Support DBVDD and LDO1-IN supplies

Add support for the DBVDD and LDO1-IN supplies.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20221102182002.255282-6-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: dt-bindings: rt5682: Add DBVDD and LDO1-IN supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:19:58 +0000 (14:19 -0400)]
ASoC: dt-bindings: rt5682: Add DBVDD and LDO1-IN supplies

The rt5682 codec has two additional power supply pins, DBVDD and
LDO1_IN, that aren't currently described in the binding. Add them.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221102182002.255282-5-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: dt-bindings: rt5682: Add AVDD, MICVDD and VBAT supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:19:57 +0000 (14:19 -0400)]
ASoC: dt-bindings: rt5682: Add AVDD, MICVDD and VBAT supplies

The rt5682 codec has three supplies - AVDD, MICVDD and VBAT - which are
already used by sc7180-trogdor.dtsi. Document them in the binding.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20221102182002.255282-4-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: dt-bindings: realtek,rt5682s: Add DBVDD and LDO1-IN supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:19:56 +0000 (14:19 -0400)]
ASoC: dt-bindings: realtek,rt5682s: Add DBVDD and LDO1-IN supplies

The rt5682s codec has two additional power supply pins, DBVDD and
LDO1_IN, that aren't currently described in the binding. Add them.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221102182002.255282-3-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: dt-bindings: realtek,rt5682s: Add AVDD and MICVDD supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:19:55 +0000 (14:19 -0400)]
ASoC: dt-bindings: realtek,rt5682s: Add AVDD and MICVDD supplies

The rt5682s codec has two supplies - AVDD and MICVDD - which are already
used by sc7180-trogdor-kingoftown.dtsi. Document them in the binding.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20221102182002.255282-2-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: Intel: hda-loader: use small buffer for iccmax stream
Kai Vehmanen [Mon, 7 Nov 2022 07:26:21 +0000 (09:26 +0200)]
ASoC: SOF: Intel: hda-loader: use small buffer for iccmax stream

The data received via iccmax stream is not used anywhere, so no need to
allocate a big DMA buffer for it. This is especially important as the
allocation is done even in cases where reload of the firmware is skipped
and execution happens directly from the firmware stored in IMR.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter 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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221107072621.28904-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: ipc4-topology: Implement tear_down_all_pipelines callback
Peter Ujfalusi [Mon, 7 Nov 2022 08:41:58 +0000 (10:41 +0200)]
ASoC: SOF: ipc4-topology: Implement tear_down_all_pipelines callback

During system suspend there is a chance that the running stream undergo
an xrun and instead of the expected SNDRV_PCM_TRIGGER_SUSPEND trigger
we will receive SNDRV_PCM_TRIGGER_STOP.

The handling of SUSPEND and STOP triggers differ that case of the later
the sof_pcm_stream_free() will be called with free_widget_list = false.
But we must make sure that all active widgets and streams are free before
entering suspend in order to be able to resume without error.

We can utilize the tear_down_all_pipelines to put the system to an expected
state and to fix the suspend/resume error.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221107084158.26629-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: mt8183-mt6358: Register to module device table
Nícolas F. R. A. Prado [Fri, 4 Nov 2022 21:24:08 +0000 (17:24 -0400)]
ASoC: mediatek: mt8183-mt6358: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221104212409.603970-2-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: mt8183-da7219: Register to module device table
Nícolas F. R. A. Prado [Fri, 4 Nov 2022 21:24:07 +0000 (17:24 -0400)]
ASoC: mediatek: mt8183-da7219: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221104212409.603970-1-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: codecs: da7219: Do not export internal symbols
Amadeusz Sławiński [Mon, 31 Oct 2022 16:02:27 +0000 (17:02 +0100)]
ASoC: codecs: da7219: Do not export internal symbols

With all users utilizing component->set_jack(), there is no need to
export da7219_aad_jack_det() function.

While at it, remove exports from all other functions as well.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: Intel: avs: Drop da7219_aad_jack_det() usage
Cezary Rojewski [Mon, 31 Oct 2022 16:02:26 +0000 (17:02 +0100)]
ASoC: Intel: avs: Drop da7219_aad_jack_det() usage

Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: amd: Drop da7219_aad_jack_det() usage
Cezary Rojewski [Mon, 31 Oct 2022 16:02:25 +0000 (17:02 +0100)]
ASoC: amd: Drop da7219_aad_jack_det() usage

Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: rockchip: Drop da7219_aad_jack_det() usage
Cezary Rojewski [Mon, 31 Oct 2022 16:02:24 +0000 (17:02 +0100)]
ASoC: rockchip: Drop da7219_aad_jack_det() usage

Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: Drop da7219_aad_jack_det() usage
Cezary Rojewski [Mon, 31 Oct 2022 16:02:23 +0000 (17:02 +0100)]
ASoC: mediatek: Drop da7219_aad_jack_det() usage

Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: Intel: Drop da7219_aad_jack_det() usage
Cezary Rojewski [Mon, 31 Oct 2022 16:02:22 +0000 (17:02 +0100)]
ASoC: Intel: Drop da7219_aad_jack_det() usage

Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: codecs: da7219: Introduce set_jack() callback
Amadeusz Sławiński [Mon, 31 Oct 2022 16:02:21 +0000 (17:02 +0100)]
ASoC: codecs: da7219: Introduce set_jack() callback

Codec driver for da7219 implements jack detect functionality, but does
not integrate it with the framework. Platform component drivers are
accessing the functionality through internal da7219_aad_jack_det()
instead.

Address this by implementing set_jack() for the codec.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: topology: Add helper to get/put widget queue id
Chao Song [Mon, 7 Nov 2022 08:57:06 +0000 (10:57 +0200)]
ASoC: SOF: topology: Add helper to get/put widget queue id

Add get/put queue id helper to manage queue id in route
setup and route free.

The queue allocation rules are:

  - If widget only has one sink/source pin, zero will be
returned as the queue ID directly.

  - If widget has more than one sink/source pins, and pin
binding array is defined in topology, queue ID will be
allocated according to the pin binding array.

  - If widget has more than one sink/sink pins, and pin
binding array is not defined, Linux ID allocation will be
used to allocate queue ID dynamically.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221107085706.2550-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: Add support to parse pin binding array from topology
Chao Song [Mon, 7 Nov 2022 08:57:05 +0000 (10:57 +0200)]
ASoC: SOF: Add support to parse pin binding array from topology

Add support for parsing sink/source pin binding array
per widget from topology. The pin binding arrays will
be used to determine the source and sink queue IDs during
widget binding for widget that requires special pin binding.

An example of widget that requires special pin binding is
the smart amplifier widget, its feedback sink pin has to be
connected to a capture DAI copier for codec feedback, while
the other sink pin has to be connected to a host DAI copier.
Pin ID is required during widget binding for correct route setup.

Conversely, the pin ID for 'generic' pins is not defined in the
topology and will be allocated by the kernel dynamically. When
only one pin is supported, the pin ID shall always be zero. When
more than one pin is supported, the pin ID is determined with the
ID allocation mechanism in the kernel.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221107085706.2550-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: Add support for parsing the number of sink/source pins
Chao Song [Mon, 7 Nov 2022 08:57:04 +0000 (10:57 +0200)]
ASoC: SOF: Add support for parsing the number of sink/source pins

Add support for parsing the number of sink/source pins
per widget from topology. They will be used to determine
the sink/source queue IDs during widget binding.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221107085706.2550-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: audio-graph-card2: check also dpcm node for convert-xxx
Kuninori Morimoto [Tue, 1 Nov 2022 04:22:27 +0000 (04:22 +0000)]
ASoC: audio-graph-card2: check also dpcm node for convert-xxx

DPCM connection on Card2, its DT looks like below.
Current Card2 is checking (a)/(b) part only for convert-xxx settings.
But it is not useful. This patch enables its settings at (A)/(B) part
too. (A)/(B) settings will be overwritten (a)/(b) settings if it has.

<Image>       (A) (a)
Card2 <--+--> FE <---> CPU
 |
 +--> BE <---> Codec
      (B) (b)

<DT>
card2-sound {
...
links = <fe, be>; /* (A) (B) */
};

dpcm {
/* FE */
ports@0 {
/* (A) */
fe: port { fe_ep: endpoint { remote-endpoint = <&cpu_ep>; } };
};
/* BE */
ports@1 {
/* (B) */
be: port {
convert-rate = <44100>; /* This patch enables this */
be_ep: endpoint { remote-endpoint = <&codec_ep>; }
};
};
};

cpu {
/* CPU (a) */
port { cpu_ep: endpoint { remote-endpoint = <&fe_ep>; } };
};

codec {
/* Codec (b) */
port {
convert-rate = <48000>; /* (B) settings will be over written here */
codec_ep: endpoint { remote-endpoint = <&be_ep>; }
};
};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871qqn8fst.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: audio-graph-card2-custom-sample.dtsi: add convert-rate for DPCM (MIXer)
Kuninori Morimoto [Tue, 1 Nov 2022 04:22:09 +0000 (04:22 +0000)]
ASoC: audio-graph-card2-custom-sample.dtsi: add convert-rate for DPCM (MIXer)

audio-graph-card2-custom-sample.dtsi is assuming that
DPCM sample is MIXer connection.

FE BE
        ****
CPU3 -- *  * -- Codec3
CPU4 -- *  *
        ****

CPU3/CPU4 need to convert rate in this case.
This patch adds missing "convert-rate" setting sample for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8735b38fta.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: simple-card-utils: remove asoc_simple_convert_fixup()
Kuninori Morimoto [Tue, 1 Nov 2022 04:21:54 +0000 (04:21 +0000)]
ASoC: simple-card-utils: remove asoc_simple_convert_fixup()

No one is using asoc_simple_convert_fixup(), we don't need to
export its symbol. This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874jvj8ftp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: amd: fix ACP version typo mistake
syed saba kareem [Fri, 4 Nov 2022 12:09:07 +0000 (17:39 +0530)]
ASoC: amd: fix ACP version typo mistake

Pink Sardine is based on ACP6.3 architecture.
This patch fixes the typo mistake acp6.2 -> acp6.3

Signed-off-by: syed saba kareem <syed.sabakareem@amd.com>
Link: https://lore.kernel.org/r/20221104121001.207992-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoModify documentation and machine driver for mt8186_rt1019_rt5682s sound card
Mark Brown [Thu, 3 Nov 2022 16:23:39 +0000 (16:23 +0000)]
Modify documentation and machine driver for mt8186_rt1019_rt5682s sound card

Merge series from Ajye Huang <ajye_huang@compal.corp-partner.google.com>:

Support selecting between front and rear microphones on some of the
MediaTek platforms.

19 months agoASoC: Intel: cirrus-common: Make const array uid_strings static
Colin Ian King [Thu, 3 Nov 2022 12:06:24 +0000 (12:06 +0000)]
ASoC: Intel: cirrus-common: Make const array uid_strings static

Don't populate the read-only const array uid_strings on the stack but
instead make it static. Also makes the object code a little smaller.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20221103120624.72583-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: simple-mux: add read function
Maarten Zanders [Fri, 28 Oct 2022 19:13:01 +0000 (21:13 +0200)]
ASoC: simple-mux: add read function

During initialisation DAPM tries to read the state of the MUX
being connected, resulting in this error log:
input-mux: ASoC: error at soc_component_read_no_lock on input-mux: -5

Provide a read function which allows DAPM to read the state of the
MUX.

Signed-off-by: Maarten Zanders <maarten.zanders@mind.be>
Link: https://lore.kernel.org/r/20221028191303.166115-1-maarten.zanders@mind.be
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: tlv320aic3x: switch to using gpiod API
Dmitry Torokhov [Wed, 2 Nov 2022 23:20:04 +0000 (16:20 -0700)]
ASoC: tlv320aic3x: switch to using gpiod API

Switch the driver from legacy gpio API that is deprecated to the newer
gpiod API that respects line polarities described in ACPI/DT.

The driver still tries to support shared reset lines, by first trying to
allocate the reset GPIO normally, and then non-exclusively, although the
utility of such support is questionable, toggling reset line from one
driver/instance will result in all chips being reset, potentially at an
inopportune moment.

Note that this change depends on commit fbbbcd177a27 ("gpiolib: of: add
quirk for locating reset lines with legacy bindings") to translate
request for "reset" GPIO to the legacy name "gpio-reset" in case when
proper name is not used.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20221102232004.1721864-3-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: tlv320aic3x: remove support for platform data
Dmitry Torokhov [Wed, 2 Nov 2022 23:20:03 +0000 (16:20 -0700)]
ASoC: tlv320aic3x: remove support for platform data

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20221102232004.1721864-2-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoARM: omap2: n8x0: stop instantiating codec platform data
Dmitry Torokhov [Wed, 2 Nov 2022 23:20:02 +0000 (16:20 -0700)]
ARM: omap2: n8x0: stop instantiating codec platform data

As of 0426370b58b2 ("ARM: dts: omap2420-n810: Correct the audio codec
(tlv320aic33) node") the DTS properly specifies reset GPIO, and the
device name in auxdata lookup table does not even match the one in
device tree anymore, so stop instantiating it.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20221102232004.1721864-1-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: mt8186-rt5682: Modify machine driver for two DMICs case
Ajye Huang [Wed, 2 Nov 2022 12:59:36 +0000 (20:59 +0800)]
ASoC: mediatek: mt8186-rt5682: Modify machine driver for two DMICs case

Having two DMICs, a front DMIC and a Rear DMIC,
but only host audio input AUX port0 is used for these two Dmics.
A "dmic-gpios" property is used for a mixer control to switch
the dmic signal source between the Front and Rear Dmic.

Refer to this one as an example,
commit 3cfbf07c6d27
("ASoC: qcom: sc7180: Modify machine driver for 2mic")

Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221102125936.2176748-3-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: mediatek: dt-bindings: modify machine bindings for two MICs case
Ajye Huang [Wed, 2 Nov 2022 12:59:35 +0000 (20:59 +0800)]
ASoC: mediatek: dt-bindings: modify machine bindings for two MICs case

Add a property "dmic-gpios" for switching between two MICs.

Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221102125936.2176748-2-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: Intel: hda-codec: fix possible memory leak in hda_codec_device_init()
Yang Yingliang [Fri, 21 Oct 2022 12:38:49 +0000 (20:38 +0800)]
ASoC: SOF: Intel: hda-codec: fix possible memory leak in hda_codec_device_init()

If snd_hdac_device_register() fails, 'codec' and name allocated in
dev_set_name() called in snd_hdac_device_init() are leaked. Fix this
by calling put_device(), so they can be freed in snd_hda_codec_dev_release()
and kobject_cleanup().

Fixes: 829c67319806 ("ASoC: SOF: Intel: Introduce HDA codec init and exit routines")
Fixes: dfe66a18780d ("ALSA: hdac_ext: add extended HDA bus")
Suggested-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20221021123849.456857-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: Intel: Skylake: fix possible memory leak in skl_codec_device_init()
Yang Yingliang [Fri, 21 Oct 2022 12:38:48 +0000 (20:38 +0800)]
ASoC: Intel: Skylake: fix possible memory leak in skl_codec_device_init()

If snd_hdac_device_register() fails, 'codec' and name allocated in
dev_set_name() called in snd_hdac_device_init() are leaked. Fix this
by calling put_device(), so they can be freed in snd_hda_codec_dev_release()
and kobject_cleanup().

Fixes: e4746d94d00c ("ASoC: Intel: Skylake: Introduce HDA codec init and exit routines")
Fixes: dfe66a18780d ("ALSA: hdac_ext: add extended HDA bus")
Suggested-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221021123849.456857-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoAdd support for MICFIL on i.MX93 platform
Mark Brown [Tue, 1 Nov 2022 14:33:10 +0000 (14:33 +0000)]
Add support for MICFIL on i.MX93 platform

Merge series from Chancel Liu <chancel.liu@nxp.com>:

This patchset supports MICFIL on i.MX93 platform.

19 months agoASoC: fsl_micfil: Add support when using eDMA
Chancel Liu [Fri, 28 Oct 2022 08:27:50 +0000 (16:27 +0800)]
ASoC: fsl_micfil: Add support when using eDMA

On i.MX93 platform MICFIL uses eDMA. The maxburst should be set to the
number of channels in eDMA multiple FIFO mode.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20221028082750.991822-4-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: fsl_micfil: Add support for i.MX93 platform
Chancel Liu [Fri, 28 Oct 2022 08:27:49 +0000 (16:27 +0800)]
ASoC: fsl_micfil: Add support for i.MX93 platform

Add compatible string and specific soc data to support MICFIL on i.MX93
platform.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20221028082750.991822-3-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: dt-bindings: fsl,micfil: Add compatible string for i.MX93 platform
Chancel Liu [Fri, 28 Oct 2022 08:27:48 +0000 (16:27 +0800)]
ASoC: dt-bindings: fsl,micfil: Add compatible string for i.MX93 platform

Add compatible string "fsl,imx93-micfil" for i.MX93 platform

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221028082750.991822-2-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: cs42xx8-i2c.c: add module device table for of
Peter Bergin [Mon, 31 Oct 2022 20:37:23 +0000 (21:37 +0100)]
ASoC: cs42xx8-i2c.c: add module device table for of

When trying to connect the device with the driver through
device-tree it is not working. The of_device_id is defined in
cs42xx8.c but is not correctly included in cs42xx8-i2c.c.

Move of_device_id table to cs42xx8-i2c.c. Get cs42xx8_driver_data
in cs42xx8_i2c_probe() and pass as argument to cs42xx8_probe(). Move
error check if no driver data found to cs42xx8_i2c_probe().

Signed-off-by: Peter Bergin <peter@berginkonsult.se>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221031203723.168177-1-peter@berginkonsult.se
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: fix compilation issue with readb/writeb helpers
Pierre-Louis Bossart [Mon, 31 Oct 2022 19:53:40 +0000 (15:53 -0400)]
ASoC: SOF: fix compilation issue with readb/writeb helpers

Replace them with read8/write8 to avoid compilation issue on ARM. In
hindsight this is more consistent with the read64/write64 helpers
already used in SOF.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/alsa-devel/Y1rTFrohLqaiZAy%2F@dev-arch.thelio-3990X/
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221031195340.249868-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: jz4740-i2s: Remove .set_sysclk() & friends
Mark Brown [Mon, 31 Oct 2022 18:48:38 +0000 (18:48 +0000)]
ASoC: jz4740-i2s: Remove .set_sysclk() & friends

Merge series from Aidan MacDonald <aidanmacdonald.0x0@gmail.com>:

A quick series to get rid of .set_sysclk() from jz4740-i2s.
It wasn't used in practice so this shouldn't be troublesome for anyone,
and fortunately there aren't any backward compatibility concerns.

The actual rationale for removing it, as opposed to fixing the
issues of the current DT bindings and implementation, is provided
in the dt-bindings patch.

19 months agoASoC: SOF: client-probes: Add support for IPC4
Mark Brown [Mon, 31 Oct 2022 18:48:31 +0000 (18:48 +0000)]
ASoC: SOF: client-probes: Add support for IPC4

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

The probes (the ability of probing the audio data from firmware processing
points or to receive stream of debug/trace information) is supported by IPC4
as well, but due to the differences between the two IPC version the low level
setup and information we need for probing is different.

This series will extend the existing probes support for IPC3 with IPC4 'backend'

19 months agoASoC: soc-utils: Remove __exit for snd_soc_util_exit()
Chen Zhongjin [Mon, 31 Oct 2022 13:40:31 +0000 (21:40 +0800)]
ASoC: soc-utils: Remove __exit for snd_soc_util_exit()

snd_soc_util_exit() is called in __init snd_soc_init() for cleanup.
Remove the __exit annotation for it to fix the build warning:

WARNING: modpost: sound/soc/snd-soc-core.o: section mismatch in reference: init_module (section: .init.text) -> snd_soc_util_exit (section: .exit.text)

Fixes: 6ec27c53886c ("ASoC: core: Fix use-after-free in snd_soc_exit()")
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
Link: https://lore.kernel.org/r/20221031134031.256511-1-chenzhongjin@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: IPC4: probes: Implement IPC4 ops for probes client device
Jyri Sarha [Mon, 31 Oct 2022 10:51:41 +0000 (12:51 +0200)]
ASoC: SOF: IPC4: probes: Implement IPC4 ops for probes client device

Implement IPC operations for IPC4 messaging and add doxygen
documentation for the functions.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: client: Add sof_client_ipc4_find_module() function
Jyri Sarha [Mon, 31 Oct 2022 10:51:40 +0000 (12:51 +0200)]
ASoC: SOF: client: Add sof_client_ipc4_find_module() function

Add sof_client_ipc4_find_module() for calling
sof_ipc4_find_module_by_uuid() in sof client code.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: client: Add sof_client_ipc_set_get_data()
Jyri Sarha [Mon, 31 Oct 2022 10:51:39 +0000 (12:51 +0200)]
ASoC: SOF: client: Add sof_client_ipc_set_get_data()

No need to duplicate set_get_data msg handling in clients.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: probes: Separate IPC3 operations to a separate file
Jyri Sarha [Mon, 31 Oct 2022 10:51:38 +0000 (12:51 +0200)]
ASoC: SOF: probes: Separate IPC3 operations to a separate file

Declare an IPC ops struct for probes client device and move IPC3
functions behind it.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: SOF: probes: Replace [0] union members with DECLARE_FLEX_ARRAY()
Jyri Sarha [Mon, 31 Oct 2022 10:51:37 +0000 (12:51 +0200)]
ASoC: SOF: probes: Replace [0] union members with DECLARE_FLEX_ARRAY()

Replace probes related [0] arrays, all found within unions, with
DECLARE_FLEX_ARRAY() declarations.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: ingenic: Remove unnecessary clocks from schema
Aidan MacDonald [Fri, 28 Oct 2022 10:34:16 +0000 (11:34 +0100)]
ASoC: ingenic: Remove unnecessary clocks from schema

The AIC needs only the first two clocks: "aic" is a gate that's used
for gating the I2S controller when it's suspended, and "i2s" is the
system clock, from which the bit and frame clocks are derived. Both
clocks are therefore reasonably part of the AIC and should be passed
to the OS.

But the "ext" and "pll half" clocks are a little more questionable.
It appears these bindings were introduced when the schema was first
converted to YAML, but weren't present in the original .txt binding.
They are intended to be the possible parent clocks of "i2s".

The JZ4770 actually has three parents for its "i2s" clock, named
"ext", "pll0", and "pll1" in the Linux driver. The JZ4780 has two
parents but it doesn't have a "pll half" clock, instead it has an
"i2s_pll" clock which behaves much differently to the actual
"pll half" clock found on the JZ4740 & JZ4760. And there are other
Ingenic SoCs that share the JZ4780's clock layout, eg, the X1000.

Therefore, the bindings aren't really adequate for the JZ4770 and
a bit misleading for the JZ4780. Either we should fix the bindings,
or remove them entirely.

This patch opts to remove the bindings. There is a good case to be
made that "ext" and "pll half" don't belong here because they aren't
directly used by the AIC. They are only used to set the parent of
the "i2s" clock; they have no other effect on the AIC.

A good way to think of it is in terms of how the AIC constrains
clocks. The AIC can only generate the bit & frame clocks from the
system clock in certain ratios. Setting the sample rate effectively
constrains the frame clock, which, because of the clock dividers
controlled by the AIC, translates to constraints on the "i2s" clock.
Nothing in the AIC imposes a direct constraint on the parents of
the "i2s" clock, and the AIC does not need to enable or disable
the parents directly, so in principle the AIC doesn't need to be
aware of the parent clocks at all.

The choice of parent clock is still important, but the AIC doesn't
have enough information to apply such constraints itself. The sound
card does have that information because it knows how the AIC is
connected to other components. We need to use other DT mechanisms
to communicate those constraints at the sound card level, instead
of passing the clocks through to the AIC, and inventing ad-hoc ways
to plumb the constraints around behind the scenes.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20221028103418.17578-2-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: jz4740-i2s: Remove .set_sysclk()
Aidan MacDonald [Fri, 28 Oct 2022 10:34:18 +0000 (11:34 +0100)]
ASoC: jz4740-i2s: Remove .set_sysclk()

.set_sysclk() is effectively unused here. No machine drivers use
jz4740-i2s; and JZ4740_I2S_CLKSRC_EXT is the only selectable clock
source with simple-card, but that is also the default source and
has a fixed frequency, so configuring it would be redundant.

simple-card ignores -ENOTSUPP error codes when setting the sysclock,
so any device trees that do set the sysclock for some reason should
still work.

It's still possible to configure the clock parent manually in the
device tree and control frequency using other simple-card options,
so at the end of the day there's no real loss in functionality.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20221028103418.17578-4-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: add multi-port, SAL and MFC support
Mark Brown [Fri, 28 Oct 2022 19:23:31 +0000 (20:23 +0100)]
ASoC: qdsp6: audioreach: add multi-port, SAL and MFC support

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

This patchset adds support to multi-port connections between AudioReach Modules
which is required for sophisticated graphs like ECNS or Speaker Protection.
Also as part of ECNS testing new module support for SAL and MFC are added.

Tested on SM8450 with ECNS.

20 months agoASoC: SOF: Intel: HDA: refactor codec and multi-link suport
Mark Brown [Fri, 28 Oct 2022 18:52:20 +0000 (19:52 +0100)]
ASoC: SOF: Intel: HDA: refactor codec and multi-link suport

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

Existing HDaudio controllers expose an HDAudio DMA which is used to
interface with HDaudio codecs. All other interfaces supported by Intel
(SoundWire, SSP, DMIC) rely for data transfers on another GP-DMA
managed by the DSP firmware - the HDaudio DMA is only used for
memory-to-DSP transfers.

New HDaudio extensions will enable the use of this HDaudio DMA for all
of SoundWire, SSP, DMIC. These extensions will be backwards-compatible
for HDaudio and iDISP codecs, but will require new programming
sequences and DAI callbacks for SoundWire, SSP and DMIC.

Before we add support for 'extended audio links' and the programming
sequences for the DMA, we need to refactor the code. All HDaudio codec
support needs to be well identified in a separate file, and likewise
all the 'multi-link' handling needs to be better split.

This patchset removes a number of 'old' Kconfig dependencies and
options, adds helpers with a fallback to remove IS_ENABLED checks in
the code and tries to simplify programming sequences when possible.

One indirect benefit from this refactoring is that developers can
switch with a kernel parameter from HDaudio support to a variant of
'nocodec' support. This proves extremely useful to test on existing
Intel RVPs and Up boards, where the same build can be used to check 3
interfaces (HDaudio, SSP, DMIC) by just removing modules, setting the
kernel parameter and reloading modules.

20 months agoASoC: Intel: avs: PCM power management
Mark Brown [Fri, 28 Oct 2022 16:40:22 +0000 (17:40 +0100)]
ASoC: Intel: avs: PCM power management

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Goal of the series is implementation of suspend/resume operations for a
PCM stream along with all the collaterals connected to the subject.

Start with splitting avs_dai_fe_hw_free() as ideally we would like to
reuse as much of existing code as possible but snd_pcm_lib_free_pages()
is not desired part of the function when speaking of suspend operation.

The actual implementation of suspend/resume() for component drivers
follows. For most scenarios, the PM flow is similar to standard
streaming one, except for the part where the position register are being
saved and the lack of PCM pages freeing. To reduce code duplication, all
avs_dai_suspend_XXX() and avs_dai_resume_XXX() functions reuse their
non-PM equivalents.
Order of operations is affected by the fact that path binding/unbinding
happens only in FE part of the stream.

Above essentially unlocks SX+streaming scenarios i.e.: power transitions
with an ongoing stream.

As some streams are allowed to run in low power state, support is
provided for S0iX state. The handlers check ACPI capabilities and the
number of active low-power paths before deciding between SX and S0iX
flows.

The last portion of the patchset is addition of power/clock gating
overrides. There is no single set of registers that ensures AudioDSP
firmware loads 100% of time on every single configuration. By having
them exposed, user can have the loading procedure behavior adjusted for
their configuration without having to recompile the kernel.

20 months agoASoC: qdsp6: audioreach: add support to enable module command
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:10 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: add support to enable module command

Add support to enable Module command which is required for logging
module to be able to debug.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-10-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: add support for MFC Module
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:09 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: add support for MFC Module

Add support to enable and configure Media Format Converter (MFC) Module.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-9-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: add support to enable SAL Module
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:08 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: add support to enable SAL Module

Add support to Simple Accumulator-Limiter module.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-8-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: add support for more port connections
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:07 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: add support for more port connections

AudioReach Modules can connect to other modules using source and
destination port, and each module in theory can support up to 255 port
connections. But in practice this limit is at max 8 ports at a time.
So add support for allowing multiple port connections.

This support is needed for more detailed graphs like ECNS, speaker
protection and so.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: simplify module_list sz calculation
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:06 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: simplify module_list sz calculation

Simplify module_list size calculation by doing inside modules loop.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-6-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: Simplify handing FE and BE graph connections
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:05 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: Simplify handing FE and BE graph connections

Current AudioReach design of connecting FE and BE graph is very complicated
and not reliable. Instead used the virtual damp widgets private data to help
identify the modules that needs connection at runtime. Also maintain a
inter-graph connection info in the graph info, which can be used to both
determine if the graphs are connected and at graph build time.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: update dapm kcontrol private data
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:04 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: update dapm kcontrol private data

Update kcontrol private date to include more information like graph id
and module instance id which its connected to. Also maintain this virtual
dapm mixer widget in a list so that we could lookup while FE and BE connection
are added.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: remove unused connection_list
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:03 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: remove unused connection_list

Remove unused connection_list parameter.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: topology use idr_alloc_u32
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:02 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: topology use idr_alloc_u32

SubGraph and Module Instance ids take 32 bits, so use idr_alloc_u32
instead of idr_alloc to able to accommodate valid ranges.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoAdd support for SAI on i.MX93 platform
Mark Brown [Fri, 28 Oct 2022 15:50:34 +0000 (16:50 +0100)]
Add support for SAI on i.MX93 platform

Merge series from Chancel Liu <chancel.liu@nxp.com>:

This patchset supports SAI on i.MX93 platform.

20 months agoASoC: SOF: introduce new DEBUG_NOCODEC mode
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:40 +0000 (15:35 -0400)]
ASoC: SOF: introduce new DEBUG_NOCODEC mode

The existing NOCODEC mode enforces a build-time mutual exclusion with
the HDaudio link support, mostly to avoid any dependency on the
snd_hdac library and references to HDAudio codec/i915 stuff.

This is very useful to track dependencies and test a minimal
configuration, but very painful for developers and CI: a recompilation
and reinstall of the kernel modules is required.

This patch suggests an alternate middle ground where the selection of
the machine driver and all codec-related actions are bypassed at
run-time, contingent on a kernel module parameter being set.

For example setting BIT(10) with
'options snd_sof sof_debug=0x401'
is enough to switch from an HDaudio card to a nocodec one.

This new DEBUG_NOCODEC mode is not suitable for distributions and
end-users. It's not even recommended on all platforms, i.e. the
NOCODEC mode is known not to work on specific devices where the BIOS
did not configure support for I2S/DMIC interfaces. The usual
development devices such as Chromebooks, Up boards and Intel RVP are
the only recommended platforms where this mode can be supported.

Note that the dynamic switch between HDaudio and nocodec may not
always possible depending on hardware layout, pin-mux options, and
BIOS settings. The audio subsustems on Intel platforms has to support
4 types of interfaces and pin-mux can be complicated.

Reviewers might ask: why didn't we do this earlier? The main reason is
that all the codec-related configurations were not cleanly separated
out in the sof/intel directory. With all the cleanups done recently,
adding this opt-in behavior is relatively straightforward.

Tested on UpExtreme (WHL) and UpExtreme i11 (TGL).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-codec: use GPL-2.0-only license
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:39 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-codec: use GPL-2.0-only license

All the HDAudio codec handling is completely specific to Linux and
completely dependency on GPL2.0 code, specifically the snd_hdac_
library.

There was no intention to have a dual-license for this code, this was
an oversight that needs to be corrected. Update the SPDX and
EXPORT_SYMBOL information, no functionality change otherwise.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda: clarify Kconfig dependencies
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:38 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda: clarify Kconfig dependencies

Since we've moved to the same flows for HDaudio and iDISP codecs, we
need to be more consistent about dependencies.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: add hda_bus_ml_free helper
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:37 +0000 (15:35 -0400)]
ASoC: SOF: Intel: add hda_bus_ml_free helper

Add helper matching allocation done in hda_bus_ml_get_capabilities().

No functionality change, just clearer code partitioning.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-mlink: add helpers to suspend/resume links
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:36 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-mlink: add helpers to suspend/resume links

No functionality change, just move the code in hda-mlink.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: clarify bus_init and bus_exit sequences
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:35 +0000 (15:35 -0400)]
ASoC: SOF: Intel: clarify bus_init and bus_exit sequences

The dependencies are on SND_SOC_SOF_HDA_AUDIO_CODEC and the bus_exit
sequence should be well identified.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-codec: add helpers to suspend and resume cmd_io
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:34 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-codec: add helpers to suspend and resume cmd_io

No functionality change, code move to have better split between
HDaudio codec management and core parts.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dsp: clarify dependencies on SND_SOC_SOF_HDA
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:33 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-dsp: clarify dependencies on SND_SOC_SOF_HDA

IS_ENABLED is not always in the right places, the codec parts depend
on SND_SOC_SOF_HDAUDIO_CODEC

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-ctrl: use helper to clear RIRB status
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:32 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-ctrl: use helper to clear RIRB status

Change to use helper and avoid conditional compilation.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-codec: add hda_codec_check_rirb_status() helper
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:31 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-codec: add hda_codec_check_rirb_status() helper

move existing functionality to new helper.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-stream: always allocate CORB/RIRB buffer
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:30 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-stream: always allocate CORB/RIRB buffer

There is no real reason to filter out this allocation at build
time. Let's allocate it always, so that we can have a more dynamic way
of disabling HDaudio codec support without having to recompile.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-codec: add stop_cmd_io helper
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:29 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-codec: add stop_cmd_io helper

One more helper to split controller and codec

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>