platform/kernel/linux-rpi.git
13 months agoASoC: SOF: topology: Use partial match for connecting DAI link and DAI widget
Ranjani Sridharan [Fri, 26 May 2023 20:41:48 +0000 (15:41 -0500)]
ASoC: SOF: topology: Use partial match for connecting DAI link and DAI widget

This allows setting shorter names for the widget stream names in
topology. For example, in the case of HDA Analog DAI link, the stream
name is "Analog Playback and Capture". But it is enough to match "Analog"
in the DAI link stream name with a widget's stream name. This is needed
to set more meaningful names for the DAI widgets using the stream name
in topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-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/20230526204149.456068-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: topology: Allow partial matching when finding DAI link
Ranjani Sridharan [Fri, 26 May 2023 20:41:47 +0000 (15:41 -0500)]
ASoC: topology: Allow partial matching when finding DAI link

This allows for setting shorter link names in topology. For example,
for the HDA Analog DAI link, just "Analog" would suffice instead of
"Analog Playback and Capture"

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230526204149.456068-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: cs42l42: Add PLL ratio table values
Vitaly Rodionov [Wed, 24 May 2023 12:52:36 +0000 (13:52 +0100)]
ASoC: cs42l42: Add PLL ratio table values

Add 4.8Mhz 9.6Mhz and 19.2MHz SCLK values
for MCLK 12MHz and 12.288MHz requested by Intel.

Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230524125236.57149-1-vitalyr@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: cs35l45: Relicense to GPL only
Charles Keepax [Wed, 10 May 2023 09:25:34 +0000 (10:25 +0100)]
ASoC: cs35l45: Relicense to GPL only

Cirrus never intended to upstream dual licensed code, convert to
GPL only.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230510092534.3919120-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: da7219: Add jack insertion detection polarity
Mark Brown [Tue, 23 May 2023 22:11:42 +0000 (23:11 +0100)]
ASoC: da7219: Add jack insertion detection polarity

Merge series from David Rau <David.Rau.opensource@dm.renesas.com>:

This patchset adds the support of DA7219 Jack insertion detection
polarity selection.

The first patch replaces the old txt binding with a new schema binding.

The second patch adds `dlg,jack-ins-det-pty` property for Jack
insertion detection polarity selection.

The last patch adds the driver support for this topic.

The series has been verified on the DA7219 development kit.

13 months agoImprove support for sof_ipc{3|4}_bytes_ext_put
Mark Brown [Tue, 23 May 2023 21:42:57 +0000 (22:42 +0100)]
Improve support for sof_ipc{3|4}_bytes_ext_put

Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:

This patch series provides better handling of cases where sending
a data blob to FW results in a validation error.

In this case we restore to the last good known value instead of keeping
the data that firwmare rejected.

13 months agoASoC: mt6359: kselftest fix and driver extension
Mark Brown [Tue, 23 May 2023 21:42:50 +0000 (22:42 +0100)]
ASoC: mt6359: kselftest fix and driver extension

Merge series from Trevor Wu <trevor.wu@mediatek.com>:

The patch series includes a kselftest fix and changes for extending
driver capability to support more use cases.

13 months agoASoC: dt-bindings: rt1016: Convert to dtschema
Anup Sharma [Fri, 5 May 2023 13:30:42 +0000 (19:00 +0530)]
ASoC: dt-bindings: rt1016: Convert to dtschema

Convert the RT1016 Stereo Audio Amplifier bindings to DT schema

Signed-off-by: Anup Sharma <anupnewsmail@gmail.com>
Link: https://lore.kernel.org/r/ZFUFAmBJXvkQAG7m@yoga
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: do not include runtime_pm.h if not needed
Mark Brown [Tue, 23 May 2023 19:49:28 +0000 (20:49 +0100)]
ASoC: do not include runtime_pm.h if not needed

Merge series from Claudiu Beznea <claudiu.beznea@microchip.com>:

Series removes the pm_runtime.h inclusion in files where
APIs exported though pm_runtime.h are not used. In case
of files that make use of pm.h which comes form pm_runtime.h
added patch 2/2.

13 months agoASoC: SOF: Intel: mtl: Enable multicore support
Mark Brown [Tue, 23 May 2023 19:49:22 +0000 (20:49 +0100)]
ASoC: SOF: Intel: mtl: Enable multicore support

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

The following series will enable multicore support on MTL platforms similarly
to other Intel platforms.

The TGL patch is included to simplify the core_put implementation.

Multicore support can be enabled by updated topologies, with current set of
tplg files this series is not introducing any runtime change.

13 months agoASoC: mediatek: mt6359: update route for lineout mux
Trevor Wu [Mon, 8 May 2023 07:15:32 +0000 (15:15 +0800)]
ASoC: mediatek: mt6359: update route for lineout mux

Originally, lineout playback source can only be DAC_3RD. Some SoC
masters only support stereo MTKAIF outputs, so lineout path can't be
used in such case.

MTKAIF connections are as follows.
MOSI0 -> DAC_L
MOSI1 -> DAC_R
MOSI2 -> DAC_3rd

In the patch, lineout playback source can be chosen between DAC_L and
DAC_3rd, so sound can be outputted via lineout even though SoC only
supports stereo MTKAIF outputs.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230508071532.21665-5-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt6359: add mtkaif gpio setting
Trevor Wu [Mon, 8 May 2023 07:15:31 +0000 (15:15 +0800)]
ASoC: mediatek: mt6359: add mtkaif gpio setting

