linux-2.6-block.git
9 months agoImprove AMD ACP Vangogh audio support for Steam Deck
Mark Brown [Tue, 19 Dec 2023 16:45:59 +0000 (16:45 +0000)]
Improve AMD ACP Vangogh audio support for Steam Deck

Merge series from Cristian Ciocaltea <cristian.ciocaltea@collabora.com>:

This patch series provides several fixes and improvements to AMD ACP drivers
targeting the Vangogh platform, as found on the Valve's new Steam Deck OLED.

Although in theory the board should have been supported by both SOF and legacy
ACP drivers, as of next-20231208 the audio seems to be completely broken.

Please note this only restores the legacy support, while SOF will be handled in
a separate series.

9 months agoASoC: don't use original dummy dlc
Mark Brown [Tue, 19 Dec 2023 16:45:51 +0000 (16:45 +0000)]
ASoC: don't use original dummy dlc

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

"Empty" dlc might be used on Platform, but "dummy" dlc is not needed
for it. [PATCH 1/5][PATCH 2/5] removes "dummy" dlc from Platform.

Now ASoC have common dummy dlc (= snd_soc_dummy_dlc).
[PATCH 3/5][PATCH 4/5] will use it instead of original dummy dlc.

Many drivers are using below macro

SND_SOC_DAILINK_DEFS(link,
     DAILINK_COMP_ARRAY(COMP_CPU(...)),
(X)      DAILINK_COMP_ARRAY(COMP_DUMMY()),
     DAILINK_COMP_ARRAY(COMP_EMPTY()));

But (X) part will create original dummy dlc.
[PATCH 5/5] will try not to create original dummy dlc, and replace
it to common dummy dlc.

9 months agoGPIO inclusion fixes to misc sound drivers
Mark Brown [Tue, 19 Dec 2023 16:45:42 +0000 (16:45 +0000)]
GPIO inclusion fixes to misc sound drivers

Merge series from Linus Walleij <linus.walleij@linaro.org>:

Mostly dropping unused headers, and a single driver rewrite.

9 months agoASoC: dt-bindings: qcom,lpass-va-macro: remove spurious contains in if statement
Neil Armstrong [Tue, 19 Dec 2023 13:23:37 +0000 (14:23 +0100)]
ASoC: dt-bindings: qcom,lpass-va-macro: remove spurious contains in if statement

Remove this spurious "contains" which causes the bindings check of
qcom,sm8450-lpass-va-macro compatible to fail with:
codec@33f0000: clocks: [[156, 57, 1], [156, 102, 1], [156, 103, 1], [156, 70, 1]] is too long
        from schema $id: http://devicetree.org/schemas/sound/qcom,lpass-va-macro.yaml#
codec@33f0000: clock-names: ['mclk', 'macro', 'dcodec', 'npl'] is too long
        from schema $id: http://devicetree.org/schemas/sound/qcom,lpass-va-macro.yaml#

Seems the double "contains" was considered as valid by the tool but broke
the entire if statements.

Fixes: f243ef746d0a ("ASoC: dt-bindings: qcom,lpass-va-macro: Add SM8650 LPASS VA")
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231219-topic-sm8x50-upstream-va-macro-bindings-fix-v1-1-ae133886f70e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: sprd: Simplify memory allocation in sprd_platform_compr_dma_config()
Christophe JAILLET [Tue, 19 Dec 2023 04:41:19 +0000 (05:41 +0100)]
ASoC: sprd: Simplify memory allocation in sprd_platform_compr_dma_config()

'sg' is freed at the end sprd_platform_compr_dma_config() both in the
normal and in the error handling path.

There is no need to use the devm_kcalloc()/devm_kfree(), kcalloc()/kfree()
is enough.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://msgid.link/r/d16f22ae0627249a9fc658927832590cd88c544e.1702960856.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: amd: Add acp-psp mailbox interface for iram-dram fence register modification
Venkata Prasad Potturu [Tue, 19 Dec 2023 11:24:13 +0000 (16:54 +0530)]
ASoC: SOF: amd: Add acp-psp mailbox interface for iram-dram fence register modification

Add acp-psp mailbox communication interface for iram-dram size
modification to notify psp.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://msgid.link/r/20231219112416.3334928-5-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: Rename amd_bt sof_dai_type
Venkata Prasad Potturu [Tue, 19 Dec 2023 11:24:12 +0000 (16:54 +0530)]
ASoC: SOF: Rename amd_bt sof_dai_type

Rename amd_bt sof_dai_type from ACP to ACP_BT.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://msgid.link/r/20231219112416.3334928-4-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: Add i2s bt dai configuration support for AMD platforms
Venkata Prasad Potturu [Tue, 19 Dec 2023 11:24:11 +0000 (16:54 +0530)]
ASoC: SOF: Add i2s bt dai configuration support for AMD platforms

Add support for i2s bt dai configuration from topology.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://msgid.link/r/20231219112416.3334928-3-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: Refactor sof_i2s_tokens reading to update acpbt dai
Venkata Prasad Potturu [Tue, 19 Dec 2023 11:24:10 +0000 (16:54 +0530)]
ASoC: SOF: Refactor sof_i2s_tokens reading to update acpbt dai

Refactor sof_i2s_tokens reading to update config->acpbt.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://msgid.link/r/20231219112416.3334928-2-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: amd: Refactor spinlock_irq(&sdev->ipc_lock) sequence in irq_handler
Venkata Prasad Potturu [Tue, 19 Dec 2023 11:24:09 +0000 (16:54 +0530)]
ASoC: SOF: amd: Refactor spinlock_irq(&sdev->ipc_lock) sequence in irq_handler

Refactor spinlock_irq(&sdev->ipc_lock) sequence in irq_handler
to avoid race conditions for acquiring hw_semaphore.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://msgid.link/r/20231219112416.3334928-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: soc.h: don't create dummy Component via COMP_DUMMY()
Kuninori Morimoto [Tue, 19 Dec 2023 05:10:33 +0000 (05:10 +0000)]
ASoC: soc.h: don't create dummy Component via COMP_DUMMY()

Many ASoC drivers define CPU/Codec/Platform dai_link by below macro.

SND_SOC_DAILINK_DEFS(link,
(A)      DAILINK_COMP_ARRAY(COMP_CPU("cpu_dai")),
(B)      DAILINK_COMP_ARRAY(COMP_CODEC("codec", "dai1"),
(B) COMP_CODEC("codec", "dai2")),
(C)      DAILINK_COMP_ARRAY(COMP_EMPTY()));

In this case, this macro will be converted to like below

[o] = static struct snd_soc_dai_link_component

(A) [o] link_cpus[]      = {{ .dai_name = "cpu_dai" }};
(B) [o] link_codecs[]    = {{ .dai_name = "dai1", .name = "codec" },
{ .dai_name = "dai2", .name = "codec" }}
(C) [o] link_platforms[] = {{ }};

CPU and Codec info will be filled by COMP_CPU() / COMP_CODEC (= A,B),
and Platform will have empty data by COMP_EMPTY() (= C) in this case.

Platform empty info will be filled when driver probe()
(most of case, CPU info will be copied to use soc-generic-dmaengine-pcm).

For example in case of DPCM FE/BE, it will be like below.
Codec will be dummy Component / DAI in this case (X).

