OSDN Git Service

tomoyo/tomoyo-test1.git
12 months agoASoC: dt-bindings: audio-graph-card2: Drop incomplete example
Rob Herring [Fri, 7 Jul 2023 22:17:25 +0000 (16:17 -0600)]
ASoC: dt-bindings: audio-graph-card2: Drop incomplete example

The example in audio-graph-card2 binding is incomplete, uses
undocumented compatibles strings, and doesn't follow typical .dts
formatting. Rather than try to fix with what would probably be a lengthy
example, just drop the example.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230707221725.1071292-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: Update maintainer email id
Rohit kumar [Fri, 7 Jul 2023 07:43:36 +0000 (13:13 +0530)]
ASoC: dt-bindings: Update maintainer email id

Updated my mail id to latest quicinc id.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Rohit kumar <quic_rohkumar@quicinc.com>
Link: https://lore.kernel.org/r/20230707074337.3120530-1-quic_rohkumar@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: Fix extraneous error messages
Mario Limonciello [Sat, 8 Jul 2023 02:52:08 +0000 (21:52 -0500)]
ASoC: amd: ps: Fix extraneous error messages

On Pink Sardine machines that don't have SdW controllers in use, the property
`mipi-sdw-manager-list` won't exist.  There is no point in showing an error
to a user when this situation is encountered.

Furthermore if the machine doesn't have a DMIC connected to the ACP, there
may be no platform devices created either.

Downgrade the associated message to debug.

Fixes: d1351c30ac8a6 ("ASoC: amd: ps: create platform devices based on acp config")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20230708025208.54272-1-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: fsl_sai: Revert "ASoC: fsl_sai: Enable MCTL_MCLK_EN bit for master mode"
Fabio Estevam [Thu, 6 Jul 2023 22:18:27 +0000 (19:18 -0300)]
ASoC: fsl_sai: Revert "ASoC: fsl_sai: Enable MCTL_MCLK_EN bit for master mode"

This reverts commit ff87d619ac180444db297f043962a5c325ded47b.

Andreas reports that on an i.MX8MP-based system where MCLK needs to be
used as an input, the MCLK pin is actually an output, despite not having
the 'fsl,sai-mclk-direction-output' property present in the devicetree.

