platform/kernel/linux-rpi.git
13 months agoASoC: remove old trigger ordering method
Kuninori Morimoto [Thu, 8 Jun 2023 06:49:11 +0000 (06:49 +0000)]
ASoC: remove old trigger ordering method

All drivers switch to use generic trigger ordering method.
Let's remove old method.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87legufnyy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: starfive: use use new trigger ordering method
Kuninori Morimoto [Thu, 8 Jun 2023 06:49:04 +0000 (06:49 +0000)]
ASoC: starfive: use use new trigger ordering method

ASoC is now supporting generic trigger ordering method.
This patch switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mt1afnz5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: atmel: use use new trigger ordering method
Kuninori Morimoto [Thu, 8 Jun 2023 06:48:58 +0000 (06:48 +0000)]
ASoC: atmel: use use new trigger ordering method

ASoC is now supporting generic trigger ordering method.
This patch switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/87o7lqfnzb.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: amd: use use new trigger ordering method
Kuninori Morimoto [Thu, 8 Jun 2023 06:48:51 +0000 (06:48 +0000)]
ASoC: amd: use use new trigger ordering method

ASoC is now supporting generic trigger ordering method.
This patch switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pm66fnzi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: add new trigger ordering method
Kuninori Morimoto [Thu, 8 Jun 2023 06:48:36 +0000 (06:48 +0000)]
ASoC: add new trigger ordering method

Current ASoC is assuming that trigger starting order is
Link -> Component -> DAI as default, and its reverse order for stopping.
But some Driver / Card want to reorder it for some reasons.
We have such flags, but is unbalance like below.

struct snd_soc_component_driver :: start_dma_last
struct snd_soc_dai_link :: stop_dma_first

We want to have more flexible, and more generic method.
This patch adds new snd_soc_trigger_order for start/stop at
component / DAI-link.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r0qmfnzx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs: remove redundant dapm routes
Mark Brown [Mon, 12 Jun 2023 17:35:11 +0000 (18:35 +0100)]
ASoC: Intel: avs: remove redundant dapm routes

Merge series from Brent Lu <brent.lu@intel.com>:

This patch series remove redundant dapm routes declared in multiple machine
drivers. These routes will be created by snd_soc_dapm_connect_dai_link_widgets()
during soundcard initialization. Following is the kernel log from a KBL
chromebook nocturne.

dmic:
[   13.773455] avs_dmic avs_dmic: connected DAI link dmic-codec:Capture -> dmic-platform:DMIC Rx
[   13.773460] avs_dmic avs_dmic: connected DAI link dmic-codec:Capture -> dmic-platform:DMIC WoV Rx

max98373:
[   14.079536] avs_max98373 avs_max98373.1: connected DAI link avs_max98373.1-platform:ssp0 Tx -> i2c-MX98373:00:Right HiFi Playback
[   14.079545] avs_max98373 avs_max98373.1: connected DAI link i2c-MX98373:00:Right HiFi Capture -> avs_max98373.1-platform:ssp0 Rx
[   14.079550] avs_max98373 avs_max98373.1: connected DAI link avs_max98373.1-platform:ssp0 Tx -> i2c-MX98373:01:Left HiFi Playback
[   14.079554] avs_max98373 avs_max98373.1: connected DAI link i2c-MX98373:01:Left HiFi Capture -> avs_max98373.1-platform:ssp0 Rx

hdaudio:
[   14.094818] avs_hdaudio avs_hdaudio.2: connected DAI link hdaudioB0D2-platform:hdaudioB0D2-cpu0 Tx -> hdaudioB0D2:HDMI 0 Playback
[   14.094824] avs_hdaudio avs_hdaudio.2: connected DAI link hdaudioB0D2-platform:hdaudioB0D2-cpu1 Tx -> hdaudioB0D2:HDMI 1 Playback
[   14.094828] avs_hdaudio avs_hdaudio.2: connected DAI link hdaudioB0D2-platform:hdaudioB0D2-cpu2 Tx -> hdaudioB0D2:HDMI 2 Playback

13 months agoASoC: mediatek: mt8173: Fix error paths
Mark Brown [Mon, 12 Jun 2023 17:26:12 +0000 (18:26 +0100)]
ASoC: mediatek: mt8173: Fix error paths

Merge series from Ricardo Ribalda Delgado <ribalda@chromium.org>:

ASoC: mediatek: mt8173, presented a couple of error paths errors, lets
fix them.

13 months agoASoC: audio-graph-card2-custom-sample.dtsi: remove DT warning
Kuninori Morimoto [Mon, 12 Jun 2023 01:59:34 +0000 (01:59 +0000)]
ASoC: audio-graph-card2-custom-sample.dtsi: remove DT warning

Current audio-graph-card2-custom-sample.dtsi is missing
address-cells / size-cells / reg. Thus it get too many DT warnings.
This patch solved it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a5x5qw3d.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Switch two more i2c drivers back to use .probe()
Uwe Kleine-König [Mon, 12 Jun 2023 07:06:08 +0000 (09:06 +0200)]
ASoC: Switch two more i2c drivers back to use .probe()

The previous conversion back to .probe() applied in commit 9abcd24002bf
("ASoC: Switch i2c drivers back to use .probe()") was created based on
v6.3. Since then two more drivers were added which need to be convert
back in the same way before eventually .probe_new() can be dropped from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230612070608.836186-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: dt-bindings: cirrus,cs35l45: drop unneeded quotes
Krzysztof Kozlowski [Fri, 9 Jun 2023 14:06:58 +0000 (16:06 +0200)]
ASoC: dt-bindings: cirrus,cs35l45: drop unneeded quotes

