Commit Graph

12519 Commits

Author SHA1 Message Date
Krzysztof Kozlowski
100877df34
ASoC: codecs: wcd938x: Use simple defines for chipid register value
The value used to identify chip variant is not an enumeration, but raw
value used to compare registers with.  The 'enum' is not used in the
code at all, so simplify and make it a raw hex value define, so
intention will be explicit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250616-asoc-wcd93xx-enum-v1-2-a20a1b538509@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-23 00:26:39 +01:00
Krzysztof Kozlowski
2f6ff1e615
ASoC: codecs: wcd937x: Use simple defines for chipid register value
The value used to identify chip variant is not an enumeration, but raw
value used to compare registers with.  The 'enum' is not used in the
code at all, so simplify and make it a raw hex value define, so
intention will be explicit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250616-asoc-wcd93xx-enum-v1-1-a20a1b538509@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-23 00:26:38 +01:00
Terry Cheong
5eb8a0d773
ASoC: hdmi-codec: use SND_JACK_AVOUT as jack status
Use SND_JACK_AVOUT as the mask to align with hdac_hdmi driver so that we
can determine HDMI/DP devices from event type.

Most drivers that uses hdmi-codec driver will not be affected since they
are creating jacks with SND_JACK_LINEOUT mask. They will still report
SND_JACK_LINEOUT when the jack status is updated with
snd_soc_jack_report.

Signed-off-by: Terry Cheong <htcheong@chromium.org>
Link: https://patch.msgid.link/20250613-hdmi-v1-1-665ba7ecd5e7@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-13 12:23:56 +01:00
Shenghao Ding
8a5a5cecb7
ASoC: tas2781: Move the "include linux/debugfs.h" into tas2781.h
Move the include linux/debugfs.h into tas2781.h for code clean.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20250612044252.1025-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-12 13:22:05 +01:00
Richard Fitzgerald
e5d5b3aebd
ASoC: cs35l56: Use SoundWire address as alternate firmware suffix on L56 B0
Use the SoundWire link number and device unique ID as the firmware file
qualifier suffix on CS35L56 B0 if .bin files are not found with the older
suffix. Some changes in wm_adsp needed to support this have been included
in this patch because they are trivial.

The allows future products with CS35L56 B0 silicon to use the same firmware
file naming as CS35L57 and cs35L63, while retaining backward compatibility
for firmware that has already been published with the old naming scheme.

The old suffix is searched first, partly because there are already many
files using that naming scheme, but also because they are a smaller subset
of all the possible fallback name options offered by wm_adsp so we know
that it will either find the qualified files or fail. All the firmware
files already published have the wmfw qualified with only the ACPI SSID and
the bin files qualified with both SSID and the suffix.

Originally, the firmware file names indicated which amplifier instance they
were for by appending the ALSA prefix string. This is the standard ASoC way
of distinguishing different instances of the same device. However, on
SoundWire systems the SoundWire physical unique address is available as a
unique identifier for each amp, and this address is hardwired by the
address pin on the amp.

The firmware files are specific for each physical amp so they must be
applied to that amp. Using the ALSA prefix for the filename qualifier means
that to name a firmware file it must be determined what prefix string the
machine driver will assign to each device and then use that to name the
firmware file correctly. This is straightforward in traditional ASoC
systems where the machine driver is specific to a particular piece of
hardware. But on SoundWire the machine driver is generic and can handle a
very wide range of hardware. It is more difficult to determine exactly what
the prefix will be on any particular production device, and more prone to
mistakes. Also, when the machine driver switches to generating this
automatically from SDCA properties in ACPI, there is an additional layer of
complexity in determining the mapping. This uncertainty is unnecessary
because the firmware is built for a specific amp. with known address, so we
can use that directly instead of introducing a redundant intermediate
alias. This ensures the firmware is applied to the amp it was intended for.

There are already many published firmware for CS35L56 B0 silicon so this
first looks for the original name suffix, to keep backward compatibility.
If this doesn't find .bin files it will switch to using the new name suffix
so that future products using CS35L56 B0 can start to use the new suffix.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250612121428.1667-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-12 13:21:44 +01:00
Richard Fitzgerald
d1fc768795
ASoC: cs35l56: Use SoundWire address as firmware name suffix for new silicon
Use the SoundWire link number and device unique ID as the firmware file
qualifier suffix on CS35L57, CS35L63 and revisions of CS35L56 after B0. The
change in wm_adsp needed to support this has been included in this patch
because it is fairly trivial.

Originally, the firmware file names indicated which amplifier instance they
were for by appending the ALSA prefix string. This is the standard ASoC way
of distinguishing different instances of the same device. However, on
SoundWire systems the SoundWire physical unique address is available as a
unique identifier for each amp, and this address is hardwired by a pin on
the amp.

The firmware files are specific for each physical amp so they must be
applied to that amp. Using the ALSA prefix for the filename qualifier means
that to name a firmware file it must be determined what prefix string the
machine driver will assign to each device and then use that to name the
firmware file correctly. This is straightforward in traditional ASoC
systems where the machine driver is specific to a particular piece of
hardware. But on SoundWire the machine driver is generic and can handle a
very wide range of hardware. It is more difficult to determine exactly what
the prefix will be on any particular production device, and more prone to
mistakes. Also, when the machine driver switches to generating this
automatically from SDCA properties in ACPI, there is an additional layer of
complexity in determining the mapping. This uncertainty is unnecessary
because the firmware is built for a specific amp. with known address, so we
can use that directly instead of introducing the redundant intermediate
alias. This ensures the firmware is applied to the amp it was intended for.

There have not been any firmwares published for CS35L57 or CS35L63, so
these can safely be switched to using the SoundWire unique address as the
suffix string. Also note that the machine driver in older kernel version
only has match entries for the CS35L56 Soundwire identity so any future
product with a cs35L57 or CS35L63 would require a new kernel anyway.

There are already many published firmware for CS35L56 B0 silicon so this
keeps the original naming scheme on those, to preserve backward
compatibility.

Note that although sdw_slave.id contains a unique_id field, this cannot
be trusted because the SoundWire core code also puts magic values into it
that it uses as a flag. So the unique ID is read from the chip register.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250612121428.1667-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-12 13:21:43 +01:00
Mark Brown
2ccb770828
ASoC: codecs: More const and unused member cleanups
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Make static data const for code safety and drop some unused fields in
structs.
2025-06-09 17:36:20 +01:00
Charles Keepax
0cbce868ff ASoC: cs42l43: Remove unnecessary work functions
Now the SoundWire IRQ lock has been changed in the core, it is no longer
necessary to use a bunch of work functions to dodge mutex inversions.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20250609143041.495049-4-ckeepax@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2025-06-09 21:36:07 +05:30
Mark Brown
5f4f86d5e0
ASoC: Add Richtek RTQ9124 support
Merge series from cy_huang@richtek.com:

This patch series adds Richtek RTQ9124 1x30W audio amplifier support.
2025-06-09 16:44:29 +01:00
Mark Brown
23d3f6ecaf
ASoC: tas571x: add support for tas5753
Merge series from Bram Vlerick <bram.vlerick@openpixelsystems.org>:

Add support for the ti,tas5753 to tas571x driver.
2025-06-09 16:44:17 +01:00
Mark Brown
4388f5d214
ASoC: Intel: avs: Add rt5640 board support
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Small set of patches intoducing two low-impact improvements to rt5640
codec driver and then avs_rt5640 machine board driver. The board
behavior is based on existing boards such as avs_rt274.

In regard to the retry-device-verification change, there is number of
similar "fixes" found in the Realtek code in sound/soc/codecs. What I
provide here is verified with tests, the delay is not mentioned in the
spec I have access to.
2025-06-09 16:44:08 +01:00
Mark Brown
65613ac1b4
ASoC: codecs: wcd93xx: Few simplifications of code and
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Make the WCD93xx codec drivers simpler using
devm_regulator_bulk_get_enable() and obtain missing VDD_PX supply on
wcd939x.

Context depends on fixes:
https://lore.kernel.org/r/20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-v1-0-0b8a2993b7d3@linaro.org
2025-06-09 16:44:04 +01:00
ChiYuan Huang
1f5cdb6ab4
ASoC: codecs: Add support for Richtek RTQ9124
Add codecs driver for Richtek RTQ9124.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://patch.msgid.link/aca49d1912bfd1b90e82146df6393760a731810c.1749454717.git.cy_huang@richtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-09 12:48:16 +01:00
Shenghao Ding
ac209bde01
ASoC: tas2781: Drop the unnecessary symbol imply
The unnecessary symbols for imply are SND_SOC_TAS2781_COMLIB,
SND_SOC_TAS2781_COMLIB_I2C, and SND_SOC_TAS2781_FMWLIB. They all used for
library compiling. All the symbols in the imply are used for codec driver
compiling.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20250523131111.1884-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:34:52 +01:00
Kuninori Morimoto
039de8f598
ASoC: hdac_hdmi: remove hdac_hdmi_jack[_port]_init()
No one is using hdac_hdmi_jack[_port]_init(). Remove it and its
related functions.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87o6v3j73q.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:34:49 +01:00
Krzysztof Kozlowski
bb4a0f497b
ASoC: codecs: lpass: Drop unused AIF_INVALID first DAI identifier
All four Qualcomm SoC macro codecs define DAI IDs in an enum starting
with AIF_INVALID=0, which is nowhere used in the code thus actual DAI
IDs start from 1.  Drivers do not have their own of_xlate_dai_name(),
thus snd_soc_get_dlc() expects the DTS to start numbering DAIs from 0,
which creates confusing debugging scenario, e.g. DTS should use
<&lpass_wsamacro 2> for WSA_MACRO_AIF_VI with dai->id=3.

This also wastes some space, because drivers allocate few arrays for all
DAIs and basically the [0] is never used.

Drop the confusing first AIF_INVALID DAI identifier so the enum with DAI
IDs will start from 0.  This has little functional impact and does not
affect the ABI, except saving a few bytes of memory per driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250523121811.380045-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:34:48 +01:00
Xinxin Wan
19f971057b
ASoC: codecs: rt5640: Retry DEVICE_ID verification
To be more resilient to codec-detection failures when the hardware
powers on slowly, add retry mechanism to the device verification check.
Similar pattern is found throughout a number of Realtek codecs. Our
tests show that 60ms delay is sufficient to address readiness issues on
rt5640 chip.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Xinxin Wan <xinxin.wan@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250530142120.2944095-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:34:37 +01:00
Cezary Rojewski
cecec195b2
ASoC: codecs: rt5640: Drop dummy register names
Registers 0xfa and 0xfb represent "General Control 1" and "General
Control 2" respectively.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250530142120.2944095-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:34:36 +01:00
Bram Vlerick
c2bde4666d
ASoC: tas571x: add support for tas5753
Add support for tas5753, device is similar to tas5733 but with added
headphone / line driver.

