Commit Graph

53043 Commits

Author SHA1 Message Date
Baojun Xu
5dc50b111b ALSA: hda: Fix the wrong register was used for DVC of TAS2770
The wrong register was used for digital volume control of TAS2770,
The definition was changed, and usage was also updated.

Fixes: ab29b3460c ("ALSA: hda: Add TAS2770 support")
Signed-off-by: Baojun Xu <baojun.xu@ti.com>
Link: https://patch.msgid.link/20250729145849.55057-1-baojun.xu@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-29 17:48:29 +02:00
Muhammad Usama Anjum
eb3bb14528
ASoC: SOF: amd: acp-loader: Use GFP_KERNEL for DMA allocations in resume context
Replace GFP_ATOMIC with GFP_KERNEL for dma_alloc_coherent() calls. This
change improves memory allocation reliability during firmware loading,
particularly during system resume when memory pressure is high. Because
of using GFP_KERNEL, reclaim can happen which can reduce the probability
of failure.

Fixes memory allocation failures observed during system resume with
fragmented memory conditions.

	snd_sof_amd_vangogh 0000:04:00.5: error: failed to load DSP firmware after resume -12

Fixes: 145d7e5ae8 ("ASoC: SOF: amd: add option to use sram for data bin loading")
Fixes: 7e51a9e38a ("ASoC: SOF: amd: Add fw loader and renoir dsp ops to load firmware")
Cc: stable@vger.kernel.org
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Link: https://patch.msgid.link/20250725190254.1081184-1-usama.anjum@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-28 18:58:15 +01:00
Takashi Iwai
d35cdd6ed5 ASoC: More updates for v6.17
A few more updates, mostly fixes and device IDs plus some small
 enhancements for the FSL xcvr driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmiHZP8ACgkQJNaLcl1U
 h9DzHgf7B38+Y0biLZA4PbhoT4jIqx7Z6cjzw4enVAd+heYD8dCrYIf+7mADCi/1
 0rjJ76k8FvYyXUihvd+7Tm+0K9kBy8RHjA/KKiNUHqk12JziKg6fnTQTO2/zinQO
 VjIrVtMediD7lUVDJ8NeN/xwpl4UagpyYi7JdWM12bBpcpxE8Hz+nvYZiAQKfaLC
 6Fde6G1tTYQsfVnpEdidqNCIvlRCXsFbeWfBa3BDEC2gZwDuozs+caDD4zDgirJ4
 +K31t9d9yWD2oqJALB1HrUZ35edzvc+AmWE6CfWIaN7pxgwdqqOIbL2jdcOdV6Sy
 pbxrbXFQ8FKMm8knO7BtSsHhVtm22Q==
 =jUba
 -----END PGP SIGNATURE-----

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

ASoC: More updates for v6.17

A few more updates, mostly fixes and device IDs plus some small
enhancements for the FSL xcvr driver.
2025-07-28 14:28:21 +02:00
Geoffrey D. Bennett
8a15ca0ca5 ALSA: scarlett2: Add retry on -EPROTO from scarlett2_usb_tx()
During communication with Focusrite Scarlett Gen 2/3/4 USB audio
interfaces, -EPROTO is sometimes returned from scarlett2_usb_tx(),
snd_usb_ctl_msg() which can cause initialisation and control
operations to fail intermittently.

This patch adds up to 5 retries in scarlett2_usb(), with a delay
starting at 5ms and doubling each time. This follows the same approach
as the fix for usb_set_interface() in endpoint.c (commit f406005e16
("ALSA: usb-audio: Add retry on -EPROTO from usb_set_interface()")),
which resolved similar -EPROTO issues during device initialisation,
and is the same approach as in fcp.c:fcp_usb().

Fixes: 9e4d5c1be2 ("ALSA: usb-audio: Scarlett Gen 2 mixer interface")
Closes: https://github.com/geoffreybennett/linux-fcp/issues/41
Cc: stable@vger.kernel.org
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://patch.msgid.link/aIdDO6ld50WQwNim@m.b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-28 11:42:39 +02:00
Edip Hazuri
bd7814a4c0 ALSA: hda/realtek - Fix mute LED for HP Victus 16-r1xxx
The mute led on this laptop is using ALC245 but requires a quirk to work
This patch enables the existing quirk for the device.

Tested on Victus 16-r1xxx Laptop. The LED behaviour works
as intended.

Cc: <stable@vger.kernel.org>
Signed-off-by: Edip Hazuri <edip@medip.dev>
Link: https://patch.msgid.link/20250725151436.51543-2-edip@medip.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-28 11:41:49 +02:00
Weidong Wang
e95122a32e
ASoC: codecs: Add acpi_match_table for aw88399 driver
Add acpi_match_table to the aw88399 driver so that
it can be used on more platforms.

Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://patch.msgid.link/20250725094602.10017-1-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-25 13:44:29 +01:00
Mark Brown
7379907e24
ASoC: fsl_xcvr: get channel status data in two cases
Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

There is two different cases for getting channel status data:
1. With PHY exists, there is firmware running on M core, the firmware
should fill the channel status to RAM space, driver need to read them
from RAM.
2. Without PHY, the channel status need to be obtained from registers.
2025-07-24 23:17:01 +01:00
Mark Brown
1032fa556c
More minor SDCA changes
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

A small chain with some patches that seem to have got lost in the
process. One small additional bug fix for the regmap callbacks, and one
small feature addition for the control parsing.

Charles Keepax (2):
  ASoC: SDCA: Fix some holes in the regmap readable/writeable helpers
  ASoC: SDCA: Add support for -cn- value properties

 include/sound/sdca_function.h   | 14 ++---
 sound/soc/sdca/sdca_functions.c | 99 +++++++++++++++++++++------------
 sound/soc/sdca/sdca_regmap.c    | 29 ++++++++--
 3 files changed, 92 insertions(+), 50 deletions(-)

--
2.39.5
2025-07-24 22:09:30 +01:00
Chancel Liu
2260bc6ea8
ASoC: imx-card: Add WM8524 support
WM8524 is a stereo DAC. Add support for this codec in imx-card ASoC
machine driver.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20250723073725.787844-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-24 13:52:27 +01:00
Takashi Iwai
bca53a176f ASoC: Updates for v6.17
There's a few new drivers here and quite a lot of cleanup work from
 Morimoto-san but generally this has been quite a quiet release,
 resulting in a fairly small diffstat.  Highlights include:
 
  - Refactoring of the Kconfig menus to be hopefully more consistant and
    easier to navigate.
  - Refactoring of the DAPM code, mainly hiding functionality that
    doesn't need to be exposed to drivers.
  - Removal of the unused upstream weak paths DAPM functionality.
  - Further work on the generic handling for SoundWire SDCA devices.
  - Cleanups of our usage of the PM autosuspend functions, this pulls in
    some PM core changes on a shared tag.
  - Support for AMD ACP7.2 and SoundWire on ACP 7.1, Fairphone 4 & 5,
    various Intel systems, Qualcomm QCS8275, Richtek RTQ9124 and TI TAS5753.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmiCG4gACgkQJNaLcl1U
 h9DDLAgAg48dNlG1argnaoTmWQ8j5fVV2aCfzPL3+UxIj/Jy3HQGusUXuCqvxCnl
 CeZ249oQMACSxwaBthFXoFoSiv9KkD+FbB+mw+BjJWnE77fP56Z+nqR2LE2xWRTU
 F4gcGu5aeqxjFDtmWf9xEh27hgtIB63P98CkXGyJKxxvTtWCp/JQzkvRJRN3Hpuf
 9lFQr7GSt3aaNOxyon9aOczAfMa/BWcfmL7BVesuXtWzTKVJiFJVTS1mhl/7NNVR
 oZ1QLj8OdJOFWddyWwN8okZZ6omHdpdtnRWw/FOA0PiCALpBpXvd9FAuFfIA+FrU
 5fCDfYgvkX1sz1csD1RaOs2nGAehxA==
 =GR/0
 -----END PGP SIGNATURE-----

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