Cleanup bindings dropping unneeded quotes. Once all these are fixed,
checking for this can be enabled in yamllint.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230609140658.64557-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8173: Fix irq error path
Ricardo Ribalda Delgado [Mon, 12 Jun 2023 09:05:32 +0000 (11:05 +0200)]
ASoC: mediatek: mt8173: Fix irq error path

After reordering the irq probe, the error path was not properly done.
Lets fix it.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: stable@kernel.org
Fixes: 4cbb264d4e91 ("ASoC: mediatek: mt8173: Enable IRQ when pdata is ready")
Signed-off-by: Ricardo Ribalda Delgado <ribalda@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230612-mt8173-fixup-v2-2-432aa99ce24d@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path
Ricardo Ribalda Delgado [Mon, 12 Jun 2023 09:05:31 +0000 (11:05 +0200)]
ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path

If the second component fails to initialize, cleanup the first on.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: stable@kernel.org
Fixes: f1b5bf07365d ("ASoC: mt2701/mt8173: replace platform to component")
Signed-off-by: Ricardo Ribalda Delgado <ribalda@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230612-mt8173-fixup-v2-1-432aa99ce24d@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-ssm4567: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:58 +0000 (19:09 +0800)]
ASoC: Intel: avs-ssm4567: remove redundant dapm routes

Four routes "Left Playback<-sspX Tx", "Right Playback<-sspX Tx",
"sspX Rx<-Left Capture Sense", and "sspX Rx<-Right Capture Sense" are
created by snd_soc_dapm_connect_dai_link_widgets() automatically.
Remove the duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-13-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-rt5682: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:57 +0000 (19:09 +0800)]
ASoC: Intel: avs-rt5682: remove redundant dapm routes

Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are
created by snd_soc_dapm_connect_dai_link_widgets() automatically.
Remove the duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-12-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-rt298: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:56 +0000 (19:09 +0800)]
ASoC: Intel: avs-rt298: remove redundant dapm routes

Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are
created by snd_soc_dapm_connect_dai_link_widgets() automatically.
Remove the duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-11-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-rt286: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:55 +0000 (19:09 +0800)]
ASoC: Intel: avs-rt286: remove redundant dapm routes

Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are
created by snd_soc_dapm_connect_dai_link_widgets() automatically.
Remove the duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-10-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-rt274: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:54 +0000 (19:09 +0800)]
ASoC: Intel: avs-rt274: remove redundant dapm routes

Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are
created by snd_soc_dapm_connect_dai_link_widgets() automatically.
Remove the duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-9-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-nau8825: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:53 +0000 (19:09 +0800)]
ASoC: Intel: avs-nau8825: remove redundant dapm routes

Two routes "Playback<-sspX Tx" and "sspX Rx<-Capture" are created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-8-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-max98927: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:52 +0000 (19:09 +0800)]
ASoC: Intel: avs-max98927: remove redundant dapm routes

Two routes "Left HiFi Playback<-sspX Tx" and
"Right HiFi Playback<-sspX Tx" are created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-7-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-max98373: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:51 +0000 (19:09 +0800)]
ASoC: Intel: avs-max98373: remove redundant dapm routes

Two routes "Left HiFi Playback<-sspX Tx" and
"Right HiFi Playback<-sspX Tx" are created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-6-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-max98357a: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:50 +0000 (19:09 +0800)]
ASoC: Intel: avs-max98357a: remove redundant dapm routes

The route "HiFi Playback<-sspX Tx" is created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-5-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-hdaudio: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:49 +0000 (19:09 +0800)]
ASoC: Intel: avs-hdaudio: remove redundant dapm routes

Three routes "HDMI 0 Playback<-hdaudioB0D2-cpu0 Tx",
"HDMI 1 Playback<-hdaudioB0D2-cpu1 Tx" and
"HDMI 2 Playback<-hdaudioB0D2-cpu2 Tx" are created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-4-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-dmic: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:48 +0000 (19:09 +0800)]
ASoC: Intel: avs-dmic: remove redundant dapm routes

Two routes "DMIC Rx<-Capture" and "DMIC WoV Rx<-Capture" are created
by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-3-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: avs-da7219: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:47 +0000 (19:09 +0800)]
ASoC: Intel: avs-da7219: remove redundant dapm routes

Two routes "Playback<-sspX Tx" and "sspX Rx<-Capture" are created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-2-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoFix error check and cleanup for JH7110 TDM
Mark Brown [Fri, 9 Jun 2023 12:13:51 +0000 (13:13 +0100)]
Fix error check and cleanup for JH7110 TDM

Merge series from Walker Chen <walker.chen@starfivetech.com>:

Some minor issues were found during addtional testing and static
analysis. The first patch fix the error check for the return value of
devm_reset_control_array_get_exclusive(). The second patch drop some
unused macros.

13 months agoASoC: dt-bindings: audio-graph-card: Expand 'widgets' documentation
Marek Vasut [Tue, 6 Jun 2023 17:59:51 +0000 (19:59 +0200)]
ASoC: dt-bindings: audio-graph-card: Expand 'widgets' documentation

Document the encoding of 'widgets' property to avoid confusion.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20230606175951.215740-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: audio-graph-card2-custom-sample: add missing CPU:Codec = 1:N sample
Kuninori Morimoto [Fri, 9 Jun 2023 01:40:41 +0000 (01:40 +0000)]
ASoC: audio-graph-card2-custom-sample: add missing CPU:Codec = 1:N sample

It has CPU:Codec = 1:1 and N:N samples, but missing 1:N settings.
This patch adds it.