Signed-off-by: Bram Vlerick <bram.vlerick@openpixelsystems.org>
Link: https://patch.msgid.link/20250528-asoc-tas5753-support-v1-1-a50c3f6734ee@openpixelsystems.org
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:34:20 +01:00
Krzysztof Kozlowski
b9ecde0bcf
ASoC: codecs: wcd939x: Add VDD_PX supply
Device has also VDD_PX supply, which should be acquired by the driver.
Regulator framework will provide a dummy supply, thus the change is
compatible with older DTS.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250526-b4-asoc-wcd9395-vdd-px-v1-6-64d3cb60313b@linaro.org
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:33:32 +01:00
Krzysztof Kozlowski
1a134881a8
ASoC: codecs: wcd939x: Simplify return from devm_gpiod_get() error
No need to store devm_gpiod_get() error code in temporary variable.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250526-b4-asoc-wcd9395-vdd-px-v1-4-64d3cb60313b@linaro.org
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:33:30 +01:00
Krzysztof Kozlowski
cc50d176d0
ASoC: codecs: wcd939x: Simplify with devm_regulator_bulk_get_enable()
Drop separate regulator get and enable in probe() path with
devm_regulator_bulk_get_enable(), which simplifies cleanup paths and
device remove().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250526-b4-asoc-wcd9395-vdd-px-v1-3-64d3cb60313b@linaro.org
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:33:29 +01:00
Krzysztof Kozlowski
a7ee107c2d
ASoC: codecs: wcd938x: Simplify with devm_regulator_bulk_get_enable()
Drop separate regulator get and enable in probe() path with
devm_regulator_bulk_get_enable(), which simplifies cleanup paths and
device remove().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250526-b4-asoc-wcd9395-vdd-px-v1-2-64d3cb60313b@linaro.org
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:33:28 +01:00
Krzysztof Kozlowski
10cf8f6be6
ASoC: codecs: wcd937x: Simplify with devm_regulator_bulk_get_enable()
Drop separate regulator get and enable in probe() path with
devm_regulator_bulk_get_enable(), which simplifies cleanup paths and
device remove().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250526-b4-asoc-wcd9395-vdd-px-v1-1-64d3cb60313b@linaro.org
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:33:28 +01:00
Krzysztof Kozlowski
ece5d88100
ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields
'wcd_regmap_irq_chip' and 'jack' in 'struct wcd939x_priv' are not used
at all.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20250528-asoc-const-unused-v1-8-19a5d07b9d5c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:30:36 +01:00
Krzysztof Kozlowski
ff228b6b9e
ASoC: codecs: wcd938x: Drop unused variant field
Member wcd938x_priv.variant is assigned in probe() function and used
immediately thereafter, thus it can be just a local variable for less
variables stored in 'struct wcd938x_priv' device-wide state.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20250528-asoc-const-unused-v1-7-19a5d07b9d5c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:30:35 +01:00
Krzysztof Kozlowski
fd32bd4467
ASoC: codecs: wcd938x: Drop unused 'struct wcd938x_priv' fields
'wcd_regmap_irq_chip' and 'jack' in 'struct wcd938x_priv' are not used
at all.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20250528-asoc-const-unused-v1-6-19a5d07b9d5c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:30:34 +01:00
Krzysztof Kozlowski
87a2270fd1
ASoC: codecs: wcd937x: Drop unused 'struct wcd937x_priv' fields
'wcd_regmap_irq_chip' and 'jack' in 'struct wcd937x_priv' are not used
at all.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20250528-asoc-const-unused-v1-5-19a5d07b9d5c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:30:33 +01:00
Krzysztof Kozlowski
9afc53569d
ASoC: codecs: wcd934x: Drop unused num_rx_port/num_tx_port fields
Members wcd934x_codec.num_rx_port and num_tx_port are not read anywhere
after assignment, so they can be safely dropped.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20250528-asoc-const-unused-v1-4-19a5d07b9d5c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:30:32 +01:00
Krzysztof Kozlowski
620d968700
ASoC: codecs: wcd9335: Drop unused sido_input_src field
Member wcd9335_codec.sido_input_src is not read anywhere after
assignment, so it can be safely dropped.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20250528-asoc-const-unused-v1-3-19a5d07b9d5c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:30:31 +01:00
Krzysztof Kozlowski
0045b902ad
ASoC: codecs: Constify regmap configuration static variables
Static arrays/structs for regmap configuration like 'struct
reg_default', 'struct reg_sequence' and others are not modified so can
be changed to const for more safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20250528-asoc-const-unused-v1-1-19a5d07b9d5c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:30:30 +01:00
Zhang Yi
b44b269400
ASoC: codecs: ES8326: Modify initialization configuration
Modify the value of ES8326_SDINOUT1_IO in the initialization

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20250604061821.2678-1-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:29:05 +01:00
Harshit Mogalapalli
22188b9df6
ASoC: cs48l32: Fix a signedness bug in cs48l32_hw_params()
There is a type promotion that can happen when freq(u32) variable is
comapared with sclk_target(integer), when sclk_target is a negative
value it promotes to a large postive integer which might not be a
problem in this particular case as the condition evaluates to false
when that happens, but bail out early when sclk_target has negative
error codes.

	cs48l32_sclk_rates[i].freq >= sclk_target

Fix this by adding a negative error check when
snd_soc_tdm_params_to_bclk() fails

Fixes: e2bcbf99d0 ("ASoC: cs48l32: Add driver for Cirrus Logic CS48L32 audio DSP")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://patch.msgid.link/20250603214813.197346-1-harshit.m.mogalapalli@oracle.com
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:29:04 +01:00
Ingo Molnar
41cb08555c treewide, timers: Rename from_timer() to timer_container_of()
Move this API to the canonical timer_*() namespace.

[ tglx: Redone against pre rc1 ]

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/aB2X0jCKQO56WdMt@gmail.com
2025-06-08 09:07:37 +02:00
Takashi Iwai
10db952852 ASoC: Fixes for v6.16
A bunch of fixes, including a big batch for the Intel AVS driver, and
 one new device ID.  It's all device specific.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmhALmUACgkQJNaLcl1U
 h9CQ3gf/eBmbd/G0CiooTGpornoFRj1GAT1SWr05cT8qEZ1v03mf57AEX8DTTW2o
 SUpkIdYhiJByF5BPlxIB2PdljpweRUc3uwfequeHu6WdVP2tgvB824IN1c6v5ymR
 LMsFxGvfCZTz+S/hqlzmMCE0qm3pZrjsKccK8rmCePBGbjWvWYntYOy3h+EoQWPi
 +EFnUw2sU80e8VX5UJFrMP9YHEv2/xr6QGkYRT+SsEyPWs/DyfVjdMo/SBVH6VAC
 jLNour0FlPcvLN9m/yWdv1n7rq1Q3sOQ/Cl0ORMggmDs6r8Csaea9D+RIUK4+dFv
 qLK7/Wepkjw3R5dnfnW4b6ZfSj1bKw==
 =o11g
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v6.16-merge-window' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.16

A bunch of fixes, including a big batch for the Intel AVS driver, and
one new device ID.  It's all device specific.
2025-06-05 09:35:24 +02:00
Mark Brown
b3f3ca04ec
ASoC: Intel: avs: Set of functional fixes
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Medium range of fixes all avs-driver related. The most important fixes
lead the way:

1. For ASoC-hda codec driver, existing RPM manipulation in
hda_codec_probe_complete()'s error path is superfluous and leads to RPM
usage count underflow if the probe exists early e.g.: build-controls
operation fails.

2. Resolve deadlock when DSP-recovery is a consequence of SET_D0IX IPC.
The procedure handling IPC timeouts and EXCEPTION_CAUGHT notification
shall cancel any D0IX work before proceeding with DSP recovery. If
SET_D0IX called from delayed_work is the failing IPC the procedure will
deadlock.

3. LINK format (PPLCxFMT) calculation is incorrect.
HDAudio transfer types utilize SDxFMT for front-end (HOST) and PPLCxFMT
for back-end (LINK) side when setting up the stream. BE's
substream->runtime duplicates FE runtime so switch to using BE's
hw_params to address incorrect format values on the LINK side when FE
and BE formats differ.

Below three patches address problems found by Coverity static analyzer:
  ASoC: Intel: avs: Fix possible null-ptr-deref when initing hw
  ASoC: Intel: avs: Verify kcalloc() status when setting constraints
  ASoC: Intel: avs: Verify content returned by parse_int_array()

While unlikely in runtime, it's good to keep code resilient. The last
few patches are readability/cohesiveness improvements.
2025-06-02 16:51:02 +01:00
Shuming Fan
9adf2de866
ASoC: rt1320: fix speaker noise when volume bar is 100%
This patch updates the settings to fix the speaker noise.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20250602085851.4081886-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-02 12:27:41 +01:00
Cezary Rojewski
ff0045de4e
ASoC: codecs: hda: Fix RPM usage count underflow
RPM manipulation in hda_codec_probe_complete()'s error path is
superfluous and leads to RPM usage count underflow if the
build-controls operation fails.