ASoC: Updates for v6.17

There's a few new drivers here and quite a lot of cleanup work from
Morimoto-san but generally this has been quite a quiet release,
resulting in a fairly small diffstat.  Highlights include:

 - Refactoring of the Kconfig menus to be hopefully more consistant and
   easier to navigate.
 - Refactoring of the DAPM code, mainly hiding functionality that
   doesn't need to be exposed to drivers.
 - Removal of the unused upstream weak paths DAPM functionality.
 - Further work on the generic handling for SoundWire SDCA devices.
 - Cleanups of our usage of the PM autosuspend functions, this pulls in
   some PM core changes on a shared tag.
 - Support for AMD ACP7.2 and SoundWire on ACP 7.1, Fairphone 4 & 5,
   various Intel systems, Qualcomm QCS8275, Richtek RTQ9124 and TI TAS5753.
2025-07-24 14:47:49 +02:00
Takashi Iwai
0aa9e51298 Merge branch 'for-linus' into for-next
Merge the last-piece from 6.16 devel branch to sync the code base.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-24 14:46:21 +02:00
Shengjiu Wang
6776ecc9dd
ASoC: fsl_xcvr: get channel status data with firmware exists
For the XCVR module on i.MX95, even though it only supports SPDIF, the
channel status needs to be obtained from RAM space, which is processed
by firmware. Firmware is necessary to trigger the FSL_XCVR_IRQ_NEW_CS
interrupt.

This change also applies for the SPDIF & ARC function on i.MX8MP which
has the firmware.

Fixes: e6a9750a34 ("ASoC: fsl_xcvr: Add suspend and resume support")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20250710030405.3370671-3-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-24 13:44:22 +01:00
Shengjiu Wang
ca592e2065
ASoC: fsl_xcvr: get channel status data when PHY is not exists
There is no PHY for the XCVR module on i.MX93, the channel status needs
to be obtained from FSL_XCVR_RX_CS_DATA_* registers. And channel status
acknowledge (CSA) bit should be set once channel status is processed.

Fixes: e240b9329a ("ASoC: fsl_xcvr: Add support for i.MX93 platform")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20250710030405.3370671-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-24 13:44:21 +01:00
Charles Keepax
50a479527e
ASoC: SDCA: Add support for -cn- value properties
Many of the DisCo properties that specify Control values have an
additional variant that specifies a separate value for each Control
Number. Add support for these.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250718135432.1048566-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-24 13:28:09 +01:00
Charles Keepax
061fade7a6
ASoC: SDCA: Fix some holes in the regmap readable/writeable helpers
The current regmap readable/writeable helper functions always
allow the Next flag and allows any Control Number. Mask the Next
flag based on SDCA_ACCESS_MODE_DUAL which is the only Mode that
supports it. Also check that the Control Number is valid for
the given control.

Fixes: e3f7caf74b ("ASoC: SDCA: Add generic regmap SDCA helpers")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250718135432.1048566-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-24 13:28:08 +01:00
Takashi Iwai
0d57ed922b ASoC: Fixes for v6.16
A few device specific fixes, none especially remarkable though all
 useful.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmiBFdUACgkQJNaLcl1U
 h9CrBwf/S9zAmKv9zfCgpgyxN8GEJv4pwj/8NGLjv1FlNetX3gMsGq6Xp58b+9Ry
 /nPLkKnl3Vgon3QDQCbWNza3wliDDyPFVqqrIsbGrEy3E78UraIKNXIjxlanJkDx
 emZGfi4C8tCdaBMjaHTNGcxomYsH0TGascDfng5yrtVDi9mityg+zeC0gLBUuR/Z
 07qLIakp5iYavHGuxBkY55eHWncperoQpRv3C3efzXlDM/Eu3HcQoRmKX1M3yTx9
 mboJ/xfuLDOSf7ZZJeGnoeZToDgvoUcyM8m6R06uj9th3dq6sP3FraFGHe60E+Mq
 qwbBrtGv/dczbf/LyIBnolqXx1xdfg==
 =Pl6U
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v6.16

A few device specific fixes, none especially remarkable though all
useful.
2025-07-24 08:45:13 +02:00
Baojun Xu
ab29b3460c ALSA: hda: Add TAS2770 support
Add TAS2770 support in TI's HDA driver. And add hda_chip_id for
more products. Distinguish DSP and non-DSP in firmware
loading function.

Signed-off-by: Baojun Xu <baojun.xu@ti.com>

Link: https://patch.msgid.link/20250723142423.38768-1-baojun.xu@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-23 16:38:25 +02:00
Luca Weiss
c58c35ef6a
ASoC: qcom: sm8250: Add Fairphone 4 soundcard compatible
Add a compatible for the SM7225-based Fairphone 4 which can use this
machine driver.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://patch.msgid.link/20250723-fp4-usb-audio-offload-v3-3-6be84ed4fc39@fairphone.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-23 15:09:30 +01:00
Johan Hovold
696e123aa3
ASoC: mediatek: common: fix device and OF node leak
Make sure to drop the references to the accdet OF node and platform
device taken by of_parse_phandle() and of_find_device_by_node() after
looking up the sound component during probe.

Fixes: cf536e2622 ("ASoC: mediatek: common: Handle mediatek,accdet property")
Cc: stable@vger.kernel.org	# 6.15
Cc: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20250722092542.32754-1-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-23 13:03:57 +01:00
Takashi Iwai
089a60acbd Merge branch 'for-linus' into for-next
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-22 20:02:20 +02:00
SHARAN KUMAR M
931837cd92 ALSA: hda/realtek: Fix mute LED mask on HP OMEN 16 laptop
this patch is to fix my previous Commit <e5182305a519> i have fixed mute
led but for by This patch corrects the coefficient mask value introduced
in commit <e5182305a519>, which was intended to enable the mute LED
functionality. During testing, multiple values were evaluated, and
an incorrect value was mistakenly included in the final commit.
This update fixes that error by applying the correct mask value for
proper mute LED behavior.