One note here is that because of registering timing, probing and
CPU/Codec numbering are mismatching.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ilbx1kh3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Add IPC3 Kernel Injector
Curtis Malainey [Thu, 8 Jun 2023 22:18:16 +0000 (15:18 -0700)]
ASoC: SOF: Add IPC3 Kernel Injector

Add debugfs path to fake a malicious firmware message for fuzzing purposes.

Skip IPC4 for initial integration

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
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/20230608221822.2825786-2-cujomalainey@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Refactor rx function for fuzzing
Curtis Malainey [Thu, 8 Jun 2023 22:18:15 +0000 (15:18 -0700)]
ASoC: SOF: Refactor rx function for fuzzing

Refactor the function so reading the data is done outside the work
function so fuzzing can pass data directly into the work callbacks.

Also expose the inner function outside the module so we can call it from
the injector.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
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/20230608221822.2825786-1-cujomalainey@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8192-mt6359: Go back to old headphone pin name
Nícolas F. R. A. Prado [Thu, 8 Jun 2023 22:10:48 +0000 (18:10 -0400)]
ASoC: mediatek: mt8192-mt6359: Go back to old headphone pin name

This reverts commit cbbc0ec6dea09c ("ASoC: mediatek: mt8192-mt6359:
Remove " Jack" from Headphone pin name"). That commit removed the "
Jack" suffix with the reasoning that it is automatically added to the
name of the kcontrol created, which is true, but this name is also used
to look for the DAPM widget that will be toggled when the jack status is
updated. Since the widget is still called "Headphone Jack" the jack
can't link to the widget and the following error is shown:

mt8192_mt6359 sound: ASoC: DAPM unknown pin Headphone

It is not possible to also rename the headphone DAPM widget because its
name is used by a switch kcontrol, "Headphone Jack Switch", both to link
to the headphone widget and to assemble its name. This switch's name is
referenced in the upstream UCM file, so renaming it would break
userspace. Since the original commit didn't bring any benefit, besides
sparing a few CPU cycles, simply revert it.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20230608221050.217968-1-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: starfive: Remove some unused macros
Walker Chen [Thu, 8 Jun 2023 13:57:50 +0000 (21:57 +0800)]
ASoC: starfive: Remove some unused macros

These macros are unused and can be dropped.

Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230608135750.11041-3-walker.chen@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: starfive: Fix an error check in jh7110_tdm_clk_reset_get()
Walker Chen [Thu, 8 Jun 2023 13:57:49 +0000 (21:57 +0800)]
ASoC: starfive: Fix an error check in jh7110_tdm_clk_reset_get()

Fix the check for devm_reset_control_array_get_exclusive() return value.
The devm_reset_control_array_get_exclusive() function may return NULL if
it's an optional request. If optional is intended then NULL should not
be treated as an error case, but as a special kind of success case. So
here the IS_ERR() is used to check better.

Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230608135750.11041-2-walker.chen@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mt8188-mt6359: Cleanups
Mark Brown [Thu, 8 Jun 2023 15:07:32 +0000 (16:07 +0100)]
ASoC: mt8188-mt6359: Cleanups

Merge series from AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:

This series performs some cleanups to the mt8188-mt6359 driver,
including usage of bitfield macros, adding definitions of register
fields and some others for readability and consistency.

13 months agoASoC: tegra: Simplify code around clk_get_rate() handling
Christophe JAILLET [Thu, 8 Jun 2023 05:27:22 +0000 (07:27 +0200)]
ASoC: tegra: Simplify code around clk_get_rate() handling

clk_get_rate() returns an unsigned long, so there is no point in storing it
in a long, and test for negative values.

So, turn 'parent_rate' into an unsigned long, simplify the sanity check,
the error message and the return value, in case of error (i.e. 0).

Doing so also turns 'i' and 'valid_rates' into unsigned long, but it is
fine and harmless.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/53f928290f08f50ff43031e17fe1d88443c2c441.1686202022.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: max98088: clean up some inconsistent indenting
Jiapeng Chong [Thu, 8 Jun 2023 07:55:40 +0000 (15:55 +0800)]
ASoC: max98088: clean up some inconsistent indenting

No functional modification involved.

sound/soc/codecs/max98088.c:316 m98088_eq_band() warn: inconsistent indenting.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5461
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230608075540.61575-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers
AngeloGioacchino Del Regno [Thu, 8 Jun 2023 08:47:27 +0000 (10:47 +0200)]
ASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers

Replace open coded instances of FIELD_GET() with it, move register
definitions at the top of the file and also replace magic numbers
with register definitions.

While at it, also change a regmap_update_bits() call to regmap_write()
because the top 29 bits of AUD_TOP_CFG (31:3) are reserved (unused).

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230608084727.74403-6-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8188-mt6359: Clean up log levels
AngeloGioacchino Del Regno [Thu, 8 Jun 2023 08:47:26 +0000 (10:47 +0200)]
ASoC: mediatek: mt8188-mt6359: Clean up log levels

Change some dev_info prints to dev_err() and some to dev_dbg(),
depending on the actual severity of them.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230608084727.74403-5-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return ret
AngeloGioacchino Del Regno [Thu, 8 Jun 2023 08:47:25 +0000 (10:47 +0200)]
ASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return ret

Change all instances of `return ret` to `return 0` at the end of
functions where ret is always zero and also change functions
mt8188_{hdmi,dptx}_codec_init to be consistent with how other
functions are returning errors

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230608084727.74403-4-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8188-mt6359: clean up a return in codec_init
Dan Carpenter [Thu, 8 Jun 2023 08:47:24 +0000 (10:47 +0200)]
ASoC: mediatek: mt8188-mt6359: clean up a return in codec_init

This code triggers a Smatch static checker warning and does sort of
look like an error path.

sound/soc/mediatek/mt8188/mt8188-mt6359.c:597 mt8188_max98390_codec_init() warn: missing error code? 'ret'

However, returning 0 is intentional.  Make that explicit.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230608084727.74403-3-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8188-mt6359: Compress of_device_id entries
AngeloGioacchino Del Regno [Thu, 8 Jun 2023 08:47:23 +0000 (10:47 +0200)]
ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries

Those entries fit in one line: compress them to reduce line count.
While at it, also add the sentinel comment to the last entry.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230608084727.74403-2-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: stm32: fix dtbs_check warnings
Mark Brown [Wed, 7 Jun 2023 20:16:47 +0000 (21:16 +0100)]
ASoC: stm32: fix dtbs_check warnings

Merge series from Olivier Moysan <olivier.moysan@foss.st.com>:

Fix dtbs_check warnings in STM32MP15 DK boards Devices Trees for
STM32 I2S and Cirrus CS42L51 codec.

- Add OF graph port property in I2S and CS42L51 DT bindings.
  Fixes warnings:
  audio-controller@4000b000: Unevaluated properties are not allowed
  ('port' was unexpected)
  cs42l51@4a: Unevaluated properties are not allowed
  ('port' was unexpected)
- Correct OF graph DAI audio format property for STM32MP15x Dkx I2S node

13 months agoASoC: codecs: wsa883x: use existing define instead of raw value
Krzysztof Kozlowski [Wed, 7 Jun 2023 17:13:26 +0000 (19:13 +0200)]
ASoC: codecs: wsa883x: use existing define instead of raw value

Use existing define for WSA883X_GLOBAL_PA_ENABLE instead of hard-coded
value, just like in other places in this driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230607171326.179527-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: HDA: two cleanups
Mark Brown [Wed, 7 Jun 2023 17:22:08 +0000 (18:22 +0100)]
ASoC: Intel: HDA: two cleanups

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

One removal of a non-existent Kconfig initialization and one
correction to enable SoundWire link when no HDaudio external codec is
detected. This will generate more information and help resolve cases
where the ACPI information is incorrect.

13 months agoASoC: mediatek: mt8188-mt6359: add i2c dependency
Arnd Bergmann [Wed, 7 Jun 2023 12:08:15 +0000 (14:08 +0200)]
ASoC: mediatek: mt8188-mt6359: add i2c dependency

The newly added driver is missing this dependency, causing a possible
build failure:

WARNING: unmet direct dependencies detected for SND_SOC_MAX98390
WARNING: unmet direct dependencies detected for SND_SOC_NAU8825
  Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=m]
  Selected by [y]:
  - SND_SOC_MT8188_MT6359 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_MT8188 [=y] && MTK_PMIC_WRAP [=y]