SND_SOC_DAILINK_DEFS(link,
     DAILINK_COMP_ARRAY(COMP_CPU(...)),
(X)      DAILINK_COMP_ARRAY(COMP_DUMMY()),
     DAILINK_COMP_ARRAY(COMP_EMPTY()));

(X) part will converted like below

[o] link_codecs[]    = {{ .name = "snd-soc-dummy",
  .dai_name = "snd-soc-dummy-dai", }}

Even though we already have common asoc_dummy_dlc for dummy
Component / DAI, this macro will re-create new dummy dlc.
Some drivers defines many dai_link info via SND_SOC_DAILINK_DEFS(),
this means many dummy dlc also will be re-created. This is waste of
memory.

If we can use existing common asoc_dummy_dlc at (X),
we can avoid to re-creating dummy dlc, then, we can save the memory.

At that time, we want to keep existing code as much as possible, because
too many drivers are using this macro. But because of its original style,
using common asoc_dummy_dlc from it is very difficult or impossible.

So let's change the mind. The macro is used like below

SND_SOC_DAILINK_DEFS(link,
     DAILINK_COMP_ARRAY(COMP_CPU(...)),
(x)      DAILINK_COMP_ARRAY(COMP_DUMMY()),
     DAILINK_COMP_ARRAY(COMP_EMPTY()));

static struct snd_soc_dai_link dai_links[] = {
{
.name = ...,
.stream_name = ...,
(y) SND_SOC_DAILINK_REG(link),
},

(y) part will be like below