Tested on 6.15.5-arch1-1

Fixes: e5182305a5 ("ALSA: hda/realtek: Enable Mute LED on HP OMEN 16 Laptop xd000xx")
Signed-off-by: SHARAN KUMAR M <sharweshraajan@gmail.com>
Link: https://patch.msgid.link/20250722172224.15359-1-sharweshraajan@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-22 19:57:09 +02:00
Charles Keepax
246570cd35
ASoC: SDCA: Fix implicit cast from le16
As the HID wDescriptorLength is explicitly marked as little endian it
should be converted to host endian before being used.

Fixes: ac558015df ("ASoC: SDCA: add a HID device for HIDE entity")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507221024.M18hWD6q-lkp@intel.com/
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250722114705.2816910-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-22 15:34:08 +01:00
Charles Keepax
59c5dbd585
ASoC: SDCA: Shrink detected_mode_handler() stack frame
The stack frame for detected_mode_handler() is a bit large. Dynamically
allocate the control value struct, which is most of the size, to avoid
this.

Fixes: b9ab3b6182 ("ASoC: SDCA: Add some initial IRQ handlers")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507182222.OLgOy9fX-lkp@intel.com/
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250722102305.2513755-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-22 12:20:42 +01:00
Stephen Rothwell
5b838a24e9
ASoC: SDCA: Check devm_mutex_init() return value
Fix interaction with commit daec29dcc8 ("locking/mutex: Mark
devm_mutex_init() as __must_check"), add return value check. There is no
need for additional complex error handling here, failure to init the
mutex means the code can't progress, so the failure just needs to be passed
up to the caller.

Fixes: b126394d9e ("ASoC: SDCA: Generic interrupt support")
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250722102754.2514351-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-22 12:20:42 +01:00
Erick Karanja
48915162b5 ALSA: usb-audio: qcom: Adjust mutex unlock order
The mutexes qdev_mutex and chip->mutex are acquired in that order
throughout the driver. To preserve proper lock hierarchy and avoid
potential deadlocks, they must be released in the reverse
order of acquisition.

This change reorders the unlock sequence to first release chip->mutex
followed by qdev_mutex, ensuring consistency with the locking pattern.

[ fixed the code indentations and Fixes tag by tiwai ]

Fixes: 326bbc3482 ("ALSA: usb-audio: qcom: Introduce QC USB SND offloading support")
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
Link: https://patch.msgid.link/20250721114554.1666104-1-karanja99erick@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-22 11:39:40 +02:00
Shuming Fan
17882721dc
ASoC: SDCA: add route by the number of input pins in MU entity
This patch removed the code where num_sources should be the same as cn_list.
For better resilience, it would be preferable to explicitly add the route
mapping the input pins to this MU entity.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250721112346.388542-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-21 16:04:53 +01:00
Shuming Fan
9e55f11926
ASoC: SDCA: correct the calculation of the maximum init table size
One initial setting is 5 bytes, so num_init_writes should divide by 5.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250721112334.388506-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-21 16:04:47 +01:00
Stefan Binding
0156c22fb0 ALSA: hda/realtek: Add support for ASUS Commercial laptops using CS35L41 HDA
Add support for ASUS PM3406CKA and PM3606CKA.

Laptops use 2 CS35L41 Amps with HDA, using Internal boost, with I2C

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://patch.msgid.link/20250721135406.366912-1-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-21 16:29:13 +02:00
Derek Fang
d312962188
ASoC: rt5650: Eliminate the high frequency glitch
The glitch was detected in the high frequency of the HP playback.
This patch adjusts the DAC dither setting to avoid this situation
for almost all cases.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://patch.msgid.link/20250721034728.1396238-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-21 13:26:52 +01:00
Ranjani Sridharan
0503ac474a
ASoC: SOF: Intel: PTL: Add the sdw_process_wakeen op
Add the missing op in the device description to avoid issues with jack
detection.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250721063039.2234279-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-21 13:26:51 +01:00
Takashi Iwai
7cd3c8cafb Merge branch 'for-linus' into for-next
Synch HD-audio changes landed in 6.16-rc7.
Mostly for file rename tracking.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-21 09:23:34 +02:00
Dawid Rezler
9744ede709 ALSA: hda/realtek - Add mute LED support for HP Pavilion 15-eg0xxx
The mute LED on the HP Pavilion Laptop 15-eg0xxx,
which uses the ALC287 codec, didn't work.
This patch fixes the issue by enabling the ALC287_FIXUP_HP_GPIO_LED quirk.

Tested on a physical device, the LED now works as intended.

Signed-off-by: Dawid Rezler <dawidrezler.patches@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20250720154907.80815-2-dawidrezler.patches@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-21 09:23:07 +02:00
Edip Hazuri
21c8ed9047 ALSA: hda/realtek - Add mute LED support for HP Victus 15-fa0xxx
The mute led on this laptop is using ALC245 but requires a quirk to work
This patch enables the existing quirk for the device.

Tested on my Victus 15-fa0xxx Laptop. The LED behaviour works
as intended.

Cc: <stable@vger.kernel.org>
Signed-off-by: Edip Hazuri <edip@medip.dev>
Link: https://patch.msgid.link/20250717212625.366026-2-edip@medip.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-18 14:23:07 +02:00
Guoqing Jiang
6bea85979d
ASoC: mediatek: mt8365-dai-i2s: pass correct size to mt8365_dai_set_priv
Given mt8365_dai_set_priv allocate priv_size space to copy priv_data which
means we should pass mt8365_i2s_priv[i] or "struct mtk_afe_i2s_priv"
instead of afe_priv which has the size of "struct mt8365_afe_private".

Otherwise the KASAN complains about.

[   59.389765] BUG: KASAN: global-out-of-bounds in mt8365_dai_set_priv+0xc8/0x168 [snd_soc_mt8365_pcm]
...
[   59.394789] Call trace:
[   59.395167]  dump_backtrace+0xa0/0x128
[   59.395733]  show_stack+0x20/0x38
[   59.396238]  dump_stack_lvl+0xe8/0x148
[   59.396806]  print_report+0x37c/0x5e0
[   59.397358]  kasan_report+0xac/0xf8
[   59.397885]  kasan_check_range+0xe8/0x190
[   59.398485]  asan_memcpy+0x3c/0x98
[   59.399022]  mt8365_dai_set_priv+0xc8/0x168 [snd_soc_mt8365_pcm]
[   59.399928]  mt8365_dai_i2s_register+0x1e8/0x2b0 [snd_soc_mt8365_pcm]
[   59.400893]  mt8365_afe_pcm_dev_probe+0x4d0/0xdf0 [snd_soc_mt8365_pcm]
[   59.401873]  platform_probe+0xcc/0x228
[   59.402442]  really_probe+0x340/0x9e8
[   59.402992]  driver_probe_device+0x16c/0x3f8
[   59.403638]  driver_probe_device+0x64/0x1d8
[   59.404256]  driver_attach+0x1dc/0x4c8
[   59.404840]  bus_for_each_dev+0x100/0x190
[   59.405442]  driver_attach+0x44/0x68
[   59.405980]  bus_add_driver+0x23c/0x500
[   59.406550]  driver_register+0xf8/0x3d0
[   59.407122]  platform_driver_register+0x68/0x98
[   59.407810]  mt8365_afe_pcm_driver_init+0x2c/0xff8 [snd_soc_mt8365_pcm]

Fixes: 402bbb13a1 ("ASoC: mediatek: mt8365: Add I2S DAI support")
Signed-off-by: Guoqing Jiang <guoqing.jiang@canonical.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20250710011806.134507-1-guoqing.jiang@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-18 12:28:21 +01:00
Mario Limonciello
6642adf0c1 ALSA: hda: Use pci_is_display()
The inline pci_is_display() helper does the same thing.  Use it.

Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Daniel Dadap <ddadap@nvidia.com>
Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch>
Link: https://patch.msgid.link/20250717173812.3633478-6-superm1@kernel.org
2025-07-17 15:30:13 -05:00
Takashi Iwai
348954f9b7 ASoC: Fixes for v6.16
A relatively large set of changes, but most of them are quirk
 information for various x86 systems.  There is one more substantial fix
 for a NULL pointer dereference when removing the AVS driver, plus one
 for Kconfig dependencies.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmh46Y4ACgkQJNaLcl1U
 h9AGZAf/QywROx8gGKCXUxQAvZb+/Dag3qNoBq/TZ2/bope+3QLwcq6IB2hP5G1D
 YedKMxVBdkwCrIy/OpZcrhPFLG6YgL+KOQDZd+hs3QldmEUeOQ7u3YHxJ0WeT9yG
 xLWAvYVRajom04KpZqHbbsPfJUa7QXVdpfzh0YhtJG83Q0ZCx6xwjcAL3GRS6Egb
 p4al2CzYrs+4AImPFWMWmym1aS+88nM9yprRLQn+lVvWEarjw/hU0ikI5VrivJv5
 RKIaIOKgCPLJ10RKHdaBkZOKMbC276Px1YU8VcDj8MnWsRisnE0ViT5U/ylxBLMP
 9/ajgO6yxG6R7BG7AJAlGKAhiIpUTA==
 =6U78
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v6.16

A relatively large set of changes, but most of them are quirk
information for various x86 systems.  There is one more substantial fix
for a NULL pointer dereference when removing the AVS driver, plus one
for Kconfig dependencies.
2025-07-17 14:53:38 +02:00
Mark Brown
da863e772e
Add SDCA DAI ops helpers
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

First, a couple of minor code fixups to already submitted code. Then
some patches to add new DAI ops helpers for the SDCA stuff, these allow
configuring things like the sample rate and finding out which SoundWire
port should be used for a specific SDCA streaming input/output terminal.
Still a few bits of outstanding work here (propogation of Cluster
information particularly) but his should be good enough to get some
basic use-cases working.

Hopefully we are getting fairly close to completing a first version of
the SDCA work now. Should be one more series to add FDL (firmware
downloading), then we should be able to send a first version of the
actual SDCA class driver itself.
2025-07-16 18:33:28 +01:00
Balamurugan C
03aa2ed9e1
ASoC: Intel: sof_rt5682: Add HDMI-In capture with rt5682 support for PTL.
Added match table entry on ptl machines to support HDMI-In capture
with rt5682 I2S audio codec. also added the respective quirk
configuration in rt5682 machine driver.

Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250716082300.1810352-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-16 16:57:06 +01:00
Lane Odenbach
7bab1bd9fd
ASoC: amd: yc: Add DMI quirk for HP Laptop 17 cp-2033dx
This fixes the internal microphone in the stated device

Signed-off-by: Lane Odenbach <laodenbach@gmail.com>
Link: https://patch.msgid.link/20250715182038.10048-1-laodenbach@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-16 11:50:33 +01:00
Bard Liao
ec5b9c847b
ASoC: Intel: soc-acpi: add support for HP Omen14 ARL
This platform has an RT711-sdca on link0 and RT1316 on link3.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20250716082233.1810334-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-16 11:50:32 +01:00
Alexander Stein
8778837f0a
ASoC: codec: tlv320aic32x4: Fix reset GPIO check
rstn_gpio being a GPIO descriptor the check is wrong (inverted) for
releasing the reset of the codec.

Fixes: 790d5f8ee6 ("ASoC: codec: tlv320aic32x4: Convert to GPIO descriptors")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250716065708.4041153-1-alexander.stein@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-16 11:15:20 +01:00
Mark Brown
3f998cd512
SDCA Bug Fixes
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

Some small SDCA bug fixes reported from various sources. An array bounds
check, an uninitialised variable and some memory allocations that should
zero initialise.

Charles Keepax (3):
  ASoC: SDCA: Fix off by one error in IRQ bound check
  ASoC: SDCA: Avoid use of uninitialised local name variable
  ASoC: SDCA: Update memory allocations to zero initialise

 sound/soc/sdca/sdca_asoc.c       | 12 ++++++------
 sound/soc/sdca/sdca_interrupts.c |  5 ++---
 2 files changed, 8 insertions(+), 9 deletions(-)

--
2.39.5
2025-07-15 22:40:13 +01:00
Mark Brown
dd10ed1caf
ASoC: convert from clk round_rate() to
Merge series from Brian Masney <bmasney@redhat.com>:

The round_rate() clk ops is deprecated in the clk framework in favor
of the determine_rate() clk ops, so let's go ahead and convert the
drivers in the rtc subsystem using the Coccinelle semantic patch
posted below. I did a few minor cosmetic cleanups of the code in a
few cases.

Coccinelle semantic patch:

    virtual patch

    // Look up the current name of the round_rate function
    @ has_round_rate @
    identifier round_rate_name =~ ".*_round_rate";
    identifier hw_param, rate_param, parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    	...
    }

    // Rename the route_rate function name to determine_rate()
    @ script:python generate_name depends on has_round_rate @
    round_rate_name << has_round_rate.round_rate_name;
    new_name;
    @@

    coccinelle.new_name = round_rate_name.replace("_round_rate", "_determine_rate")

    // Change rate to req->rate; also change occurrences of 'return XXX'.
    @ chg_rate depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    identifier ERR =~ "E.*";
    expression E;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    (
    -return -ERR;
    +return -ERR;
    |
    - return rate_param;
    + return 0;
    |
    - return E;
    + req->rate = E;
    +
    + return 0;
    |
    - rate_param
    + req->rate
    )
    ...>
    }

    // Coccinelle only transforms the first occurrence of the rate parameter
    // Run a second time. FIXME: Is there a better way to do this?
    @ chg_rate2 depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    - rate_param
    + req->rate
    ...>
    }

    // Change parent_rate to req->best_parent_rate
    @ chg_parent_rate depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    (
    - *parent_rate_param
    + req->best_parent_rate
    |
    - parent_rate_param
    + &req->best_parent_rate
    )
    ...>
    }

    // Convert the function definition from round_rate() to determine_rate()
    @ func_definition depends on chg_rate @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    identifier generate_name.new_name;
    @@

    - long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
    -               unsigned long *parent_rate_param)
    + int new_name(struct clk_hw *hw, struct clk_rate_request *req)
    {
        ...
    }

    // Update the ops from round_rate() to determine_rate()
    @ ops depends on func_definition @
    identifier has_round_rate.round_rate_name;
    identifier generate_name.new_name;
    @@

    {
        ...,
    -   .round_rate = round_rate_name,
    +   .determine_rate = new_name,
        ...,
    }