This is caused by commit ff87d619ac18 ("ASoC: fsl_sai: Enable
MCTL_MCLK_EN bit for master mode") that sets FSL_SAI_MCTL_MCLK_EN
unconditionally for imx8mm/8mn/8mp/93, causing the MCLK to always
be configured as output.

FSL_SAI_MCTL_MCLK_EN corresponds to the MOE (MCLK Output Enable) bit
of register MCR and the drivers sets it when the
'fsl,sai-mclk-direction-output' devicetree property is present.

Revert the commit to allow SAI to use MCLK as input as well.

Cc: stable@vger.kernel.org
Fixes: ff87d619ac18 ("ASoC: fsl_sai: Enable MCTL_MCLK_EN bit for master mode")
Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230706221827.1938990-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC/soundwire/qdsp6/wcd: fix leaks and probe deferral
Mark Brown [Thu, 6 Jul 2023 15:03:07 +0000 (16:03 +0100)]
ASoC/soundwire/qdsp6/wcd: fix leaks and probe deferral

Merge series from Johan Hovold <johan+linaro@kernel.org>:

I've been hitting a race during boot which breaks probe of the sound
card on the Lenovo ThinkPad X13s as I've previously reported here:

https://lore.kernel.org/all/ZIHMMFtuDtvdpFAZ@hovoldconsulting.com/

The immediate issue appeared to be a probe deferral that was turned into
a hard failure, but addressing that in itself only made things worse as
it exposed further bugs.

I was hoping someone more familiar with the code in question would look
into this, but as this affects users of the X13s and breaks audio on my
machine every fifth boot or so, I decided to investigate it myself.

As expected, the Qualcomm codec drivers are broken and specifically leak
resources on component remove, which in turn breaks sound card probe
deferrals.

The source of the deferral itself appears to be legitimate and was
simply due to some audio component not yet having been registered due to
random changes in timing during boot.

These issues can most easily be reproduced by simply blacklisting the
q6apm_dai module and loading it manually after boot.

Included are also two patches that suppresses error messages on
component probe deferral to avoid spamming the logs during boot.

12 months agoASoC: codecs: SND_SOC_WCD934X should select REGMAP_IRQ
Geert Uytterhoeven [Thu, 6 Jul 2023 11:42:04 +0000 (13:42 +0200)]
ASoC: codecs: SND_SOC_WCD934X should select REGMAP_IRQ

If CONFIG_SND_SOC_WCD934X=y, CONFIG_COMPILE_TEST=y,
CONFIG_MFD_WCD934X=n, CONFIG_REGMAP_IRQ=n:

    aarch64-linux-gnu-ld: sound/soc/codecs/wcd934x.o: in function `wcd934x_codec_probe':
    wcd934x.c:(.text+0x33cc): undefined reference to `regmap_irq_get_virq'
    aarch64-linux-gnu-ld: sound/soc/codecs/wcd934x.o: in function `wcd934x_comp_probe':
    wcd934x.c:(.text+0x4cb0): undefined reference to `regmap_irq_get_virq'
    aarch64-linux-gnu-ld: wcd934x.c:(.text+0x4cc0): undefined reference to `regmap_irq_get_virq'
    aarch64-linux-gnu-ld: wcd934x.c:(.text+0x4cd0): undefined reference to `regmap_irq_get_virq'
    aarch64-linux-gnu-ld: wcd934x.c:(.text+0x4ce0): undefined reference to `regmap_irq_get_virq'
    aarch64-linux-gnu-ld: sound/soc/codecs/wcd934x.o:wcd934x.c:(.text+0x4cf0): more undefined references to `regmap_irq_get_virq' follow

Fix this by making SND_SOC_WCD934X select REGMAP_IRQ.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/cafd878747e7951914a7d9fea33788a4a230d1f0.1688643442.git.geert@linux-m68k.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: qcom: q6apm: do not close GPR port before closing graph
Srinivas Kandagatla [Wed, 5 Jul 2023 13:18:42 +0000 (14:18 +0100)]
ASoC: qcom: q6apm: do not close GPR port before closing graph

Closing GPR port before graph close can result in un handled notifications
from DSP, this results in spam of errors from GPR driver as there is no
one to handle these notification at that point in time.

Fix this by closing GPR port after graph close is finished.

Fixes: 5477518b8a0e ("ASoC: qdsp6: audioreach: add q6apm support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705131842.41584-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: core: suppress probe deferral errors
Johan Hovold [Wed, 5 Jul 2023 12:30:18 +0000 (14:30 +0200)]
ASoC: core: suppress probe deferral errors

Suppress probe deferral error messages when probing link components to
avoid spamming the logs, for example, if a required component has not
yet been registered:

snd-sc8280xp sound: ASoC: failed to instantiate card -517

Note that dev_err_probe() is not used as the card can be unbound and
rebound while the underlying platform device remains bound to its
driver.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230705123018.30903-9-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: topology: suppress probe deferral errors
Johan Hovold [Wed, 5 Jul 2023 12:30:17 +0000 (14:30 +0200)]
ASoC: topology: suppress probe deferral errors

Suppress probe deferral error messages when loading topologies and
creating frontend links to avoid spamming the logs when a component has
not yet been registered:

    snd-sc8280xp sound: ASoC: adding FE link failed
    snd-sc8280xp sound: ASoC: topology: could not load header: -517

Note that dev_err_probe() is not used as the topology component can be
probed and removed while the underlying platform device remains bound to
its driver.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230705123018.30903-8-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd-mbhc-v2: fix resource leaks on component remove
Johan Hovold [Wed, 5 Jul 2023 12:30:16 +0000 (14:30 +0200)]
ASoC: codecs: wcd-mbhc-v2: fix resource leaks on component remove

The MBHC resources must be released on component probe failure and
removal so can not be tied to the lifetime of the component device.

This is specifically needed to allow probe deferrals of the sound card
which otherwise fails when reprobing the codec component:

    snd-sc8280xp sound: ASoC: failed to instantiate card -517
    genirq: Flags mismatch irq 299. 00002001 (mbhc sw intr) vs. 00002001 (mbhc sw intr)
    wcd938x_codec audio-codec: Failed to request mbhc interrupts -16
    wcd938x_codec audio-codec: mbhc initialization failed
    wcd938x_codec audio-codec: ASoC: error at snd_soc_component_probe on audio-codec: -16
    snd-sc8280xp sound: ASoC: failed to instantiate card -16

Fixes: 0e5c9e7ff899 ("ASoC: codecs: wcd: add multi button Headset detection support")
Cc: stable@vger.kernel.org # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705123018.30903-7-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd934x: fix resource leaks on component remove
Johan Hovold [Wed, 5 Jul 2023 12:30:15 +0000 (14:30 +0200)]
ASoC: codecs: wcd934x: fix resource leaks on component remove

Make sure to release allocated MBHC resources also on component remove.

This is specifically needed to allow probe deferrals of the sound card
which otherwise fails when reprobing the codec component.

Fixes: 9fb9b1690f0b ("ASoC: codecs: wcd934x: add mbhc support")
Cc: stable@vger.kernel.org # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705123018.30903-6-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: fix resource leaks on component remove
Johan Hovold [Wed, 5 Jul 2023 12:30:14 +0000 (14:30 +0200)]
ASoC: codecs: wcd938x: fix resource leaks on component remove

Make sure to release allocated resources on component probe failure and
on remove.

This is specifically needed to allow probe deferrals of the sound card
which otherwise fails when reprobing the codec component:

    snd-sc8280xp sound: ASoC: failed to instantiate card -517
    genirq: Flags mismatch irq 289. 00002001 (HPHR PDM WD INT) vs. 00002001 (HPHR PDM WD INT)
    wcd938x_codec audio-codec: Failed to request HPHR WD interrupt (-16)
    genirq: Flags mismatch irq 290. 00002001 (HPHL PDM WD INT) vs. 00002001 (HPHL PDM WD INT)
    wcd938x_codec audio-codec: Failed to request HPHL WD interrupt (-16)
    genirq: Flags mismatch irq 291. 00002001 (AUX PDM WD INT) vs. 00002001 (AUX PDM WD INT)
    wcd938x_codec audio-codec: Failed to request Aux WD interrupt (-16)
    genirq: Flags mismatch irq 292. 00002001 (mbhc sw intr) vs. 00002001 (mbhc sw intr)
    wcd938x_codec audio-codec: Failed to request mbhc interrupts -16

Fixes: 8d78602aa87a ("ASoC: codecs: wcd938x: add basic driver")
Cc: stable@vger.kernel.org # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705123018.30903-5-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: fix missing clsh ctrl error handling
Johan Hovold [Wed, 5 Jul 2023 12:30:13 +0000 (14:30 +0200)]
ASoC: codecs: wcd938x: fix missing clsh ctrl error handling

Allocation of the clash control structure may fail so add the missing
error handling to avoid dereferencing an error pointer.

Fixes: 8d78602aa87a ("ASoC: codecs: wcd938x: add basic driver")
Cc: stable@vger.kernel.org # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705123018.30903-4-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: qdsp6: audioreach: fix topology probe deferral
Johan Hovold [Wed, 5 Jul 2023 12:30:12 +0000 (14:30 +0200)]
ASoC: qdsp6: audioreach: fix topology probe deferral

Propagate errors when failing to load the topology component so that
probe deferrals can be handled.

Fixes: 36ad9bf1d93d ("ASoC: qdsp6: audioreach: add topology support")
Cc: stable@vger.kernel.org # 5.17
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705123018.30903-3-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: fix dB range for HPHL and HPHR
Srinivas Kandagatla [Wed, 5 Jul 2023 12:57:23 +0000 (13:57 +0100)]
ASoC: codecs: wcd938x: fix dB range for HPHL and HPHR

dB range for HPHL and HPHR gains are from +6dB to -30dB in steps of
1.5dB with register values range from 0 to 24.

Current code maps these dB ranges incorrectly, fix them to allow proper
volume setting.

Fixes: e8ba1e05bdc0 ("ASoC: codecs: wcd938x: add basic controls")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705125723.40464-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: qcom: q6afe-dai: fix Display Port Playback stream name
Srinivas Kandagatla [Wed, 5 Jul 2023 12:48:50 +0000 (13:48 +0100)]
ASoC: qcom: q6afe-dai: fix Display Port Playback stream name

With recent changes to add more display ports did not change the Stream
name in q6afe-dai. This results in below error
"ASoC: Failed to add route DISPLAY_PORT_RX -> Display Port Playback(*)"
and sound card fails to probe.

Fix this by adding correct stream name.

Fixes: 90848a2557fe ("ASoC: qcom: q6dsp: add support to more display ports")
Reported-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705124850.40069-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: rt5645: check return value after reading device id
Shuming Fan [Wed, 5 Jul 2023 04:29:14 +0000 (12:29 +0800)]
ASoC: rt5645: check return value after reading device id

If the I2C controller encounters some problems like timed-out, the codec
driver will report the error code for the first read.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20230705042915.24932-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l45: Select REGMAP_IRQ
Nathan Chancellor [Mon, 3 Jul 2023 21:43:15 +0000 (14:43 -0700)]
ASoC: cs35l45: Select REGMAP_IRQ

After commit 6085f9e6dc19 ("ASoC: cs35l45: IRQ support"), without any
other configuration that selects CONFIG_REGMAP_IRQ, modpost errors out
with:

  ERROR: modpost: "regmap_irq_get_virq" [sound/soc/codecs/snd-soc-cs35l45.ko] undefined!
  ERROR: modpost: "devm_regmap_add_irq_chip" [sound/soc/codecs/snd-soc-cs35l45.ko] undefined!

Add the Kconfig selection to ensure these functions get built and
included, which resolves the build failure.

Cc: stable@vger.kernel.org
Fixes: 6085f9e6dc19 ("ASoC: cs35l45: IRQ support")
Reported-by: Marcus Seyfarth <m.seyfarth@gmail.com>
Closes: https://github.com/ClangBuiltLinux/linux/issues/1882
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20230703-cs35l45-select-regmap_irq-v1-1-37d7e838b614@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: fix missing mbhc init error handling
Johan Hovold [Mon, 3 Jul 2023 12:47:01 +0000 (14:47 +0200)]
ASoC: codecs: wcd938x: fix missing mbhc init error handling

MBHC initialisation can fail so add the missing error handling to avoid
dereferencing an error pointer when later configuring the jack:

    Unable to handle kernel paging request at virtual address fffffffffffffff8

    pc : wcd_mbhc_start+0x28/0x380 [snd_soc_wcd_mbhc]
    lr : wcd938x_codec_set_jack+0x28/0x48 [snd_soc_wcd938x]

    Call trace:
     wcd_mbhc_start+0x28/0x380 [snd_soc_wcd_mbhc]
     wcd938x_codec_set_jack+0x28/0x48 [snd_soc_wcd938x]
     snd_soc_component_set_jack+0x28/0x8c [snd_soc_core]
     qcom_snd_wcd_jack_setup+0x7c/0x19c [snd_soc_qcom_common]
     sc8280xp_snd_init+0x20/0x2c [snd_soc_sc8280xp]
     snd_soc_link_init+0x28/0x90 [snd_soc_core]
     snd_soc_bind_card+0x628/0xbfc [snd_soc_core]
     snd_soc_register_card+0xec/0x104 [snd_soc_core]
     devm_snd_soc_register_card+0x4c/0xa4 [snd_soc_core]
     sc8280xp_platform_probe+0xf0/0x108 [snd_soc_sc8280xp]

Fixes: bcee7ed09b8e ("ASoC: codecs: wcd938x: add Multi Button Headset Control support")
Cc: stable@vger.kernel.org # 5.15
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230703124701.11734-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: fix soundwire initialisation race
Johan Hovold [Sat, 1 Jul 2023 09:47:23 +0000 (11:47 +0200)]
ASoC: codecs: wcd938x: fix soundwire initialisation race

Make sure that the soundwire device used for register accesses has been
enumerated and initialised before trying to read the codec variant
during component probe.

This specifically avoids interpreting (a masked and shifted) -EBUSY
errno as the variant:

wcd938x_codec audio-codec: ASoC: error at soc_component_read_no_lock on audio-codec for register: [0x000034b0] -16

in case the soundwire device has not yet been initialised, which in turn
prevents some headphone controls from being registered.

Fixes: 8d78602aa87a ("ASoC: codecs: wcd938x: add basic driver")
Cc: stable@vger.kernel.org # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reported-by: Steev Klimaszewski <steev@kali.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Link: https://lore.kernel.org/r/20230701094723.29379-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x/wcd934x: loglevel fix and
Mark Brown [Fri, 30 Jun 2023 18:18:53 +0000 (19:18 +0100)]
ASoC: codecs: wcd938x/wcd934x: loglevel fix and

Merge series from Johan Hovold <johan+linaro@kernel.org>:

When investigating a race in the wcd938x driver I noticed that the MBHC
impedance measurements where printed at error loglevel which is clearly
wrong.

Fix that, and clean up the logging somewhat by using dev_printk() and
addressing some style issues.

Included are also two patches that drop the bogus inline keywords from
the functions involved.

12 months agoASoC: codecs: wcd934x: drop inline keywords
Johan Hovold [Fri, 30 Jun 2023 14:27:17 +0000 (16:27 +0200)]
ASoC: codecs: wcd934x: drop inline keywords

The compiler is generally better at deciding what functions should be
inlined than driver authors are.

Drop the bogus inline keyword from two functions that were neither very
small or used in a single place.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230630142717.5314-6-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd934x: demote impedance printk
Johan Hovold [Fri, 30 Jun 2023 14:27:16 +0000 (16:27 +0200)]
ASoC: codecs: wcd934x: demote impedance printk

Demote the MBHC impedance measurement printk, which is only needed
for development and debugging, to debug level.

While at it, fix the capitalisation of "ohm" and add the missing space
before the opening parenthesis.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230630142717.5314-5-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: use dev_printk() for impedance logging
Johan Hovold [Fri, 30 Jun 2023 14:27:15 +0000 (16:27 +0200)]
ASoC: codecs: wcd938x: use dev_printk() for impedance logging

Pass the component structure also to the
wcd938x_mbhc_get_result_params() helper so that the component device can
be used for logging consistently.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230630142717.5314-4-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: drop inline keywords
Johan Hovold [Fri, 30 Jun 2023 14:27:14 +0000 (16:27 +0200)]
ASoC: codecs: wcd938x: drop inline keywords

The compiler is generally better at deciding what functions should be
inlined than driver authors are.

Drop the bogus inline keyword from two functions that were neither very
small or used in a single place.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230630142717.5314-3-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: fix mbhc impedance loglevel
Johan Hovold [Fri, 30 Jun 2023 14:27:13 +0000 (16:27 +0200)]
ASoC: codecs: wcd938x: fix mbhc impedance loglevel

Demote the MBHC impedance measurement printk, which is not an error
message, from error to debug level.

While at it, fix the capitalisation of "ohm" and add the missing space
before the opening parenthesis.

Fixes: bcee7ed09b8e ("ASoC: codecs: wcd938x: add Multi Button Headset Control support")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230630142717.5314-2-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: qdsp6: q6apm: use dai link pcm id as pcm device number
Srinivas Kandagatla [Wed, 28 Jun 2023 09:24:04 +0000 (10:24 +0100)]
ASoC: qdsp6: q6apm: use dai link pcm id as pcm device number

For some reason we ended up with a setup without this flag.
This resulted in inconsistent sound card devices numbers which
 are also not starting as expected at dai_link->id.
 (Ex: MultiMedia1 pcm ended up with device number 4 instead of 0)

With this patch patch now the MultiMedia1 PCM ends up with device number 0
as expected.

[This is causing unstable numbering in userspace as other changes go in,
which in turn gets noticed by some userspace.  There's been multiple
values so we can't simply pick one and revert to it.  Do not backport
since it will introduce a change. -- broonie]

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230628092404.13927-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: fix codec initialisation race
Johan Hovold [Fri, 30 Jun 2023 12:03:18 +0000 (14:03 +0200)]
ASoC: codecs: wcd938x: fix codec initialisation race

Make sure to resume the codec and soundwire device before trying to read
the codec variant and configure the device during component probe.

This specifically avoids interpreting (a masked and shifted) -EBUSY
errno as the variant:

wcd938x_codec audio-codec: ASoC: error at soc_component_read_no_lock on audio-codec for register: [0x000034b0] -16

when the soundwire device happens to be suspended, which in turn
prevents some headphone controls from being registered.

Fixes: 8d78602aa87a ("ASoC: codecs: wcd938x: add basic driver")
Cc: stable@vger.kernel.org # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reported-by: Steev Klimaszewski <steev@kali.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230630120318.6571-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: amd: add revision check for sending sha dma completion command
Mastan Katragadda [Fri, 30 Jun 2023 07:05:42 +0000 (12:35 +0530)]
ASoC: SOF: amd: add revision check for sending sha dma completion command

ACP driver should send SHA DMA completion command to PSP module for RN
platform only.
Add a revision check for RN platform.

Signed-off-by: Mastan Katragadda <Mastan.Katragadda@amd.com>
Link: https://lore.kernel.org/r/20230630070544.2167421-1-Mastan.Katragadda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: rt5640: Fix sleep in atomic context
Sameer Pujar [Thu, 29 Jun 2023 05:12:15 +0000 (10:42 +0530)]
ASoC: rt5640: Fix sleep in atomic context

Following prints are observed while testing audio on Jetson AGX Orin which
has onboard RT5640 audio codec:

  BUG: sleeping function called from invalid context at kernel/workqueue.c:3027
  in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 0, name: swapper/0
  preempt_count: 10001, expected: 0
  RCU nest depth: 0, expected: 0
  ------------[ cut here ]------------
  WARNING: CPU: 0 PID: 0 at kernel/irq/handle.c:159 __handle_irq_event_percpu+0x1e0/0x270
  ---[ end trace ad1c64905aac14a6 ]-

The IRQ handler rt5640_irq() runs in interrupt context and can sleep
during cancel_delayed_work_sync().

Fix this by running IRQ handler, rt5640_irq(), in thread context.
Hence replace request_irq() calls with devm_request_threaded_irq().

Fixes: 051dade34695 ("ASoC: rt5640: Fix the wrong state of JD1 and JD2")
Cc: stable@vger.kernel.org
Cc: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1688015537-31682-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tegra: Fix ADX byte map
Sheetal [Thu, 29 Jun 2023 05:12:14 +0000 (10:42 +0530)]
ASoC: tegra: Fix ADX byte map

Byte mask for channel-1 of stream-1 is not getting enabled and this
causes failures during ADX use cases. This happens because the byte
map value 0 matches the byte map array and put() callback returns
without enabling the corresponding bits in the byte mask.

ADX supports 4 output streams and each stream can have a maximum of
16 channels. Each byte in the input frame is uniquely mapped to a
byte in one of these 4 outputs. This mapping is done with the help of
byte map array via user space control setting. The byte map array
size in the driver is 16 and each array element is of size 4 bytes.
This corresponds to 64 byte map values.

Each byte in the byte map array can have any value between 0 to 255
to enable the corresponding bits in the byte mask. The value 256 is
used as a way to disable the byte map. However the byte map array
element cannot store this value. The put() callback disables the byte
mask for 256 value and byte map value is reset to 0 for this case.
This causes problems during subsequent runs since put() callback,
for value of 0, just returns without enabling the byte mask. In short,
the problem is coming because 0 and 256 control values are stored as
0 in the byte map array.

Right now fix the put() callback by actually looking at the byte mask
array state to identify if any change is needed and update the fields
accordingly. The get() callback needs an update as well to return the
correct control value that user has set before. Note that when user
set 256, the value is stored as 0 and byte mask is disabled. So byte
mask state is used to either return 256 or the value from byte map
array.

Given above, this looks bit complicated and all this happens because
the byte map array is tightly packed and cannot actually store the 256
value. Right now the priority is to fix the existing failure and a TODO
item is put to improve this logic.

Fixes: 3c97881b8c8a ("ASoC: tegra: Fix kcontrol put callback in ADX")
Cc: stable@vger.kernel.org
Signed-off-by: Sheetal <sheetal@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1688015537-31682-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tegra: Fix AMX byte map
Sheetal [Thu, 29 Jun 2023 05:12:13 +0000 (10:42 +0530)]
ASoC: tegra: Fix AMX byte map

Byte mask for channel-1 of stream-1 is not getting enabled and this
causes failures during AMX use cases. This happens because the byte
map value 0 matches the byte map array and put() callback returns
without enabling the corresponding bits in the byte mask.

AMX supports 4 input streams and each stream can take a maximum of
16 channels. Each byte in the output frame is uniquely mapped to a
byte in one of these 4 inputs. This mapping is done with the help of
byte map array via user space control setting. The byte map array
size in the driver is 16 and each array element is of size 4 bytes.
This corresponds to 64 byte map values.

Each byte in the byte map array can have any value between 0 to 255
to enable the corresponding bits in the byte mask. The value 256 is
used as a way to disable the byte map. However the byte map array
element cannot store this value. The put() callback disables the byte
mask for 256 value and byte map value is reset to 0 for this case.
This causes problems during subsequent runs since put() callback,
for value of 0, just returns without enabling the byte mask. In short,
the problem is coming because 0 and 256 control values are stored as
0 in the byte map array.

Right now fix the put() callback by actually looking at the byte mask
array state to identify if any change is needed and update the fields
accordingly. The get() callback needs an update as well to return the
correct control value that user has set before. Note that when user
sets 256, the value is stored as 0 and byte mask is disabled. So byte
mask state is used to either return 256 or the value from byte map
array.

Given above, this looks bit complicated and all this happens because
the byte map array is tightly packed and cannot actually store the 256
value. Right now the priority is to fix the existing failure and a TODO
item is put to improve this logic.

Fixes: 8db78ace1ba8 ("ASoC: tegra: Fix kcontrol put callback in AMX")
Cc: stable@vger.kernel.org
Signed-off-by: Sheetal <sheetal@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1688015537-31682-2-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: fix for invalid dai id handling in acp_get_byte_count()
Vijendar Mukunda [Mon, 26 Jun 2023 10:53:54 +0000 (16:23 +0530)]
ASoC: amd: acp: fix for invalid dai id handling in acp_get_byte_count()

For invalid dai id, instead of returning -EINVAL
return bytes count as zero in acp_get_byte_count() function.

Fixes: 623621a9f9e1 ("ASoC: amd: Add common framework to support I2S on ACP SOC")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: fix byte count return value for invalid SoundWire manager instance
Vijendar Mukunda [Mon, 26 Jun 2023 10:53:53 +0000 (16:23 +0530)]
ASoC: amd: ps: fix byte count return value for invalid SoundWire manager instance

acp_get_byte_count() function should return zero bytes instead of
-EINVAL for invalid SoundWire manager instance.

Fixes: f722917350ee ("ASoC: amd: ps: add SoundWire dma driver dma ops")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: add comments for DMA register mapping
Vijendar Mukunda [Mon, 26 Jun 2023 10:53:52 +0000 (16:23 +0530)]
ASoC: amd: ps: add comments for DMA register mapping

Add comments for DMA register mapping for both the SoundWire manager
instances.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: fix for position register set for AUDIO0 RX stream
Vijendar Mukunda [Mon, 26 Jun 2023 10:53:51 +0000 (16:23 +0530)]
ASoC: amd: ps: fix for position register set for AUDIO0 RX stream

For AUDIO0 RX stream, AUDIO0_RX position registers should be used.
DMA error is reported due to referring wrong position register set for
AUDIO0 RX stream.
Correct the position register set for AUDIO0 RX stream.

Fixes: f722917350ee ("ASoC: amd: ps: add SoundWire dma driver dma ops")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: add fix for dma irq mask for rx streams for SDW0 instance
Vijendar Mukunda [Mon, 26 Jun 2023 10:53:50 +0000 (16:23 +0530)]
ASoC: amd: ps: add fix for dma irq mask for rx streams for SDW0 instance

Correct the DMA irq mask macro to program DMA irq bits correctly for
SDW0 instance rx streams.

Fixes: 298d4f7b1765 ("ASoC: amd: ps: add support for SoundWire DMA interrupts")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: add comments for DMA irq bits mapping
Vijendar Mukunda [Mon, 26 Jun 2023 10:53:49 +0000 (16:23 +0530)]
ASoC: amd: ps: add comments for DMA irq bits mapping

Add comments for DMA stream id and IRQ bit mapping in
ACP_EXTERNAL_CNTL & ACP_EXTERNAL_CNTL1 registers for
SDW0 and SDW1 manager instances.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: hdmi-codec: fix channel info for compressed formats
Matthias Reichl [Sat, 24 Jun 2023 16:52:32 +0000 (18:52 +0200)]
ASoC: hdmi-codec: fix channel info for compressed formats

According to CTA 861 the channel/speaker allocation info in the
audio infoframe only applies to uncompressed (PCM) audio streams.

The channel count info should indicate the number of channels
in the transmitted audio, which usually won't match the number of
channels used to transmit the compressed bitstream.

Some devices (eg some Sony TVs) will refuse to decode compressed
audio if these values are not set correctly.

To fix this we can simply set the channel count to 0 (which means
"refer to stream header") and set the channel/speaker allocation to 0
as well (which would mean stereo FL/FR for PCM, a safe value all sinks
will support) when transmitting compressed audio.

Signed-off-by: Matthias Reichl <hias@horus.com>
Link: https://lore.kernel.org/r/20230624165232.5751-1-hias@horus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: core: Always store of_node when getting DAI link component
Mark Brown [Fri, 23 Jun 2023 21:04:39 +0000 (22:04 +0100)]
ASoC: core: Always store of_node when getting DAI link component

The generic snd_soc_dai_get_dlc() contains a default translation function
for DAI names which has factored out common code in a number of card
drivers, resolving the dai_name and of_node either using a driver provided
translation function or with a generic implementation. Unfortunately the
of_node can't be set by the translation function since it currently doesn't
have an interface to do that but snd_soc_dai_get_dlc() only initialises the
of_node in the case where there is no translation function.

This breaks the Meson support after conversion to use the generic helpers
since the DPCM cards for it check which component of the SoC is connected
to each link by checking the compatible for the component and the Meson
components provide a custom operation so don't use the generic code.

Fix this and potentially other cards by unconditionally storing the node in
the dai_link_component, there shouldn't be a binding specific of_node
selected since that's how we determine the translation function.

Fixes: 2e1dbea1f8a3 ("ASoC: meson: use snd_soc_{of_}get_dlc()")
Fixes: 3c8b5861850c ("ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()")
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tas2781: Fix error code in tas2781_load_calibration()
Dan Carpenter [Fri, 23 Jun 2023 12:09:48 +0000 (15:09 +0300)]
ASoC: tas2781: Fix error code in tas2781_load_calibration()

Return -EINVAL instead of success on this error path.

Fixes: 915f5eadebd2 ("ASoC: tas2781: firmware lib")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: update pm_runtime enable sequence
Arun Gopal Kondaveeti [Fri, 23 Jun 2023 21:41:40 +0000 (03:11 +0530)]
ASoC: amd: update pm_runtime enable sequence

pm_runtime_allow() is not needed for ACP child platform devices.
Replace pm_runtime_allow() with pm_runtime_mark_last_busy()
& pm_runtime_set_active() in pm_runtime enable sequence for
ACP child platform drivers.

Signed-off-by: Arun Gopal <arungopal.kondaveeti@amd.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tas2781: fix Kconfig dependencies
Arnd Bergmann [Thu, 22 Jun 2023 10:11:23 +0000 (12:11 +0200)]
ASoC: tas2781: fix Kconfig dependencies

The new driver has two modules that both get enabled for build testing
when all codecs are selected. The comlib part has an i2c dependency,
so this remains disabled on builds without i2c, but then the other
one fails to link:

ERROR: modpost: "tasdevice_dev_bulk_write" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_update_bits" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_bulk_read" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_read" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_write" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!

There are many ways to address this, adding an explicit dependency seems
to be the clearest method that keeps the structure of the driver otherwise
unchanged.

Fixes: ef3bcde75d06d ("ASoC: tas2781: Add tas2781 driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: remove acp poweroff function
Syed Saba Kareem [Thu, 22 Jun 2023 15:23:41 +0000 (20:53 +0530)]
ASoC: amd: acp: remove acp poweroff function

BIOS invokes ACP Power off sequence based on ACP device state.
Remove redundant code from ACP PCI driver for ACP Power off sequence.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: clear pdm dma interrupt mask
Syed Saba Kareem [Thu, 22 Jun 2023 15:23:38 +0000 (20:53 +0530)]
ASoC: amd: acp: clear pdm dma interrupt mask

Clear pdm dma interrupt mask in acp_dmic_shutdown().

'Fixes: c32bd332ce5c9 ("ASoC: amd: acp: Add generic support for
PDM controller on ACP")'

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: max98090: Allow dsp_a mode
Maxim Kochetkov [Thu, 22 Jun 2023 14:20:36 +0000 (17:20 +0300)]
ASoC: codecs: max98090: Allow dsp_a mode

TDM mode for max98090 is dsp_a compatible with such limitations:
1) Up to four timeslots supported.
2) Only 16 bits timeslots supported.
3) Only 2 active timeslots (L/R) supported.