Add mtkaif gpio driving to increase signal strength and smt setting to
prevent from overshooting.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230508071532.21665-4-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt6359: fix kselftest error of playback gain
Trevor Wu [Mon, 8 May 2023 07:15:30 +0000 (15:15 +0800)]
ASoC: mediatek: mt6359: fix kselftest error of playback gain

kselftest tries to read/write the default value. The default register
value of playback gain is 0x1F(mute), but max gain we specified is 0x12.
The range of the control is 0x0~0x12 and mute(0x1F) is only used in the
driver internally. To solve the problem, implement a new callback
mt6359_get_playback_volsw to report user configured volume instead of
the register value.

In addition, update max of "Headset Volume" to 0x12, so it can match the
maximum seen on latest data sheet.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230508071532.21665-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt6359: add supply for MTKAIF
Trevor Wu [Mon, 8 May 2023 07:15:29 +0000 (15:15 +0800)]
ASoC: mediatek: mt6359: add supply for MTKAIF

There are three output data pins MISO0, MISO1 and MISO2 for mt6359.
UL_SRC should be enabled when MISO0 or MISO1 is used, and UL_SRC_34
should be enabled when MISO2 is used.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230508071532.21665-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: sof: Improve sof_ipc4_bytes_ext_put function
Paul Olaru [Wed, 3 May 2023 08:10:49 +0000 (11:10 +0300)]
ASoC: sof: Improve sof_ipc4_bytes_ext_put function

The function is improved in the way that if the firmware returns a
validation error on the newly sent bytes, then the kernel will
automatically restore to the old bytes value for a given kcontrol.

This way, if the firmware rejects a data blob then the kernel will also
reject it, instead of saving it for the next suspend/resume cycle. The
old behaviour is that the kernel would save it anyway and on next
firmware boot it would apply the previously-rejected configuration,
leading to errors during playback.

Additionally, the function also saves previously validated
configurations, so that if the firmware does end up rejecting a new
bytes value the kernel can send an old, previously-valid configuration.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230503081049.73847-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: sof: Improve sof_ipc3_bytes_ext_put function
Paul Olaru [Wed, 3 May 2023 08:10:48 +0000 (11:10 +0300)]
ASoC: sof: Improve sof_ipc3_bytes_ext_put function

The function is improved in the way that if the firmware returns a
validation error on the newly sent bytes, then the kernel will
automatically restore to the old bytes value for a given kcontrol.

This way, if the firmware rejects a data blob then the kernel will also
reject it, instead of saving it for the next suspend/resume cycle. The
old behaviour is that the kernel would save it anyway and on next
firmware boot it would apply the previously-rejected configuration,
leading to errors during playback.

Additionally, the function also saves previously validated
configurations, so that if the firmware does end up rejecting a new
bytes value the kernel can send an old, previously-valid configuration.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230503081049.73847-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: da7219: Add Jack insertion detection polarity
David Rau [Tue, 23 May 2023 16:18:21 +0000 (16:18 +0000)]
ASoC: da7219: Add Jack insertion detection polarity

Add support of selecting insertion detection polarity
- Default polarity (Low)
- Inverted polarity (High)

Correct the keywords of parsing `dlg,jack-det-rate`
bases on the new DT binding.

Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com>
Link: https://lore.kernel.org/r/20230523161821.4260-4-David.Rau.opensource@dm.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: dt-bindings: da7219: Add jack-ins-det-pty property
David Rau [Tue, 23 May 2023 16:18:20 +0000 (16:18 +0000)]
ASoC: dt-bindings: da7219: Add jack-ins-det-pty property

Add `dlg,jack-ins-det-pty` property for Jack insertion detection
polarity selection.

Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com>
Link: https://lore.kernel.org/r/20230523161821.4260-3-David.Rau.opensource@dm.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: dt-bindings: dialog,da7219: convert to dtschema
David Rau [Tue, 23 May 2023 16:18:19 +0000 (16:18 +0000)]
ASoC: dt-bindings: dialog,da7219: convert to dtschema

- Convert Dialog DA7219 bindings to DT schema format.
- Remove unused `dlg,ldo-lvl` property.

Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230523161821.4260-2-David.Rau.opensource@dm.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: hda-dai: Fix locking in hda_ipc4_pre_trigger()
Harshit Mogalapalli [Fri, 19 May 2023 06:44:01 +0000 (23:44 -0700)]
ASoC: SOF: Intel: hda-dai: Fix locking in hda_ipc4_pre_trigger()

hda_ipc4_pre_trigger() has two issues:
 1. In the default case, we are returning without unlocking the mutex.
 2. In case SNDRV_PCM_TRIGGER_STOP: when ret is less than zero it goes
    to out, unlocks but returns zero instead of a negative value.

Fix this by changing the final return value to 'ret' instead of zero,
and initialize 'ret' to zero in the start of the function.

Fixes: 225f37b578a9 ("ASoC: SOF: ipc4-pcm: reset all pipelines during FE DAI hw_free")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230519064404.1659637-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-topology: Fix an unsigned comparison which can never be negative
Yang Li [Tue, 16 May 2023 08:11:16 +0000 (16:11 +0800)]
ASoC: SOF: ipc4-topology: Fix an unsigned comparison which can never be negative

The return value from the call to sof_ipc4_get_valid_bits() is int.
However, the return value is being assigned to an unsigned
int variable 'out_ref_valid_bits', so making it an int.