        static struct snd_soc_dai_link dai_links[] = {
        {
                .name = ...,
                .stream_name = ...,
 ^ ...
 | .codecs = link_codecs,
(y) .num_codecs = ARRAY_SIZE(link_codecs),
 v ...
}

This patch try to use trick on COMP_DUMMY()

- #define COMP_DUMMY() { .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", }
+ #define COMP_DUMMY()

By this tric, (x) part will be like below.

before
[o] link_codecs[] = {{ .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", }}
after
[o] link_codecs[] = { };

This is same as below

[o] link_codecs[0];

This means it has pointer (link_codecs), but the array size is 0.
(y) part will be like below.

static struct snd_soc_dai_link dai_links[] = {
{
...
.codecs = link_codecs,
.num_codecs = 0,
...
},

This is very special settings that normal use usually not do,
but new macro do.
We can find this special settings on soc-core.c and fill it as
"dummy DAI" (= asoc_dummy_dlc). By this tric, we can avoid to re-create
dummy dlc and save the memory.

This patch add tric at COMP_DUMMY() and add snd_soc_fill_dummy_dai()
to fill dummy DAI.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/871qbi93qu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: sof: use snd_soc_dummy_dlc
Kuninori Morimoto [Tue, 19 Dec 2023 05:10:19 +0000 (05:10 +0000)]
ASoC: sof: use snd_soc_dummy_dlc

We already have snd_soc_dummy_dlc.
Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/8734vy93r8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: intel: hdaudio.c: use snd_soc_dummy_dlc
Kuninori Morimoto [Tue, 19 Dec 2023 05:10:09 +0000 (05:10 +0000)]
ASoC: intel: hdaudio.c: use snd_soc_dummy_dlc

We already have snd_soc_dummy_dlc.
Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/874jge93ri.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: samsung: odroid: don't need DUMMY Platform
Kuninori Morimoto [Tue, 19 Dec 2023 05:10:02 +0000 (05:10 +0000)]
ASoC: samsung: odroid: don't need DUMMY Platform

We can use SND_SOC_DAILINK_REG() with 2 parameter.
DUMMY Platform is not needed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/875y0u93rq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl: fsl-asoc-card: don't need DUMMY Platform
Kuninori Morimoto [Tue, 19 Dec 2023 05:09:53 +0000 (05:09 +0000)]
ASoC: fsl: fsl-asoc-card: don't need DUMMY Platform

We can use SND_SOC_DAILINK_REG() with 2 parameter.
DUMMY Platform is not needed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/877cla93ry.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: acp: Remove redundant ret variable
Himanshu Bhavani [Mon, 18 Dec 2023 14:32:08 +0000 (20:02 +0530)]
ASoC: amd: acp: Remove redundant ret variable

Removed Unneeded variable: "ret"

Signed-off-by: Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
Link: https://msgid.link/r/20231218143214.939885-1-himanshu.bhavani@siliconsignals.io
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: tas2781: add support for FW version 0x0503
Gergo Koteles [Thu, 14 Dec 2023 00:25:39 +0000 (01:25 +0100)]
ASoC: tas2781: add support for FW version 0x0503

Layout of FW version 0x0503 is compatible with 0x0502.
Already supported by TI's tas2781-linux-driver tree.
https://git.ti.com/cgit/tas2781-linux-drivers/tas2781-linux-driver/

Fixes: 915f5eadebd2 ("ASoC: tas2781: firmware lib")
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Link: https://msgid.link/r/98d4ee4e01e834af72a1a0bea6736facf43582e0.1702513517.git.soyer@irl.hu
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: qcom,lpass-rx-macro: Add X1E80100 LPASS WSA
Krzysztof Kozlowski [Mon, 11 Dec 2023 12:31:04 +0000 (13:31 +0100)]
ASoC: dt-bindings: qcom,lpass-rx-macro: Add X1E80100 LPASS WSA

Add bindings for Qualcomm X1E80100 SoC Low Power Audio SubSystem (LPASS)
WSA macro codec, which looks like compatible with earlier SM8550.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231211123104.72963-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: qcom,lpass-rx-macro: Add X1E80100 LPASS VA
Krzysztof Kozlowski [Mon, 11 Dec 2023 12:31:03 +0000 (13:31 +0100)]
ASoC: dt-bindings: qcom,lpass-rx-macro: Add X1E80100 LPASS VA

Add bindings for Qualcomm X1E80100 SoC Low Power Audio SubSystem (LPASS)
VA macro codec, which looks like compatible with earlier SM8550.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231211123104.72963-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: qcom,lpass-rx-macro: Add X1E80100 LPASS TX
Krzysztof Kozlowski [Mon, 11 Dec 2023 12:31:02 +0000 (13:31 +0100)]
ASoC: dt-bindings: qcom,lpass-rx-macro: Add X1E80100 LPASS TX

Add bindings for Qualcomm X1E80100 SoC Low Power Audio SubSystem (LPASS)
TX macro codec, which looks like compatible with earlier SM8550.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231211123104.72963-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: qcom,lpass-rx-macro: Add X1E80100 LPASS RX
Krzysztof Kozlowski [Mon, 11 Dec 2023 12:31:01 +0000 (13:31 +0100)]
ASoC: dt-bindings: qcom,lpass-rx-macro: Add X1E80100 LPASS RX

Add bindings for Qualcomm X1E80100 SoC Low Power Audio SubSystem (LPASS)
RX macro codec, which looks like compatible with earlier SM8550.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231211123104.72963-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: qcom: Fix trivial code style issues
Krzysztof Kozlowski [Mon, 4 Dec 2023 10:00:48 +0000 (11:00 +0100)]
ASoC: qcom: Fix trivial code style issues

Fix few trivial code style issues, pointed out by checkpatch, so they do
not get copied to new code (when old code is used as template):

  WARNING: Prefer "GPL" over "GPL v2" - see commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity")
  WARNING: function definition argument 'struct platform_device *' should also have an identifier name
  ERROR: code indent should use tabs where possible
  WARNING: please, no spaces at the start of a line
  WARNING: Missing a blank line after declarations
  WARNING: unnecessary whitespace before a quoted newline

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231204100048.211800-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: soc-pcm.c: Complete the active count for components without DAIs
Chancel Liu [Mon, 4 Dec 2023 11:15:32 +0000 (19:15 +0800)]
ASoC: soc-pcm.c: Complete the active count for components without DAIs

Some components like platforms don't have DAIs. If the active count of
these components is ignored pinctrl may be wrongly selected between
default and sleep state. So need to increment or decrement the active
count for components without DAIs to avoid it.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://msgid.link/r/20231204111532.3165-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: qcom,sm8250: Add X1E80100 sound card
Krzysztof Kozlowski [Mon, 4 Dec 2023 10:01:16 +0000 (11:01 +0100)]
ASoC: dt-bindings: qcom,sm8250: Add X1E80100 sound card

Document bindings for the Qualcomm X1E80100 SoC sound card.  The
bindings are the same as for other newer Qualcomm ADSP sound cards, thus
keep them in existing qcom,sm8250.yaml file, even though Linux driver is
separate.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://msgid.link/r/20231204100116.211898-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: qcom: Add x1e80100 sound machine driver
Krzysztof Kozlowski [Mon, 4 Dec 2023 10:01:15 +0000 (11:01 +0100)]
ASoC: qcom: Add x1e80100 sound machine driver

Add sound machine driver for the soundcards on Qualcomm X1E80100 SoC,
supporting up to four channel audio playback over Soundwire bus.  The
driver is based on existing sc8280xp.c driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231204100116.211898-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: acp: Add missing MODULE_DESCRIPTION in mach-common
Cristian Ciocaltea [Sat, 9 Dec 2023 20:32:23 +0000 (22:32 +0200)]
ASoC: amd: acp: Add missing MODULE_DESCRIPTION in mach-common

Add a MODULE_DESCRIPTION() in the generic ACP machine driver to avoid
the following warning when building with W=1:

WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/amd/acp/snd-acp-mach.o

Fixes: d4c750f2c7d4 ("ASoC: amd: acp: Add generic machine driver support for ACP cards")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Link: https://msgid.link/r/20231209203229.878730-6-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: acp-config: Add missing MODULE_DESCRIPTION
Cristian Ciocaltea [Sat, 9 Dec 2023 20:32:22 +0000 (22:32 +0200)]
ASoC: amd: acp-config: Add missing MODULE_DESCRIPTION

Add the missing MODULE_DESCRIPTION() to avoid the following warning when
building with W=1:

WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/amd/snd-acp-config.o

Fixes: f1bdd8d385a8 ("ASoC: amd: Add module to determine ACP configuration")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Link: https://msgid.link/r/20231209203229.878730-5-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: vangogh: Switch to {RUNTIME,SYSTEM_SLEEP}_PM_OPS
Cristian Ciocaltea [Sat, 9 Dec 2023 20:32:21 +0000 (22:32 +0200)]
ASoC: amd: vangogh: Switch to {RUNTIME,SYSTEM_SLEEP}_PM_OPS

Replace the old SET_{RUNTIME,SYSTEM_SLEEP}_PM_OPS() helpers with their
modern alternatives and drop the now unnecessary __maybe_unused
qualifier in the suspend and resume functions.

Additionally, make use of pm_ptr() to ensure the PM ops are dropped when
building with CONFIG_PM disabled.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Link: https://msgid.link/r/20231209203229.878730-4-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: vangogh: Allow probing ACP PCI when SOF is disabled
Cristian Ciocaltea [Sat, 9 Dec 2023 20:32:20 +0000 (22:32 +0200)]
ASoC: amd: vangogh: Allow probing ACP PCI when SOF is disabled

Since commit e89f45edb747 ("ASoC: amd: vangogh: Add check for acp config
flags in vangogh platform"), the Vangogh ACP PCI driver could not be used
anymore for boards which happen to have a matching entry in acp-config
list.

Commit f18818eb0dbe ("ASoC: amd: vangogh: Add condition check for acp
config flag") slightly changed the behaviour to permit loading the
driver if AMD_LEGACY flag is set.  However, for AMD_SOF flag the probing
is still denied, even if SOF support is disabled in kernel
configuration.

While this helps preventing conflicts between SOF and generic ACP
drivers, there are cases where a fallback to the generic non-SOF support
would still be needed or useful, e.g. SOF firmware is not available or
doesn't work properly, SOF driver is broken or doesn't provide full
support for a particular hardware, or simply for testing/debugging the
alternative solution.  A real-life example is Steam Deck OLED, which
works with both drivers.

Prevent returning from probe() when ACP config indicates SOF support for
the current board *and* the Vangogh SOF driver is not enabled in kernel
configuration.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Link: https://msgid.link/r/20231209203229.878730-3-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: vangogh: Drop conflicting ACPI-based probing
Cristian Ciocaltea [Sat, 9 Dec 2023 20:32:19 +0000 (22:32 +0200)]
ASoC: amd: vangogh: Drop conflicting ACPI-based probing

The Vangogh machine driver variant based on the MAX98388 amplifier, as
found on Valve's Steam Deck OLED, relies on probing via an ACPI match
table.  This worked fine until commit 197b1f7f0df1 ("ASoC: amd: Add new
dmi entries to config entry") enabled SOF support for the target machine
(i.e. Galileo product), causing the sound card to enter the deferred
probe state indefinitely:

$ cat /sys/kernel/debug/devices_deferred
AMDI8821:00 acp5x_mach: Register card (acp5x-max98388) failed

The issue is related to commit e89f45edb747 ("ASoC: amd: vangogh: Add
check for acp config flags in vangogh platform"), which tries to
mitigate potential conflicts between SOF and generic ACP Vangogh
drivers, due to sharing the PCI device IDs.

However, the solution is effective only if the machine driver is
directly probed by pci-acp5x through platform_device_register_full().

Hence, remove the conflicting ACPI based probing and rely exclusively on
DMI quirks for sound card setup.

Fixes: dba22efd0d17 ("ASoC: amd: vangogh: Add support for NAU8821/MAX98388 variant")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Link: https://msgid.link/r/20231209203229.878730-2-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: tegra: tegra20_ac97: Convert to use GPIO descriptors
Linus Walleij [Thu, 14 Dec 2023 13:15:45 +0000 (14:15 +0100)]
ASoC: tegra: tegra20_ac97: Convert to use GPIO descriptors

The Tegra20 AC97 driver is using the legacy GPIO APIs in
<linux/of_gpio.h> and <linux/gpio.h> to obtain GPIOs for reset
and sync.

Convert it over and fix the polarity error on the RESET line
in the process: this reset line is clearly active low. Just
fix the one in-tree device tree site using it at the same
time.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://msgid.link/r/20231214-gpio-descriptors-sound-misc-v1-4-e3004176bd8b@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: simple-card-utils: Drop GPIO include
Linus Walleij [Thu, 14 Dec 2023 13:15:44 +0000 (14:15 +0100)]
ASoC: simple-card-utils: Drop GPIO include

The generic card utilities are including the legacy GPIO header
<linux/gpio.h> but not using any symbols from it. Drop the
include from all files.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://msgid.link/r/20231214-gpio-descriptors-sound-misc-v1-3-e3004176bd8b@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: qcom: sc7180: Drop GPIO include
Linus Walleij [Thu, 14 Dec 2023 13:15:43 +0000 (14:15 +0100)]
ASoC: qcom: sc7180: Drop GPIO include

This driver is including the legacy GPIO header <linux/gpio.h>
but not using any symbols from it. Drop the include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://msgid.link/r/20231214-gpio-descriptors-sound-misc-v1-2-e3004176bd8b@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: hisilicon: Drop GPIO include
Linus Walleij [Thu, 14 Dec 2023 13:15:42 +0000 (14:15 +0100)]
ASoC: hisilicon: Drop GPIO include

This driver is including the legacy GPIO header <linux/gpio.h>
but not using any symbols from it. Drop the include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://msgid.link/r/20231214-gpio-descriptors-sound-misc-v1-1-e3004176bd8b@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: acp: add pm ops support for renoir platform.
Syed Saba Kareem [Fri, 15 Dec 2023 13:02:42 +0000 (18:32 +0530)]
ASoC: amd: acp: add pm ops support for renoir platform.

Add pm ops for renoir platform.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://msgid.link/r/20231215130300.1247475-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: query FW config to reload library
Mark Brown [Fri, 15 Dec 2023 17:56:07 +0000 (17:56 +0000)]
ASoC: SOF: query FW config to reload library

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

We should query FW config if context save is supported, and no need
to reload FW if hda->booted_from_imr and ipc4_data->fw_context_save
are true.

9 months agoASoC: fsl_mqs: remove duplicated including
Wang Jinchao [Fri, 15 Dec 2023 09:13:51 +0000 (17:13 +0800)]
ASoC: fsl_mqs: remove duplicated including

rm the second \#include <linux/of.h>

Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
Link: https://msgid.link/r/202312151713+0800-wangjinchao@xfusion.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: amd: remove duplicated including
Wang Jinchao [Fri, 15 Dec 2023 09:20:00 +0000 (17:20 +0800)]
ASoC: SOF: amd: remove duplicated including

remove the second \#include "../sof-audio.h"

Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
Link: https://msgid.link/r/202312151719+0800-wangjinchao@xfusion.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: Intel: check fw_context_save for library reload
Rander Wang [Fri, 15 Dec 2023 08:31:02 +0000 (16:31 +0800)]
ASoC: SOF: Intel: check fw_context_save for library reload

If fw_context_save is defined by fw, driver can skip library reload on
d3 exit or reload library.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20231215083102.3064200-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: IPC4: query fw_context_save feature from fw
Rander Wang [Fri, 15 Dec 2023 08:31:01 +0000 (16:31 +0800)]
ASoC: SOF: IPC4: query fw_context_save feature from fw

Driver queries fw_context_save feature when fw is ready and can skip
library reload with this feature since library is saved in persistent
memory. The default value of fw_context_save is true unless fw reports
false.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20231215083102.3064200-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: IPC4: synchronize fw_config_params with fw definitions
Rander Wang [Fri, 15 Dec 2023 08:31:00 +0000 (16:31 +0800)]
ASoC: SOF: IPC4: synchronize fw_config_params with fw definitions

Update fw_config_params in driver.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20231215083102.3064200-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: audio-graph-port: Document new DAI link flags playback-only/captur...
Daniel Baluta [Tue, 28 Nov 2023 08:11:19 +0000 (10:11 +0200)]
ASoC: dt-bindings: audio-graph-port: Document new DAI link flags playback-only/capture-only

Document new playback-only and capture-only flags which can be used
when dai link can only support just one direction: playback or capture
but not both.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://msgid.link/r/20231128081119.106360-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: audio-graph-card2: Introduce playback-only/capture-only DAI link flags
Daniel Baluta [Tue, 28 Nov 2023 08:11:18 +0000 (10:11 +0200)]
ASoC: audio-graph-card2: Introduce playback-only/capture-only DAI link flags

We need this to support MICFIL PDM found on i.MX8MP where the DAI link
supports only capture direction.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://msgid.link/r/20231128081119.106360-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: mediatek: mt7986: silence error in case of -EPROBE_DEFER
Daniel Golle [Tue, 12 Dec 2023 23:10:07 +0000 (23:10 +0000)]
ASoC: mediatek: mt7986: silence error in case of -EPROBE_DEFER

If probe is defered no error should be printed. Use dev_err_probe() to
have it muted.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Maso Huang <maso.huang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://msgid.link/r/b941a404d97c01ef3e30c49925927b9a7dafeb19.1702422544.git.daniel@makrotopia.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs42l43: Add missing statics for hp_ilimit functions
Charles Keepax [Tue, 12 Dec 2023 10:41:49 +0000 (10:41 +0000)]
ASoC: cs42l43: Add missing statics for hp_ilimit functions

Fixes: bbbc18d8c27c ("ASoC: cs42l43: Allow HP amp to cool off after current limit")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://msgid.link/r/20231212104149.2388753-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs42l43: Allow HP amp to cool off after current limit
Charles Keepax [Mon, 11 Dec 2023 16:00:19 +0000 (16:00 +0000)]
ASoC: cs42l43: Allow HP amp to cool off after current limit

Whilst occasional current limiting is fine, constant current limiting
should be avoided. Add a back off system that will disable the
headphone amp, if a lot of current limiting is seen in a short window
of time.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://msgid.link/r/20231211160019.2034442-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codec: wsa884x: make use of new mute_unmute_on_trigger flag
Neil Armstrong [Mon, 11 Dec 2023 11:40:57 +0000 (12:40 +0100)]
ASoC: codec: wsa884x: make use of new mute_unmute_on_trigger flag

This fix is based on commit [1] fixing click and pop sounds during
SoundWire port start because PA is left unmuted.

making use of new mute_unmute_on_trigger flag and removing unmute
at PA setup, removes the Click/Pop issue at SoundWire enable.

[1] 805ce81826c8 ("ASoC: codecs: wsa883x: make use of new mute_unmute_on_trigger flag")

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231211-topic-sm8x50-upstream-wsa884x-fix-plop-v1-1-0dc630a19172@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: qcom,lpass-wsa-macro: Add SM8650 LPASS WSA
Krzysztof Kozlowski [Wed, 29 Nov 2023 11:30:14 +0000 (12:30 +0100)]
ASoC: dt-bindings: qcom,lpass-wsa-macro: Add SM8650 LPASS WSA

Add bindings for Qualcomm SM8650 Low Power Audio SubSystem (LPASS) WSA
macro codec, which looks like compatible with earlier SM8550.

Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://msgid.link/r/20231129113014.38837-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: qcom,lpass-va-macro: Add SM8650 LPASS VA
Krzysztof Kozlowski [Wed, 29 Nov 2023 11:30:13 +0000 (12:30 +0100)]
ASoC: dt-bindings: qcom,lpass-va-macro: Add SM8650 LPASS VA

Add bindings for Qualcomm SM8650 Low Power Audio SubSystem (LPASS) VA
macro codec, which looks like compatible with earlier SM8550.

Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231129113014.38837-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: qcom,lpass-tx-macro: Add SM8650 LPASS TX
Krzysztof Kozlowski [Wed, 29 Nov 2023 11:30:12 +0000 (12:30 +0100)]
ASoC: dt-bindings: qcom,lpass-tx-macro: Add SM8650 LPASS TX

Add bindings for Qualcomm SM8650 Low Power Audio SubSystem (LPASS) TX
macro codec, which looks like compatible with earlier SM8550.

Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://msgid.link/r/20231129113014.38837-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: qcom,lpass-rx-macro: Add SM8650 LPASS RX
Krzysztof Kozlowski [Wed, 29 Nov 2023 11:30:11 +0000 (12:30 +0100)]
ASoC: dt-bindings: qcom,lpass-rx-macro: Add SM8650 LPASS RX

Add bindings for Qualcomm SM8650 Low Power Audio SubSystem (LPASS) RX
macro codec, which looks like compatible with earlier SM8550.

Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://msgid.link/r/20231129113014.38837-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: qcom: audioreach: Add 4 channel support
Krzysztof Kozlowski [Thu, 30 Nov 2023 18:07:58 +0000 (19:07 +0100)]
ASoC: qcom: audioreach: Add 4 channel support

Add support four channel streams.  Map channel 3 and 4 to left/right
surround ("quad(side)" from ffmpeg standard channel list) to match what
is in qdsp6/q6dsp-common.c driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231130180758.212172-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: qcom: audioreach: drop duplicate channel defines
Krzysztof Kozlowski [Thu, 30 Nov 2023 18:07:57 +0000 (19:07 +0100)]
ASoC: qcom: audioreach: drop duplicate channel defines

q6apm.h header already defines channel mapping values, so drop
duplicated devices from audioreach.h.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231130180758.212172-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: qcom: audioreach: Commonize setting channel mappings
Krzysztof Kozlowski [Thu, 30 Nov 2023 18:07:56 +0000 (19:07 +0100)]
ASoC: qcom: audioreach: Commonize setting channel mappings

Move code assigning channel mapping values to a common helper function.
This simplifies three out of four cases, with the last case using
incompatible type (uint16_t array instead of uint8_t array).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231130180758.212172-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: wm1250-ev1: Fix uninitialized ret
Linus Walleij [Sat, 9 Dec 2023 22:01:27 +0000 (23:01 +0100)]
ASoC: wm1250-ev1: Fix uninitialized ret

The GPIO descriptor conversion patch left an unitialized ret behind
by mistake, fix it by getting rid of the variable altogether.

Fixes: 10a366f36e2a ("ASoC: wm1250-ev1: Convert to GPIO descriptors")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312090953.DiUo3mue-lkp@intel.com/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231209-descriptors-sound-wlf-v1-1-5b885ce43ae1@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoGPIO descriptor cleanup for some Wolfson codecs
Mark Brown [Sat, 9 Dec 2023 00:16:04 +0000 (00:16 +0000)]
GPIO descriptor cleanup for some Wolfson codecs

Merge series from Linus Walleij <linus.walleij@linaro.org>:

This converts the remaining Wolfson ASoC codecs to
use GPIO descriptors.

These Wolfson codecs are mostly used with different
Samsung S3C (especially Cragganmore 6410) board files,
so the in-tree users are fixed up in the process.

9 months agoASoC: wm8996: Convert to GPIO descriptors
Linus Walleij [Fri, 8 Dec 2023 10:09:29 +0000 (11:09 +0100)]
ASoC: wm8996: Convert to GPIO descriptors

This converts the WM8996 codec to use GPIO descriptors, an a similar
way to WM5100.

The driver is instantiating a GPIO chip named wm8996, and we get
rid of the base address for the GPIO chip from the platform data and
just use dynamic numbering. Move base and ngpio into the static
gpio_chip template.

Fix up the only in-tree user which is the Cragganmore 6410 module.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231208-descriptors-sound-wlf-v1-5-c4dab6f521ec@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: wm5100: Convert to GPIO descriptors
Linus Walleij [Fri, 8 Dec 2023 10:09:28 +0000 (11:09 +0100)]
ASoC: wm5100: Convert to GPIO descriptors

This converts the WM5100 codec to use GPIO descriptors, a pretty
straight-forward conversion with the following peculiarities:

- The driver is instantiating a GPIO chip named wm5100, and the
  headphone polarity detection GPIO is lifted from there. We add
  this to the GPIO descriptor table as well, and we can then get
  rid of also the base address for the GPIO chip from the
  platform data and just use dynamic numbering.

- Fix up the only in-tree user which is the Cragganmore 6410
  module.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231208-descriptors-sound-wlf-v1-4-c4dab6f521ec@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: wm2200: Convert to GPIO descriptors
Linus Walleij [Fri, 8 Dec 2023 10:09:27 +0000 (11:09 +0100)]
ASoC: wm2200: Convert to GPIO descriptors

This converts the WM2200 codec to use GPIO descriptors.
This is a pretty straight-forward conversion, and it also
switches over the single in-tree user in the S3C
Cragganmore module for S3C 6410.

This coded does not seem to get selected or be selectable
through Kconfig, I had to hack another soundcard Kconfig
entry to select it for compile tests.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231208-descriptors-sound-wlf-v1-3-c4dab6f521ec@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: wm1250-ev1: Convert to GPIO descriptors
Linus Walleij [Fri, 8 Dec 2023 10:09:26 +0000 (11:09 +0100)]
ASoC: wm1250-ev1: Convert to GPIO descriptors

This converts the WM1250-EV1 codec to use GPIO descriptors.
It turns out that the platform data was only used to pass some
global GPIO numbers from a board file, so we get rid of this
and also switch over the single in-tree user in the S3C
Cragganmore module for S3C 6410.

The driver obtains two GPIO lines named OSR and master and just
pull them low, we leave this behaviour as it was.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231208-descriptors-sound-wlf-v1-2-c4dab6f521ec@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: wm0010: Convert to GPIO descriptors
Linus Walleij [Fri, 8 Dec 2023 10:09:25 +0000 (11:09 +0100)]
ASoC: wm0010: Convert to GPIO descriptors

This converts the WM0010 codec to use GPIO descriptors.
It's a pretty straight-forward conversion also switching over
the single in-tree user in the S3C Cragganmore module
for S3C 6410.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231208-descriptors-sound-wlf-v1-1-c4dab6f521ec@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: audio-graph-card2: fix off by one in graph_parse_node_multi_nm()
Dan Carpenter [Mon, 4 Dec 2023 12:42:07 +0000 (15:42 +0300)]
ASoC: audio-graph-card2: fix off by one in graph_parse_node_multi_nm()

The > comparison should be >= to avoid writing one element beyond the end
of the dai_link->ch_maps[] array.  The dai_link->ch_maps[] array is
allocated in graph_parse_node_multi() and it has "nm_max" elements.

Fixes: e2de6808df4a ("ASoC: audio-graph-card2: add CPU:Codec = N:M support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/1032216f-902f-48f9-aa49-9d5ece8e87f2@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: acp: modify config flag read logic
Vijendar Mukunda [Thu, 7 Dec 2023 04:55:01 +0000 (10:25 +0530)]
ASoC: amd: acp: modify config flag read logic

Modify acp config flag read logic from ACP v7.0 onwards.
Instead of reading from DMI table match entry, read the
config flag value from BIOS ACPI table.
This will remove updating DMI table when new platform support
is added.
Use FLAG_AMD_LEGACY_ONLY_DMIC flag as default one.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20231207045505.1519151-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: Intel: hda-codec: Delay the codec device registration
Peter Ujfalusi [Thu, 7 Dec 2023 09:54:25 +0000 (11:54 +0200)]
ASoC: SOF: Intel: hda-codec: Delay the codec device registration

The current code flow is:
1. snd_hdac_device_register()
2. set parameters needed by the hdac driver
3. request_codec_module()
   the hdac driver is probed at this point

During boot the codec drivers are not loaded when the hdac device is
registered, it is going to be probed later when loading the codec module,
which point the parameters are set.

On module remove/insert
rmmod snd_sof_pci_intel_tgl
modprobe snd_sof_pci_intel_tgl

The codec module remains loaded and the driver will be probed when the
hdac device is created right away, before the parameters for the driver
has been configured:

1. snd_hdac_device_register()
   the hdac driver is probed at this point
2. set parameters needed by the hdac driver
3. request_codec_module()
   will be a NOP as the module is already loaded

Move the snd_hdac_device_register() later, to be done right before
requesting the codec module to make sure that the parameters are all set
before the device is created:

1. set parameters needed by the hdac driver
2. snd_hdac_device_register()
3. request_codec_module()

This way at the hdac driver probe all parameters will be set in all cases.

Link: https://github.com/thesofproject/linux/issues/4731
Fixes: a0575b4add21 ("ASoC: hdac_hda: Conditionally register dais for HDMI and Analog")
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>
Link: https://lore.kernel.org/r/20231207095425.19597-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: acp: Set bclk as source to set pll for rt5682s codec
Venkata Prasad Potturu [Wed, 6 Dec 2023 11:06:18 +0000 (16:36 +0530)]
ASoC: amd: acp: Set bclk as source to set pll for rt5682s codec

Some platforms doesn't have reference mclk pin to codec,
so set bclk as a clk source for rt5682s codec pll in tdm mode.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20231206110620.1695591-7-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: acp: Set bclk as source to set pll for rt5682s codec
Venkata Prasad Potturu [Wed, 6 Dec 2023 11:06:18 +0000 (16:36 +0530)]
ASoC: amd: acp: Set bclk as source to set pll for rt5682s codec

Some platforms doesn't have reference mclk pin to codec,
so set bclk as a clk source for rt5682s codec pll in tdm mode.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20231206110620.1695591-7-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: acp: Enable dpcm_capture for MAX98388 codec
Venkata Prasad Potturu [Wed, 6 Dec 2023 11:06:17 +0000 (16:36 +0530)]
ASoC: amd: acp: Enable dpcm_capture for MAX98388 codec

Enable dpcm_capture for amplifier codec MAX98388
for reference stream capture in smart amplifier case.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20231206110620.1695591-6-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: acp: Add i2s bt support for nau8821-max card
Venkata Prasad Potturu [Wed, 6 Dec 2023 11:06:16 +0000 (16:36 +0530)]
ASoC: amd: acp: Add i2s bt support for nau8821-max card

Add i2s bt support for sof-nau8821-max sound card.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20231206110620.1695591-5-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: acp: Add new cpu dai and dailink creation for I2S BT instance
Venkata Prasad Potturu [Wed, 6 Dec 2023 11:06:15 +0000 (16:36 +0530)]
ASoC: amd: acp: Add new cpu dai and dailink creation for I2S BT instance

Add sof_bt cpu id and create dailink for i2s bt instance in
acp common machine driver.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20231206110620.1695591-4-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: Remove extra dmi parameter
Venkata Prasad Potturu [Wed, 6 Dec 2023 11:06:14 +0000 (16:36 +0530)]
ASoC: amd: Remove extra dmi parameter

Remove extra dmi_product_family entry in amd config entry table.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20231206110620.1695591-3-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: vangogh: Add condition check for acp config flag
Venkata Prasad Potturu [Wed, 6 Dec 2023 11:06:13 +0000 (16:36 +0530)]
ASoC: amd: vangogh: Add condition check for acp config flag

Add condition check for acp config flag to load legacy driver only.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20231206110620.1695591-2-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: Add new dmi entries for acp5x platform
Venkata Prasad Potturu [Wed, 6 Dec 2023 11:06:12 +0000 (16:36 +0530)]
ASoC: amd: Add new dmi entries for acp5x platform

Add sys_vendor and product_name dmi entries for acp5x platform.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20231206110620.1695591-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: fsl,xcvr: Adjust the number of interrupts
Fabio Estevam [Wed, 6 Dec 2023 11:30:47 +0000 (08:30 -0300)]
ASoC: dt-bindings: fsl,xcvr: Adjust the number of interrupts

Unlike i.MX8MP, i.MX93 has two XCVR interrupts.

Describe the two interrupts for the i.MX93 to fix the following
dt-schema warning:

imx93-11x11-evk.dtb: xcvr@42680000: interrupts: [[0, 203, 4], [0, 204, 4]] is too long
from schema $id: http://devicetree.org/schemas/sound/fsl,xcvr.yaml#

Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20231206113047.2240055-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: topology cleanups
Mark Brown [Wed, 6 Dec 2023 13:16:21 +0000 (13:16 +0000)]
ASoC: SOF: topology cleanups

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

Header alignment with firmware, addition of new token and partial
match filters.

9 months agoASoC: Intel: machine driver updates
Mark Brown [Wed, 6 Dec 2023 13:16:10 +0000 (13:16 +0000)]
ASoC: Intel: machine driver updates

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

Minor cleanups for machine drivers.

9 months agoASoC: Intel: sof_sdw_cs_amp: Connect outputs to a speaker widget
Richard Fitzgerald [Tue, 5 Dec 2023 13:50:01 +0000 (13:50 +0000)]
ASoC: Intel: sof_sdw_cs_amp: Connect outputs to a speaker widget

Hookup the CS35L56 DAPM_OUTPUT widgets to a DAPM_SPK widget so
that there is a complete logical path to a speaker.

There is no particular reason to use multiple speaker widgets.
The CS35L56 are designed to work together as a set so they have
all been connected to a single speaker widget.

Instead of a hardcoded list of codec widget names, the code walks
through all the codecs on the dailink and for every cs35l56 it uses
its name prefix to construct the source end of the route. This adds
a small amount of overhead during probe but has the benefit that it
isn't dependent on every system using the same prefixes.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231205135001.2506070-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: Intel: lnl: add core get and set support for dsp core
Rander Wang [Mon, 4 Dec 2023 21:44:07 +0000 (15:44 -0600)]
ASoC: SOF: Intel: lnl: add core get and set support for dsp core

Driver uses get and set ops to change the power state of dsp core.

Closes: https://github.com/thesofproject/sof/issues/8478
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214407.208528-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs4271: Fix spelling mistake "retrieveing" -> "retrieving"
Colin Ian King [Tue, 5 Dec 2023 10:17:40 +0000 (10:17 +0000)]
ASoC: cs4271: Fix spelling mistake "retrieveing" -> "retrieving"

There is a spelling mistake in a dev_err_probe error message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231205101740.2820813-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: rt722-sdca: Set lane_control_support for multilane
Chao Song [Mon, 4 Dec 2023 21:37:21 +0000 (15:37 -0600)]
ASoC: rt722-sdca: Set lane_control_support for multilane

The RT722 SDCA codec supports 3 data lanes,
lane_control_support property has to be
set to use additional two lanes.

Reviewed-by: Jack Yu <jack580304@gmail.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204213721.197785-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: Wire up buffer flags
Curtis Malainey [Mon, 4 Dec 2023 21:47:13 +0000 (15:47 -0600)]
ASoC: SOF: Wire up buffer flags

Buffer flags have been in firmware for ages but were never fully
implemented in the topology/kernel system. This commit finishes off the
implementation.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214713.208951-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: add alignment for topology header file struct definition
Baofeng Tian [Mon, 4 Dec 2023 21:47:12 +0000 (15:47 -0600)]
ASoC: SOF: add alignment for topology header file struct definition

sof header file requires these struct with 4 byte aligned, so
add same alignment in sof driver definition.

Signed-off-by: Baofeng Tian <baofeng.tian@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: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214713.208951-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: align topology header file with sof topology header
Baofeng Tian [Mon, 4 Dec 2023 21:47:11 +0000 (15:47 -0600)]
ASoC: SOF: align topology header file with sof topology header

Add missed definition and align variable names with sof topology
header file.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214713.208951-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget
Bard Liao [Mon, 4 Dec 2023 21:47:10 +0000 (15:47 -0600)]
ASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget

We use partial match for connecting DAI link and DAI widget. We need to
use partial match for disconnecting, too.

Fixes: fe88788779fc ("ASoC: SOF: topology: Use partial match for connecting DAI link and DAI widget")
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/20231204214713.208951-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: sof_sdw_rt_sdca_jack_common: check ctx->headset_codec_dev instead of...
Bard Liao [Mon, 4 Dec 2023 21:42:00 +0000 (15:42 -0600)]
ASoC: Intel: sof_sdw_rt_sdca_jack_common: check ctx->headset_codec_dev instead of playback

'if (!playback)' will not work if the dai is only on capture dai link
or is on more than one playback dai links. Check 'if
(ctx->headset_codec_dev)' instead.

Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214200.203100-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL
Bard Liao [Mon, 4 Dec 2023 21:41:59 +0000 (15:41 -0600)]
ASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL

sof_sdw_rt_sdca_jack_exit() are used by different codecs, and some of
them use the same dai name.
For example, rt712 and rt713 both use "rt712-sdca-aif1" and
sof_sdw_rt_sdca_jack_exit().
As a result, sof_sdw_rt_sdca_jack_exit() will be called twice by
mc_dailink_exit_loop(). Set ctx->headset_codec_dev = NULL; after
put_device(ctx->headset_codec_dev); to avoid ctx->headset_codec_dev
being put twice.

Fixes: 5360c6704638 ("ASoC: Intel: sof_sdw: add rt712 support")
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214200.203100-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: glk_rt5682_max98357a: fix board id mismatch
Brent Lu [Mon, 4 Dec 2023 21:41:58 +0000 (15:41 -0600)]
ASoC: Intel: glk_rt5682_max98357a: fix board id mismatch

The drv_name in enumeration table for ALC5682I-VS codec does not match
the board id string in machine driver. Modify the entry of "10EC5682"
to enumerate "RTL5682" as well and remove invalid entry.

Fixes: 88b4d77d6035 ("ASoC: Intel: glk_rt5682_max98357a: support ALC5682I-VS codec")
Reported-by: Curtis Malainey <cujomalainey@chromium.org>
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214200.203100-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: sof_nau8825: board id cleanup for rpl boards
Brent Lu [Mon, 4 Dec 2023 21:41:57 +0000 (15:41 -0600)]
ASoC: Intel: sof_nau8825: board id cleanup for rpl boards

Many board configs are duplicated since codec and amplifier type are
removed from board quirk. Introduce "rpl_nau8825_def" board to reduce
the number of rpl board configs.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214200.203100-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: sof_nau8825: board id cleanup for adl boards
Brent Lu [Mon, 4 Dec 2023 21:41:56 +0000 (15:41 -0600)]
ASoC: Intel: sof_nau8825: board id cleanup for adl boards

Many board configs are duplicated since codec and amplifier type are
removed from board quirk. Introduce "adl_nau8825_def" board to reduce
the number of adl board configs.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214200.203100-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: soc-acpi-intel-tgl-match: add cs42l43 and cs35l56 support
Bard Liao [Mon, 4 Dec 2023 13:56:14 +0000 (13:56 +0000)]
ASoC: Intel: soc-acpi-intel-tgl-match: add cs42l43 and cs35l56 support

This is a test configuration for UpExtreme with Cirrus Logic
CS35L56-EIGHT-C board.

The codec layout is configured as:
    - Link3: CS42L43 Jack
    - Link0: 2x CS35L56 Speaker (amps 1 and 2)
    - Link1: 2x CS35L56 Speaker (amps 7 and 8)

Signed-off-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>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231204135614.2169624-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: bytcht_es8316: Determine
Mark Brown [Mon, 4 Dec 2023 19:31:56 +0000 (19:31 +0000)]
ASoC: Intel: bytcht_es8316: Determine

Merge series from Hans de Goede <hdegoede@redhat.com>:

This takes some of the work done to auto-configure quirks/routing
for ESS83xx codecs by getting the info from ACPI from:
https://github.com/thesofproject/linux/pull/4112

And then builds on top of this to add auto-configuration to
the bytcht_es8316 board driver.

Note compared to the pull-request, which deals with the ES8336, this
series deals with the ES8316 (for which I have several devices to test
on) and this moves handling of the _DSM from the codec driver to
the board driver since with the ES8316 the board driver takes
care of setting up various routes for things like the mic and
speakers.

After this series audio now works properly on a CHT Chuwi Hi12
tablet without needing to add an extra quirk for that model.

This has also been tested on the following devices, where things
are unchanged from before (the ACPI autoconfiguration gives the
same results as the old defaults) :

Onda V80 plus (CHT)
GP-electronic T701 (BYT)

I also tested this on a Nanote UMPC-01, here the _DSM result
for PLATFORM_SPK_TYPE_ARG wrongly returns 1 (mono) while
the device actually has 2 speakers, so this model needs to keep
its DMI quirk.

I don't have an IRBIS NB41 nor a TECLAST X98 Plus II,
so the DMI quirks for those are left in place too on
a better safe then sorry basis.

9 months agoASoC: Intel: bytcht_es8316: Determine quirks/routing with codec-dev ACPI DSM
Hans de Goede [Sat, 2 Dec 2023 12:39:46 +0000 (13:39 +0100)]
ASoC: Intel: bytcht_es8316: Determine quirks/routing with codec-dev ACPI DSM

Add support for querying the same ACPI Device-Specific-Method (DSM) as
Windows uses to determine things like speaker and mic routing.

This avoids the need to add DMI quirks for each new ESS8316 tablet model.

This has been tested on the following devices:

1. Chuwi Hi12 CHT with stereo speakers and IN2-mic-map,
   this avoids the need to add a DMI quirk for this model.

2. Nanote UMPC-01 CHT with stereo speakers and IN1-mic-map,
   the existing DMI quirk is still necessary because of a bug
   in the DSM return values for the speakers (it returns mono).

3. Onda V80 plus CHT with mono speaker and IN1-mic-map,
   DSM set quirks match the previously used defaults.

4. GP-electronic T701 BYT with mono speaker and IN2-mic-map,
   DSM set quirks match the previously used defaults.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231202123946.54347-5-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: bytcht_es8316: Add is_bytcr helper variable
Hans de Goede [Sat, 2 Dec 2023 12:39:45 +0000 (13:39 +0100)]
ASoC: Intel: bytcht_es8316: Add is_bytcr helper variable

Add a is_bytcr helper variable to probe().

This is a preparation patch for determining the quirks through querying
the ACPI Device-Specific-Method (DSM) on the codec-device.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231202123946.54347-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: bytcht_es8316: Dump basic _DSM information
Pierre-Louis Bossart [Sat, 2 Dec 2023 12:39:44 +0000 (13:39 +0100)]
ASoC: Intel: bytcht_es8316: Dump basic _DSM information

Instead of adding DMI quirks for each new tablet model which uses
the ESS8316 codec, the plan is to switch to querying the same ACPI
Device-Specific-Method (DSM) as Windows uses to determine things
like speaker and mic routing.

Call the new es83xx_dsm_dump() helper which logs various basic settings
which can be queried through the ACPI DSM method on the codec ACPI device,
this is intended to help with developing a DSM based solution to replace
most DMI quirks.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
[hdegoede@redhat.com: improve commit message]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231202123946.54347-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: es83xx: add ACPI DSM helper module
Pierre-Louis Bossart [Sat, 2 Dec 2023 12:39:43 +0000 (13:39 +0100)]
ASoC: es83xx: add ACPI DSM helper module

Most of the ES83xx codec configuration is exposed in the DSDT table
and accessible via a _DSM method. Start adding basic definitions and
helpers to dump the information.

Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Co-developed-by: David Yang <yangxiaohua@everest-semi.com>
Signed-off-by: David Yang <yangxiaohua@everest-semi.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231202123946.54347-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: Move sof_of_machine_select() to core.c from sof-of-dev.c
Chen-Yu Tsai [Mon, 4 Dec 2023 03:35:47 +0000 (11:35 +0800)]
ASoC: SOF: Move sof_of_machine_select() to core.c from sof-of-dev.c

Commit 014fdeb0d747 ("ASoC: SOF: Move sof_of_machine_select() to
sof-of-dev.c from sof-audio.c") caused a circular dependency between
the snd_sof and snd_sof_of modules:

depmod: ERROR: Cycle detected: snd_sof -> snd_sof_of -> snd_sof
depmod: ERROR: Found 2 modules in dependency cycles!

Move the function back with sof_machine_select().

Fixes: 014fdeb0d747 ("ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.c")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20231204033549.2020289-1-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Convert Cirrus codecs to GPIO descriptors
Mark Brown [Fri, 1 Dec 2023 22:16:41 +0000 (22:16 +0000)]
ASoC: Convert Cirrus codecs to GPIO descriptors

Merge series from Linus Walleij <linus.walleij@linaro.org>:

This series walks over the Cirrus Logic ASoC drivers and
clean out the use of legacy GPIO numbers and legacy
GPIO APIs.

The CS4271 affects an ASoC driver for EP93xx which Nikita is
actively working on moving over to device tree, so I don't
know about that patch specifically, but I think the collision
would be max "the file was deleted".

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Changes in v2:
- Add explicit <linux/irq.h> include in the cs35l36 driver, apparently
  the driver useeed this implicitly through the <linux/gpio.h> include.
- Fix commit messages "gpios" -> "reset" on two patches.
- Test builds OK
- Link to v1: https://lore.kernel.org/r/20231129-descriptors-sound-cirrus-v1-0-31aa74425ff8@linaro.org

---
Linus Walleij (10):
      ASoC: cs35l32: Drop legacy include
      ASoC: cs35l33: Fix GPIO name and drop legacy include
      ASoC: cs35l34: Fix GPIO name and drop legacy include
      ASoC: cs35l35: Drop legacy includes
      ASoC: cs35l36: Drop legacy includes
      ASoC: cs4271: Convert to GPIO descriptors
      ASoC: cirrus: edb93xx: Drop legacy include
      ASoC: cs42l42: Drop legacy include
      ASoC: cs43130: Drop legacy includes
      ASoC: cs4349: Drop legacy include

 arch/arm/mach-ep93xx/edb93xx.c       | 32 +++++++++++++++++++++++++----
 arch/arm/mach-ep93xx/vision_ep9307.c | 12 ++++++++++-
 include/sound/cs4271.h               |  1 -
 sound/soc/cirrus/edb93xx.c           |  1 -
 sound/soc/codecs/cs35l32.c           |  1 -
 sound/soc/codecs/cs35l33.c           |  4 +---
 sound/soc/codecs/cs35l34.c           |  4 +---
 sound/soc/codecs/cs35l35.c           |  2 --
 sound/soc/codecs/cs35l36.c           |  3 +--
 sound/soc/codecs/cs4271.c            | 39 ++++++++++++------------------------
 sound/soc/codecs/cs42l42.c           |  1 -
 sound/soc/codecs/cs42l42.h           |  2 +-
 sound/soc/codecs/cs43130.c           |  2 --
 sound/soc/codecs/cs4349.c            |  1 -
 14 files changed, 56 insertions(+), 49 deletions(-)
---
base-commit: 267aea213ae042f779a8054401a8a5f301518605
change-id: 20231129-descriptors-sound-cirrus-522d9061808e

Best regards,
--
Linus Walleij <linus.walleij@linaro.org>

9 months agoASoC: qcom: sc8280xp: Add support for SM8450 and SM8550
Krzysztof Kozlowski [Fri, 1 Dec 2023 13:53:32 +0000 (14:53 +0100)]
ASoC: qcom: sc8280xp: Add support for SM8450 and SM8550

Add compatibles for sound card on Qualcomm SM8450 and SM8550 boards.
The compatibles were already documented.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231201135332.154017-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: qcom: sc8280xp: set card driver name from match data
Krzysztof Kozlowski [Fri, 1 Dec 2023 13:53:31 +0000 (14:53 +0100)]
ASoC: qcom: sc8280xp: set card driver name from match data

Sound machine drivers for all newer Qualcomm SoC platforms are the
exactly same, therefore it makes sense to use same machine driver for
newer platforms as well.  Choice of sound topology and user-space Alsa
UCM files depends however on card driver name, which must be customized
per each board.  Allow such customization by using driver match data as
sound card driver name.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231201135332.154017-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs4349: Drop legacy include
Linus Walleij [Fri, 1 Dec 2023 13:20:39 +0000 (14:20 +0100)]
ASoC: cs4349: Drop legacy include

This driver includes the legacy GPIO API <linux/gpio.h> but
does not use any symbols from it.

Drop the include.

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231201-descriptors-sound-cirrus-v2-10-ee9f9d4655eb@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs43130: Drop legacy includes
Linus Walleij [Fri, 1 Dec 2023 13:20:38 +0000 (14:20 +0100)]
ASoC: cs43130: Drop legacy includes

This driver includes the legacy GPIO APIs <linux/gpio.h> and
<linux/of_gpio.h> but does not use any symbols from any of
them.

Drop the includes.

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231201-descriptors-sound-cirrus-v2-9-ee9f9d4655eb@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>