aarch64-linux-ld: sound/soc/codecs/max98390.o: in function `max98390_i2c_probe':
max98390.c:(.text+0x514): undefined reference to `__devm_regmap_init_i2c'

Fixes: 9f08dcbddeb30 ("ASoC: mediatek: mt8188-mt6359: support new board with nau88255")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230607120831.3587379-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: hda-pcm: remove kernel parameter init
Pierre-Louis Bossart [Tue, 6 Jun 2023 22:25:29 +0000 (17:25 -0500)]
ASoC: SOF: Intel: hda-pcm: remove kernel parameter init

The 'hda_disable_rewinds' kernel parameter is initialized with a
non-existent CONFIG_SND_SOC_SOF_HDA_DISABLE_REWINDS.

We probably forgot to clean this up when this Kconfig option was
removed when upstreaming in 2021.

Reported-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: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230606222529.57156-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: fix SoundWire/HDaudio mutual exclusion
Pierre-Louis Bossart [Tue, 6 Jun 2023 22:25:28 +0000 (17:25 -0500)]
ASoC: SOF: Intel: fix SoundWire/HDaudio mutual exclusion

The functionality described in Commit 61bef9e68dca ("ASoC: SOF: Intel: hda: enforce exclusion between HDaudio and SoundWire")
does not seem to be properly implemented with two issues that need to
be corrected.

a) The test used is incorrect when DisplayAudio codecs are not supported.

b) Conversely when only Display Audio codecs can be found, we do want
to start the SoundWire links, if any. That will help add the relevant
topologies and machine descriptors, and identify cases where the
SoundWire information in ACPI needs to be modified with a quirk.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230606222529.57156-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: add snd_soc_get_stream_cpu()
Kuninori Morimoto [Thu, 1 Jun 2023 00:42:49 +0000 (00:42 +0000)]
ASoC: add snd_soc_get_stream_cpu()

We are using get_stream_cpu() to get CPU stream which cares
Codec2Codec. But it is static function for now, and we want to use it
from other files. This patch makes it global function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fs7cj9mf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: soc.h: remove snd_soc_compr_ops :: trigger
Kuninori Morimoto [Thu, 1 Jun 2023 00:43:02 +0000 (00:43 +0000)]
ASoC: soc.h: remove snd_soc_compr_ops :: trigger

ASoC framework is not using trigger call-back for snd_soc_compr_ops.
This patch remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87edmwj9m1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: machine driver updates for 6.5
Mark Brown [Tue, 6 Jun 2023 15:41:59 +0000 (16:41 +0100)]
ASoC: Intel: machine driver updates for 6.5

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