Eliminate the following warning:
./sound/soc/sof/ipc4-topology.c:1537:6-24: WARNING: Unsigned expression compared with zero: out_ref_valid_bits < 0

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4985
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230516081116.71370-1-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: tgl: unify core_put on IPC3 & IPC4 path
Rander Wang [Tue, 23 May 2023 10:32:17 +0000 (13:32 +0300)]
ASoC: SOF: Intel: tgl: unify core_put on IPC3 & IPC4 path

Firmware may do context saving before powering off primary core, so driver
needs to send ipc msg by set_core_state. In IPC4 path, firmware needs to
save current context to IMR before powering off primary core. Firmware
does nothing for set_core_state message in IPC3 path. So IPC4 and IPC3
can share the same operation sequence.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230523103217.20412-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: mtl: add core_get & put support on MeterLake platforms
Rander Wang [Tue, 23 May 2023 10:32:16 +0000 (13:32 +0300)]
ASoC: SOF: Intel: mtl: add core_get & put support on MeterLake platforms

In core_get case, driver can power up primary core and don't need to send
ipc message to fw. Non-primary core should be powered up by fw with ipc
message.

In core_put case, driver should first send ipc message to fw to disable dsp
core then power down primary core if the target is primary core.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230523103217.20412-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: use pm.h instead of runtime_pm.h
Claudiu Beznea [Wed, 17 May 2023 09:49:03 +0000 (12:49 +0300)]
ASoC: use pm.h instead of runtime_pm.h

Do not include pm_runtime.h header in files where runtime PM support is
not implemented. Use pm.h instead as suspend to RAM specific
implementation is available.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230517094903.2895238-3-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: do not include pm_runtime.h if not used
Claudiu Beznea [Wed, 17 May 2023 09:49:02 +0000 (12:49 +0300)]
ASoC: do not include pm_runtime.h if not used

Do not include pm_runtime.h header in files where APIs exported by
pm_runtime.h are not used.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> # for omap-mcbsp-st.c
Link: https://lore.kernel.org/r/20230517094903.2895238-2-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: nau8825: Add pre-charge actions for input
David Lin [Tue, 23 May 2023 08:33:04 +0000 (16:33 +0800)]
ASoC: nau8825: Add pre-charge actions for input

Adding pre-charge actions to make FEPGA power stable faster. It
improve the recording quality at the beginning. Thus, it is also
meaningfully to decrease the final adc delay time.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20230523083303.98436-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: amd: Add pci revision id check
Venkata Prasad Potturu [Tue, 23 May 2023 07:20:01 +0000 (12:50 +0530)]
ASoC: SOF: amd: Add pci revision id check

Add pci revision id check for renoir and rembrandt platforms.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230523072009.2379198-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: topology: Clean up error messages handling
Mark Brown [Mon, 22 May 2023 15:32:40 +0000 (16:32 +0100)]
ASoC: topology: Clean up error messages handling

Merge series from Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>:

Series of patches cleaning up error messages when loading topology. In
few places instead of logging in place of failure message is logged in
caller. Additionally there are places where both caller and failing
function log error, leading to unnecessary logs. Clean all of the above
up.

13 months agoASoC: SOF: ipc4: Querry CPC value from firmware's
Mark Brown [Mon, 22 May 2023 14:48:54 +0000 (15:48 +0100)]
ASoC: SOF: ipc4: Querry CPC value from firmware's

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

The MOD_INIT_INSTANCE message contains a CPC (Cycles Per Chunk/processing unit)
parameter.
This CPC value is used by the firmware to calculate the total cycles needed by
the enabled module instances and based on this it can decide to set the
frequency of the DSP core(s).

The manifest section of the firmware image contains a module configuration
section, where a per module table of configurations are listed with measured
CPC values as triplet of IBS/IBS/CPC (Input/Output buffer size - corresponding
to the selected audio format).

In case the CPC value is 0 (missing from the manifest or the
configuration cannot be matched) the firmware will force the DSP cores
to maximum speed to avoid audio glitches due to starvation.  In these
cases the kernel will print a warning message to let the SOF developers
know about the gap and provide information to correct it with a firmware
update.

13 months agoASoC: rt5682s: Use the devm_clk_get_optional() helper
Christophe JAILLET [Sat, 20 May 2023 14:58:24 +0000 (16:58 +0200)]
ASoC: rt5682s: Use the devm_clk_get_optional() helper

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

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f538c24ad7b1926478347a03b5b7f0432e195e3b.1684594691.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: cs53l30: Use the devm_clk_get_optional() helper
Christophe JAILLET [Sat, 20 May 2023 14:54:06 +0000 (16:54 +0200)]
ASoC: cs53l30: Use the devm_clk_get_optional() helper

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

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/3219effee5c7f190530bdb1ef8ec35cb142e3611.1684594433.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: stm32: sai: Use the devm_clk_get_optional() helper
Christophe JAILLET [Sat, 20 May 2023 15:00:50 +0000 (17:00 +0200)]
ASoC: stm32: sai: Use the devm_clk_get_optional() helper

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

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f7987f18dadf77bfa09969fd4c82d5a0f4e4e3b7.1684594838.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: rt5659: Use the devm_clk_get_optional() helper
Christophe JAILLET [Sat, 20 May 2023 14:56:00 +0000 (16:56 +0200)]
ASoC: rt5659: Use the devm_clk_get_optional() helper

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

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/5b44b2fddd8973e949e4ae2132971b147cfd1ec1.1684594544.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: cs42l51: Use the devm_clk_get_optional() helper
Christophe JAILLET [Sat, 20 May 2023 14:50:54 +0000 (16:50 +0200)]
ASoC: cs42l51: Use the devm_clk_get_optional() helper

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

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/3debf3bb7ea504ee9ca2d8eb0f948a426681cbdd.1684594240.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: atmel: sam9g20_wm8731: Remove the unneeded include <linux/i2c.h>
Christophe JAILLET [Sat, 20 May 2023 10:21:58 +0000 (12:21 +0200)]
ASoC: atmel: sam9g20_wm8731: Remove the unneeded include <linux/i2c.h>