We want to setup TDM mode only when dsp_a mode is selected. So move
M98090_REG_TDM_FORMAT/M98090_REG_TDM_CONTROL registers setup from
max98090_set_tdm_slot() to the max98090_dai_set_fmt(). Also extend
max98090_set_tdm_slot() with all TDM limitations check.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: qcom: common: add default jack dapm pins
Srinivas Kandagatla [Thu, 2 Mar 2023 12:03:27 +0000 (12:03 +0000)]
ASoC: qcom: common: add default jack dapm pins

If the soundcard does not specify the dapm pins, let the common
code add these pins for jack.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: loongson: fix address space confusion
Arnd Bergmann [Thu, 22 Jun 2023 10:12:22 +0000 (12:12 +0200)]
ASoC: loongson: fix address space confusion

The i2s driver uses the mapped __iomem address of the FIFO as the DMA
address for the device. This apparently works on loongarch because of
the way it handles __iomem pointers as aliases of physical addresses,
but this is not portable to other architectures and causes a compiler
warning when dma addresses are not the same size as pointers:

sound/soc/loongson/loongson_i2s_pci.c: In function 'loongson_i2s_pci_probe':
sound/soc/loongson/loongson_i2s_pci.c:110:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  110 |         tx_data->dev_addr = (dma_addr_t)i2s->reg_base + LS_I2S_TX_DATA;
      |                             ^