Note that I used coccinelle 1.2 instead of 1.3 since the newer version
adds unnecessary braces as described in this post.
https://lore.kernel.org/cocci/67642477-5f3e-4b2a-914d-579a54f48cbd@intel.com/
2025-07-15 21:44:05 +01:00
Charles Keepax
4ed357f72a
ASoC: SDCA: Add hw_params() helper function
Add a helper function that can be called from hw_params() in the DAI ops
to configure the SDCA Cluster, Clock and Usage controls. These setup the
channels, sample rate, and bit depths that will be used by the Terminal.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250707124155.2596744-8-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 19:45:51 +01:00
Charles Keepax
264d3d776f
ASoC: SDCA: Add a helper to get the SoundWire port number
Add a helper function to extract the SoundWire hardware port number
from the SDCA DataPort Selector Control. Typically this would be
called from hw_params() and used to call sdw_stream_add_slave().

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250707124155.2596744-7-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 19:45:50 +01:00
Charles Keepax
7b0d60dbb4
ASoC: SDCA: Add helper to add DAI constraints
Currently the core SDCA code simply creates a place holder available
channels from 1 to SDCA_MAX_CHANNEL_COUNT. Add a helper function
that will constrain the number of channels based on the actual
available SDCA Clusters in DisCo. Currently this code only handles
Input Terminal Entities as they directly specify the Cluster. More
work will be required later for Output Terminals which inherit their
Cluster. Typically this new helper would be called from the DAIs
startup callback.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250707124155.2596744-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 19:45:49 +01:00
Charles Keepax
c57ad86246
ASoC: SDCA: Move SDCA search functions and export
The ASoC code for SDCA contains several helper functions that search for
controls/ranges/etc. As the code evolves these helpers are likely to be
useful to anything interacting with the stored DisCo data. Move the
helpers into sdca_function.c and export them so other modules can also
use them.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250707124155.2596744-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 19:45:47 +01:00
Charles Keepax
cbcb5f5c2b
ASoC: SDCA: Remove overly chatty input pin list warning
An input pin list is not generally required, so a warning on the
absence of one is a little extreme, remove this warning message.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250707124155.2596744-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 19:45:45 +01:00
Charles Keepax
4eb6ad5d20
ASoC: SDCA: Allow read-only controls to be deferrable
The current SDCA Control parsing only checks the deferrable flag for
Read/Write and Dual Ranked controls. However, reads can defer as well as
writes so Read Only controls should also check for the deferrable flag.
Add the handling for this into find_sdca_entity_control().