This driver does not use i2c, so there is no point in including
<linux/i2c.h>

Remove it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/9b39a59f5829d200d7d1fac4e993dbf8ce05836d.1684578051.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: adau1761: Use the devm_clk_get_optional() helper
Christophe JAILLET [Sat, 20 May 2023 14:48:19 +0000 (16:48 +0200)]
ASoC: adau1761: Use the devm_clk_get_optional() helper

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

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/ab0fe7e7ecf965df84b9516ba65428af9b3805c1.1684594081.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: topology: Remove redundant log
Amadeusz Sławiński [Fri, 19 May 2023 19:56:11 +0000 (21:56 +0200)]
ASoC: topology: Remove redundant log

soc_tplg_valid_header() logs all the failures in detail already.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230519195611.4068853-6-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: topology: Remove redundant log
Amadeusz Sławiński [Fri, 19 May 2023 19:56:10 +0000 (21:56 +0200)]
ASoC: topology: Remove redundant log

soc_tplg_dapm_complete() logs all the failures in detail already.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230519195611.4068853-5-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: topology: Do not split message string on multiple lines
Amadeusz Sławiński [Fri, 19 May 2023 19:56:09 +0000 (21:56 +0200)]
ASoC: topology: Do not split message string on multiple lines

Kernel coding guidelines recommend to not split string unnecessarily.
While at it adapt the other print present in the function to 100
characters line limit.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230519195611.4068853-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: topology: Remove redundant logs
Amadeusz Sławiński [Fri, 19 May 2023 19:56:08 +0000 (21:56 +0200)]
ASoC: topology: Remove redundant logs

soc_tplg_add_kcontrol() logs all the failures in detail already.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230519195611.4068853-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: topology: Log control load errors in soc_tplg_control_load()
Amadeusz Sławiński [Fri, 19 May 2023 19:56:07 +0000 (21:56 +0200)]
ASoC: topology: Log control load errors in soc_tplg_control_load()

Simplify code by logging any errors in function that does the actual
work instead of doing so in its callers.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230519195611.4068853-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-loader/topology: Query the CPC value from manifest
Peter Ujfalusi [Mon, 22 May 2023 10:13:13 +0000 (13:13 +0300)]
ASoC: SOF: ipc4-loader/topology: Query the CPC value from manifest

The manifest's firmware module configuration section contains the measured
CPC values along with a matching IBS/OBS values.

The CPC can be looked up by looking for a matching IBS/OBS entry.
In case of multiple matches we will use the highest CPC value.

If there is no mod_cfg or no CPC value (all 0) or no match was found then
print warning message and use 0 as CPC value.

Signed-off-by: Peter 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>
Link: https://lore.kernel.org/r/20230522101313.12519-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-topology: Do not use the CPC value from topology
Peter Ujfalusi [Mon, 22 May 2023 10:13:12 +0000 (13:13 +0300)]
ASoC: SOF: ipc4-topology: Do not use the CPC value from topology

Stop parsing the CPC value from topology to module_base_cfg.
The CPC value is only set for few modules in topology which makes the CPC
handling inconsistent.

Signed-off-by: Peter 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>
Link: https://lore.kernel.org/r/20230522101313.12519-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-topology: Rename sof_ipc4_update_pipeline_mem_usage() to be generic
Peter Ujfalusi [Mon, 22 May 2023 10:13:11 +0000 (13:13 +0300)]
ASoC: SOF: ipc4-topology: Rename sof_ipc4_update_pipeline_mem_usage() to be generic

Rename sof_ipc4_update_pipeline_mem_usage() to
sof_ipc4_update_resource_usage() in order to be re-usable for generic
resource storage, calculation of a module, like CPC adjustment.

Signed-off-by: Peter 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>
Link: https://lore.kernel.org/r/20230522101313.12519-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-loader: Save a pointer to fm_config in sof_ipc4_fw_module
Peter Ujfalusi [Mon, 22 May 2023 10:13:10 +0000 (13:13 +0300)]
ASoC: SOF: ipc4-loader: Save a pointer to fm_config in sof_ipc4_fw_module

Save a pointer to the firmware module configuration area in
sof_ipc4_fw_module struct for later use.

Signed-off-by: Peter 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>
Link: https://lore.kernel.org/r/20230522101313.12519-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-loader: Drop unused bss_size from struct sof_ipc4_fw_module
Peter Ujfalusi [Mon, 22 May 2023 10:13:09 +0000 (13:13 +0300)]
ASoC: SOF: ipc4-loader: Drop unused bss_size from struct sof_ipc4_fw_module

The bss_size is only set, but not used by the code, remove it.

Signed-off-by: Peter 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>
Link: https://lore.kernel.org/r/20230522101313.12519-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
14 months agoASoC: cs35l56: Bugfixes and efficiency improvement
Mark Brown [Fri, 19 May 2023 03:32:36 +0000 (12:32 +0900)]
ASoC: cs35l56: Bugfixes and efficiency improvement

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

First two patches are bugfixes.
Third patch skips the overhead of rebooting the amp after applying
firmware files when we know that it isn't necessary.