An unusually large set of patches to deal with new SoundWire-based
platforms.

The bulk of the patches addresses support for MTL using RT712, RT713,
MAX98363, CS42L42 jack codec and amplifiers. The sof_sdw machine
driver had to be updated to remove limitations on number of codecs per
links, dai types, dai naming, etc. We also moved parts of the Realtek
and Maxim support in common code to avoid duplication.

Community users also reported two Dell SKUs which were not supported
in the mainline due to hardware permutations.

13 months agoASoC: dt-bindings: document audio of graph port for cs42l51
Olivier Moysan [Tue, 6 Jun 2023 11:56:03 +0000 (13:56 +0200)]
ASoC: dt-bindings: document audio of graph port for cs42l51

When linking the CS42L51 to another DAI component, according
to audio graph cards bindings, an OF graph port property is expected
in the node. Document the port property.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230606115605.1633595-3-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: dt-bindings: stm32: document audio of graph port for i2s
Olivier Moysan [Tue, 6 Jun 2023 11:56:02 +0000 (13:56 +0200)]
ASoC: dt-bindings: stm32: document audio of graph port for i2s

When linking the STM32 I2S to another DAI component, according
to audio graph cards bindings, an OF graph port property is expected
in the node. Document the port property.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230606115605.1633595-2-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mt8188: add new board support
Mark Brown [Mon, 5 Jun 2023 17:29:36 +0000 (18:29 +0100)]
ASoC: mt8188: add new board support

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

In the series, we extend the capability of mt8188-mt6359 driver.

The following changes are included.
1. Divide ADDA BE dai into two dais for SOF.
2. Register hdmi/dp jack pins.
3. dai_fmt can be configured from device tree.
4. Add some I2S codecs support.

In addition, new compatible string "mediatek,mt8188-nau8825" is
included for a new board support.

13 months agoASoC: SOF: Intel: LunarLake preparation patches
Mark Brown [Mon, 5 Jun 2023 17:29:30 +0000 (18:29 +0100)]
ASoC: SOF: Intel: LunarLake preparation patches

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

This patchset adds the changes required for the hda-dai extension to
deal with SSSP/DMIC/SoundWire starting with LunarLake, as well as the
new TLV IPC to provide the DMA stream_tag to the DSP firmware.

LunarLake support for SSP/DMIC is ready but is gated by the patch
"ASoC: SOF: Intel: shim: add enum for ACE 2.0 IP used in LunarLake"
currently only present in the SoundWire tree.

13 months agoASoC: SOF: Intel: hda: add helper to extract SoundWire link count
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:20 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda: add helper to extract SoundWire link count

The register changed with the HDaudio integration, the information is
present in the extended link descriptor and not in the SHIM.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: mtl: prepare for code reuse
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:19 +0000 (15:56 -0500)]
ASoC: SOF: Intel: mtl: prepare for code reuse

Some functions can be used for newer LNL hardware.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-topology: add DMA config TLV to IPC data
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:18 +0000 (15:56 -0500)]
ASoC: SOF: ipc4-topology: add DMA config TLV to IPC data

This patch adds a DMA config TLV structure and the relevant code to
copy this TLV after the gateway configuration. For now this is an
iso-functionality change, the TLVs are not configured just
yet. Additional patches will be needed for DMIC/SSP/ALH (aka
SoundWire).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@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/20230602205620.310879-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-topology: introduce DMA config TLV
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:17 +0000 (15:56 -0500)]
ASoC: SOF: ipc4-topology: introduce DMA config TLV

Starting with LunarLake, the DMIC/SSP/SoundWire audio interfaces will
use the HDaudio DMA. This patch adds the DMA configuration structure
to be passed as a TLV appended at the end of each gateway
configuration.

This patch only provides the definitions for now, the TLV will be
added in the actual blobs separately for each interface.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@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/20230602205620.310879-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-topology: extend ALH-specific data structure
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:16 +0000 (15:56 -0500)]
ASoC: SOF: ipc4-topology: extend ALH-specific data structure

LunarLake introduces a new TLV blob passed to the firmware for DMA
configuration. This TLV structure is directly inspired by the ALH
multi-gateway structure used so far. This patch suggest a transition
to the more abstract structure with no references to ALH.

This is an iso-functionality redefinition of structure, the TLV will
be added in a follow-up patch.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@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/20230602205620.310879-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: hda-dai: add get_hlink callback
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:15 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda-dai: add get_hlink callback

The existing code for HDAudio DAIs cannot be extended to other types
of DAIs, specific programming sequences need to be abstracted
away.

This patch hides the mechanism to determine the multi-link structure
related to the DAI and program the LOSIDV register. An added benefit
is that we can remove all references to the codec DAI from what should
be a CPU dai configuration only.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: hda-dai: add calc_stream_format callback
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:14 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda-dai: add calc_stream_format callback

The existing code for HDAudio DAIs cannot be extended to other types
of DAIs, specific programming sequences need to be abstracted away.

This patch hides the stream format setup which is currently completely
related to the HDaudio codec setup - not something that will work for
other types of DAIs.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: hda-dai: add codec_dai_set_stream callback
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:13 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda-dai: add codec_dai_set_stream callback

The existing code for HDAudio DAIs cannot be extended to other types
of DAIs, specific programming sequences need to be abstracted
away. Start here with hiding the stream_tag needed by the HDAudio
codec_dai.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: hda-dai: add error checks to prevent static analysis warnings
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:12 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda-dai: add error checks to prevent static analysis warnings

make KCFLAGS='-fanalyzer' sound/soc/sof/intel/ reports several NULL
pointer dereference paths.