sound/soc/loongson/loongson_i2s_pci.c:113:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  113 |         rx_data->dev_addr = (dma_addr_t)i2s->reg_base + LS_I2S_RX_DATA;
      |                             ^

Change the driver to instead use the physical address as stored in the
PCI BAR resource directly. Since 'dev_addr' is a 32-bit address, I think
this results in the same truncated address on loongarch but is otherwise
closer to portable code and avoids the warning.

Fixes: d84881e06836d ("ASoC: Add support for Loongson I2S controller")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: microchip,sama7g5-pdmc: Simplify "microchip,mic-pos" constraints
Rob Herring [Wed, 21 Jun 2023 23:10:44 +0000 (17:10 -0600)]
ASoC: dt-bindings: microchip,sama7g5-pdmc: Simplify "microchip,mic-pos" constraints

"enum" values should be integers or strings, not arrays (though json-schema
does allow arrays, we do not). In this case, all possible combinations are
allowed anyways, so there's little point in expressing as an array.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tegra: Remove stale comments in AHUB
Sameer Pujar [Thu, 22 Jun 2023 11:34:14 +0000 (17:04 +0530)]
ASoC: tegra: Remove stale comments in AHUB

Remove stale comments in AHUB driver which is related to DAPM
widgets and routes. This is misleading otherwise.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tegra: Use normal system sleep for ASRC
Sameer Pujar [Thu, 22 Jun 2023 11:34:13 +0000 (17:04 +0530)]
ASoC: tegra: Use normal system sleep for ASRC