14 months agoMerge tag 'v6.4-rc2' into asoc-6.5 to get fixes for CI
Mark Brown [Fri, 19 May 2023 03:32:04 +0000 (12:32 +0900)]
Merge tag 'v6.4-rc2' into asoc-6.5 to get fixes for CI

Linux 6.4-rc2

14 months agoASoC: cs35l56: In secure mode skip SHUTDOWN and RESET around fw download
Simon Trimmer [Thu, 18 May 2023 15:02:50 +0000 (16:02 +0100)]
ASoC: cs35l56: In secure mode skip SHUTDOWN and RESET around fw download

If the device is in secure mode it's unnecessary to send a SHUTDOWN and
SYSTEM_RESET around the firmware download. It could only be patching
insecure tunings. A tuning patch doesn't need a SHUTDOWN and only needs
a REINIT afterwards. This will reduce the overhead of exiting system
suspend in secure mode.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
14 months agoASoC: cs35l56: sdw_write_no_pm() should be performed under a pm_runtime request
Simon Trimmer [Thu, 18 May 2023 15:02:49 +0000 (16:02 +0100)]
ASoC: cs35l56: sdw_write_no_pm() should be performed under a pm_runtime request

SoundWire bus accesses must be performed under the guard of a pm_runtime
request, in this case the write was being performed just after the
request had been put() and so the bus could not be guaranteed to be
available.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
14 months agoASoC: cs35l56: Move DSP part string generation so that it is done only once
Simon Trimmer [Thu, 18 May 2023 15:02:48 +0000 (16:02 +0100)]
ASoC: cs35l56: Move DSP part string generation so that it is done only once

Each time we go through dsp_work() it does a devm_kasprintf() to
allocate memory to hold the part name string. It's not strictly a memory
leak because devm will free it all if the driver is removed. But we keep
allocating more and more memory to hold the same string.

Move the allocation so that it is performed after the version and
secured state information is gathered and handle allocation errors.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
14 months agoAdd Chameleon v3 ASoC audio
Mark Brown [Thu, 18 May 2023 22:27:08 +0000 (07:27 +0900)]
Add Chameleon v3 ASoC audio

Merge series from Paweł Anikiel <pan@semihalf.com>:

The Google Chameleon v3 is a device made for testing audio and video
paths of other devices. This patchset adds support for ASoC audio on
this device. It has two audio sources: HDMI audio from the it68051 chip
(RX only), and analog audio from the ssm2603 chip (RX and TX).

The patchset adds the ASoC platform and codec drivers.

14 months agoASoC: codecs: do not store status in state containe
Mark Brown [Thu, 18 May 2023 17:11:12 +0000 (02:11 +0900)]
ASoC: codecs: do not store status in state containe

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

Many SoundWire CODEC drivers store the device status in a member
variable in the driver data but never reference this, and in any case
the SoundWire core stores this information for drivers so it would be
redundant even if used.

14 months agoASoC: mediatek: mt8192-mt6359: Remove " Jack" from Headphone pin name
AngeloGioacchino Del Regno [Wed, 17 May 2023 15:15:16 +0000 (17:15 +0200)]
ASoC: mediatek: mt8192-mt6359: Remove " Jack" from Headphone pin name

Function jack_kctl_name_gen() will remove the redundant " Jack" from
the name, if present, and then it will add it back, so that all of
the controls are named "(pin-name) Jack".

Remove " Jack" from the Headphone pin name to spare some CPU cycles.

This commit brings no functional changes.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com
Link: https://lore.kernel.org/r/20230517151516.343037-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt722-sdca: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:53 +0000 (09:27 +0200)]
ASoC: codecs: rt722-sdca: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-13-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt715: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:52 +0000 (09:27 +0200)]
ASoC: codecs: rt715: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-12-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt715-sdca: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:51 +0000 (09:27 +0200)]
ASoC: codecs: rt715-sdca: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-11-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt712-sdca: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:50 +0000 (09:27 +0200)]
ASoC: codecs: rt712-sdca: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-10-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt712-sdca-dmic: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:49 +0000 (09:27 +0200)]
ASoC: codecs: rt712-sdca-dmic: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-9-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt711: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:48 +0000 (09:27 +0200)]
ASoC: codecs: rt711: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-8-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt711-sdca: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:47 +0000 (09:27 +0200)]
ASoC: codecs: rt711-sdca: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-7-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt700: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:46 +0000 (09:27 +0200)]
ASoC: codecs: rt700: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-6-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt5682: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:45 +0000 (09:27 +0200)]
ASoC: codecs: rt5682: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-5-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt1318: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:44 +0000 (09:27 +0200)]
ASoC: codecs: rt1318: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt1316: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:43 +0000 (09:27 +0200)]
ASoC: codecs: rt1316: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: codecs: rt1308: do not store status in state container
Krzysztof Kozlowski [Thu, 18 May 2023 07:27:42 +0000 (09:27 +0200)]
ASoC: codecs: rt1308: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later.  Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: dt-bindings: nau8810: Convert to dtschema
David Lin [Tue, 16 May 2023 05:44:48 +0000 (13:44 +0800)]
ASoC: dt-bindings: nau8810: Convert to dtschema

Convert the NAU8810 audio CODEC bindings to DT schema.

Signed-off-by: David Lin <CTLIN0@nuvoton.com
Link: https://lore.kernel.org/r/20230516054447.1081404-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: tegra: tegra210_adx: fix snd_pcm_format_t type
Min-Hua Chen [Tue, 16 May 2023 22:36:59 +0000 (06:36 +0800)]
ASoC: tegra: tegra210_adx: fix snd_pcm_format_t type

