Commit graph

12519 commits

Author SHA1 Message Date
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