Align with other AHUB module drivers and use normal system
sleep for ASRC as well.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: fsl-asoc-card: Allow passing the number of slots in use
Fabio Estevam [Fri, 16 Jun 2023 20:39:13 +0000 (17:39 -0300)]
ASoC: fsl-asoc-card: Allow passing the number of slots in use

Currently, fsl-asoc-card supports passing the width of the TDM slot, but
not the number of slots in use, as it harcodes it as two slots.

Add support for passing the number of slots in use.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20230616203913.551183-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wsa884x: Add WSA884x family of speakers
Krzysztof Kozlowski [Fri, 16 Jun 2023 11:57:51 +0000 (13:57 +0200)]
ASoC: codecs: wsa884x: Add WSA884x family of speakers

Add drivers for Qualcomm WSA8840/WSA8845/WSA8845H smart speaker
amplifiers.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230616115751.392886-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: qcom,wsa8840: Add WSA884x family of speakers
Krzysztof Kozlowski [Fri, 16 Jun 2023 11:57:50 +0000 (13:57 +0200)]
ASoC: dt-bindings: qcom,wsa8840: Add WSA884x family of speakers

Add binding for WSA8840/WSA8845/WSA8845H smart speaker amplifiers used
in Qualcomm QRD8550 board with SM8550 SoC.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230616115751.392886-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: Add mtl support RT1019P speaker
Mac Chiang [Fri, 16 Jun 2023 06:36:17 +0000 (02:36 -0400)]
ASoC: Intel: sof_rt5682: Add mtl support RT1019P speaker

