summaryrefslogtreecommitdiff
path: root/sound/hda/codecs/side-codecs
AgeCommit message (Collapse)Author
14 hoursMerge branch 'for-next' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git # Conflicts: # include/sound/tas2781.h
14 hoursMerge branch 'for-next' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git # Conflicts: # sound/hda/codecs/side-codecs/cs35l41_hda.c
20 hoursMerge asoc/for-7.4 into asoc-nextMark Brown
39 hoursALSA: hda: cs35l41: Fix ACPI device reference leak on probe failureMa Ke
cs35l41_hda_probe() takes an acpi_device through cs35l41_hda_read_acpi() and stores it in cs35l41->dacpi. Only the failures that happen later reach the err: label, which is where that reference and cs35l41->acpi_subsystem_id are released, so the early return taken when cs35l41_hda_read_acpi() fails leaves both behind. Keep the ownership in the caller instead of dropping the reference inside cs35l41_hda_read_acpi(). That removes the need to work out whether a given failure path has already released it, and with it the double put that cs35l41_hda_parse_acpi() would otherwise cause when it fails after having released the device itself. cs35l41_hda_parse_acpi() and the !physdev path no longer put the reference, and the early failure enters the existing err: cleanup tail through a new err_acpi label. The label sits between the reset of the codec and the gpio cleanup, so an early failure also releases the reset and chip-select descriptors that cs35l41_hda_parse_acpi() may already have taken, while still skipping cs35l41_safe_reset() on a codec that was never brought up. cs35l41->dacpi comes from devm_kzalloc() and is only assigned once the ACPI device has been found, so the put is a no-op when the lookup itself failed. Found by code review. Fixes: 447106e92a0c ("ALSA: hda: cs35l41: Support mute notifications for CS35L41 HDA") Cc: stable@vger.kernel.org Signed-off-by: Ma Ke <make_ruc2021@163.com> Link: https://patch.msgid.link/20261012084152.3740340-1-make_ruc2021@163.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
43 hoursMerge branch 'acpi-driver' into linux-nextRafael J. Wysocki
* acpi-driver: ACPI: bus: Drop acpi_get_first_physical_node() efi/dev-path-parser: Switch to use acpi_bus_get_primary_device() ALSA: hda: tas2781: Switch to use acpi_bus_get_primary_device() ALSA: hda: cs35l41: Switch to use acpi_bus_get_primary_device() iommu/arm-smmu-v3: Switch to use acpi_bus_get_primary_device() ACPI: Add stub for acpi_find_child_device() ACPI: bus: Provide !ACPI stub for acpi_device_uid() ALSA: hda: aw88399: Switch to use acpi_bus_get_primary_device() ASoC: loongson: Switch to use acpi_bus_get_primary_device() ASoC: intel: boards: Switch to use acpi_bus_get_primary_device() ASoC: amd: acp3x-es83xx: Switch to use acpi_bus_get_primary_device() ASoC: amd: acp-es8336: Switch to use acpi_bus_get_primary_device() thunderbolt: Switch to use acpi_bus_get_primary_device() platform/x86: apple-gmux: Switch to use acpi_bus_get_primary_device() platform/x86: x86-android-tablets: Use acpi_bus_get_primary_device() platform/x86: serdev_helpers: Switch to use acpi_bus_get_primary_device() platform/x86: yogabook: Switch to use acpi_bus_get_primary_device() ACPI: amba: Switch to use acpi_bus_get_primary_device() ACPI: bus: Use acpi/acpi_bus.h without CONFIG_ACPI
47 hoursMerge branch 'for-linus' into for-nextTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 daysALSA: hda/scodec: imply SERIAL_MULTI_INSTANTIATE for AW88399Marco Giunta
The AW88399 HDA side codec driver relies on the serial-multi-instantiate driver to create I2C devices from the "AWDZ8399" ACPI HID entry. Add imply SERIAL_MULTI_INSTANTIATE to help kernel configuration tools suggest the correct dependency, matching the CS35L41 and CS35L56 HDA side codec entries. Signed-off-by: Marco Giunta <marco_giunta@outlook.it> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/SN6PR19MB2303BF65050B51AE7217BB9AFCBD2@SN6PR19MB2303.namprd19.prod.outlook.com
9 daysASoC: aw88399: remove bsts_unreliable workaroundMarco Giunta
Now that the shared library correctly skips the BSTS check when the boost converter is bypassed, the per-instance bsts_unreliable flag added as a workaround in the HDA side codec driver is unnecessary. Remove it from the library, the HDA driver, and the shared header. This also simplifies testing the HDA side codec driver on new devices, as new models no longer need a quirk entry to bypass the BSTS check. Users can test via the model= module parameter in alc269 without a custom kernel. Signed-off-by: Marco Giunta <marco_giunta@outlook.it> Link: https://patch.msgid.link/SN6PR19MB2303CC64AF7DEC3C5C98A512FC8F2@SN6PR19MB2303.namprd19.prod.outlook.com Signed-off-by: Mark Brown <broonie@kernel.org>
9 daysALSA: hda/tas2781: Enable bass speakers supportGeorg Wenzel
Configure the driver to correctly initialize and enable the bass speakers on devices utilizing the TAS2781 amplifier. Without this change, only the tweeters or main speakers are active, leading to thin audio output. Set up the required register sequences and routing to ensure the bass channels are properly powered and mixed into the audio stream. Signed-off-by: Georg Wenzel <g.wenzel@gmail.com> Link: https://patch.msgid.link/20261004071202.89116-1-g.wenzel@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 daysALSA: hda: Fix speakers on ThinkBook Plus G3 IAPZhang Heng
Lenovo ThinkBook Plus G3 IAP shares PCI SSID 17aa:3891 with Yoga Pro 7 14AHP9, but has a different codec SSID (0x17aa3875). Use HDA_CODEC_QUIRK to select ALC287_FIXUP_CS35L41_I2C_2 and add ACPI _SUB values 17AA3845/17AA3846 to the CS35L41 property table, since the BIOS provides no _DSD. Reported-by: Harry Nixon <harryanixon@yahoo.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222053 Tested-by: Harry Nixon <harryanixon@yahoo.com> Signed-off-by: Zhang Heng <zhangheng@kylinos.cn> Link: https://patch.msgid.link/20261001033920.111061-1-zhangheng@kylinos.cn Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 daysALSA: hda/tas2781: Accept V1 calibration data without CRCMohamed Yassine Jebabli
Some Lenovo BIOSes (e.g. Legion Pro 7 16IRX9H, SSID 17aa:38cd) store valid V1 calibration data in the CALI_DATA EFI variable but leave the TimeStamp and CRC fields zeroed. The driver rejects such data, so the amplifiers always run with default parameters on these machines. The rejection was silent until commit 4fe238513407 ("ALSA: hda/tas2781: Move and unified the calibrated-data getting function for SPI and I2C into the tas2781_hda lib") turned it into "V1 CRC error". The stored values are consistent (R0 = 3.82/3.83 ohm, 1/R0 matching within 1e-4), so accept V1 data when both TimeStamp and CRC are zero and the first device entry is non-zero, and emit a warning. Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Cc: stable@vger.kernel.org Signed-off-by: Mohamed Yassine Jebabli <med.jebabli@gmail.com> Link: https://patch.msgid.link/20261001-tas2781-v1-nocrc-v1-1-ff0c1032ce76@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 daysALSA: hda: tas2781: Switch to use acpi_bus_get_primary_device()Rafael J. Wysocki
Replace acpi_get_first_physical_node() that is slated for removal with acpi_bus_get_primary_device() that takes a reference to the device it is about to return. This addresses a potential use-after-free that may occur if the device returned by acpi_get_first_physical_node() is removed right after dropping its ACPI companion's physical_node_lock in that function. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/8782185.NyiUUSuA9g@rafael.j.wysocki
12 daysALSA: hda: cs35l41: Switch to use acpi_bus_get_primary_device()Rafael J. Wysocki
Replace acpi_get_first_physical_node() that is slated for removal with acpi_bus_get_primary_device() that takes a reference to the device it is about to return. This addresses a potential use-after-free that may occur if the device returned by acpi_get_first_physical_node() is removed right after dropping its ACPI companion's physical_node_lock in that function. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/6200303.MhkbZ0Pkbq@rafael.j.wysocki
2026-09-29ALSA: hda: cs35l41: Add support for CLSA0102Ilya Pavlukhin
The Lenovo Yoga Slim 7 Carbon 14ACN6 (82L0) drives its bass speakers with two CS35L41 amplifiers, described by ACPI HID CLSA0102 without a _DSD. The node has the same layout as CLSA0100/CLSA0101: both amps in one node, reset on GPIO index 0 and the interrupt on a GpioInt. Unlike the Legion 7 there is no speaker ID GPIO, index 2 is the interrupt line. The Windows driver runs the amps from an external VSPK supply (ExternalVspkControl, boost converter disabled), so use CS35L41_EXT_BOOST with the VSPK switch on GPIO1. With the internal boost converter enabled the amps report "Amp short error" during playback. There is no _SUB in the ACPI node, so the firmware files are looked up by the codec SSID, 17aa3856. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215632 Assisted-by: Claude Opus 5 Signed-off-by: Ilya Pavlukhin <i.pavluhin@ya.ru> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260920092808.17234-4-i.pavluhin@ya.ru
2026-09-22ALSA: hda: aw88399: Switch to use acpi_bus_get_primary_device()Rafael J. Wysocki
Replace acpi_get_first_physical_node() that is slated for removal with acpi_bus_get_primary_device() that takes a reference to the device it is about to return. This addresses a potential use-after-free that may occur if the device returned by acpi_get_first_physical_node() is removed right after dropping its ACPI companion's physical_node_lock in that function. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Marco Giunta <marco_giunta@outlook.it> Link: https://patch.msgid.link/2568518.jE0xQCEvom@rafael.j.wysocki
2026-08-18Merge tag 'asoc-v7.3' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v7.3 A very busy release, a combination of a lot of new device work and more people than usual doing various subsystem wide improvements in the code. The main subsystem level change is the work Morimoto-san has been doing to get automatic DAI format selection more widely deployed, and even that is largely changes in the drivers to enable use of the feature rather than framework work. - Conversions of a lot of drivers to use the automatic DAI format selection code from Morimoto-san. - Many fixes and code improvements from bui duc phuc and Morimoto-san. - Fixes for ordering problems in register default tables from Peter Ujfalusi. - Changes to use auto-cleanup for firmware to improve robustness from Takashi Iwai. - Support for firmware on more Awinc devices. - Many changes in the Qualcomm driver stack, mostly around new platform support. - Support for AMD ACP7.B/F, Cirrus Logic CS35L62, Loongson 2K0300, Meson GX formatter and interface, Qualcomm LPI MI2S, SM8475 and WSA855 and Realtek RT1321 VA1/2 and RT766/7.
2026-08-11ASoC: amd: enable audio on HP OmniBook X Flip 14Mark Brown
Ville Saarinen <wiza@saarinenkoti.fi> says: The HP OmniBook X Flip 14-kc0xxx (board 8EA1, Strix Point, ACP 7.2) has no usable audio on mainline at all. Its BIOS reports an ACP configuration flag of FLAG_AMD_LEGACY_ONLY_DMIC, which binds the legacy ACP driver and registers a PDM-only card, so the SoundWire links are never scanned. The two TAS2783 speaker amplifiers on link 0 and the RT712-VB jack codec on link 1 never enumerate, and the machine has no playback path whatsoever. Patch 1 adds a DMI quirk overriding the flag so snd_pci_ps probes. Patch 2 adds the machine entry describing the link topology. With both applied the card comes up and every path on the machine works: internal speakers, headphone jack with detection, headset microphone and the internal DMIC array. Two further patches are needed for the speakers to render stereo rather than mono, and to survive a system resume; those are in the TAS2783 codec driver and are being sent separately to the TI maintainers, since they have no build dependency on this pair. Related reports for the same root cause on other machines: - kernel bugzilla #221226 (ASUS Zenbook S16) - CachyOS linux-cachyos#820 (HP OmniBook X Flip 16, board 8EA2 -- the sibling board, which would need its own entry; I have no access to one and have not added it) Tested on the affected machine only. I do not have any other ACP 7.2 board, so the gating on patch 2 is written to be conservative rather than broad. Testing ======= The hardware testing was done on v7.1.6, where an equivalent version of this pair is what makes audio work on the machine. Against the master commit named below, both patches have been compile-tested only (gcc, W=1, no new warnings, no new external symbol references). Patch 2 has been reworked slightly relative to the tested build: the RT712-VB entry now reuses the existing jack_dmic_endpoints array, which already describes exactly the AIF1 jack + AIF3 DMIC pairing this board needs, instead of adding a second identical copy of it. That was a mechanical substitution, but it has not been through hardware. Tool disclosure, per Documentation/process/generated-content.rst ================================================================ This work was done in extended interactive sessions with Claude (Anthropic, model claude-opus-5) acting as a coding and debugging assistant, and a substantial amount of the analysis and of the patch text originated with it. Both patches carry an Assisted-by tag as described in Documentation/process/coding-assistants.rst. The division of work: - The assistant read the DMI data and ACP configuration flag off the running machine, identified the flag override as the fix, derived the SoundWire topology from the enumerated peripherals, and drafted both patches and both changelogs. - I ran everything that needed root or physical access, rebooted into each build, and did the listening tests. The left/right ordering in patch 2 is set by the order of the two amplifier entries; the first version had the sides reversed and that was caught by ear, not by the assistant. - No single prompt generated these patches. The session was iterative over roughly a day: inspect state, form a hypothesis, build, reboot, measure, discard the hypothesis if the measurement disagreed. Several confident intermediate conclusions were wrong and were only caught by measurement. I have reviewed both patches, I understand what they do, and I take responsibility for them. Link: https://patch.msgid.link/20260809101439.4798-1-wiza@saarinenkoti.fi
2026-08-05ALSA: hda/realtek: enable AW88399 on Lenovo Legion R9000P ADR10HMarco Giunta
Add codec SSID entries for the Lenovo Legion R9000P ADR10H (83RV), which uses the same ALC287 + AW88399 smart amplifier configuration as the existing supported Legion models. DSDT inspection confirms identical AWDZ8399 ACPI device layout with reversed I2C addresses (0x35 before 0x34). Register dumps show the same BSTS behavior as the other Legions. Both the channel swap and BSTS bypass quirks apply. Codec SSIDs (Lenovo vendor ID 0x17aa): * 0x3936: Legion R9000P ADR10H (AMD) * 0x3937: Legion R9000P ADR10H (AMD) Signed-off-by: Marco Giunta <marco_giunta@outlook.it> Link: https://patch.msgid.link/DS7PR19MB7724EE8DED946545C55717C1FCD32@DS7PR19MB7724.namprd19.prod.outlook.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-08-04ASoC: tas2781: add capture_profile_id field and update the tuning_switch ↵Shenghao Ding
function Currently, the TAS2781 SmartAMP driver uses the same profile ID for both playback and capture scenarios (e.g., PDM microphone recording or IV data capture). This makes it impossible to apply different DSP configurations for capture and playback, which is required in real-world tuning and production use cases. With these changes, capture and playback paths now use their own DSP profiles, improving tuning flexibility and avoiding unintended profile conflicts between SmartAMP capture and playback scenarios. Signed-off-by: Shenghao Ding <shenghao-ding@ti.com> Link: https://patch.msgid.link/20260804111433.1148-1-shenghao-ding@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-08-04ALSA: hda: cs35l41: Use auto-cleanup for put_device()Takashi Iwai
A temporary refcount management of a struct device can be done gracefully with __clean(put_device) for avoiding potential leaks. No functional change but just a code cleanup. Cc: patches@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260803140100.919071-3-tiwai@suse.de
2026-08-04ALSA: hda: tas2781: Use auto-cleanup for put_device()Takashi Iwai
A temporary refcount management of a struct device can be done gracefully with __clean(put_device) for avoiding potential leaks. No functional change but just a code cleanup. Cc: Shenghao Ding <shenghao-ding@ti.com> Cc: Kevin Lu <kevin-lu@ti.com> Cc: Baojun Xu <baojun.xu@ti.com> Cc: Sen Wang <sen@ti.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260803140100.919071-2-tiwai@suse.de
2026-08-04ALSA: hda: aw88399: Use auto-cleanup for put_device()Takashi Iwai
A temporary refcount management of a struct device can be done gracefully with __clean(put_device) for avoiding potential leaks. No functional change but just a code cleanup. Cc: Marco Giunta <marco_giunta@outlook.it> Reviewed-by: Marco Giunta <marco_giunta@outlook.it> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260803140100.919071-1-tiwai@suse.de
2026-08-03Merge branch 'for-linus' into for-nextTakashi Iwai
Pull 7.2 devel branch for put_device auto-clean fixes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-08-03ALSA: hda/tas2781: fix ACPI reference handlingXu Rao
tas2781_read_acpi() gets a reference to the matching ACPI device and then looks up its first physical device node. After taking a reference to the physical device, it immediately drops the ACPI device reference. However, every later failure jumps to an error path that drops the ACPI device reference a second time. This unbalances the reference count and may prematurely release the ACPI device. In addition, acpi_get_first_physical_node() may return NULL. Without a check, the driver passes the NULL physical device to the property helper calls and may dereference it. Return -ENODEV when no physical device is associated with the ACPI node, and remove the duplicate acpi_dev_put() from the common error path. Fixes: bb5f86ea50ff ("ALSA: hda/tas2781: Add tas2781 hda SPI driver") Cc: stable@vger.kernel.org Signed-off-by: Xu Rao <raoxu@uniontech.com> Link: https://patch.msgid.link/97EA8F29DA0D9AF7+20260731033554.949564-1-raoxu@uniontech.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-07-31ALSA: hda: cs35l56: Use auto-cleanup for firmware loadingTakashi Iwai
Simplify the code to manage the firmware loading with auto-cleanup. By the use of __free(firmware), we can replace the manual mutex locks with guard() gracefully, too. Only the code refactoring, no functional changes. Cc: patches@opensource.cirrus.com Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260729083735.120219-7-tiwai@suse.de
2026-07-31ALSA: hda: cs35l41: Use auto-cleanup for firmware loadingTakashi Iwai
Simplify the code to manage the firmware loading with auto-cleanup with __free(firmware). A NULL clear is added at cs35l41_request_firmware_file() for avoiding the double-free. Note that the driver still keeps a few manual firmware releases because it retries with different firmware files when one of firmware pairs fails. Only the code refactoring, no functional changes. Cc: patches@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260729083735.120219-6-tiwai@suse.de
2026-07-30ALSA: hda/realtek: enable AW88399 on Lenovo Legion ProMarco Giunta
Enable audio output through the AW88399 woofer amplifiers on Lenovo Legion laptops by adding the necessary Realtek ALC287 fixups and AW88399 per-model quirks. Realtek fixups (alc269.c): * ALC287_FIXUP_AW88399_I2C_2: registers the AW88399 as a two-instance I2C companion codec using comp_generic_fixup, matching ACPI HID "AWDZ8399". * ALC287_FIXUP_LENOVO_LEGION_AW88399: forces DAC 0x02 for the bass speaker pin 0x17, as the default DAC 0x06 lacks volume controls. Also applies internal microphone boost calibration via alc269_fixup_limit_int_mic_boost and disables unused pin 0x1d to match the Windows driver's pin configuration. Chained to ALC287_FIXUP_AW88399_I2C_2. Per-model quirks (aw88399_hda.c): * Channel swap: the I2C wiring on these Legion models is reversed (0x34 is physically the right speaker, 0x35 is the left). The quirk swaps the channel assignment to correct L/R audio. * BSTS status bypass: the AW88399's boost-finished status bit (BSTS, SYSST register bit 9) does not reliably assert on this hardware. Register dumps during normal playback show both amplifiers reporting BSTS=0 on both channels despite clean audio output. The quirk sets the bsts_unreliable flag, introduced in commit b4530a3e4895 ("ASoC: aw88399: add per-instance BSTS status bypass flag"), so the startup status check skips the BSTS requirement on these devices. The R9000P ADR10 entries use HDA_CODEC_QUIRK and are placed before the existing SND_PCI_QUIRK for 17aa:38bb (Yoga S780-14.5 Air) to ensure the codec SSID match takes priority over the shared PCI SSID, following the pattern established by e.g. commit 0f3a822ae225 ("ALSA: hda/realtek: Fix quirk matching for Legion Pro 7"), commit dd074f04e046 ("ALSA: hda/realtek: Fix Legion 7 16ITHG6 speaker amp binding"). All other entries also use HDA_CODEC_QUIRK for consistency. Supported models (Lenovo vendor ID 0x17aa): * 0x3906: Legion Pro 7i 16IAX10H / Y9000P IAX10 (Intel) * 0x3907: Legion Pro 7i 16IAX10H / Y9000P IAX10 (Intel) * 0x3927: Legion R9000P ADR10 (AMD) * 0x3928: Legion R9000P ADR10 (AMD) * 0x3938: Legion Pro 7 16AFR10H (AMD) * 0x3939: Legion Pro 7 16AFR10H (AMD) Tested-by: Nadim Kobeissi <nadim@symbolic.software> Tested-by: Xia Yun'an <imitoy@imitoy.top> Tested-by: Munzir Taha <munzirtaha@gmail.com> Co-developed-by: Yakov Till <yakov.till@gmail.com> Signed-off-by: Yakov Till <yakov.till@gmail.com> Signed-off-by: Marco Giunta <marco_giunta@outlook.it> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/DS7PR19MB7724ACD7C8D1BE71451E1AEEFCCA2@DS7PR19MB7724.namprd19.prod.outlook.com
2026-07-30ALSA: hda/scodec: add AW88399 HDA side codec driverMarco Giunta
Add an HDA side codec driver for the AWINIC AW88399 smart amplifier, enabling its use as a companion amplifier on HDA systems where the chip is connected via I2C to the host and driven alongside a primary HDA codec (such as Realtek ALC287). The driver is structured after the existing side codec drivers: * aw88399_hda_i2c.c: I2C bus driver matching ACPI HID "AWDZ8399" and serial-multi-instantiate device name "aw88399-hda". Creates the regmap and passes it to the shared probe function, following the CS35L41/CS35L56/TAS2781 pattern. * aw88399_hda.c: Core driver implementing HDA component binding, playback hooks (using the shared library's start/stop functions), ACPI subsystem ID retrieval, and runtime/system power management. Includes per-model quirk infrastructure using ACPI subsystem ID matching; the quirk table is empty in this patch and populated in the next patch along with the corresponding Realtek fixups that activate the driver. The driver includes <sound/aw88399.h> for shared definitions and depends on SND_SOC_AW88399_LIB for chip initialization, firmware loading, and playback control, avoiding any dependency on the full ASoC codec module. Tested-by: Nadim Kobeissi <nadim@symbolic.software> Tested-by: Xia Yun'an <imitoy@imitoy.top> Tested-by: Munzir Taha <munzirtaha@gmail.com> Co-developed-by: Yakov Till <yakov.till@gmail.com> Signed-off-by: Yakov Till <yakov.till@gmail.com> Signed-off-by: Marco Giunta <marco_giunta@outlook.it> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/DS7PR19MB77247D67E739956AA4611ACEFCCA2@DS7PR19MB7724.namprd19.prod.outlook.com
2026-07-20ALSA: hda/tas2781: clear cali_data.total_sz when calibration read failsPhilipp Oster
tas2563_save_calibration() assigns cali_data.total_sz before it reads the per-device calibration data from EFI, but its error paths return without clearing it again. cali_data.cali_reg_array is left all zero, because the function returns before the register addresses are assigned. On the first playback tasdev_load_calibrated_data() does if (!data || !cali_data->total_sz) return; which passes, since total_sz is still non-zero. It then issues five 4-byte bulk writes to p->r0_reg, p->r0_low_reg, p->invr0_reg, p->pow_reg and p->tlimit_reg, all of which are 0. Register 0 decodes to book 0 / page 0 / register 0x00, so the auto-incrementing block write zeroes registers 0x00 to 0x03. Register 0x03 is PB_CFG1, which holds AMP_LEVEL, so the amplifier gain is set to its minimum and the speaker stays silent. This is reproducible on a Lenovo Yoga 7 14ARB7 (two TAS2563 on I2C, ACPI INT8866) whose factory calibration was never written to UEFI, so the EFI read fails with EFI_NOT_FOUND. The two woofers driven by the amplifiers are silent while the tweeters driven directly by the ALC287 play. Reading the amplifier registers over i2c shows PWR_CTL = 0x00 (active) and the TDM slots correctly programmed by the RCA profile, but PB_CFG1 = 0x00. With this change PB_CFG1 keeps its power-on default of 0x20 and both woofers play. tas2781_save_calibration() in tas2781_hda.c already clears total_sz on failure; do the same for the TAS2563 variant. Signed-off-by: Philipp Oster <philippdev5396@outlook.de> Link: https://patch.msgid.link/20260720-tas2781-calfix-v1-1-3a5fa6ad90bc@outlook.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-07-15ALSA: hda: cs35l41: validate and free ACPI mute objectGuangshuo Li
cs35l41_get_acpi_mute_state() evaluates a _DSM method to get the ACPI mute state and reads the first byte from the returned object. However, the returned ACPI object is owned by the caller and is never freed after use, so each successful query leaks the _DSM result object. The code also assumes that the returned object is a buffer with at least one byte. A malformed firmware response can return a different object type or an empty buffer, and the direct ret->buffer.pointer dereference can then access an invalid pointer. Use the typed _DSM helper, validate that the returned buffer contains at least one byte, and free the ACPI object after reading it. Fixes: 447106e92a0c ("ALSA: hda: cs35l41: Support mute notifications for CS35L41 HDA") Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com> Link: https://patch.msgid.link/20260708113625.752913-1-lgs201920130244@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-07-13ALSA: hda: cs35l56: Fail if wmfw file is missingRichard Fitzgerald
Fail cs35l56_hda_fw_load() and log an error if it didn't find a wmfw file and the BIOS didn't patch the firmware already. Also remove a section of code from cs35l56_hda_request_firmware_files() that attempted to find a .bin if a .wmfw was not found. The CS35L56 ROM can only provide default audio in SoundWire mode. A wmfw is needed to enable I2S audio. Also none of the customer-specific .bin files are compatible with the ROM firmware. So a .wmfw file is always required. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260709161211.686498-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-07-09ALSA: hda/cirrus_scodec: Make Kconfig visible if KUNITRichard Fitzgerald
Make the Kconfig item for cirrus_scodec visible if CONFIG_KUNIT is enabled. This is so that its KUnit test can be enabled by KUnit scripts without requiring a large amount of irrelevant additional components. The general rule for KUNIT_ALL_TESTS is that it should only enable tests for components that are already selected. However, the UML environment does not support ACPI, which means the HDA codec drivers that use cirrus_scodec cannot be selected. But cirrus_scodec does not need ACPI. By making the Kconfig option visible if CONFIG_KUNIT, the KUnit test can be enabled with only the minimal set of functionality that is required for cirrus_scodec. This is still compliant with the KUNIT_ALL_TESTS rule "only tests for enabled modules" because by default cirrus_scodec will only be enabled if the drivers that use it are enabled. It must be intentionally enabled to force it to be included for testing. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260709121224.614350-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-07-03Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c ↵Uwe Kleine-König (The Capable Hub)
files) Replace the #include of <linux/mod_devicetable.h> by the more specific <linux/device-id/*.h> where applicable. For most cases the include can be dropped completely, only a few drivers need one or two headers added. Acked-by: Danilo Krummrich <dakr@kernel.org> Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/1a3f2007c5c5dcf555c09a4035ce3ae8ef1b6c49.1782808461.git.u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
2026-06-25ALSA: hda: Add Lenovo Legion 7i 16IAX7 17AA3874 quirkKamlesh Chhetty
Lenovo Legion 7i 16IAX7 systems with Realtek ALC287 codec SSID 17aa:3874 and CSC3551/CS35L41 speaker amps do not provide the required CS35L41 _DSD properties in ACPI. Without a quirk, cs35l41-hda fails probing the amps with missing cirrus,dev-index / Platform not supported errors, leaving the built-in speakers silent. This model is similar to the already-supported 17AA386F Legion 7i 16IAX7 variant. Add the Realtek ALC287 quirk to select ALC287_FIXUP_CS35L41_I2C_2 and add 17AA3874 to the CS35L41 property table using the same two-amp external-boost configuration. Tested on a Lenovo Legion 7 16IAX7 with Ubuntu 7.0.0-22-generic. Both CSC3551 CS35L41 amps probe and bind, firmware loads, calibration applies, built-in speaker playback works, and the cirrus,dev-index failure is gone. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221663 Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2157060 Signed-off-by: Kamlesh Chhetty <kamleshkc2002@gmail.com> Link: https://patch.msgid.link/20260622172247.19301-1-kamleshkc2002@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-06-15Merge tag 'asoc-v7.2' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v7.2 There's been quite a lot of framework improvements this time around, though mainly cleanups and robustness rather than user visible features. The same pattern is seen with a lot of the driver work that's going on, there are new features but a huge proportion of this is bug fixing and cleanup work. We also have a good selectio of new device support. - Improvements to SDCA jack handling from Charles Keepax. - Use of device links to make suspend handling more robust from Richard Fitzgerald. - Use of a new helper to factor out a common pattern in SoundWire enmeration from Charles Keepax. - Slimming down of the component from Kuninori Morimoto. - Simplification of format auto selection from Kuninori Morimoto. - Lots of conversions to guard() from Bui Duc Phuc. - Addition of a simple-amplifier driver supporting more featureful GPIO controller amplifiers than the previous basic driver from Herve Codina. - Support for AMD ACP 7.x, Cirrus Logic CS42448/CS42888, Everest Semi ES9356, Mediatek MT2701 and MT8196, Renesas RZ/G3E, Spacemit K3, Texas Instruments TAC5xx2 and TAS67524.
2026-06-10ALSA: hda/tas2781: Fix device-0 reset issue and handle -EXDEV in block data ↵Baojun Xu
processing Fix reset for device-0:‌ In older projects (e.g., Merino), the hardware reset pin for the first SPI device (device-0) is ineffective, causing initialization failures. Added a software reset sequence for device-0 to ensure proper initialization. ‌Handle -EXDEV correctly:‌ When processing block data, if the data does not belong to the current SPI device, the driver returned -EXDEV. This error code is now ignored to allow the driver to continue iterating through the block data and correctly calculate the total block size. Signed-off-by: Baojun Xu <baojun.xu@ti.com> Link: https://patch.msgid.link/20260609105253.19510-1-baojun.xu@ti.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-06-01ASoC: nau8822: add support for supply regulatorsMark Brown
Alexey Charkov <alchark@flipper.net> says: The Nuvoton NAU8822 codec has four power supply pins: VDDA, VDDB, VDDC and VDDSPK, which must be online and stable before the device can be accessed over I2C. On boards where these rails are software-controlled, probing the codec before the regulators are up results in -ENXIO errors during register access. This short series adds optional regulator support to both the device tree binding and the driver, so platforms that need explicit power sequencing can describe and enforce it: Link: https://patch.msgid.link/20260525-nau8822-reg-v2-0-7d37ae393e46@flipper.net
2026-05-31ALSA: hda/tas2781: Fix spelling mistake: "Froce" -. "Force"Colin Ian King
There is a spelling mistake in a snprintf statement. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://patch.msgid.link/20260531101339.42155-1-colin.i.king@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-05-27ALSA: hda: cs35l41: imply SERIAL_MULTI_INSTANTIATEJohny Lin
Use a weak reverse selection to suggest the config SERIAL_MULTI_INSTANTIATE just like cs35l56 did. Signed-off-by: Johny Lin <johnylin@google.com> Link: https://patch.msgid.link/20260527023350.3067547-1-johnylin@google.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-05-25Merge branch 'for-linus' into for-nextTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-05-25ALSA: hda: cs35l56: Fix system name string leaksCássio Gabriel
cs35l56_hda_read_acpi() gets an allocated ACPI _SUB string from acpi_get_subsystem_id(). On success, that string is used to create the firmware system name. Several error paths after the _SUB lookup can return without releasing the allocated string. This includes speaker ID lookup errors other than -ENOENT, and errors after a firmware system name has been allocated. Use scoped cleanup for the temporary _SUB string and make cs35l56->system_name device-managed. This releases the temporary _SUB string on every error path and lets devres release the firmware system name on probe failure and device removal. Fixes: 6f03b446cbae ("ALSA: hda: cs35l56: Add support for speaker id") Fixes: 40b1c2f9b299 ("ALSA: hda/cs35l56: Workaround bad dev-index on Lenovo Yoga Book 9i GenX") Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260522-alsa-cs35l56-system-name-leak-v4-1-a6154dd09cd9@gmail.com
2026-05-21ASoC: Rework initialization of i2c_device_idsMark Brown
Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> says: This series is a preparation for diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 23ff24080dfd..aebd3a5e90af 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -477,7 +477,11 @@ struct rpmsg_device_id { struct i2c_device_id { char name[I2C_NAME_SIZE]; - kernel_ulong_t driver_data; /* Data private to the driver */ + union { + /* Data private to the driver */ + kernel_ulong_t driver_data; + const void *driver_data_ptr; + }; }; /* pci_epf */ and this requires that .driver_data is assigned via a named initializer for static data. This requirement isn't a bad one because named initializers are also much better readable than list initializers. The union added to struct i2c_device_id enables further cleanups like: diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 8a082ff034dd..b2aac7348d22 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -1429,7 +1429,7 @@ static int kxcjk1013_probe(struct i2c_client *client) if (id) { name = id->name; - data->info = (const struct kx_chipset_info *)(id->driver_data); + data->info = id->driver_data_ptr; } else { name = iio_get_acpi_device_name_and_data(&client->dev, &ddata); data->info = ddata; @@ -1630,11 +1630,11 @@ static const struct dev_pm_ops kxcjk1013_pm_ops = { }; static const struct i2c_device_id kxcjk1013_id[] = { - { .name = "kxcjk1013", .driver_data = (kernel_ulong_t)&kxcjk1013_info }, - { .name = "kxcj91008", .driver_data = (kernel_ulong_t)&kxcj91008_info }, - { .name = "kxtj21009", .driver_data = (kernel_ulong_t)&kxtj21009_info }, - { .name = "kxtf9", .driver_data = (kernel_ulong_t)&kxtf9_info }, - { .name = "kx023-1025", .driver_data = (kernel_ulong_t)&kx0231025_info }, + { .name = "kxcjk1013", .driver_data_ptr = &kxcjk1013_info }, + { .name = "kxcj91008", .driver_data_ptr = &kxcj91008_info }, + { .name = "kxtj21009", .driver_data_ptr = &kxtj21009_info }, + { .name = "kxtf9", .driver_data_ptr = &kxtf9_info }, + { .name = "kx023-1025", .driver_data_ptr = &kx0231025_info }, { } }; MODULE_DEVICE_TABLE(i2c, kxcjk1013_id); that are an improvement for readability (again!) and it keeps some properties of the pointers (here: being const) without having to pay attention for that. (I didn't find a good example in sound/soc, so an iio driver was used to demonstrate the gain.) My additional motivation for this effort is CHERI[1]. This is a hardware extension that uses 128 bit pointers but unsigned long is still 64 bit. So with CHERI you cannot store pointers in unsigned long variables. The first patch drops a few empty remove callbacks that I found while working on patch #2. The second converts all hwmon drivers to use named initializers. Link: https://patch.msgid.link/cover.1778692164.git.u.kleine-koenig@baylibre.com
2026-05-21ASoC: Use named initializers for arrays of i2c_device_dataUwe Kleine-König (The Capable Hub)
While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition. The mentioned robustness is relevant for a planned change to struct i2c_device_id that replaces .driver_data by an anonymous union. While touching all these arrays, unify indention and usage of commas. This patch doesn't modify the compiled arrays, only their representation in source form benefits. The former was confirmed with x86 and arm64 builds. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/ae2ff4898eb340bd8bcafb7b75443eb4a0ce3e76.1778692164.git.u.kleine-koenig@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-15ALSA: hda/cs35l41: Fix firmware load work teardownCássio Gabriel
cs35l41_hda creates ALSA controls whose private data points at the cs35l41_hda object. The firmware load control can also queue fw_load_work. Those controls are not removed on component unbind, and device remove only cancels fw_load_work through cs35l41_remove_dsp(). That helper is skipped when halo_initialized is false. With firmware_autostart disabled, a firmware load can be requested before the DSP has been initialized. If the component or device is removed before the queued work runs, the worker can run after teardown and dereference driver state that is no longer valid. Track the created controls and remove them on unbind so no new control callback can reach the driver data or queue more work. Then cancel fw_load_work to drain any request that was already queued. Also cancel the work unconditionally during device remove before runtime PM teardown. Fixes: 47ceabd99a28 ("ALSA: hda: cs35l41: Support Firmware switching and reloading") Fixes: 4c870513fbb0 ("ALSA: hda: cs35l41: Add read-only ALSA control for forced mute") Cc: stable@vger.kernel.org Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com> Reviewed-by: Stefan Binding <sbinding@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260511-alsa-hda-cs35l41-fw-work-teardown-v1-1-1184e9bc4f25@gmail.com
2026-05-15Merge branch 'for-linus' into for-nextTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-05-15ALSA: hda/cs35l56: Drop malformed default N from KconfigAndy Shevchenko
First of all, it has to be 'default n' (small letter n), otherwise it looks for CONFIG_N which is absent and in case of appearance will enable something unrelated. Second and most important is that 'n' *is* the default 'default' already. Hence just drop malformed line. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260513162758.365972-1-andriy.shevchenko@linux.intel.com
2026-05-07ALSA: hda: cs35l41: Put ACPI device on missing physical nodeShuhao Fu
acpi_dev_get_first_match_dev() returns a refcounted ACPI device and callers must balance it with acpi_dev_put(). cs35l41_hda_read_acpi() stores the returned ACPI device in cs35l41->dacpi. That reference is normally released by the later probe cleanup or the remove path, but the NULL-check on physdev exits before either of those paths can run. Drop the lookup reference before returning -ENODEV. Fixes: c34b04cc6178 ("ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_hda_read_acpi()") Signed-off-by: Shuhao Fu <sfual@cse.ust.hk> Tested-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260428081238.GA1659932@chcpu16
2026-05-07ALSA: hda: cs35l56: Put ACPI device after setting companionShuhao Fu
acpi_dev_get_first_match_dev() returns a refcounted ACPI device and callers are expected to balance it with acpi_dev_put(). When no companion is already attached, cs35l56_hda_read_acpi() looks up an ACPI device and sets it with ACPI_COMPANION_SET(), but leaves the lookup reference held. ACPI_COMPANION_SET() does not take ownership of that reference, so drop it with acpi_dev_put() after attaching the companion. Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier") Signed-off-by: Shuhao Fu <sfual@cse.ust.hk> Tested-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260428080139.GA1649104@chcpu16
2026-05-06ALSA: hda/tas2781: Cancel async firmware request at unbindCássio Gabriel
TAS2781 HDA I2C and SPI queue RCA firmware loading from component bind with request_firmware_nowait(). The firmware loader keeps the callback module pinned and holds a device reference, but the callback still uses driver-private HDA state. Component unbind removes controls and DSP state immediately. Later device removal tears down the TAS2781 private data, including codec_lock. If the async firmware callback runs after unbind has started, it can operate on state that is being torn down. Cancel or synchronize the async firmware request before removing controls and DSP state. A queued callback is cancelled, and an already-running callback is allowed to finish before unbind continues. Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Fixes: bb5f86ea50ff ("ALSA: hda/tas2781: Add tas2781 hda SPI driver") Cc: stable@vger.kernel.org Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Acked-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260505-alsa-hda-tas2781-fw-callback-teardown-v4-2-e7c4bf930dc8@gmail.com
2026-04-29ALSA: hda/tas2781: Fix incorrect bit update for non-book-zero or book 0 pages >1Shenghao Ding
In TAS2781 SPI mode, when accessing non-book-zero or page numbers greater than 1 in book 0, an additional byte must be read. The first byte in such cases is a dummy byte and should be ignored. Fixes: 9fa6a693ad8d ("ALSA: hda/tas2781: Remove tas2781_spi_fwlib.c and leverage SND_SOC_TAS2781_FMWLIB") Signed-off-by: Shenghao Ding <shenghao-ding@ti.com> Link: https://patch.msgid.link/20260429054206.429-1-shenghao-ding@ti.com Signed-off-by: Takashi Iwai <tiwai@suse.de>