Fixes: 42b144cb6a ("ASoC: SDCA: Add SDCA Control parsing")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250707124155.2596744-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 19:45:44 +01:00
Charles Keepax
15247b5a63
ASoC: SDCA: Update memory allocations to zero initialise
All the memory allocations in the SDCA ASoC helpers rely on fields being
zero initialised, the code should use kzalloc not kmalloc.

Reported-by: Shuming Fan <shumingf@realtek.com>
Fixes: 2c8b3a8e6a ("ASoC: SDCA: Create DAPM widgets and routes from DisCo")
Fixes: c3ca24e3fc ("ASoC: SDCA: Create ALSA controls from DisCo")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250715151723.2964336-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 17:58:22 +01:00
Charles Keepax
71562278a1
ASoC: SDCA: Avoid use of uninitialised local name variable
The local name variable is accidentally left over from an earlier
version of the code. Remove the variable and its uninitialised usage.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202507150415.M1tCgi3p-lkp@intel.com/
Fixes: b126394d9e ("ASoC: SDCA: Generic interrupt support")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250715151723.2964336-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 17:58:21 +01:00
Charles Keepax
3f2e4c1192
ASoC: SDCA: Fix off by one error in IRQ bound check
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202507150415.M1tCgi3p-lkp@intel.com/
Fixes: b126394d9e ("ASoC: SDCA: Generic interrupt support")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250715151723.2964336-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 17:58:20 +01:00
Brian Masney
d5f317fd5c
ASoC: stm: stm32_sai_sub: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Link: https://patch.msgid.link/20250710-sound-clk-round-rate-v1-6-4a9c3bb6ff3a@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 13:38:55 +01:00
Brian Masney
afd529d740
ASoC: stm: stm32_i2s: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Link: https://patch.msgid.link/20250710-sound-clk-round-rate-v1-5-4a9c3bb6ff3a@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 13:38:54 +01:00
Brian Masney
fc62ed665e
ASoC: qcom: qdsp6: q6dsp-lpass-clocks: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20250710-sound-clk-round-rate-v1-4-4a9c3bb6ff3a@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 13:38:53 +01:00
Brian Masney
a37d9c8aef
ASoC: codecs: rt5682s: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Link: https://patch.msgid.link/20250710-sound-clk-round-rate-v1-3-4a9c3bb6ff3a@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 13:38:52 +01:00
Brian Masney
4e15a10f6f
ASoC: codecs: rt5682: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Link: https://patch.msgid.link/20250710-sound-clk-round-rate-v1-2-4a9c3bb6ff3a@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 13:38:51 +01:00
Brian Masney
8a4d73121d
ASoC: codecs: da7219: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Link: https://patch.msgid.link/20250710-sound-clk-round-rate-v1-1-4a9c3bb6ff3a@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 13:38:50 +01:00
Adam Queler
949ddec372
ASoC: amd: yc: Add DMI entries to support HP 15-fb1xxx
This model requires an additional detection quirk to
enable the internal microphone.

Signed-off-by: Adam Queler <queler+k@gmail.com>
Link: https://patch.msgid.link/20250715031434.222062-1-queler+k@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 13:28:47 +01:00
Takashi Iwai
7828740b06 Merge branch 'for-linus' into for-next
Pull yet another HD-audio codec quirk update from 6.16 devel branch.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-15 09:54:17 +02:00
Takashi Iwai
e201c19dde ALSA: hda/realtek: Add quirk for ASUS ROG Strix G712LWS
ASUS ROG Strix G712LWS (PCI SSID 1043:1a83) requires the quirk for
ALC294 headset mode in order to make the speaker and headset I/O
working properly.