use snd_pcm_format_t instead of unsigned int to fix
the following sparse warnings:

sound/soc/tegra/tegra210_adx.c:125:14: sparse: warning: restricted snd_pcm_format_t degrades to integer
sound/soc/tegra/tegra210_adx.c:128:14: sparse: warning: restricted snd_pcm_format_t degrades to integer
sound/soc/tegra/tegra210_adx.c:131:14: sparse: warning: restricted snd_pcm_format_t degrades to integer

Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com
Link: https://lore.kernel.org/r/20230516223700.185569-1-minhuadotchen@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: dt-bindings: nau8315: Convert to dtschema
David Lin [Tue, 16 May 2023 05:49:45 +0000 (13:49 +0800)]
ASoC: dt-bindings: nau8315: Convert to dtschema

Convert the NAU8315 audio CODEC bindings to DT schema.

Signed-off-by: David Lin <CTLIN0@nuvoton.com
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230516054944.1081808-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: dt-bindings: Add Google Chameleon v3 i2s device
Paweł Anikiel [Mon, 8 May 2023 11:30:33 +0000 (13:30 +0200)]
ASoC: dt-bindings: Add Google Chameleon v3 i2s device

Add binding for google,chv3-i2s device.

Signed-off-by: Paweł Anikiel <pan@semihalf.com
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230508113037.137627-4-pan@semihalf.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: dt-bindings: Add Google Chameleon v3 audio codec
Paweł Anikiel [Mon, 8 May 2023 11:30:34 +0000 (13:30 +0200)]
ASoC: dt-bindings: Add Google Chameleon v3 audio codec

Add binding for google,chv3-codec device.

Signed-off-by: Paweł Anikiel <pan@semihalf.com
Link: https://lore.kernel.org/r/20230508113037.137627-5-pan@semihalf.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: Add Google Chameleon v3 codec driver
Paweł Anikiel [Mon, 8 May 2023 11:30:32 +0000 (13:30 +0200)]
ASoC: Add Google Chameleon v3 codec driver

Add driver for the codec IP present on Google Chameleon v3

Signed-off-by: Paweł Anikiel <pan@semihalf.com
Link: https://lore.kernel.org/r/20230508113037.137627-3-pan@semihalf.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: Add Google Chameleon v3 i2s driver
Paweł Anikiel [Mon, 8 May 2023 11:30:31 +0000 (13:30 +0200)]
ASoC: Add Google Chameleon v3 i2s driver

Add driver for the i2s IP present on Google Chameleon v3

Signed-off-by: Paweł Anikiel <pan@semihalf.com
Link: https://lore.kernel.org/r/20230508113037.137627-2-pan@semihalf.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: dt-bindings: nau8824: Convert to dtschema
David Lin [Mon, 15 May 2023 06:55:58 +0000 (14:55 +0800)]
ASoC: dt-bindings: nau8824: Convert to dtschema

Convert the NAU8824 audio CODEC bindings to DT schema.

Signed-off-by: David Lin <CTLIN0@nuvoton.com
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230515065557.614125-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: dt-bindings: ssm2518: Convert to dtschema
Marek Vasut [Sun, 14 May 2023 22:52:43 +0000 (00:52 +0200)]
ASoC: dt-bindings: ssm2518: Convert to dtschema

Convert the ADI SSM2518 audio CODEC bindings to DT schema.

Signed-off-by: Marek Vasut <marex@denx.de
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230514225243.777504-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: ipc4-topology: Improve the audio format
Mark Brown [Mon, 15 May 2023 15:30:14 +0000 (00:30 +0900)]
ASoC: SOF: ipc4-topology: Improve the audio format

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

Improve the logic to account for the current restrictions in topology while
making it extensible for future topology modifications.

The current topology definitions assume that input/output formats come in pairs.
For example even if there's only 1 output format for a module, we add 3 output
formats to match that of the input format count with the same parameters.
This is unnecessary but we have to deal with it until the topologies are
modified. Additionally, choosing the input/output audio format should
depend only on the pipeline params or the runtime FE hw_params depending
on where the module is in the pipeline.

This series modifies the logic for selection based on this and removes
unnecessary dependencies between the input and output formats.

14 months agoASoC: mediatek: mt8188: revise AFE driver
Mark Brown [Mon, 15 May 2023 15:30:08 +0000 (00:30 +0900)]
ASoC: mediatek: mt8188: revise AFE driver

Merge series from Trevor Wu <trevor.wu@mediatek.com>:

The series of patches consists of four major changes.
First, remove redundant supply for ADDA DAI dirver. Second, revise ETDM
control including APLL dynamic switch via DAPM, so APLL can be enabled
when it is really required. Third, update AFE probe function. Bus
protection change was dropped at the previous patch because the dependent
change was not accepted at that time. Finally, correct some binding errors
and add required clocks.

14 months agoASoC: Factor out control notification support
Mark Brown [Mon, 15 May 2023 15:17:58 +0000 (00:17 +0900)]
ASoC: Factor out control notification support

Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

This series introduces and uses a helper for notifying control changes
to userspace.

14 months agoASoC: SOF: Intel/ipc4: Do not reset BE DAI pipeline
Mark Brown [Mon, 15 May 2023 15:17:51 +0000 (00:17 +0900)]
ASoC: SOF: Intel/ipc4: Do not reset BE DAI pipeline

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