This patch support below hardware configuration:

SSP2: 10EC5682/RTL5682 codec
SSP0: RTL1019 amplifier

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Rui Zhou <zhourui@huaqin.corp-partner.google.com>
Link: https://lore.kernel.org/r/20230616063617.25900-2-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: reorder quirk table
Terry Cheong [Fri, 16 Jun 2023 06:36:16 +0000 (02:36 -0400)]
ASoC: Intel: sof_rt5682: reorder quirk table

Reorder the entries in quirk table to group entries with same platform.

Signed-off-by: Terry Cheong <htcheong@chromium.org>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Link: https://lore.kernel.org/r/20230616063617.25900-1-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Merge up fixes for CI
Mark Brown [Wed, 21 Jun 2023 00:32:31 +0000 (01:32 +0100)]
ASoC: Merge up fixes for CI

Some of the fixes merged should be relevant for my CI stability.

12 months agoASoC: amd: ps: add SoundWire support
Mark Brown [Tue, 20 Jun 2023 23:56:07 +0000 (00:56 +0100)]
ASoC: amd: ps: add SoundWire support

Merge series from Vijendar Mukunda <Vijendar.Mukunda@amd.com>:

This patch series add support for
- Platform device creation for SoundWire Manager instances and
  PDM controller.
- SoundWire DMA driver.
- Interrupt handling for SoundWire manager related interrupts,
  SoundWire DMA interrupts and ACP error interrupts.
- ACP PCI driver PM ops modification with respect to SoundWire
  Power modes.

12 months agoadd snd_soc_{of_}get_dlc()
Mark Brown [Tue, 20 Jun 2023 23:56:00 +0000 (00:56 +0100)]
add snd_soc_{of_}get_dlc()

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

Current soc-core.c has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component). It gets .dai_name, but we need
.of_node too. Therefor user need to arrange.

It will be more useful if it gets both .dai_name and .of_node.
This patch adds snd_soc_{of_}get_dlc() for it, and convert to use it.

12 months agoASoC: amd: ps: add acp_reset flag check in acp pci driver pm ops.
Vijendar Mukunda [Mon, 12 Jun 2023 09:59:03 +0000 (15:29 +0530)]
ASoC: amd: ps: add acp_reset flag check in acp pci driver pm ops.

AMD SoundWire manager supports different power modes.
acp_reset flag will be set to false only when SoundWire manager power
mode is selected as ClockStop Mode. For rest of the combinations
(ACP PDM + SDW), acp_reset flag will be set to true.
When acp_reset flag is set, acp de-init and acp init sequence should
be invoked during suspend/resume callbacks.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-10-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: update comments in Kconfig file
Vijendar Mukunda [Mon, 12 Jun 2023 09:59:02 +0000 (15:29 +0530)]
ASoC: amd: update comments in Kconfig file