Cc: <stable@vger.kernel.org>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220334
Link: https://patch.msgid.link/20250715062906.11857-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-15 08:33:37 +02:00
Takashi Iwai
891667cefd Merge branch 'for-linus' into for-next
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-14 14:29:49 +02:00
Richard Fitzgerald
40b1c2f9b2 ALSA: hda/cs35l56: Workaround bad dev-index on Lenovo Yoga Book 9i GenX
The Lenovo Yoga Book 9i GenX has the wrong values in the cirrus,dev-index
_DSD property. Add a fixup for this model to ignore the property and
hardcode the index from the I2C bus address.

The error in the cirrus,dev-index property would prevent the second amp
instance from probing. The component binding would never see all the
required instances and so there would not be a binding between
patch_realtek.c and the cs35l56 driver.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reported-by: Brian Howard <blhoward2@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220228
Link: https://patch.msgid.link/20250714110154.204740-1-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-14 14:09:51 +02:00
Jackie Dong
4722727373 ALSA: hda/realtek: Support mute LED for Yoga with ALC287
Support mute LED on keyboard for Lenovo Yoga series products with
Realtek ALC287 chipset.

Tested on Lenovo Slim Pro 7 14APH8.

[ slight comment cleanup by tiwai ]

Signed-off-by: Jackie Dong <xy-jackie@139.com>
Link: https://patch.msgid.link/20250714094655.4657-1-xy-jackie@139.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-14 12:34:42 +02:00
Mark Brown
bfd291279f
ASoC: codec: Convert to GPIO descriptors for
Merge series from Peng Fan <peng.fan@nxp.com>:

This patchset is a pick up of patch 1,2 from [1]. And I also collect
Linus's R-b for patch 2. After this patchset, there is only one user of
of_gpio.h left in sound driver(pxa2xx-ac97).

of_gpio.h is deprecated, update the driver to use GPIO descriptors.

Patch 1 is to drop legacy platform data which in-tree no users are using it
Patch 2 is to convert to GPIO descriptors

Checking the DTS that use the device, all are using GPIOD_ACTIVE_LOW
polarity for reset-gpios, so all should work as expected with this patch.

[1] https://lore.kernel.org/all/20250408-asoc-gpio-v1-0-c0db9d3fd6e9@nxp.com/
2025-07-14 11:34:16 +01:00
Mark Brown
e977f3811e
Update SDCA Kconfig
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

Tidy up a bunch of makefile and Kconfig things, and pull the HID and IRQ
into the main SDCA module.

Changes since v1:
 - Don't expose SND_SOC_SDCA to the user
 - Simplify the makefile bits for HID and IRQ

Thanks,
Charles

Charles Keepax (2):
  ASoC: SDCA: Kconfig/Makefile fixups
  ASoC: SDCA: Pull HID and IRQ into the primary SDCA module

 sound/soc/sdca/Kconfig           | 13 +++++++++----
 sound/soc/sdca/Makefile          | 12 ++++--------
 sound/soc/sdca/sdca_functions.c  |  1 -
 sound/soc/sdca/sdca_hid.c        |  2 +-
 sound/soc/sdca/sdca_interrupts.c |  8 ++++----
 5 files changed, 18 insertions(+), 18 deletions(-)

--
2.39.5
2025-07-14 11:34:12 +01:00
Mark Brown
5f120ccf28
ASoC: set bias_level at if
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

ASoC has 2 functions to set bias level.

	(A) snd_soc_dapm_force_bias_level()
	(B) snd_soc_dapm_set_bias_level()

(A) sets dapm->bias_level, but (B) is not.
I think we should set it on both (A) and (B).
I think it is miss or bug, but Samsung is the only vendor that feels a
problem about this.

I think this patch (= [1/5]) is correct approach, but some non-samsung
vendor might get affect from this patch-set, so I added [RFC] on this
patch-set.

Furthermore, (B) cares both Card and Component, (A) cares Component only.
I guess it is the reason why it is called as "force" bias_level function.
(A) is used from each drivers, (B) is used from soc-dapm only.
I'm not 100% sure though, except special cases, each driver should use (B),
I guess ?
2025-07-14 11:34:08 +01:00
Shengjiu Wang
af241e3fa4
ASoC: fsl-asoc-card: add sysclk_ratio for calculate sysclk frequency
The sysclk frequency can be calculated from sample rate multiply ratio.
When sysclk_freq is not configured, but sysclk_ratio is configured, then
calculate sysclk frequency according to sysclk_ratio.

Apply this change for wm8524 codec.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20250708085318.2563521-1-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:37:01 +01:00
Peng Fan
790d5f8ee6
ASoC: codec: tlv320aic32x4: 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, and set consumer
   name.
 - Use gpiod_set_value to configure output value.

While at here, reorder the included headers.

Checking the DTS that use the device, all are using GPIOD_ACTIVE_LOW
polarity for reset-gpios, so all should work as expected with this patch.

Cc: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250710-asoc-gpio-1-v2-3-2233b272a1a6@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:56 +01:00
Peng Fan
b709c1aef5
ASoC: codec: tlv320aic32x4: Sort headers alphabetically
Sort headers alphabetically to easily insert new ones
and drop unused ones.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://patch.msgid.link/20250710-asoc-gpio-1-v2-2-2233b272a1a6@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:55 +01:00
Peng Fan
69d5b62c4b
ASoC: codec: tlv320aic32x4: Drop aic32x4_pdata usage
There is no machine is using aic32x4_pdata as platform_data, so
remove the dead code.

Cc: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250710-asoc-gpio-1-v2-1-2233b272a1a6@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:54 +01:00
Kuninori Morimoto
f00e06296b
ASoC: samsung: littlemill: don't set dapm->bias_level directly
snd_soc_dapm_set_bias_level() (A) will set dapm->bias_level (a) inside.
No need to set it by each callback function. Remove it.

(A)	static int snd_soc_dapm_set_bias_level(...)
	{
		...
		/* success */
		if (ret == 0)
(a)			snd_soc_dapm_init_bias_level(dapm, level);
		...
	}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ldov4g3c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:48 +01:00
Kuninori Morimoto
4421e455d2
ASoC: samsung: tobermory: don't set dapm->bias_level directly
snd_soc_dapm_set_bias_level() (A) will set dapm->bias_level (a) inside.
No need to set it by each callback function. Remove it.

(A)	static int snd_soc_dapm_set_bias_level(...)
	{
		...
		/* success */
		if (ret == 0)
(a)			snd_soc_dapm_init_bias_level(dapm, level);
		...
	}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ms9b4g3j.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:48 +01:00
Kuninori Morimoto
d2f423a4f4
ASoC: samsung: speyside: don't set dapm->bias_level directly
snd_soc_dapm_set_bias_level() (A) will set dapm->bias_level (a) inside.
No need to set it by each callback function. Remove it.