Do not reset pipelines during the stop/suspend triggers in the BE DAI
ops as the BE DAI pipeline needs to be left in the PAUSED state. It should
only be reset during hw_free. This simplification is already done for
the FE pipelines and the DAI trigger only toggles the states between
PAUSED and RUNNING.

14 months agoASoC: SOF: Intel: hda-dai: prepare LNL support
Mark Brown [Mon, 15 May 2023 15:17:44 +0000 (00:17 +0900)]
ASoC: SOF: Intel: hda-dai: prepare LNL support

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

The HDAudio support has not changed much since CometLake/2019: the
code was reshuffled for IPC4 support and we used hdac_hda for external
and Display Audio codec, but the hda-dai code was only used for
HDAudio codecs.

In the LunarLake architecture, all endpoints (HDaudio, SSP, DMIC,
SoundWire) are handled with the HDaudio DMA, which requires us to
revisit the definitions of HDA_LINK, and remove the mutual exclusion
between NOCODEC and HDA_LINK: we do want the ability to test SSP/DMIC
in NOCODEC mode even with an HDA DMA.

This code change exposed a number of issues, with a useless .prepare
callback, a DAI number mismatch and the need to support SoundWire
which is handled by a different component in
drivers/soundwire/intel_ace2.c.

14 months agoASoC: Intel: machine driver updates
Mark Brown [Mon, 15 May 2023 15:17:37 +0000 (00:17 +0900)]
ASoC: Intel: machine driver updates

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

Several updates for RPL/MTL/LNL, and one fix for SoundWire TGL device.

14 months agoASoC: SOF: ipc4-pcm: reset all pipelines during FE DAI hw_free
Ranjani Sridharan [Mon, 15 May 2023 11:20:22 +0000 (14:20 +0300)]
ASoC: SOF: ipc4-pcm: reset all pipelines during FE DAI hw_free

Do not reset pipelines during the stop/suspend triggers in the BE DAI
ops as the BE DAI pipeline needs to be left in the PAUSED state. It should
only be reset during hw_free. This simplification is already done for
the FE pipelines and the DAI trigger only toggles the states between
PAUSED and RUNNING.

But because the FE DAI hw_free is invoked first and all the pipelines are
freed during this op, we need to make sure that the BE DAI pipeline also
gets reset before it is freed. So do not skip the pipelines that have the
skip_during_fe_trigger flag set when resetting pipelines.

Also, because the pipeline state changes are split between the FE and BE
DAI ops now, protect the BE DAI pipeline state changes with the
pipeline_state_mutex as well.

Signed-off-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
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230515112022.30297-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: Intel: hda-dai-ops: Split the get_hext_stream() op for IPC4
Ranjani Sridharan [Mon, 15 May 2023 11:20:21 +0000 (14:20 +0300)]
ASoC: SOF: Intel: hda-dai-ops: Split the get_hext_stream() op for IPC4

Introduce a separate op implementation for get_hext_stream() for IPC4.
This op will also be used to set the skip_during_fe_trigger flag for the
BE DAI pipeline. With this change, we can remove the flag setting in
sof_ipc4_dai_config() which will further simplify support for
DMIC/SSP/Soundwire in the LunarLake platform.

Signed-off-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
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230515112022.30297-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: Simplify the calculation of variables
Jiapeng Chong [Fri, 12 May 2023 06:42:25 +0000 (14:42 +0800)]
ASoC: SOF: Simplify the calculation of variables

./sound/soc/sof/pcm.c:372:27-29: WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4938
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230512064225.75358-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: ipc4-topology: Use set_get_data() to send LARGE_CONFIG message
Peter Ujfalusi [Fri, 12 May 2023 10:56:42 +0000 (13:56 +0300)]
ASoC: SOF: ipc4-topology: Use set_get_data() to send LARGE_CONFIG message

Instead of open coding the sending of sink format of the copier with
LARGE_CONFIG_SET message, use the proper function to do so.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@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/20230512105642.23437-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: Intel: remove mutual exclusion between NOCODEC and HDA_LINK
Pierre-Louis Bossart [Fri, 12 May 2023 18:17:02 +0000 (13:17 -0500)]
ASoC: SOF: Intel: remove mutual exclusion between NOCODEC and HDA_LINK

The nocodec mode served two purposes so far
a) generate a test driver for DMIC/SSP without any codec connected
b) make sure the use of snd_hdac_ libraries was contained

b) is no longer an option for LunarLake, the HDaudio DMA is used for
DMIC/SSP and the HDA_LINK option needs to be enabled.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: Intel: hda-dai: use HDA_LINK instead of HDA_AUDIO_CODEC
Pierre-Louis Bossart [Fri, 12 May 2023 18:17:01 +0000 (13:17 -0500)]
ASoC: SOF: Intel: hda-dai: use HDA_LINK instead of HDA_AUDIO_CODEC

For LunarLake support, we will have to use HDAudio DMA-based DAIs even
for SSP/DMIC/SoundWire. That's completely different to the
HDA_AUDIO_CODEC, the DAI ops deal with DMA configuration and that can
happen in the absence of any HDAudio codec.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: Intel: hda-dai: mark functions as __maybe_unused
Pierre-Louis Bossart [Fri, 12 May 2023 18:17:00 +0000 (13:17 -0500)]
ASoC: SOF: Intel: hda-dai: mark functions as __maybe_unused

hda_dai_hw_params, hda_dai_trigger(), hda_dai_hw_free are currently
only used for HDaudio codec support, but will be reused for
SSP/DMIC/SoundWire in the LunarLake/ACE2.x case. To avoid 'defined but
not used' errors or added complexity in Kconfig, mark all these
functions as __maybe_used.