Example log:
ops = hda_dai_get_ops(substream, cpu_dai);
  |      |                          ^~~~~
  |      |                          |
  |      |               (14) return of NULL to ‘non_hda_dai_hw_params’ from ‘hda_dai_get_ops’
  |  353 |         sdev = widget_to_sdev(w);
  |  354 |         hext_stream = ops->get_hext_stream(sdev, cpu_dai, substream);
  |      |                       ~~~~~~~~~~~~~~~~~~~~
  |      |                          |
  |      |                          (15) dereference of NULL ‘ops’

The function hda_dai_get_ops() can return NULL, but the return value
is not checked across the board. It's not a problem today, since we do
check in the first use of the function, but static analysis tools are
not aware of the different ALSA stages. Rather than argue forever,
let's just add the error checks consistently and make sure this tool
can be added to the CI checks.

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>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: soc-acpi: add Rex CS42l42 and MAX98363 SoundWire entries
Uday M Bhat [Fri, 2 Jun 2023 20:22:25 +0000 (15:22 -0500)]
ASoC: Intel: soc-acpi: add Rex CS42l42 and MAX98363 SoundWire entries

Add support to the following daughter card for rex:

SDW0: CS42l42 Headset
SDW2: MX98363 Speaker

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-29-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: Add support for Rex soundwire
Uday M Bhat [Fri, 2 Jun 2023 20:22:24 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: Add support for Rex soundwire

Add rex entry in the soundwire quirk table

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-28-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: Add support for MAX98363 codec
Uday M Bhat [Fri, 2 Jun 2023 20:22:23 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: Add support for MAX98363 codec

Add support for MAX98363 soundwire codec. Update build
configuration to include this codec.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-27-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: Modify maxim helper functions and structure names
Uday M Bhat [Fri, 2 Jun 2023 20:22:22 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: Modify maxim helper functions and structure names

Init function and structure names are modified to use maxim
instead of max98373. Card components and speaker names are
updated based on part id.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-26-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: Rename sof_sdw_max98373.c file to sof_sdw_maxim.c
Uday M Bhat [Fri, 2 Jun 2023 20:22:21 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: Rename sof_sdw_max98373.c file to sof_sdw_maxim.c

This is needed to use the common implementation for other maxim
soundwire codecs

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-25-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: Add helper function for cs42l42 codec
Uday M Bhat [Fri, 2 Jun 2023 20:22:20 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: Add helper function for cs42l42 codec

Helper functions added to support CS42l42 soundwire codec.
Build configuration is updated to include this codec.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-24-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: Add rpl_rt1019_rt5682 driver
Terry Cheong [Fri, 2 Jun 2023 20:22:19 +0000 (15:22 -0500)]
ASoC: Intel: Add rpl_rt1019_rt5682 driver

Boards were using this in older kernels before adl and rpl ids were
split. Add this back to maintain support.

Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Terry Cheong <htcheong@chromium.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: Sof_ssp_amp: Correcting author name.
Balamurugan C [Fri, 2 Jun 2023 20:22:18 +0000 (15:22 -0500)]
ASoC: Intel: Sof_ssp_amp: Correcting author name.

Corrected the author name camel case and initial.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: ADL: Moving amp only boards into end of the table.
Balamurugan C [Fri, 2 Jun 2023 20:22:17 +0000 (15:22 -0500)]
ASoC: Intel: ADL: Moving amp only boards into end of the table.

Moving amp only boards into end of the match table to have
better order and maintenance.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: ADL: Enable HDMI-In capture feature support for non-I2S codec boards.
Balamurugan C [Fri, 2 Jun 2023 20:22:16 +0000 (15:22 -0500)]
ASoC: Intel: ADL: Enable HDMI-In capture feature support for non-I2S codec boards.

Adding HDMI-In capture support for the products doesn't have onboard
I2S codec.but need to support HDMI-In capture via I2S and audio playback
through HDMI/DP monitor.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof-sdw: add Dell SKU 0B34
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:22:15 +0000 (15:22 -0500)]
ASoC: Intel: sof-sdw: add Dell SKU 0B34

This device has no 3.5mm jack, only a single amplifier and mic codec.

Closes: https://github.com/thesofproject/linux/issues/4399
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: soc-acpi: add tables for Dell SKU 0B34
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:22:14 +0000 (15:22 -0500)]
ASoC: Intel: soc-acpi: add tables for Dell SKU 0B34

Yet another permutation of devices.

Closes: https://github.com/thesofproject/linux/issues/4399
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add quick for Dell SKU 0BDA
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:22:13 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: add quick for Dell SKU 0BDA

The SKU numbering isn't quite consistent with the existing RaptorLake
SKUs but the PCI ID is definitively RaptorLake.

Closes: https://github.com/thesofproject/linux/issues/4380
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: soc-acpi: add table for RPL Dell SKU 0BDA
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:22:12 +0000 (15:22 -0500)]
ASoC: Intel: soc-acpi: add table for RPL Dell SKU 0BDA

This is a standard configuration we've seen before for TGL.

Closes: https://github.com/thesofproject/linux/issues/4380
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: increase sdw pin index for each sdw link
Bard Liao [Fri, 2 Jun 2023 20:22:11 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: increase sdw pin index for each sdw link

To support multiple codecs per SoundWire link, we have to assign multiple
CPU DAIs to different DAI links sharing the same physical link. This is
not possible with the existing code since we assume that only 'Pin2' is
used for playback and 'Pin3' used for capture - additional DAIs cannot
be handled.

This patch enables more CPU DAIs to be used, e.g. "SDW0 Pin2",
"SDW0 Pin3", and "SDW0 Pin4" for SDW0-Playback-SimpleJack,
SDW0-Capture-SimpleJack, and SDW0-Playback-SmartAmp DAI links on physical
link #0.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add rt713 support
Bard Liao [Fri, 2 Jun 2023 20:22:10 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: add rt713 support

rt713 is rt712 but without amp.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: soc-acpi-intel-mtl-match: add rt712 ID
Bard Liao [Fri, 2 Jun 2023 20:22:09 +0000 (15:22 -0500)]
ASoC: Intel: soc-acpi-intel-mtl-match: add rt712 ID

Add rt712 ID for MTL.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: soc-acpi-intel-tgl-match: add rt712 ID
Bard Liao [Fri, 2 Jun 2023 20:22:08 +0000 (15:22 -0500)]
ASoC: Intel: soc-acpi-intel-tgl-match: add rt712 ID

Add rt712 ID for TGL.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add rt712 support
Bard Liao [Fri, 2 Jun 2023 20:22:07 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: add rt712 support

Rt712 is a multi function codec which shpports headset, amp, and dmic
functions. Rt712 has two sdw interfaces and codec drivers, one for jack
and amp, the other for dmic. part id 0x712 is for jack and amp, and 0x1712
is for dmic.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: make rt711_sdca be generic
Bard Liao [Fri, 2 Jun 2023 20:22:06 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: make rt711_sdca be generic

Let rename rt711_sdca to rt_sdca_jack and let it be used for all
Realtek sdca jacks.
The commit uses component->name_prefix to construct card->components,
and determine which codec it is. So, we have to set name_prefix
properly.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: rename SOF_RT711_JDSRC to SOF_JACK_JDSRC
Bard Liao [Fri, 2 Jun 2023 20:22:05 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: rename SOF_RT711_JDSRC to SOF_JACK_JDSRC

Jack Detection source can be applied to all jacks, not only rt711.
No function changes.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw_rt_sdca_jack_common: test SOF_JACK_JDSRC in _exit
Bard Liao [Fri, 2 Jun 2023 20:22:04 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw_rt_sdca_jack_common: test SOF_JACK_JDSRC in _exit

if (!SOF_RT711_JDSRC(sof_sdw_quirk)) is tested in rt711_sdca_add_codec_
device_props(), and we don't add software node to the device if jack
source is not set. We need to do the same test in
sof_sdw_rt711_sdca_exit(), and avoid removing software node if jack
source is not set.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add multi dailink support for a codec
Bard Liao [Fri, 2 Jun 2023 20:22:03 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: add multi dailink support for a codec

A codec may support multiple dais for different purpose. For example,
the rt712 codec supports jack and amp on different dais and machine
driver needs to create different dailink for those dais.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sdw_sof: append dai_type and remove codec_type
Bard Liao [Fri, 2 Jun 2023 20:22:02 +0000 (15:22 -0500)]
ASoC: Intel: sdw_sof: append dai_type and remove codec_type

We append codec type to dailink name to distinguish different dailink
on the same sdw link and direction. But we could create multi dailinks
for a codec and the dailink name will be duplicated if we append codec
type to the dailink name.
Appending dai type instead of codec type can solve the issue.
For example, if a codec supports JACK on dai 0 and AMP on dai 1, the
existing code will create dailinks
SDW0-Playback-SimpleJack or SDW0-Playback-SmartAmp for both dailinks,
and it will be SDW0-Playback-SimpleJack for dailink 0 and
SDW0-Playback-SmartAmp for dailink 1 after this change.
Then codec type is not used any more and can be removed.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add codec_info pointer
Bard Liao [Fri, 2 Jun 2023 20:22:01 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: add codec_info pointer

codec_info_list[codec_index] is used multiple times in the
create_sdw_dailink() function. Adding a codec_info pointer to shorten
the code. This is a preparation for the following up patches.
No function changed.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: use predefine dailink id
Bard Liao [Fri, 2 Jun 2023 20:22:00 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: use predefine dailink id

Currently, we assign dailink ids in order, and shift with codec type.
The purpose is to have consistent dailink ids for topologies.
This can be simplified if we have a predefined dailink id in
sof_sdw_dai_info.
We reuse the existing ids as the predefine ids. So the dailink ids will
not be changed by this commit.
With this change, we no longer need to check the adr order described in a
snd_soc_acpi_link_adr array.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add dai info
Bard Liao [Fri, 2 Jun 2023 20:21:59 +0000 (15:21 -0500)]
ASoC: Intel: sof_sdw: add dai info

The existing code create a dailink for a codec. However, we may need
multi dailinks for a codec. This commit adds a new struct in
sof_sdw_codec_info{} to store the dai info of a codec.
The initial assumption if that we will create at most 3 dailink types
for a codec, since this is the max known with upcoming SDCA devices. We
may need to increase this number as new SDCA 'functions' become available.

One strong assumption is that all dailinks exposed are independent, as per
SDCA directions.

This commit just moves some items into the new sof_sdw_dai_info struct.
There is no function changed. Multi dais supported will be added in the
follow up commits.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add missing exit callback
Bard Liao [Fri, 2 Jun 2023 20:21:58 +0000 (15:21 -0500)]
ASoC: Intel: sof_sdw: add missing exit callback

Somehow .exit = sof_sdw_rt_amp_exit was missing in rt1318 codec info.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: amd: vangogh: select CONFIG_SND_AMD_ACP_CONFIG
Arnd Bergmann [Mon, 5 Jun 2023 08:58:29 +0000 (10:58 +0200)]
ASoC: amd: vangogh: select CONFIG_SND_AMD_ACP_CONFIG

The vangogh driver just gained a link time dependency that now causes
randconfig builds to fail:

x86_64-linux-ld: sound/soc/amd/vangogh/pci-acp5x.o: in function `snd_acp5x_probe':
pci-acp5x.c:(.text+0xbb): undefined reference to `snd_amd_acp_find_config'

Fixes: e89f45edb747e ("ASoC: amd: vangogh: Add check for acp config flags in vangogh platform")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230605085839.2157268-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoAdd NAU8825C support
Mark Brown [Mon, 5 Jun 2023 12:11:17 +0000 (13:11 +0100)]
Add NAU8825C support

Merge series from David Lin <CTLIN0@nuvoton.com>:

This series adds nau8825c support. The driver can be used on
NAU8825B and NAU8825C.

13 months agoASoC: amd: vangogh: select CONFIG_SND_AMD_ACP_CONFIG
Arnd Bergmann [Fri, 2 Jun 2023 12:44:39 +0000 (14:44 +0200)]
ASoC: amd: vangogh: select CONFIG_SND_AMD_ACP_CONFIG

The vangogh driver just gained a link time dependency that now causes
randconfig builds to fail:

x86_64-linux-ld: sound/soc/amd/vangogh/pci-acp5x.o: in function `snd_acp5x_probe':
pci-acp5x.c:(.text+0xbb): undefined reference to `snd_amd_acp_find_config'

Fixes: e89f45edb747e ("ASoC: amd: vangogh: Add check for acp config flags in vangogh platform")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230602124447.863476-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: dt-bindings: mediatek,mt8188-mt6359: add NAU8825 support
Trevor Wu [Fri, 26 May 2023 09:31:50 +0000 (17:31 +0800)]
ASoC: dt-bindings: mediatek,mt8188-mt6359: add NAU8825 support

Add compatible string "mediatek,mt8188-nau8825" to support new board
with nau8825 codec.

Introduce two properties "dai-format" and "mediatek,clk-provider" under
dai-link subnode to configure dai-link parameters via dts.

"codec" property is removed from required property of dai-link subnode.
For co-clock case, it's possible two dai-links should be configured to
the same dai format, but only one cpu dai is bound with codec.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230526093150.22923-8-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8188-mt6359: support new board with nau88255
Trevor Wu [Fri, 26 May 2023 09:31:49 +0000 (17:31 +0800)]
ASoC: mediatek: mt8188-mt6359: support new board with nau88255

This patch adds multiple i2s codecs support including NAU88L25,
MAX98390, and the dumb amp like NAU8318 usage. In addition, dmic-codec
is also added to skip the beginning pop noise.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230526093150.22923-7-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: soc-dapm.c: clean up debugfs for freed widget
Trevor Wu [Fri, 26 May 2023 09:31:48 +0000 (17:31 +0800)]
ASoC: soc-dapm.c: clean up debugfs for freed widget

When a widget is added to dapm via snd_soc_dapm_new_widgets,
dapm_debugfs_add_widget is also called to create a corresponding debugfs
file. However, when a widget is freed by snd_soc_dapm_free_widget, the
corresponding debugfs is not cleared. As a result, the freed widget is
still seen in the dapm directory.

This patch adds dapm_debugfs_free_widget to free the debugfs of a
specified widget, and it's called at snd_soc_dapm_free_widget to clean
up the debugfs for freed widget.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230526093150.22923-6-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: common: soundcard driver add dai_fmt support
Trevor Wu [Fri, 26 May 2023 09:31:47 +0000 (17:31 +0800)]
ASoC: mediatek: common: soundcard driver add dai_fmt support

There are two changes included in the patch.

First, add set_dailink_daifmt() function, so dai_fmt can be updated by
the configuration in dai-link sub node.

Second, remove codec phandle from required property in dai-link sub node.
For example, user possibly needs to update dai-format for all etdm
co-clock dai-links, but codec doesn't need to be specified in capture
dai-link for a speaker amp.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230526093150.22923-5-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8188-mt6359: register hdmi/dp jack pins
Trevor Wu [Fri, 26 May 2023 09:31:46 +0000 (17:31 +0800)]
ASoC: mediatek: mt8188-mt6359: register hdmi/dp jack pins

Some userspace applications need jack control events, so register hdmi
and dp jack pins to activate jack control events.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230526093150.22923-4-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: dt-bindings: mediatek,mt8188-mt6359: remove ADDA_BE from link-name
Trevor Wu [Fri, 26 May 2023 09:31:45 +0000 (17:31 +0800)]
ASoC: dt-bindings: mediatek,mt8188-mt6359: remove ADDA_BE from link-name

ADDA_BE is used to connect to mt6359. For machine mt8188-mt6359, codec
for ADDA_BE must be mt6359 which are configured on the machine driver.
Besides, ADDA_BE is divided into two dais, UL_SRC_BE and DL_SRC_BE.
As a result, remove ADDA_BE from items of link-name.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230526093150.22923-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8188: separate ADDA playback dai from capture dai
Trevor Wu [Fri, 26 May 2023 09:31:44 +0000 (17:31 +0800)]
ASoC: mediatek: mt8188: separate ADDA playback dai from capture dai

MT8188 will support SOF. In SOF, be_hw_params_fixup callback are used to
configure BE hardware parameters. However, playback and capture stream
share the same callback function in which it can't know the stream type.

It's possible to require different parameters for playback and capture
stream, so separate them into two dais for SOF usage.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230526093150.22923-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>