hda_codec_probe_complete() is called in:

1) hda_codec_probe() for all non-HDMI codecs
2) in card->late_probe() for HDMI codecs

Error path for hda_codec_probe() takes care of bus' RPM already.
For 2) if late_probe() fails, ASoC performs card cleanup what
triggers hda_codec_remote() - same treatment is in 1).

Fixes: b5df2a7dca ("ASoC: codecs: Add HD-Audio codec driver")
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250530141025.2942936-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-02 12:26:44 +01:00
Bram Vlerick
bc4005ef43
ASoC: tas571x: fix tas5733 num_controls
Commit e3de7984e4 ("ASoC: tas571x: add separate tas5733 controls")
introduces a separate struct for the tas5733 controls but did not update
the num_controls with the correct ARRAY_SIZE.

Fixes: e3de7984e4 ("ASoC: tas571x: add separate tas5733 controls")

Signed-off-by: Bram Vlerick <bram.vlerick@openpixelsystems.org>
Acked-by: Peter Korsgaard <peter@korsgaard.com>
Link: https://patch.msgid.link/20250528-tas5733-fix-controls-size-v1-1-5c70595accaf@openpixelsystems.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-28 11:50:12 +01:00
Mark Brown
a784d606ac
ASoC: codecs: wcd93xx: Few regulator supplies fixes
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Fix cleanup paths in wcd9335 and wcd937x codec drivers.
2025-05-27 17:33:01 +01:00
Bram Vlerick
e3de7984e4
ASoC: tas571x: add separate tas5733 controls
The controls between the tas5717 and tas5733 should not be shared since
the biquad and register setup is not identical. For example, writing to
0x5c on the tas5717 modifies ch2_bq[10] while on the tas5733 this is
ch1_cross_bq[3].

see https://www.ti.com/lit/ds/symlink/tas5733l.pdf and
https://www.ti.com/lit/ds/symlink/tas5717.pdf for more details on the
register maps.

Signed-off-by: Bram Vlerick <bram.vlerick@openpixelsystems.org>
Link: https://patch.msgid.link/20250527-tas5733-biquad-fix-v1-1-0d3d941700bb@openpixelsystems.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-27 14:27:26 +01:00
Qasim Ijaz
16719d4819
ASoC: codecs: fix out-of-bounds access on invalid clock config
get_coeff() returns –EINVAL when no table entry matches.
The driver then uses that value as an index into coeff_div[],
causing an OOB access.

To fix lets abort the hw_params call instead.

Fixes: de2b3119f9 ("ASoC: codecs: add support for ES8375")
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
Link: https://patch.msgid.link/20250526191820.72577-1-qasdev00@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-27 12:12:17 +01:00
Krzysztof Kozlowski
63fe298652
ASoC: codecs: wcd9375: Fix double free of regulator supplies
Driver gets regulator supplies in probe path with
devm_regulator_bulk_get(), so should not call regulator_bulk_free() in
error and remove paths to avoid double free.