When SSP/DMIC/SoundWire are added, some of these changes may be
reverted. For now this avoids compilation warnings.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: Intel: hda-dai: move hda_dai_prepare() code
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:59 +0000 (13:16 -0500)]
ASoC: SOF: Intel: hda-dai: move hda_dai_prepare() code

Before we change the Kconfig support, move code around. No
functionality change with this commit in isolation.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: Intel: Kconfig: move selection of PROBE_WORK_QUEUE
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:58 +0000 (13:16 -0500)]
ASoC: SOF: Intel: Kconfig: move selection of PROBE_WORK_QUEUE

The probe workqueue is only needed if we have a Display Audio codec.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: Intel: clarify initialization when HDA_AUDIO_CODEC is not used
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:57 +0000 (13:16 -0500)]
ASoC: SOF: Intel: clarify initialization when HDA_AUDIO_CODEC is not used

For LunarLake support, we need to enable HDA_LINK but we also want the
ability to remove HDaudio codec support, e.g. for 'nocodec'
tests. This requires a small change in the bus initialization without
any codec-specific callbacks provided.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: Intel: fix DAI number mismatch
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:56 +0000 (13:16 -0500)]
ASoC: SOF: Intel: fix DAI number mismatch

The number of DAIs was based on a Kconfig option and the declaration
on another. Fix before changing the dependencies.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: Intel: hda-dai: remove use of cpu_dai->component drvdata
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:55 +0000 (13:16 -0500)]
ASoC: SOF: Intel: hda-dai: remove use of cpu_dai->component drvdata

The existing code relies on conversions from cpu_dai to the sdev
structure pointer based on the cpu_dai component. This works fine for
HDaudio but will not work for SoundWire DAIs which are registered by a
different component. That's a problem preventing reuse of the HDaudio
DMA stream allocation for SoundWire DAIs starting with the LunarLake
platform.

This patch introduces a set of helpers to perform the conversion, and
an indirect way of retrieving the sdev pointer based on the
swidget->comp intermediate pointer.

Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: Intel: hda-dai: simplify .prepare callback
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:54 +0000 (13:16 -0500)]
ASoC: SOF: Intel: hda-dai: simplify .prepare callback

The code has been cleaned-up multiple times, but while adding the new
abstractions for DMIC/SSP/SoundWire it appears that we don't really
need a specific sequence for .prepare, and we can reuse what
.hw_params already does.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: ipc4-topology: Modify input audio format selection logic
Ranjani Sridharan [Mon, 15 May 2023 10:33:36 +0000 (13:33 +0300)]
ASoC: SOF: ipc4-topology: Modify input audio format selection logic

The current selection logic assumes that input and output formats always
come in pairs in topology. Handle this special case by checking if all
input formats are the same. And for the case where there are multiple
supported input audio formats, modify the selection logic to pick the
audio formats based on the reference params which is either the FE
hw_params or the pipeline params based on the type of module.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230515103336.16132-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: ipc4-topology: New helper to check if all output formats are the same
Ranjani Sridharan [Mon, 15 May 2023 10:33:35 +0000 (13:33 +0300)]
ASoC: SOF: ipc4-topology: New helper to check if all output formats are the same

Add a helper function to check if all formats are identical.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230515103336.16132-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: ipc4-topology: Modify the output format selection logic
Ranjani Sridharan [Mon, 15 May 2023 10:33:34 +0000 (13:33 +0300)]
ASoC: SOF: ipc4-topology: Modify the output format selection logic

Modify the output format selection when there are multiple output
formats available to choose the one that matches the reference params.
The reference params depend on the type of module. In the case of
processing modules, the reference params are based on the selected input
audio format. This would be the case when a processing module does not
perform any format conversion during processing.

The only special case is the copier module. The copier module is capable
of format conversion but it is only used in the case when the output
is fixed to a single format. In the case of a module copier, when there are
multiple formats, the reference params is based on the selected input
params and the output format must match that of the selected input
format. In the case of host copier, the reference params should be
based on the input audio format for playback and the FE hw_params for
capture. In the case DAI copier, the reference params should be based on
the input audio format for capture and the FE hw_params for playback
when there is no format conversion in the pipeline from the host to the
DAI.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230515103336.16132-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: ipc4-topology: Add a new helper function to get the valid bits
Ranjani Sridharan [Mon, 15 May 2023 10:33:33 +0000 (13:33 +0300)]
ASoC: SOF: ipc4-topology: Add a new helper function to get the valid bits

Add a new helper function sof_ipc4_get_valid_bits() to get the valid
bits in the PCM params.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230515103336.16132-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: ipc4-topology: Handle output format special case
Ranjani Sridharan [Mon, 15 May 2023 10:33:32 +0000 (13:33 +0300)]
ASoC: SOF: ipc4-topology: Handle output format special case

The current topologies have input/output formats in pairs and even
though there are multiple output formats, they are all the same. Handle
this case as if there were only one format in topology. Also, add a check
for the number of output formats and reports errors where applicable.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230515103336.16132-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
14 months agoASoC: SOF: ipc4-topology: Rename sof_ipc4_init_audio_fmt()
Ranjani Sridharan [Mon, 15 May 2023 10:33:31 +0000 (13:33 +0300)]
ASoC: SOF: ipc4-topology: Rename sof_ipc4_init_audio_fmt()

Rename it to sof_ipc4_init_input_audio_fmt() as it only does input
format selection now.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230515103336.16132-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org