(A)	static int snd_soc_dapm_set_bias_level(...)
	{
		...
		/* success */
		if (ret == 0)
(a)			snd_soc_dapm_init_bias_level(dapm, level);
		...
	}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87o6tr4g3r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:47 +01:00
Kuninori Morimoto
88f60cb4b8
ASoC: samsung: bell: don't set dapm->bias_level directly
snd_soc_dapm_set_bias_level() (A) will set dapm->bias_level (a) inside.
No need to set it by each callback function. Remove it.

(A)	static int snd_soc_dapm_set_bias_level(...)
	{
		...
		/* success */
		if (ret == 0)
(a)			snd_soc_dapm_init_bias_level(dapm, level);
		...
	}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ple74g47.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:46 +01:00
Kuninori Morimoto
f40ecc2743
ASoC: soc-dapm: set bias_level if snd_soc_dapm_set_bias_level() was successed
ASoC has 2 functions to set bias level.
	(A) snd_soc_dapm_force_bias_level()
	(B) snd_soc_dapm_set_bias_level()

snd_soc_dapm_force_bias_level() (A) will set dapm->bias_level (a) if
successed.

(A)	int snd_soc_dapm_force_bias_level(...)
	{
		...
		if (ret == 0)
(a)			dapm->bias_level = level;
		...
	}

snd_soc_dapm_set_bias_level() (B) is also a function that sets bias_level.
It will call snd_soc_dapm_force_bias_level() (A) inside, but doesn't
set dapm->bias_level by itself. One note is that (A) might not be called.

(B)	static int snd_soc_dapm_set_bias_level(...)
	{
		...
		ret = snd_soc_card_set_bias_level(...);
		...
		if (dapm != &card->dapm)
(A)			ret = snd_soc_dapm_force_bias_level(...);
		...
		ret = snd_soc_card_set_bias_level_post(...);
		...
	}

dapm->bias_level will be set if (A) was called, but might not be set
if (B) was called, even though it calles set_bias_level() function.

We should set dapm->bias_level if we calls
snd_soc_dapm_set_bias_level() (B), too.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87qzyn4g4h.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:45 +01:00
Charles Keepax
5030abcb0a
ASoC: SDCA: Pull HID and IRQ into the primary SDCA module
If the HID or the IRQ are selected as options they will always require
loading alongside the main SDCA module. Since it will never be possible
to run without them the value of keeping them as separate modules is
fairly limited. Pull them into the main SDCA module to simplify things
still further.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250711100616.296329-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:40 +01:00
Charles Keepax
6894e49b7b
ASoC: SDCA: Kconfig/Makefile fixups
Tidy up a few bits of the SDCA Kconfig. Default both HID and IRQ to
enabled, since typically if one wants SDCA all the functionality
will be expected.

Finally, update the IRQ support to match the changes made to the
HID support.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250711100616.296329-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:39 +01:00
Arnd Bergmann
e837b59f8b
ASoC: Intel: fix SND_SOC_SOF dependencies
It is currently possible to configure a kernel with all Intel SoC
configs as loadable modules, but the board config as built-in. This
causes a link failure in the reference to the snd_soc_sof.ko module:

x86_64-linux-ld: sound/soc/intel/boards/sof_rt5682.o: in function `sof_rt5682_hw_params':
sof_rt5682.c:(.text+0x1f9): undefined reference to `sof_dai_get_mclk'
x86_64-linux-ld: sof_rt5682.c:(.text+0x234): undefined reference to `sof_dai_get_bclk'
x86_64-linux-ld: sound/soc/intel/boards/sof_rt5682.o: in function `sof_rt5682_codec_init':
sof_rt5682.c:(.text+0x3e0): undefined reference to `sof_dai_get_mclk'
x86_64-linux-ld: sound/soc/intel/boards/sof_cs42l42.o: in function `sof_cs42l42_hw_params':
sof_cs42l42.c:(.text+0x2a): undefined reference to `sof_dai_get_bclk'
x86_64-linux-ld: sound/soc/intel/boards/sof_nau8825.o: in function `sof_nau8825_hw_params':
sof_nau8825.c:(.text+0x7f): undefined reference to `sof_dai_get_bclk'
x86_64-linux-ld: sound/soc/intel/boards/sof_da7219.o: in function `da7219_codec_init':
sof_da7219.c:(.text+0xbf): undefined reference to `sof_dai_get_mclk'
x86_64-linux-ld: sound/soc/intel/boards/sof_maxim_common.o: in function `max_98373_hw_params':
sof_maxim_common.c:(.text+0x6f9): undefined reference to `sof_dai_get_tdm_slots'
x86_64-linux-ld: sound/soc/intel/boards/sof_realtek_common.o: in function `rt1015_hw_params':
sof_realtek_common.c:(.text+0x54c): undefined reference to `sof_dai_get_bclk'
x86_64-linux-ld: sound/soc/intel/boards/sof_realtek_common.o: in function `rt1308_hw_params':
sof_realtek_common.c:(.text+0x702): undefined reference to `sof_dai_get_mclk'
x86_64-linux-ld: sound/soc/intel/boards/sof_cirrus_common.o: in function `cs35l41_hw_params':
sof_cirrus_common.c:(.text+0x2f): undefined reference to `sof_dai_get_bclk'

Add an optional dependency on SND_SOC_SOF_INTEL_COMMON, to ensure that whenever
the SOF support is in a loadable module, none of the board code can be built-in.

This may be be a little heavy-handed, but I also don't see a reason why one would
want the boards to be built-in but not the SoC, so it shouldn't actually cause
any usability problems.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250709145626.64125-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:31 +01:00
Oder Chiou
d235538723
ASoC: rt5660: Fix the dmic data source from GPIO2
The patch fixes an issue with the dmic data pin connected to GPIO2.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://patch.msgid.link/20250711034813.3278989-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:30 +01:00
Takashi Iwai
0bdbce2585 ALSA: hda: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Link: https://patch.msgid.link/20250711083051.18759-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-11 13:36:20 +02:00
Takashi Iwai
0c8e393941 ALSA: hda: Return the codec init error properly at snd_hda_codec_build_controls()
The error from snd_hda_codec_init() was ignored in
snd_hda_codec_build_controls(), which should have been taken account
and abort the flow.  Fix it now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-28-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
691351de31 ALSA: hda: Drop superfluous driver->ops NULL checks
After all conversions, driver->ops became a must in most places
(except for the codec power setup which might be called before binding
to the codec driver), hence we can get rid of the superfluous
driver->ops NULL checks, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-26-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
cabaf5908e ALSA: hda: Drop old codec binding method
Now that all patch_ops usage have been converted to the new
hda_codec_ops probe, we can drop patch_ops from the hda_codec,
together with the calls of patch_ops callbacks.

The hda_codec_ops.free callback is removed as all have been replaced
with the new remove callback.

Also, correct comments mentioning "patch"; it's replaced with "codec
driver".

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-25-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
ad781b550f ALSA: hda/hdmi: Rewrite to new probe method
Convert the HDMI codec drivers to use the new hda_codec_ops probe.

The Intel and Nvidia-MCP HDMI drivers needed slightly more changes to
deal with the unified callbacks among all models.

Also another non-trivial change is Intel driver's set_power_state
callback.  An additional NULL check of codec->spec is needed there
since the set_power_state() may be called before the probe gets called
(e.g. in ASoC hda codec hda_codec_probe()).

Other than that, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-24-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
6cce08122f ALSA: hda/ca0132: Rewrite to new probe method
Convert the CA0132 codec driver to use the new hda_codec_ops probe.
No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-23-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
eb2f084414 ALSA: hda/sigmatel: Rewrite to new probe method
Convert the Sigmatel/IDT codec driver to use the new hda_codec_ops
probe.  No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-22-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
be60c12909 ALSA: hda/via: Rewrite to new probe method
Convert the VIA codec driver to use the new hda_codec_ops probe.
No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-21-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
51a1e7f413 ALSA: hda/si3054: Rewrite to new probe method
Convert the SI3054 codec driver to use the new hda_codec_ops probe.
No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-20-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
3cea413834 ALSA: hda/senary: Rewrite to new probe method
Convert the Senary codec driver to use the new hda_codec_ops probe.
No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-19-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
dec96130ea ALSA: hda/conexant: Rewrite to new probe method
Convert the Conexant codec driver to use the new hda_codec_ops probe.
No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-18-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
e4c9f524a1 ALSA: hda/cs8409: Rewrite to new probe method
Convert the CS8409 codec driver to use the new hda_codec_ops probe.
The Dolphin support needs an override of unsol_event callback, and
redirect via spec->unsol_event function pointer for now.

Other than that, no functional changes.

Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-17-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
1cb8744a36 ALSA: hda/cirrus: Split to cs420x and cs421x drivers
Since the codec ops for CS420x and CS421x are fairly independent,
split the cirrus codec driver into two drivers, snd-hda-codec-cs420x
and snd-hda-code-cs421x.  Together with the split, convert to the new
hda_codec_ops probe.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-16-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
dbe3e4ab57 ALSA: hda/ca0110: Rewrite to new probe method
Convert the CA0110 codec driver to use the new hda_codec_ops probe.
No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-15-tiwai@suse.de
2025-07-11 09:55:37 +02:00
Takashi Iwai
f025ef0316 ALSA: hda/analog: Rewrite to new probe method
Convert the Analog Device codec driver to use the new hda_codec_ops
probe.  The probe function had to be unified and branched with the
model type specified via driver_data instead.

Other than that, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-14-tiwai@suse.de
2025-07-11 09:55:37 +02:00
Takashi Iwai
0f1e8306dc ALSA: hda/cmedia: Rewrite to new probe method
Convert the C-Media codec driver to use the new hda_codec_ops probe.

Since the CM9825 uses a completely different probe and codec ops,
factor out to an individual codec driver, snd-hda-codec-cm9825.

Other than that, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-13-tiwai@suse.de
2025-07-11 09:55:37 +02:00
Takashi Iwai
e1d695b45f ALSA: hda/realtek: Rewrite to new probe method
Convert the Realtek codec drivers to use the new hda_codec_ops probe.
No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-12-tiwai@suse.de
2025-07-11 09:55:37 +02:00
Takashi Iwai
1d0e6926ef ALSA: hda/generic: Rewrite to new probe method
Convert the generic HD-audio codec driver to use the new hda_codec_ops
probe.  No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-11-tiwai@suse.de
2025-07-11 09:55:37 +02:00
Takashi Iwai
6bf917e9aa ALSA: hda: Introduce hda_codec_driver ops
Until now, we use "patch_ops" embedded in hda_codec object for
defining the callbacks that are used in various places to manage
HD-audio codec.  But from the device driver POV, this should have been
rather the driver ops, instead of the callbacks in the codec object.

This patch defines the driver ops for HD-audio codec driver as the
replacement.  We reuse the same struct hda_codec_ops, and this is put
as hda_codec_driver.ops.  When the driver->ops callbacks are defined,
they are called primarily instead of codec->patch_ops callbacks.

With converting to the driver ops, there is no need to pass the ugly
patch_ops handling in hda_device_id tables.  That is, driver_data
field of hda_device_id becomes really optional and it can be used for
passing the codec-specific data (e.g. specifying a model).

The codec entries after the conversion should be with HDA_CODEC_ID()
and co, instead of the former HDA_CODEC_ENTRY().

Once after converting all codec drivers to use driver ops, we can get
rid of codec patch_ops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-10-tiwai@suse.de
2025-07-11 09:55:37 +02:00
Takashi Iwai
73cd049081 ALSA: hda/hdmi: Split vendor codec drivers
In the past, we unified HD-audio HDMI codec driver once with a slight
hope that more vendors will follow the standard, but in reality, the
driver received more and more vendor-specific code.  In order to make
the messy code a bit more understandable, this patch splits the HDMI
codec driver into multiple drivers again.

Namely, the vendor-specific code for Intel, AMD and Nvidia are moved
into the own drivers, while we split the common HDMI code to two
drivers, the generic HDMI driver and the simple HDMI driver.
So, now we have:

- The generic HDMI driver (snd-hda-codec-hdmi):
  providing the common helpers, also supports Glenfly HDMI codecs and
  some other codecs that don't need vendor-specific stuff

- The simple HDMI driver (snd-hda-codec-simplehdmi):
  devices with no dynamic PCM assignment and with fixed channels,
  mostly used by some other drivers, but this driver alone suffices
  for VIA HDMI codec support, too

- Intel HDMI driver (snd-hda-codec-intelhdmi):
  bound with i915 / Xe DRM, based on the generic HDMI driver

- AMD/ATI HDMI driver (snd-hda-codec-atihdmi):
  optionally bound with radeon / amdgpu DRM, based on the generic HDMI
  driver

- Nvidia HDMI driver (snd-hda-codec-nvhdmi);
  optionally bound with nouveau DRM, based on the generic HDMI driver

- Legacy Nvidia HDMI driver (snd-hda-codec-nvhdmi-mcp):
  for 2ch or 8ch outputs, based on the simple HDMI driver

- Nvidia Tegra HDMI driver (snd-hda-codec-tegrahdmi):
  based on the generic HDMI driver

Along with the driver split, the enable_silent_stream module option is
moved to snd-hda-codec-intelhdmi, too, as it's an Intel-specific
feature.

Most of the changes here are just to split and move the code to
different files, as well as to rename/expose the functions that are
commonly used by drivers.

The silent stream handling code is slightly modified for putting the
stuff into Intel driver; now a new callback "silent_stream" is defined
in hdmi_ops, and it's called in silent_stream_enable() and *_disable()
functions.  The runtime-PM handling in silent_stream_enable() was
cleaned up, and rather taking the runtime PM refcount in the
silent_stream() callback appropriately, instead.

Other than that, there should be no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-9-tiwai@suse.de
2025-07-11 09:55:37 +02:00