Fixes: 216d04139a ("ASoC: codecs: wcd937x: Remove separate handling for vdd-buck supply")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-v1-3-0b8a2993b7d3@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-27 12:12:03 +01:00
Krzysztof Kozlowski
dc59189d32
ASoC: codecs: wcd937x: Drop unused buck_supply
Last user of wcd937x_priv->buck_supply was removed in
commit 216d04139a ("ASoC: codecs: wcd937x: Remove separate handling
for vdd-buck supply").

Fixes: 216d04139a ("ASoC: codecs: wcd937x: Remove separate handling for vdd-buck supply")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-v1-2-0b8a2993b7d3@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-27 12:12:02 +01:00
Krzysztof Kozlowski
9079db287f
ASoC: codecs: wcd9335: Fix missing free of regulator supplies
Driver gets and enables all regulator supplies in probe path
(wcd9335_parse_dt() and wcd9335_power_on_reset()), but does not cleanup
in final error paths and in unbind (missing remove() callback).  This
leads to leaked memory and unbalanced regulator enable count during
probe errors or unbind.

Fix this by converting entire code into devm_regulator_bulk_get_enable()
which also greatly simplifies the code.

Fixes: 20aedafdf4 ("ASoC: wcd9335: add support to wcd9335 codec")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-v1-1-0b8a2993b7d3@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-27 12:12:01 +01:00
Takashi Iwai
534e9cf378 ASoC: Additional v6.16 updates
A couple more updates on top of the last set I sent you, a new driver
 for the ES8375 and a fix for the Cirrus KUnit tests from Jaroslav.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmgwtYkACgkQJNaLcl1U
 h9AjLAf+LgK342fYYY1vrYF9qDAghA3hjF0GXzMw7GSY1eik4Fd+Gc6Dgch7btqp
 bnrME3en1syDq4Q+0bXFvzTHp3jlWFngCOdMCrZKDAvQztrwgLDSlaXNmiDNapXx
 XqhY/afE1pOMimHtbE/wg5NlYCSxQayz5OFnarpOpf/SAUMGCR6L3V+XRnbzwLVJ
 qmpS74bN2C9TtrKASPaKxdi8sQ4rKisHlqjybYxn5bfYNnw9hfBUVsUK3/qzeO8q
 vju80NfBtvxjlOyt/ogcob5gMnr9+uRok4WP18wjbsZ5GsJeKkgIEoeW+NmanmG+
 xYLoc2K/XhHs6eKpWQlCksvmnJo8Xg==
 =OjPi
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v6.16-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: Additional v6.16 updates

A couple more updates on top of the last set I sent you, a new driver
for the ES8375 and a fix for the Cirrus KUnit tests from Jaroslav.
2025-05-23 20:45:16 +02:00
Mark Brown
43a38a0ff8
ASoC: codecs: add support for ES8375
Merge series from Zhang Yi <zhangyi@everest-semi.com>:

The driver is for codec ES8375 of everest-semi.
2025-05-23 16:52:28 +01:00
Zhang Yi
de2b3119f9
ASoC: codecs: add support for ES8375
The driver is for codec es8375 of everest

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20250523025502.23214-3-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-23 11:16:45 +01:00
Takashi Iwai
547c5775a7 ASoC: Updates for v6.16
The changes in this release are quite large, mainly in drivers rather
 than the core.  This is partly due to cleanups that touch a lot of
 drivers and partly due to several relatively large new drivers.
 
  - Support for automatically enumerating DAIs from standards conforming
    SoundWire SDCA devices, further work is required for these to be
    useful in an actual card.
  - Conversion of quite a few drivers to newer GPIO APIs.
  - More helpers and cleanups from Mormimoto-san.
  - Support for a wider range of AVS platforms.
  - Support for AMD ACP 7.x platforms, Cirrus Logic CS35L63 and CS48L32,
    Everest Semiconductor ES8389, Longsoon-1 AC'97 controllers, nVidia
    Tegra264, Richtek ALC203 and RT9123 and Rockchip SAI controllers.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmgvRsEACgkQJNaLcl1U
 h9DInQf/SD/3ygLJOY3h7YMcY8ua39Jcu01cDtJ4F8Aezt2T+hTppxd/uUqPYiyM
 UcS6B+0yzFbtpKrtdectPoYIBYBXcoH34tnDn0/Qj9yaYX9BzFV1j6meIPJA10Wv
 CdCG35QKNamxL7PfCq/QxekWuS91TcRDZLzsX04lme5jm12q89/mWtenMIlAtRXH
 JCaVp6CzGaXBMpTJYK3uQ9DwszqMnSLmkoPvXJQAr8ymOJ/emOMY9uKPF5nSYtEU
 4T4jbIvt/stR5vsfgRUgOPuXquf2oupExgzOPdGWXWSGOg23QeiJcfeE+7OH1bAf
 k551jztnqivFhY5Ad72iipiaPYhSzw==
 =G6Xw
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: Updates for v6.16

The changes in this release are quite large, mainly in drivers rather
than the core.  This is partly due to cleanups that touch a lot of
drivers and partly due to several relatively large new drivers.

 - Support for automatically enumerating DAIs from standards conforming
   SoundWire SDCA devices, further work is required for these to be
   useful in an actual card.
 - Conversion of quite a few drivers to newer GPIO APIs.
 - More helpers and cleanups from Mormimoto-san.
 - Support for a wider range of AVS platforms.
 - Support for AMD ACP 7.x platforms, Cirrus Logic CS35L63 and CS48L32,
   Everest Semiconductor ES8389, Longsoon-1 AC'97 controllers, nVidia
   Tegra264, Richtek ALC203 and RT9123 and Rockchip SAI controllers.
2025-05-22 20:30:34 +02:00
Richard Fitzgerald
fd4b6c0fdf
ASoC: wm_adsp: Make cirrus_dir const
The cirrus_dir pointer should be const data but was missing the second
const needed to achieve this.

I haven't marked this as a 'Fixes' because it isn't causing any bugs,
it's only a code improvement.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250522103816.543919-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-22 12:29:53 +01:00
Shenghao Ding
4fe2385134 ALSA: hda/tas2781: Move and unified the calibrated-data getting function for SPI and I2C into the tas2781_hda lib
Calibration data getting function for SPI and I2C HDA drivers are almost
same, which read the calibration data from UEFI. To put them into
tas2781_hda lib for code cleanup is more reasonable than to still keep
them in the codec driver. For tas2781 codec driver, there're two different
sources for calibrated data, one is from bin file, generated in factory
test, requested and read in codec driver side; the other is from user
space during device bootup.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>

Link: https://patch.msgid.link/20250522014347.1163-1-shenghao-ding@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-05-22 09:09:40 +02:00
Shenghao Ding
e4dca67b24
ASoC: tas2781: Header file cleanup and Move the macro definitions to fwlib
Drop the I2C in one comment, for these registers are also used in SPI
driver; Move the macro definition of TASDEVICE_CMD_XXX from tas2781.h to
tas2781_fmwlib.c, because the macros are only referenced in only fwlib.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20250518132451.707-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-19 11:41:34 +01:00
Shuming Fan
152c773fb4
ASoC: rt722: make regmap cache-only in probe
This patch makes sure the access to the codecs is cached until the device is enumerated.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20250519090645.2620292-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-19 11:41:33 +01:00
Takashi Iwai
a3d14d1602 Merge branch 'for-linus' into for-next
Back-merge of 6.15 devel branch for further development of HD-audio
stuff.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-05-16 09:58:35 +02:00
Mark Brown
4a5883a586
cs35l56: Log tuning unique identifiers during firmware
Merge series from Simon Trimmer <simont@opensource.cirrus.com>:

These two patches introduce a log message when provisioning the cs35l56
family of devices that uniquely identifies the firmware tuning.
2025-05-15 11:43:58 +02:00
Mark Brown
dd4eb861d0
ASoC: codecs: add support for ES8389
Merge series from Zhang Yi <zhangyi@everest-semi.com>:

The driver is for codec ES8389 of everest-semi.
2025-05-15 11:43:48 +02:00
Zhang Yi
0319c26889
ASoC: codecs: add support for ES8389
The driver is for codec es8389 of everest which is different from ES8388

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20250514094546.35508-2-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-14 12:01:00 +02:00
Simon Trimmer
823a036f04
ASoC: cs35l56: Log tuning unique identifiers during firmware load
The cs35l56 smart amplifier has some informational firmware controls
that are populated by a tuning bin file to unique values - logging these
during firmware load identifies the specific configuration being used on
that device instance.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://patch.msgid.link/47762a5f1ce2b178ad863c6698296aea09b72e10.1747142267.git.simont@opensource.cirrus.com
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-14 10:57:40 +02:00
Nishanth Menon
85f8c2d56c
ASoC: tlv320aic3x: Use dev_err_probe
During probe the regulator supply drivers may not yet be available.
Use dev_err_probe to provide just the pertinent log.

Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://patch.msgid.link/20250512185739.2907466-1-nm@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-13 11:47:06 +02:00
Shenghao Ding
eef5bccfb1 ALSA: hda/tas2781: Fix the ld issue reported by kernel test robot
After commit 9fa6a693ad ("ALSA: hda/tas2781: Remove tas2781_spi_fwlib.c
and leverage SND_SOC_TAS2781_FMWLIB")created a separated lib for i2c,
However, tasdevice_remove() used for not only for I2C but for SPI being
still in that lib caused ld issue.
All errors (new ones prefixed by >>):
>> ld.lld: error: undefined symbol: tasdevice_remove
   >>> referenced by tas2781_hda.c:33 (sound/pci/hda/tas2781_hda.c:33)
   >>>               vmlinux.o:(tas2781_hda_remove)
To fix this issue, the implementation of tasdevice_remove was moved from
tas2781-comlib-i2c.c to tas2781-comlib.c.

Fixes: 9fa6a693ad ("ALSA: hda/tas2781: Remove tas2781_spi_fwlib.c and leverage SND_SOC_TAS2781_FMWLIB")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://urldefense.com/v3/__https://lore.kernel.org/oe-kbuild-all/202505111855.FP2fScKA-lkp@intel.com/__;!!G3vK!U-wdsvrOG1iezggZ55RYi8ikBxMaJD
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20250513085947.1121-1-shenghao-ding@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-05-13 11:03:19 +02:00
Colin Ian King
4815e9fc89
ASoC: rt712-sdca: remove redundant else path of if statement
There is an if/else check where the else part is executed if
adc_vol_flag is true, this else path checks if adc_vol_flag
is true (which is a redundant second check) and the if path is
always taken. Remove the redundant check and remove the else
path since that can never occur.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20250508084527.316380-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-08 23:41:15 +09:00
ChiYuan Huang
07cb9b5107
ASoC: codecs: rt9123: Fix sparse cast warning
Use i2c block read/write API to fix casting warning.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505072140.iHyLlDN6-lkp@intel.com/
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://patch.msgid.link/185a5ffea22ebd20725fdc7739db6b6addfae3ad.1746672687.git.cy_huang@richtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-08 23:41:14 +09:00
Colin Ian King
8147e75bd5
ASoC: rt712-sdca: remove redundant else path of if statement
There is an if/else check where the else part is executed if
adc_vol_flag is true, this else path checks if adc_vol_flag
is true (which is a redundant second check) and the if path is
always taken. Remove the redundant check and remove the else
path since that can never occur.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20250507140907.255562-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-08 10:32:52 +09:00
Shenghao Ding
d75d38dc46
ASoC: tas2781: Add a debugfs node for acoustic tuning
"Acoustic Tuning" debugfs node is a bridge to the acoustic tuning tool
which can tune the chips' acoustic effect.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20250507094616.210-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-07 20:35:30 +09:00
Mark Brown
0fa382a4f5
Add support for CS35L63 Smart Amplifier
Merge series from Stefan Binding <sbinding@opensource.cirrus.com>:

CS35L63 is a Mono Class-D PC Smart Amplifier, with Speaker Protection
and Audio Enhancement Algorithms.

CS35L63 uses a similar control interface to CS35L56 so support for
it can be added into the CS35L56 driver.
CS35L63 only has SoundWire and I2C control interfaces.
2025-05-07 14:12:38 +09:00
Mark Brown
599b86f8cf
ASoC: codec: cs42l[56,73,52]: Convert to GPIO
Merge series from "Peng Fan (OSS)" <peng.fan@oss.nxp.com>:

This patchset is separate from [1], and not merging changes in one
patch. So separate changes into three patches for each chip.
- sort headers
- Drop legacy platform support
- Convert to GPIO descriptors

of_gpio.h is deprecated, update the driver to use GPIO descriptors.
 - Use devm_gpiod_get_optional to get GPIO descriptor with default
   polarity GPIOD_OUT_LOW, set consumer name.
 - Use gpiod_set_value_cansleep to configure output value.

I not have platforms to test, just do the patches with my best efforts,
and make build pass.

[1] https://lore.kernel.org/all/20250408-asoc-gpio-v1-0-c0db9d3fd6e9@nxp.com/
2025-05-07 14:12:15 +09:00
Peng Fan
5bf5bdfd00
ASoC: codec: cs42l52: Convert to GPIO descriptors
of_gpio.h is deprecated, update the driver to use GPIO descriptors.
 - Use devm_gpiod_get_optional to get GPIO descriptor with default
   polarity GPIOD_OUT_LOW, set consumer name.
 - Use gpiod_set_value_cansleep to configure output value.

Checking the current driver using legacy GPIO API, the
reset value is first output HIGH, then LOW, then HIGH.

Checking the datasheet, the device remains in Power-down state until
RESET pin is brought high.

Since the driver has been here for quite long time and no complain on
the reset flow, still follow original flow when using GPIOD
descriptors.

Per datasheet, the DTS polarity should be GPIOD_ACTIVE_LOW. The binding
example use value 0(GPIOD_ACTIVE_HIGH) which seems wrong.
And the binding use reset-gpio as example, not same as driver using
"cirrus,reset-gpio", and there is no in-tree DTS has the device,
so all should be fine with this patch.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250506-csl42x-v3-9-e9496db544c4@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 22:48:18 +09:00
Peng Fan
772c036bef
ASoC: codec: cs42l52: Drop cs42l52.h
There is no in-tree user of "include/sound/cs42l52.h", so move
'struct cs42l52_platform_data ' to cs42l52.c and remove the header file.
And platform data is mostly for legacy platforms that create devices
non using device tree. So drop cs42l52.h to prepare using GPIOD API.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250506-csl42x-v3-8-e9496db544c4@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 22:48:17 +09:00
Peng Fan
2d703321b8
ASoC: codec: cs42l52: Sort headers alphabetically
Sort headers alphabetically to easily insert new ones
and drop unused ones.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250506-csl42x-v3-7-e9496db544c4@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 22:48:16 +09:00
Peng Fan
b611810038
ASoC: codec: cs42l73: Convert to GPIO descriptors
of_gpio.h is deprecated, update the driver to use GPIO descriptors.
 - Use devm_gpiod_get_optional to get GPIO descriptor with default
   polarity GPIOD_OUT_LOW, set consumer name.
 - Use gpiod_set_value_cansleep to configure output value.

Checking the current driver using legacy GPIO API, the
reset value is first output HIGH, then LOW, then HIGH.

Checking the datasheet, Hold RESET LOW (active) until all the power
supply rails have risen to greater than or equal to the minimum
recommended operating voltages.

Since the driver has been here for quite long time and no complain on
the reset flow, still follow original flow when using GPIOD
descriptors.

Per datasheet, the DTS polarity should be GPIOD_ACTIVE_LOW. The binding
example use value 0(GPIOD_ACTIVE_HIGH) which seems wrong. There is
no in-tree DTS has the device, so all should be fine.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250506-csl42x-v3-6-e9496db544c4@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 22:48:15 +09:00
Peng Fan
43ef0dccbc
ASoC: codec: cs42l73: Drop cs42l73.h
There is no in-tree user of "include/sound/cs42l56.h", so move
'struct cs42l73_platform_data ' to cs42l73.c and remove the header file.
And platform data is mostly for legacy platforms that create devices
non using device tree. So drop cs42l73.h to prepare using GPIOD API.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250506-csl42x-v3-5-e9496db544c4@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 22:48:15 +09:00
Peng Fan
f3e7298848
ASoC: codec: cs42l73: Sort headers alphabetically
Sort headers alphabetically to easily insert new ones
and drop unused ones.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250506-csl42x-v3-4-e9496db544c4@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 22:48:14 +09:00
Peng Fan
0bb92e4736
ASoC: codec: cs42l56: Convert to GPIO descriptors
of_gpio.h is deprecated, update the driver to use GPIO descriptors.
 - Use devm_gpiod_get_optional to get GPIO descriptor with default
   polarity GPIOD_OUT_LOW, set consumer name.
 - Use gpiod_set_value_cansleep to configure output value.

Checking the current driver using legacy GPIO API, the
nreset value is first output HIGH, then LOW, then HIGH.

Checking the datasheet, nreset is should be held low after power
on, when nreset is high, it starts to work.

Since the driver has been here for quite long time and no complain on
the nreset flow, still follow original flow when using GPIOD
descriptors.

Commit 944004eb56 ("gpiolib: of: add a quirk for reset line for Cirrus
CS42L56 codec") added quirks, so the gpio request API will work as before.

Per datasheet, the DTS polarity should be GPIOD_ACTIVE_LOW. The binding
example use value 0(GPIOD_ACTIVE_HIGH) which seems wrong. There is
no in-tree DTS has the device, so all should be fine.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250506-csl42x-v3-3-e9496db544c4@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 22:48:13 +09:00
Peng Fan
86f6e4791c
ASoC: codec: cs42l56: Drop cs42l56.h
There is no in-tree user of "include/sound/cs42l56.h", so move
'struct cs42l56_platform_data' to cs42l56.c and remove the header file.
And platform data is mostly for platforms that create
devices non using device tree. CS42L56 is a discontinued product,
there is less possibility that new users will use legacy method
to create devices. So drop cs42l56.h to prepare using GPIOD API.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250506-csl42x-v3-2-e9496db544c4@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 22:48:12 +09:00
Peng Fan
4060ebdd50
ASoC: codec: cs42l56: Sort headers alphabetically
Sort headers alphabetically to easily insert new ones
and drop unused ones.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250506-csl42x-v3-1-e9496db544c4@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 22:48:11 +09:00
Stefan Binding
406fbc4d0f
ASoC: cs35l56: Read Silicon ID from DIE_STS registers for CS35L63
On CS35L63 the DIE_STS registers are populated by the Firmware from
OTP, so the driver can read these registers directly, rather than
obtaining them from OTP.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250407151842.143393-6-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 08:49:20 +09:00
Stefan Binding
978858791c
ASoC: cs35l56: Add initial support for CS35L63 for I2C and SoundWire
CS35L63 uses a similar control interface to CS35L56 so support for
it can be added into the CS35L56 driver.
New regmap configs have been added to support CS35L63.
CS35L63 only has SoundWire and I2C control interfaces.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250407151842.143393-5-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 08:49:20 +09:00
Stefan Binding
a3ec669efc
ASoC: cs35l56: Add Mute, Volume and Posture registers to firmware register list
Registers to set Mute, Volume and Posture are inside firmware,
which means they should be added to the list of registers set inside
firmware, in case they vary across Device or Revision.

These three registers are also used for controls, so additional
handling is required to be able to obtain and set the register inside
ALSA controls.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250407151842.143393-4-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 08:49:19 +09:00
Stefan Binding
8c0821ccaa
ASoC: cs35l56: Add struct to index firmware registers
Firmware based registers may be different addresses across different
device ids and revision ids. Create a structure to store and access
these addresses.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250407151842.143393-3-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 08:49:18 +09:00
Stefan Binding
9ea280f3df
ASoC: cs35l56: Add Index based on ACPI HID or SDW ID to select regmap config
This is to prepare for further products using slightly different
regmap configs.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250407151842.143393-2-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-06 08:49:17 +09:00
Arnd Bergmann
f0ccc717c6 ALSA: hda/tas2781: select CONFIG_CRC8 for SND_HDA_SCODEC_TAS2781_I2C
The crc8 function is used by the common fmwlib module, so this has
to be selected directly to avoid a link failure:

ERROR: modpost: "crc8" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!

Fixes: 9fa6a693ad ("ALSA: hda/tas2781: Remove tas2781_spi_fwlib.c and leverage SND_SOC_TAS2781_FMWLIB")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250505052303.1812002-1-arnd@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-05-05 12:39:23 +02:00
Krzysztof Kozlowski
c23c7c6071
ASoC: codecs: tas2764: Fix Wvoid-pointer-to-enum-cast warning
'devid' is an enum, thus cast of pointer on 64-bit compile test with
clang and W=1 causes:

  tas2764.c:879:19: error: cast to smaller integer type 'enum tas2764_devid' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

One of the discussions in 2023 on LKML suggested warning is not suitable
for kernel.  Nothing changed in this regard for more than a year, so
assume the warning will stay and we want to have warnings-free builds.

Link: https://lore.kernel.org/all/20230814160457.GA2836@dev-arch.thelio-3990X/
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250427105105.18164-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-02 05:38:52 +09:00
Krzysztof Kozlowski
9cd54a6bf1
ASoC: codecs: wsa88xx/wcd938x: Drop kerneldoc marker from inner comment
Drop the kerneldoc marker from a comment within a function:

  wsa883x.c:1402: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202504261851.TJGZIvtl-lkp@intel.com/
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250427105105.18164-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-02 05:38:51 +09:00
Mark Brown
c788129c85
ASoC: codec: twl4030: Convert to GPIO descriptors
Merge series from "Peng Fan (OSS)" <peng.fan@oss.nxp.com>:

This is separated from [1]. With an update that sorting the headers in a
separate patch. No other changes, so I still keep Linus' R-b for
Patch 2.

[1] https://lore.kernel.org/all/20250408-asoc-gpio-v1-3-c0db9d3fd6e9@nxp.com/
2025-05-01 15:46:16 +09:00
Peng Fan
a9ec9212f6
ASoC: codec: sma1307: Remove including of_gpio.h
of_gpio.h is deprecated. And there is no user in this driver
using API in of_gpio.h, so remove it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250427055020.176099-1-peng.fan@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-01 09:26:02 +09:00
Peng Fan
178c169a30
ASoC: codec: twl4030: Convert to GPIO descriptors
of_gpio.h is deprecated, update the driver to use GPIO descriptors.
 - Use of_property_present to check "ti,hs_extmute_gpio" to set hs_extmute
 - if returned value is true.
 - Use devm_gpiod_get_optional to get GPIO descriptor, set consumer name.
 - Use gpiod_set_value to configure output value.

While at here
 - drop remove hook after switching to use devm_gpiod_get_optional
 - Add return value for twl4030_init_chip to propagate value to parent
   in case defer probe happens

Checking the only user logicpd-som-lv.dtsi that uses polarity
GPIO_ACTIVE_HIGH, so all should work as expected.

Cc: Tony Lindgren <tony@atomide.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250428-twl4030-v2-2-868d0d572f12@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-01 08:23:29 +09:00
Peng Fan
5ae1bd2f63
ASoC: codec: twl4030: Sort headers alphabetically
Sort headers alphabetically to easily insert new ones
and drop unused ones.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250428-twl4030-v2-1-868d0d572f12@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-01 08:23:29 +09:00
Shenghao Ding
9fa6a693ad ALSA: hda/tas2781: Remove tas2781_spi_fwlib.c and leverage SND_SOC_TAS2781_FMWLIB
Most codes in tas2781_spi_fwlib.c are same as tas2781-fmwlib.c, mainly for
firmware parsing, only differece is the register reading, bit update and
book switching in i2c and spi. The main purpose of this patch is for code
cleaup and arrange the shared part for i2c and spi.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250429111055.567-1-shenghao-ding@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-04-30 07:36:25 +02:00
Richard Fitzgerald
94602d8416
ASoC: wm_adsp: Don't use no_free_ptr() when passing to PTR_ERR()
It's no longer necessary to no_free_ptr() an auto-freed pointer before
passing it to PTR_ERR(). This was fixed by commit
cd7eb8f83f ("mm/slab: make __free(kfree) accept error pointers").

Removing the no_free_ptr() avoids the spurious warning
"inconsistent IS_ERR and PTR_ERR".

Fixes: b5d057a86e ("ASoC: wm_adsp: Use vmemdup_user() instead of open-coding")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202504270751.nR3Ngfrq-lkp@intel.com/
Link: https://patch.msgid.link/20250428090803.97909-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-30 09:38:25 +09:00
Thorsten Blum
84dea31d33
ASoC: codecs: Use min() to simplify aw_dev_dsp_update_container()
Use min() to simplify aw_dev_dsp_update_container() and improve its
readability.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250429071032.65391-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-30 09:38:24 +09:00
Mark Brown
c27c313026
ASoC: codec: tpa6130a2: Convert to GPIO descriptors
Merge series from "Peng Fan (OSS)" <peng.fan@oss.nxp.com>:

Per Mark's comments in [1], each driver in one patchset and not merge
the changes to one driver in one patch, so worked out three patches.

- Sort the included headers.
- Drop sound/tpa6130a2-plat.h because no user is creating the device using
   platform data
- Covert to GPIO descriptors

Checking the DTS polarity, all users are using GPIOD_ACTIVE_HIGH.
so all should work as expected with this patch.

I not have hardware to test, just my best effort to do this.

[1] https://lore.kernel.org/all/66db9962-d773-4c7a-bf59-4698eca9eedc@sirena.org.uk/
2025-04-25 18:40:44 +01:00
Mark Brown
b009011500
ASoC: codecs: wcd938x: fix mux error handling
Merge series from Johan Hovold <johan+linaro@kernel.org>:

A recent change added support for looking up an optional mux control
before falling back to gpio control for us-euro plug selection.

The mux framework does however not yet support optional muxes and an
error message is now incorrectly logged on machines like the Lenovo
ThinkPad X13s which do not have one:

    wcd938x_codec audio-codec: /audio-codec: failed to get mux-control (0)

Suppress the bogus error and add the missing mux error handling by
making sure that the 'mux-controls' DT property is present before
looking up the mux control.

Included is also a related cleanup.
2025-04-25 18:40:40 +01:00
Mark Brown
402dda23a3
ASoC: Merge up fixes
They have build/application dependencies for some new changes coming in.
2025-04-24 12:55:06 +01:00
Johan Hovold
e358e012a6
ASoC: codecs: wcd938x: drop unnecessary mux flag assignment
The codec driver data is allocated using kzalloc() so there's no need to
clear the mux setup flag when mux selection fails during probe.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://patch.msgid.link/20250415074145.7202-3-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-24 12:53:23 +01:00
Johan Hovold
d1407c934f
ASoC: codecs: wcd938x: fix mux error handling
A recent change added support for looking up an optional mux control
before falling back to gpio control for us-euro plug selection.

The mux framework does however not yet support optional muxes and an
error message is now incorrectly logged on machines like the Lenovo
ThinkPad X13s which do not have one:

    wcd938x_codec audio-codec: /audio-codec: failed to get mux-control (0)

Suppress the bogus error and add the missing mux error handling by
making sure that the 'mux-controls' DT property is present before
looking up the mux control.

Fixes: eec611d26f ("ASoC: codecs: wcd938x: add mux control support for hp audio mux")
Link: https://lore.kernel.org/lkml/Z-z_ZAyVBK5ui50k@hovoldconsulting.com/
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://patch.msgid.link/20250415074145.7202-2-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-24 12:53:22 +01:00
Peng Fan
f198b6b256
ASoC: codec: tpa6130a2: Convert to GPIO descriptors
of_gpio.h is deprecated, update the driver to use GPIO descriptors.
- Use devm_gpiod_get_optional to get GPIO descriptor with default
  polarity GPIOD_OUT_LOW, set consumer name.
- Use gpiod_set_value to configure output value.

Checking the DTS polarity, all users are using GPIOD_ACTIVE_HIGH.
so all should work as expected with this patch.

Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250414-asoc-tpa6130a2-v1-3-5f4052e656a0@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-24 12:53:05 +01:00
Peng Fan
63a9362c71
ASoC: codec: tpa6130a2: Remove tpa6130a2_platform_data
There is no in-tree user to create the device using platform data
'struct tpa6130a2_platform_data', so drop the dead code.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250414-asoc-tpa6130a2-v1-2-5f4052e656a0@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-24 12:53:04 +01:00
Peng Fan
b194e82b28
ASoC: codec: tpa6130a2: Sort headers alphabetically
Sort headers alphabetically to easily insert new ones
and drop duplications.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250414-asoc-tpa6130a2-v1-1-5f4052e656a0@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-24 12:53:03 +01:00
Charles Keepax
70ad2e6bd1
ASoC: cs42l43: Disable headphone clamps during type detection
The headphone clamps cause fairly loud pops during type detect
because they sink current from the detection process itself. Disable
the clamps whilst the type detect runs, to improve the detection
pop performance.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250423090944.1504538-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-23 12:42:28 +01:00
Michael Sikora
6d7ee6de75
ASoC: adau7118: Allow dsp_a mode
TDM mode on the adau7118 is dsp_a compatible. Set SPT_SAI_MODE on the
SPT_CTRL1 register to 1 for TDM mode when the DAI is operating in
dsp_a mode.

Signed-off-by: Michael Sikora <michael.sikora@axis.com>
Link: https://patch.msgid.link/20250411-adau7118-dsp-a-v1-1-be3fb487a6ac@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-22 18:45:09 +01:00