Update comments in Kconfig file for Pink Sardine platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-9-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: enable SoundWire dma driver build
Vijendar Mukunda [Mon, 12 Jun 2023 09:59:01 +0000 (15:29 +0530)]
ASoC: amd: ps: enable SoundWire dma driver build

Enable SoundWire dma driver build for PS platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: add pm ops support for SoundWire dma driver
Vijendar Mukunda [Mon, 12 Jun 2023 09:59:00 +0000 (15:29 +0530)]
ASoC: amd: ps: add pm ops support for SoundWire dma driver

Add support pm ops support for SoundWire dma driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-7-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: add support for SoundWire DMA interrupts
Vijendar Mukunda [Mon, 12 Jun 2023 09:58:59 +0000 (15:28 +0530)]
ASoC: amd: ps: add support for SoundWire DMA interrupts

Move to request_threaded_irq and use thread for handling
SoundWire DMA interrupts.
Whenever audio data equal to the SoundWire FIFO watermark level
are produced/consumed, interrupt is generated.
Acknowledge the interrupt and wake up the irq thread.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: add SoundWire dma driver dma ops
Vijendar Mukunda [Mon, 12 Jun 2023 09:58:58 +0000 (15:28 +0530)]
ASoC: amd: ps: add SoundWire dma driver dma ops

Add SoundWire DMA driver dma ops for Pink Sardine platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: add SoundWire dma driver
Vijendar Mukunda [Mon, 12 Jun 2023 09:58:57 +0000 (15:28 +0530)]
ASoC: amd: ps: add SoundWire dma driver

SoundWire DMA platform driver binds to the platform device created by
ACP PCI device. SoundWire DMA driver registers ALSA DMA component
with ASoC framework.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: handle SoundWire interrupts in acp pci driver
Vijendar Mukunda [Mon, 12 Jun 2023 09:58:56 +0000 (15:28 +0530)]
ASoC: amd: ps: handle SoundWire interrupts in acp pci driver

Handle SoundWire manager related interrupts in ACP PCI driver
interrupt handler and schedule SoundWire manager work queue for
further processing.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: create platform devices based on acp config
Vijendar Mukunda [Mon, 12 Jun 2023 09:58:55 +0000 (15:28 +0530)]
ASoC: amd: ps: create platform devices based on acp config

Based on ACP pin configuration and scanning child devices
under ACP pci device ACPI scope, platform device configuration
(pdev_config) and platform device count(pdev_count) will be
calculated.

Using pdev_config and pdev_count values, ACP PCI driver will
create platform devices for Pink Sardine platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tas2781: Fix spelling mistake "calibraiton" -> "calibration"
Colin Ian King [Tue, 20 Jun 2023 09:56:20 +0000 (10:56 +0100)]
ASoC: tas2781: Fix spelling mistake "calibraiton" -> "calibration"

There is a spelling mistake in a dev_err message. Fix it. Also fix
grammar and add space between last word and (%d)".

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20230620095620.2522058-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: qcom: audioreach: add compress offload
Mark Brown [Tue, 20 Jun 2023 14:24:06 +0000 (15:24 +0100)]
ASoC: qcom: audioreach: add compress offload

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

This patchset adds compressed offload support to Qualcomm audioreach drivers.
Currently it supports AAC, MP3 and FALC along with gapless.

Tested this on SM8450 and sc7280.

12 months agoASoC: Use maple tree register cache for Everest Semi
Mark Brown [Tue, 20 Jun 2023 14:23:56 +0000 (15:23 +0100)]
ASoC: Use maple tree register cache for Everest Semi

Merge series from Mark Brown <broonie@kernel.org>:

Several of the Everest Semi CODECs only support single register read and
write operations and therefore do not benefit from using the rbtree
cache over the maple tree cache, convert them to the more modern maple
tree cache.

12 months agoASoC: Convert Realtek I2C drivers to use maple tree
Mark Brown [Tue, 20 Jun 2023 14:23:47 +0000 (15:23 +0100)]
ASoC: Convert Realtek I2C drivers to use maple tree

Merge series from Mark Brown <broonie@kernel.org>:

Many of the Realtek I2C/SPI devices only support single register read
and write operations so don't benefit from using the rbtree cache
instead of the more modern maple tree cache, convert them to maple tree.

12 months agoASoC: simple-card.c: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:51 +0000 (02:14 +0000)]
ASoC: simple-card.c: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fs6mdgmc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: soc-core.c: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:46 +0000 (02:14 +0000)]
ASoC: soc-core.c: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h6r2dgmi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: loongson: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:40 +0000 (02:14 +0000)]
ASoC: loongson: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ilbidgmn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: samsung: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:35 +0000 (02:14 +0000)]
ASoC: samsung: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

- note: need deep check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87jzvydgms.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: meson: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:30 +0000 (02:14 +0000)]
ASoC: meson: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87legedgmy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: qcom: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:24 +0000 (02:14 +0000)]
ASoC: qcom: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mt0udgn3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: fsl: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:18 +0000 (02:14 +0000)]
ASoC: fsl: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o7ladgn9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: soc-core.c: add index on snd_soc_of_get_dai_name()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:11 +0000 (02:14 +0000)]
ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()

Current snd_soc_of_get_dai_name() doesn't accept index
for #sound-dai-cells. It is not useful for user.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pm5qdgng.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: soc-core.c: add snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:06 +0000 (02:14 +0000)]
ASoC: soc-core.c: add snd_soc_{of_}get_dlc()

Current soc-core.c has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component). It gets .dai_name, but we need
.of_node too. Therefor user need to arrange.

It will be more useful if it gets both .dai_name and .of_node.
This patch adds snd_soc_{of_}get_dlc() for it, and existing functions
uses it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r0q6dgnm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dwc: don't assign addr_width for dt configs
Maxim Kochetkov [Tue, 13 Jun 2023 19:15:51 +0000 (22:15 +0300)]
ASoC: dwc: don't assign addr_width for dt configs

For proper DMA operation addr_width must corresponds with audio format
(S16, S24, S32, etc). Proper bus width calculations is performed by
snd_hwparams_to_dma_slave_config(). So drop wrong addr_width asignment
for dt configs and let snd_hwparams_to_dma_slave_config() do the job.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://lore.kernel.org/r/20230613191552.724748-1-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dwc: add DMA handshake control
Maxim Kochetkov [Tue, 13 Jun 2023 19:19:08 +0000 (22:19 +0300)]
ASoC: dwc: add DMA handshake control

DMA mode uses hardware handshake signals. DMACR register is used to enable
the DMA Controller interface operation. So add DMA enable/disable to
i2s_start()/i2s_stop() functions if using DMA mode.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://lore.kernel.org/r/20230613191910.725049-1-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: max98388: fix error code in probe()
Dan Carpenter [Mon, 19 Jun 2023 09:46:48 +0000 (12:46 +0300)]
ASoC: max98388: fix error code in probe()

This seems like a copy and paste bug.  Return the correct variable.
It should be "ret" instead of PTR_ERR(max98388->regmap).

Fixes: 6a8e1d46f062 ("ASoC: max98388: add amplifier driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/d44c8388-b12b-4045-95de-0d4bc7b428ac@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: loongson: change the type of variable irq to int
YingKun Meng [Mon, 19 Jun 2023 07:46:49 +0000 (15:46 +0800)]
ASoC: loongson: change the type of variable irq to int

We use variable 'irq' to store the return value of fwnode_get_irq_byname().
A negative value indicates that the operation failed. If the type of 'irq'
is unsigned int, we never know if the operation failed.

Reported-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Closes: https://lore.kernel.org/loongarch/325dd825-6fa5-0ebc-4b7e-7acf2d2840e4@loongson.cn/
Signed-off-by: YingKun Meng <mengyingkun@loongson.cn>
Link: https://lore.kernel.org/r/20230619074649.3608726-1-mengyingkun@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: Add tas2781 amplifier
Shenghao Ding [Sun, 18 Jun 2023 12:28:19 +0000 (20:28 +0800)]
ASoC: dt-bindings: Add tas2781 amplifier

Create tas2781.yaml for tas2781 driver.

Signed-off-by: Shenghao Ding <13916275206@139.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230618122819.23143-4-13916275206@139.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tas2781: Add tas2781 driver
Shenghao Ding [Sun, 18 Jun 2023 12:28:18 +0000 (20:28 +0800)]
ASoC: tas2781: Add tas2781 driver

Create tas2781 driver.

Signed-off-by: Shenghao Ding <13916275206@139.com>
Link: https://lore.kernel.org/r/20230618122819.23143-3-13916275206@139.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tas2781: firmware lib
Shenghao Ding [Sun, 18 Jun 2023 12:28:17 +0000 (20:28 +0800)]
ASoC: tas2781: firmware lib

Create tas2781 firmware lib.

Signed-off-by: Shenghao Ding <13916275206@139.com>
Link: https://lore.kernel.org/r/20230618122819.23143-2-13916275206@139.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tas2781: Add Header file for tas2781 driver
Shenghao Ding [Sun, 18 Jun 2023 12:28:16 +0000 (20:28 +0800)]
ASoC: tas2781: Add Header file for tas2781 driver

Create Header file for  tas2781 driver.

Signed-off-by: Shenghao Ding <13916275206@139.com>
Link: https://lore.kernel.org/r/20230618122819.23143-1-13916275206@139.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: loongson: fix error codes in loongson_card_parse_acpi()
Dan Carpenter [Mon, 19 Jun 2023 09:46:21 +0000 (12:46 +0300)]
ASoC: loongson: fix error codes in loongson_card_parse_acpi()

The acpi_node_get_property_reference() function returns kernel error
codes and not ACPI error codes.  So, although it does not affect the
compiled code, using the ACPI_FAILURE() macro is wrong.  Secondly,
if the is_acpi_device_node() function returns false, then we should
return -ENOENT instead of returning success.

Fixes: d24028606e76 ("ASoC: loongson: Add Loongson ASoC Sound Card Support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/fb14815d-2f9a-4b42-b193-cec61e7417ca@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: imx-audmix: check return value of devm_kasprintf()
Claudiu Beznea [Wed, 14 Jun 2023 12:15:09 +0000 (15:15 +0300)]
ASoC: imx-audmix: check return value of devm_kasprintf()

devm_kasprintf() returns a pointer to dynamically allocated memory.
Pointer could be NULL in case allocation fails. Check pointer validity.
Identified with coccinelle (kmerr.cocci script).

Fixes: b86ef5367761 ("ASoC: fsl: Add Audio Mixer machine driver")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230614121509.443926-1-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: max98363: Remove cache defaults for volatile registers
Mark Brown [Fri, 9 Jun 2023 23:58:44 +0000 (00:58 +0100)]
ASoC: max98363: Remove cache defaults for volatile registers

The max98363 driver provides cache defaults for a number of volatile
registers. This is not meaningful, the cache values will never be used so
at best they will just consume memory and at worst they will be used in
preference to real values from the device, remove them.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-mx98363-volatile-v1-1-7acad55f5dd6@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: q6dsp: q6apm-dai: Add mmap and copy compress DAI callbacks
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:53 +0000 (11:16 +0100)]
ASoC: q6dsp: q6apm-dai: Add mmap and copy compress DAI callbacks

Add q6apm mmap and copy compress DAI callbacks to support compress
offload playback.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-12-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: q6dsp: q6apm-dai: Add compress set params and metadata DAI callbacks
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:52 +0000 (11:16 +0100)]
ASoC: q6dsp: q6apm-dai: Add compress set params and metadata DAI callbacks

Add q6apm compress DAI callbacks for setting params and metadata to support
compress offload playback.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-11-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: q6dsp: q6apm-dai: Add trigger/pointer compress DAI callbacks
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:51 +0000 (11:16 +0100)]
ASoC: q6dsp: q6apm-dai: Add trigger/pointer compress DAI callbacks

Add q6apm trigger and pointer compress DAI callbacks to support
compress offload playback.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-10-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: q6dsp: q6apm-dai: Add compress DAI and codec caps get callbacks
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:50 +0000 (11:16 +0100)]
ASoC: q6dsp: q6apm-dai: Add compress DAI and codec caps get callbacks

Add q6apm get compress DAI capabilities and codec capabilities callbacks
to support compress offload playback.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-9-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: q6dsp: q6apm-dai: Add open/free compress DAI callbacks
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:49 +0000 (11:16 +0100)]
ASoC: q6dsp: q6apm-dai: Add open/free compress DAI callbacks

Add q6apm open and free compress DAI callbacks to support compress
offload playback.
Include compress event handler callback also.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-8-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: q6dsp: audioreach: Add gapless feature support
Mohammad Rafi Shaik [Mon, 19 Jun 2023 10:16:48 +0000 (11:16 +0100)]
ASoC: q6dsp: audioreach: Add gapless feature support

Add support for setting EOS delay command and receive the
EOS response from ADSP, for seamless compress offload
playback feature.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: q6dsp: audioreach: Add support to set compress format params
Mohammad Rafi Shaik [Mon, 19 Jun 2023 10:16:47 +0000 (11:16 +0100)]
ASoC: q6dsp: audioreach: Add support to set compress format params

Add function for setting compress params.

Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-6-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: q6dsp: audioreach: Add placeholder decoder for compress playback
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:46 +0000 (11:16 +0100)]
ASoC: q6dsp: audioreach: Add placeholder decoder for compress playback

Add placeholder decoder graph module for compressed playback feature.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>