summaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)Author
2026-03-10ALSA: aoa: Skip devices with no codecs in i2sbus_resume()Thorsten Blum
In i2sbus_resume(), skip devices with an empty codec list, which avoids using an uninitialized 'sysclock_factor' in the 32-bit format path in i2sbus_pcm_prepare(). In i2sbus_pcm_prepare(), replace two list_for_each_entry() loops with a single list_first_entry() now that the codec list is guaranteed to be non-empty by all callers. Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa") Cc: stable@vger.kernel.org Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://patch.msgid.link/20260310102921.210109-3-thorsten.blum@linux.dev Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-10ASoC: SOF: sof-audio: pcm_id is __le32Ben Dooks
The pcm_id value is __le32 so convert it before passing to the dev_dbg function to be printed. Also fixup some other uses of __le32 data and a couple of places where %u should have been used instead of %d Picked up by sparse prototype for variadic and printf function checking. Fixes a large number of sparse warnings, such as: sound/soc/sof/pcm.c:84:25: warning: incorrect type in argument 4 (different base types) sound/soc/sof/pcm.c:84:25: expected unsigned int sound/soc/sof/pcm.c:84:25: got restricted __le32 [usertype] pcm_id Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://patch.msgid.link/20260310125106.178944-1-ben.dooks@codethink.co.uk Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: wm_adsp: Combine some similar code in firmware file searchRichard Fitzgerald
In wm_adsp_request_firmware_files() squash the if (system_name && suffix) and the following if (system_name) blocks together. This removes some duplicated code. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260310141817.1871794-11-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: wm_adsp: Use a struct to pass around firmware struct and filenameRichard Fitzgerald
Bundle the pointers to struct firmware and its filename into a new struct wm_adsp_fw_files. This simplifies passing these pointers around. Changes are also needed to the test cases in wm_adsp_fw_find_test.c that use this API. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260310141817.1871794-10-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: wm_adsp: Add KUnit test cases for '/' in firmware filenamesRichard Fitzgerald
Add test cases that '/' in the system name or ALSA prefix are converted to '-' in the firmware filename. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260310141817.1871794-9-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: wm_adsp: Convert '/' to '-' when normalizing firmware filenamesRichard Fitzgerald
Don't preserve '/' in firmware filename fields - convert it to '-' like other punctuation characters. The code originally normalized the entire string, including the directory prefix. To prevent breaking the directory it had to preserve '/' characters in the name, but this meant that the system name and ALSA prefix must not contain those characters. It's trivial to skip the directory name prefix and start the normalization after it, and that means the normalization does not need to make a special case for '/'. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260310141817.1871794-8-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: wm_adsp: Use consistent error checks in wm_adsp_request_firmware_files()Richard Fitzgerald
Use a consistent pattern of error checking in wm_adsp_request_firmware_files(). - The integer return value of wm_adsp_request_firmware_file() reports unrecoverable errors, for example -ENOMEM. - A NULL struct firmware pointer is a valid result. This not an error, not all DSPs require both files, some may not require any files. Previously wm_adsp_request_firmware_files() was using a mix of checking the return value and checking the struct firmware pointer to determine whether a file was found. It wasn't checking for unrecoverable errors. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260310141817.1871794-7-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: wm_adsp: Remove duplicated code to find firmware fileRichard Fitzgerald
The 3rd search case in wm_adsp_request_firmware_files() does exactly the same bin file searches as the case immediately above it. Merge the conditional from the 3rd case into the second case so the duplicated code can be removed. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260310141817.1871794-6-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: wm_adsp: Add kunit test for firmware file searchRichard Fitzgerald
Add KUnit testing of the wm_adsp code that searches for firmware files. Also make the SND_SOC_WM_ADSP Kconfig symbol visible if KUNIT is enabled so that wm_adsp can be manually included for KUnit testing. The firmware filename is composed of several fields, some of which are optional, and there is a search algorithm to fallback from specific to generic versions of firmware for a device. This KUnit test verifies that wm_adsp is searching for the correct sequence of filenames. The are two ways of testing this, and both are used in this KUnit test. 1. Trap the calls to firmware_request_nowarn() and test that the sequence of filenames request is correct. This is the most thorough test because it proves that exactly the expected filenames are requested, in the correct order. But it doesn't fully cover regression testing. If a change to the search algorithm changes the expected sequence of requested files, the test must also be changed to expect that new sequence. If the expectation is wrong, the tests can pass (because the search order is as expected) while picking a different file in some cases from what it did before the change. 2. Test which file is picked from a simulated directory of files. This is better for regression testing because it is independent of the search algorithm. It does not need to change if the search algorithm changes. It is not testing exactly which files the algorithm searches for, only which file it eventually picks from a given set of available files. In other words, the regression test is: does it still pick the same file from the same directory of files? But it is impractical for thorough testing. It doesn't prove that exactly the correct files were searched for, unless it was to test with every possible combination of file names and directory content that could ever exist. Clearly this is impossible to implement, since the number of combations of possible valid filenames in a directory and number of files in a directory is astronomically large. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260310141817.1871794-5-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: wm_adsp: Export function for KUnit test to get firmware filenamesRichard Fitzgerald
Export a function that KUnit tests can use to get the firmware filenames from the wm_adsp_fw[] array. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260310141817.1871794-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: wm_adsp: Add KUnit redirection stubs for firmware file searchRichard Fitzgerald
Make some of the firmware file search functions redirectable for KUnit testing. - The call to firmware_request_nowarn() is factored out into a wrapper function so that it can be redirected. - wm_adsp_request_firmware_files() and wm_adsp_release_firmware_files() are made visible and exported if KUNIT is enabled. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260310141817.1871794-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: wm_adsp: Remove unused argument to wm_adsp_release_firmware_files()Richard Fitzgerald
The dsp argument to wm_adsp_release_firmware_files() isn't used so remove it. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260310141817.1871794-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: fsl_xcvr: add bitcount and timestamp controlsShengjiu Wang
The transmitter and receiver implement separate timestamp counters and bit counters. The bit counter increments at the end of each bit in a frame whenever the transmitter or receiver is enabled. The bit counter can be reset by software. The timestamp counter increments on the bus interface clock whenever it is enabled. The current value of the timestamp counter is latched whenever the bit counter increments. Reading the bit counter register will cause the latched timestamp value to be saved in the bit counter timestamp register. The timestamp counter can be reset by software, this also resets the latched timestamp value and the bit counter timestamp register. The timestamp counter and bit counter can be used by software to track the progress of the transmitter and receiver. It can also be used to calculate the relative frequency of the bit clock against the bus interface clock. As there are three regmap handlers defined in this driver, explicitly call the snd_soc_component_init_regmap() to init regmap handler for the component. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/20260310104235.1234569-4-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: fsl_sai: add bitcount and timestamp controlsShengjiu Wang
The transmitter and receiver implement separate timestamp counters and bit counters. The bit counter increments at the end of each bit in a frame whenever the transmitter or receiver is enabled. The bit counter can be reset by software. The timestamp counter increments on the bus interface clock whenever it is enabled. The current value of the timestamp counter is latched whenever the bit counter increments. Reading the bit counter register will cause the latched timestamp value to be saved in the bit counter timestamp register. The timestamp counter can be reset by software, this also resets the latched timestamp value and the bit counter timestamp register. The timestamp counter and bit counter can be used by software to track the progress of the transmitter and receiver. It can also be used to calculate the relative frequency of the bit clock against the bus interface clock. These bitcount and timestamp registers are volatile, and supported when the module has timestamp features. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/20260310104235.1234569-3-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: fsl_utils: Add snd_kcontrol functions for specific casesShengjiu Wang
There are some registers which are volatile, at pm runtime suspend state, the regmap cache only is enabled, regmap will return -EBUSY when trying to access these registers. static int _regmap_read(struct regmap *map, unsigned int reg, unsigned int *val) { int ret; void *context = _regmap_map_get_context(map); if (!map->cache_bypass) { ret = regcache_read(map, reg, val); if (ret == 0) return 0; } if (map->cache_only) return -EBUSY; if (!regmap_readable(map, reg)) return -EIO; When exporting these registers by amixer interface to user space, there will be -EBUSY errors in mixer-test when the cpu dai is in idle. In order to avoid such error, needs to define FSL own functions to take a pm runtime reference before calling snd_soc_get_xr_sx(), snd_soc_get_enum_double(), snd_soc_get_volsw(), and so on. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/20260310104235.1234569-2-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: ti: davinci-mcasp: McASP code cleanup and clkMark Brown
Merge series from Sen Wang <sen@ti.com>: Just two minor patches that aim to tidy up the code a little bit, as well as fix the aux_div selection in davinci_mcasp_calc_clk_div() for mid-range dividers (33 <= div <= 4096). Sen Wang (2): ASoC: ti: davinci-mcasp: extract mcasp_is_auxclk_enabled() helper ASoC: ti: davinci-mcasp: improve aux_div selection for mid-range dividers sound/soc/ti/davinci-mcasp.c | 45 +++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 14 deletions(-) -- 2.43.0
2026-03-10ALSA: hda/senary: Fix beep error handling and optimize EAPD switchingwangdicheng
This patch addresses a potential state inconsistency bug and optimizes runtime performance: 1. Fix error handling in set_beep_amp(): Previously, beep_nid was assigned before adding kcontrols. If kcontrol creation failed, the function returned error but left beep_nid set, causing inconsistent driver state. Moved the assignment to the end of the function. 2. Optimize senary_auto_turn_eapd(): Removed the redundant snd_hda_query_pin_caps() check inside the loop. The target pins are sourced from spec->eapds, which is strictly filtered during the initial parse phase. Checking capabilities again during every mute/unmute hook is unnecessary overhead. Signed-off-by: wangdicheng <wangdicheng@kylinos.cn> Link: https://patch.msgid.link/20260310023649.155858-1-wangdich9700@163.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-10ALSA: usb-audio: Check endpoint numbers at parsing Scarlett2 mixer interfacesTakashi Iwai
The Scarlett2 mixer quirk in USB-audio driver may hit a NULL dereference when a malformed USB descriptor is passed, since it assumes the presence of an endpoint in the parsed interface in scarlett2_find_fc_interface(), as reported by fuzzer. For avoiding the NULL dereference, just add the sanity check of bNumEndpoints and skip the invalid interface. Reported-by: syzbot+8f29539ef9a1c8334f42@syzkaller.appspotmail.com Closes: https://lore.kernel.org/69acbbe1.050a0220.310d8.0001.GAE@google.com Reported-by: syzbot+ae893a8901067fde2741@syzkaller.appspotmail.com Closes: https://lore.kernel.org/69acf72a.050a0220.310d8.0004.GAE@google.com Cc: <stable@vger.kernel.org> Link: https://patch.msgid.link/20260309104632.141895-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-10ASoC: simple-card-utils: fix graph_util_is_ports0() for DT overlaysSen Wang
graph_util_is_ports0() identifies DPCM front-end (ports@0) vs back-end (ports@1) by calling of_get_child_by_name() to find the first "ports" child and comparing pointers. This relies on child iteration order matching DTS source order. When the DPCM topology comes from a DT overlay, __of_attach_node() inserts new children at the head of the sibling list, reversing the order. of_get_child_by_name() then returns ports@1 instead of ports@0, causing all front-end links to be classified as back-ends. The card registers with no PCM devices. Fix this by matching the unit address directly from the node name instead of relying on sibling order. Fixes: 92939252458f ("ASoC: simple-card-utils: add asoc_graph_is_ports0()") Signed-off-by: Sen Wang <sen@ti.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20260309042109.2576612-1-sen@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-10ASoC: tegra: Add Tegra238 sound card supportMark Brown
Merge series from "Sheetal ." <sheetal@nvidia.com>: Add Tegra238 sound card support in the Tegra audio graph card driver, as Tegra238 requires different PLLA and PLLA_OUT0 clock rates compared to other Tegra platforms.
2026-03-09Add support for CS42L43B codec to CS42L43 driverMark Brown
Merge series from Maciej Strozek <mstrozek@opensource.cirrus.com>: Introducing CS42L43B, a variant of the CS42L43 codec with changes to PDM (DMIC) inputs, RAM/ROM memory and extra channels to two SoundWire ports and ISRCs, and can be supported by the existing CS42L43 driver with some modifications.
2026-03-09ASoC: soc-core: flush delayed work before removing DAIs and widgetsmatteo.cotifava
When a sound card is unbound while a PCM stream is open, a use-after-free can occur in snd_soc_dapm_stream_event(), called from the close_delayed_work workqueue handler. During unbind, snd_soc_unbind_card() flushes delayed work and then calls soc_cleanup_card_resources(). Inside cleanup, snd_card_disconnect_sync() releases all PCM file descriptors, and the resulting PCM close path can call snd_soc_dapm_stream_stop() which schedules new delayed work with a pmdown_time timer delay. Since this happens after the flush in snd_soc_unbind_card(), the new work is not caught. soc_remove_link_components() then frees DAPM widgets before this work fires, leading to the use-after-free. The existing flush in soc_free_pcm_runtime() also cannot help as it runs after soc_remove_link_components() has already freed the widgets. Add a flush in soc_cleanup_card_resources() after snd_card_disconnect_sync() (after which no new PCM closes can schedule further delayed work) and before soc_remove_link_dais() and soc_remove_link_components() (which tear down the structures the delayed work accesses). Fixes: e894efef9ac7 ("ASoC: core: add support to card rebind") Signed-off-by: Matteo Cotifava <cotifavamatteo@gmail.com> Link: https://patch.msgid.link/20260309215412.545628-3-cotifavamatteo@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09ASoC: soc-core: drop delayed_work_pending() check before flushmatteo.cotifava
The delayed_work_pending() check before flush_delayed_work() in soc_free_pcm_runtime() is unnecessary and racy. flush_delayed_work() is safe to call unconditionally - it is a no-op when no work is pending. Remove the check. The original check was added by commit 9c9b65203492 ("ASoC: core: only flush inited work during free") but delayed_work_pending() followed by flush_delayed_work() has a time-of-check/time-of-use window where work can become pending between the two calls. Fixes: 9c9b65203492 ("ASoC: core: only flush inited work during free") Signed-off-by: Matteo Cotifava <cotifavamatteo@gmail.com> Link: https://patch.msgid.link/20260309215412.545628-2-cotifavamatteo@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09ASoC: codecs: wcd9335: Remove potential undefined behavior in ↵Josh Poimboeuf
wcd9335_slimbus_irq() If 'port_id' is negative, the shift counts in wcd9335_slimbus_irq() also become negative, resulting in undefined behavior due to shift out of bounds. That appears to be not possible, but with UBSAN enabled, Clang's range analysis isn't always able to determine that and generates undefined behavior. As a result the code generation isn't optimal, and undefined behavior should be avoided regardless. Improve code generation and remove the undefined behavior by converting the signed variables to unsigned. Fixes the following warning: sound/soc/codecs/wcd9335.o: warning: objtool: wcd9335_slimbus_irq() falls through to next function __cfi_wcd9335_set_channel_map() This is very similar to a previous fix to wcd934x with commit 060aed9c0093 ("objtool, ASoC: codecs: wcd934x: Remove potential undefined behavior in wcd934x_slim_irq_handler()"). Cc: Srinivas Kandagatla <srini@kernel.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Reported-by: Arnd Bergmann <arnd@arndb.de> Closes: https://lore.kernel.org/a426d669-58bb-4be1-9eaa-6f3d83109e2d@app.fastmail.com Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Link: https://patch.msgid.link/08dbb63519ef31a5457e07673b7b256fecb5989b.1773071992.git.jpoimboe@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09ASoC: wm_adsp: Make wm_adsp_fw_text[] constRichard Fitzgerald
Add the extra const to wm_adsp_fw_text[] to make the array data const. This array should have been const data but was missing the second const that is needed when declaring a const array of const pointers. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260309145310.1199583-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09ASoC: tegra: Add support for Tegra238 soundcardSheetal
Tegra238 platforms use different clock rates for plla and plla_out0 clocks. Add Tegra238 support in the Tegra sound card driver to apply specific clock configurations. Signed-off-by: Aditya Bavanari <abavanari@nvidia.com> Signed-off-by: Sheetal <sheetal@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Link: https://patch.msgid.link/20260303100249.3214529-3-sheetal@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09ASoC: codecs: peb2466: Change the +/- 6dB switch to a volumeChristophe Leroy (CS GROUP)
In addition to the digital volume adjustment, infineon peb2466 codec has an analog adjustment which can be set to either 0dB or +/-6dB. At the time being it is defined as a switch and appears in 'alsamixer' like a 'mute'. This adjustment isn't a mute, change it to a 'volume' with an associated dB range. With this change, this adjustment now appears in 'alsamixer' as a standard volume slider which can have two positions. Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org> Acked-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/418fe76d1c9efc8182ab57b6b426a8c723e025fe.1773056714.git.chleroy@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09ASoC: cs35l56-test: Remove pointless duplicate loop countersRichard Fitzgerald
In cs35l56_test_parse_xu_onchip_spkid() the first two loops used local i to index an array and num_gpios/num_pulls to count how many entries it had seen. But both i and num_* started at 0 and incremented on each loop so were identical. Remove i from these loops. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260309115651.1090368-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09ALSA: usb-audio: add Studio 1824 supportFrederic Popp
Adapt the already implemented support for the Studio 1824c audio interface to the predecessor Studio 1824. Basically just a change adding the different hardware ID in the relevant places. Tested as much as possible. All implemented functionality seemingly works. Signed-off-by: Frederic Popp <frederic.l.popp@t-online.de> Link: https://patch.msgid.link/20260308153334.50433-2-frederic.l.popp@t-online.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-09ASoC: cs42l43: Add support for the B variantMaciej Strozek
Introducing CS42L43B codec, a variant of CS42L43 which can be driven by the same driver. Changes in CS42L43 driver specific for CS42L43B: - Decimator 1 and 2 are dedicated to ADC, can't be selected for PDM - Decimators 3 and 4 are connected to PDM1 - Added Decimator 5 and 6 for PDM2 - Supports SoundWire Clock Gearing - Updated ROM requiring no patching - Reduced RAM space - Each ISRC has 4 decimators now Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20260306152829.3130530-5-mstrozek@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09ASoC: sdw_utils: Add CS42L43B codec infoMaciej Strozek
Add codec_info for a new variant of CS42L43. It can resue existing info but needs a new part_id. Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20260306152829.3130530-2-mstrozek@opensource.cirrus.com Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09ALSA: hda/realtek: Add headset jack quirk for Thinkpad X390Uzair Mughal
The Lenovo ThinkPad X390 (ALC257 codec, subsystem ID 0x17aa2288) does not report headset button press events. Headphone insertion is detected (SW_HEADPHONE_INSERT), but pressing the inline microphone button on a headset produces no input events. Add a SND_PCI_QUIRK entry that maps this subsystem ID to ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, which enables headset jack button detection through alc_fixup_headset_jack() and ThinkPad ACPI integration. This is the same fixup used by similar ThinkPad models (P1 Gen 3, X1 Extreme Gen 3). Signed-off-by: Uzair Mughal <contact@uzair.is-a.dev> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260307012906.20093-1-contact@uzair.is-a.dev
2026-03-09ALSA: hda/realtek: add HP Laptop 14s-dr5xxx mute LED quirkLiucheng Lu
HP Laptop 14s-dr5xxx with ALC236 codec does not handle the toggling of the mute LED. This patch adds a quirk entry for subsystem ID 0x8a1f using ALC236_FIXUP_HP_MUTE_LED_COEFBIT2 fixup, enabling correct mute LED behavior. Signed-off-by: Liucheng Lu <luliucheng100@outlook.com> Link: https://patch.msgid.link/PAVPR03MB9774F3FCE9CCD181C585281AE37BA@PAVPR03MB9774.eurprd03.prod.outlook.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-09ALSA: hda/realtek: add quirk for ASUS UM6702RCZhang Heng
The sound card of this machine cannot adjust the volume, it can only be 0 or 100%. The reason is that the DAC with pin 0x17 is connected to 0x06. Testing found that connecting 0x02 can fix this problem. Link: https://bugzilla.kernel.org/show_bug.cgi?id=220356 Signed-off-by: Zhang Heng <zhangheng@kylinos.cn> Link: https://patch.msgid.link/20260306123317.575346-1-zhangheng@kylinos.cn Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-09ALSA: pcm: fix use-after-free on linked stream runtime in snd_pcm_drain()Mehul Rao
In the drain loop, the local variable 'runtime' is reassigned to a linked stream's runtime (runtime = s->runtime at line 2157). After releasing the stream lock at line 2169, the code accesses runtime->no_period_wakeup, runtime->rate, and runtime->buffer_size (lines 2170-2178) — all referencing the linked stream's runtime without any lock or refcount protecting its lifetime. A concurrent close() on the linked stream's fd triggers snd_pcm_release_substream() → snd_pcm_drop() → pcm_release_private() → snd_pcm_unlink() → snd_pcm_detach_substream() → kfree(runtime). No synchronization prevents kfree(runtime) from completing while the drain path dereferences the stale pointer. Fix by caching the needed runtime fields (no_period_wakeup, rate, buffer_size) into local variables while still holding the stream lock, and using the cached values after the lock is released. Fixes: f2b3614cefb6 ("ALSA: PCM - Don't check DMA time-out too shortly") Cc: stable@vger.kernel.org Signed-off-by: Mehul Rao <mehulrao@gmail.com> Link: https://patch.msgid.link/20260305193508.311096-1-mehulrao@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-09ALSA: hda/realtek: Add quirk for Gigabyte Technology to fix headphoneZhang Heng
The BIOS of this machine has set 0x19 to mic, which needs to be set to headphone pin in order to work properly. Link: https://bugzilla.kernel.org/show_bug.cgi?id=220814 Signed-off-by: Zhang Heng <zhangheng@kylinos.cn> Link: https://patch.msgid.link/b55f6ebe-7449-49f7-ae85-00d2ba1e7af0@kylinos.cn Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-09ASoC: ti: davinci-mcasp: improve aux_div selection for mid-range dividersSen Wang
When the ideal total divider (sysclk/bclk) is between 33 and 4096 and AUXCLK is enabled, the driver computes aux_div as ceil(div/32) and then recomputes bclk_div from the truncated sysclk. This two-step integer division loses precision due to truncation and can sometimes produce PPM errors large enough for ALSA's hw_rule_format to reject otherwise valid sample formats. For example, on AM62D-EVM (auxclk-fs-ratio=2177, tdm-slots=2, fck=96 MHz), playing S16_LE at 44100 Hz gives BCLK = 1,411,200 Hz and an ideal total divider of 68. The old code picks aux_div = ceil(68/32) = 3, then bclk_div = (96005700/3) / 1411200 = 22, for a total of 3 x 22 = 66 -- two steps from ideal. The resulting error exceeds the PPM threshold and causes S16_LE, S24_LE to be rejected. Therefore when the total divider fits in the AHCLKXDIV register alone (<=4096), use it directly as aux_div with bclk_div=1, and compare floor and ceil to pick the closer match, to ensure the best ideal total dividers. Dividers at or below 32 never enter this path, and dividers above 4096 still fall through to the existing DIV_ROUND_UP path, so previously working configurations remains unaffected. Signed-off-by: Sen Wang <sen@ti.com> Link: https://patch.msgid.link/20260305195825.9998-3-sen@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09ASoC: ti: davinci-mcasp: extract mcasp_is_auxclk_enabled() helperSen Wang
Move the AUXCLK-enabled check out of davinci_mcasp_calc_clk_div() into a reusable helper. No functional change. Signed-off-by: Sen Wang <sen@ti.com> Link: https://patch.msgid.link/20260305195825.9998-2-sen@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09ASoC: qcom: qdsp6: Fix q6apm remove ordering during ADSP stop and startRavi Hothi
During ADSP stop and start, the kernel crashes due to the order in which ASoC components are removed. On ADSP stop, the q6apm-audio .remove callback unloads topology and removes PCM runtimes during ASoC teardown. This deletes the RTDs that contain the q6apm DAI components before their removal pass runs, leaving those components still linked to the card and causing crashes on the next rebind. Fix this by ensuring that all dependent (child) components are removed first, and the q6apm component is removed last. [ 48.105720] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0 [ 48.114763] Mem abort info: [ 48.117650] ESR = 0x0000000096000004 [ 48.121526] EC = 0x25: DABT (current EL), IL = 32 bits [ 48.127010] SET = 0, FnV = 0 [ 48.130172] EA = 0, S1PTW = 0 [ 48.133415] FSC = 0x04: level 0 translation fault [ 48.138446] Data abort info: [ 48.141422] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 [ 48.147079] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 [ 48.152354] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [ 48.157859] user pgtable: 4k pages, 48-bit VAs, pgdp=00000001173cf000 [ 48.164517] [00000000000000d0] pgd=0000000000000000, p4d=0000000000000000 [ 48.171530] Internal error: Oops: 0000000096000004 [#1] SMP [ 48.177348] Modules linked in: q6prm_clocks q6apm_lpass_dais q6apm_dai snd_q6dsp_common q6prm snd_q6apm 8021q garp mrp stp llc snd_soc_hdmi_codec apr pdr_interface phy_qcom_edp fastrpc qcom_pd_mapper rpmsg_ctrl qrtr_smd rpmsg_char qcom_pdr_msg qcom_iris v4l2_mem2mem videobuf2_dma_contig ath11k_pci msm ubwc_config at24 ath11k videobuf2_memops mac80211 ocmem videobuf2_v4l2 libarc4 drm_gpuvm mhi qrtr videodev drm_exec snd_soc_sc8280xp gpu_sched videobuf2_common nvmem_qcom_spmi_sdam snd_soc_qcom_sdw drm_dp_aux_bus qcom_q6v5_pas qcom_spmi_temp_alarm snd_soc_qcom_common rtc_pm8xxx qcom_pon drm_display_helper cec qcom_pil_info qcom_stats soundwire_bus drm_client_lib mc dispcc0_sa8775p videocc_sa8775p qcom_q6v5 camcc_sa8775p snd_soc_dmic phy_qcom_sgmii_eth snd_soc_max98357a i2c_qcom_geni snd_soc_core dwmac_qcom_ethqos llcc_qcom icc_bwmon qcom_sysmon snd_compress qcom_refgen_regulator coresight_stm stmmac_platform snd_pcm_dmaengine qcom_common coresight_tmc stmmac coresight_replicator qcom_glink_smem coresight_cti stm_core [ 48.177444] coresight_funnel snd_pcm ufs_qcom phy_qcom_qmp_usb gpi phy_qcom_snps_femto_v2 coresight phy_qcom_qmp_ufs qcom_wdt gpucc_sa8775p pcs_xpcs mdt_loader qcom_ice icc_osm_l3 qmi_helpers snd_timer snd soundcore display_connector qcom_rng nvmem_reboot_mode drm_kms_helper phy_qcom_qmp_pcie sha256 cfg80211 rfkill socinfo fuse drm backlight ipv6 [ 48.301059] CPU: 2 UID: 0 PID: 293 Comm: kworker/u32:2 Not tainted 6.19.0-rc6-dirty #10 PREEMPT [ 48.310081] Hardware name: Qualcomm Technologies, Inc. Lemans EVK (DT) [ 48.316782] Workqueue: pdr_notifier_wq pdr_notifier_work [pdr_interface] [ 48.323672] pstate: 20400005 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 48.330825] pc : mutex_lock+0xc/0x54 [ 48.334514] lr : soc_dapm_shutdown_dapm+0x44/0x174 [snd_soc_core] [ 48.340794] sp : ffff800084ddb7b0 [ 48.344207] x29: ffff800084ddb7b0 x28: ffff00009cd9cf30 x27: ffff00009cd9cc00 [ 48.351544] x26: ffff000099610190 x25: ffffa31d2f19c810 x24: ffffa31d2f185098 [ 48.358869] x23: ffff800084ddb7f8 x22: 0000000000000000 x21: 00000000000000d0 [ 48.366198] x20: ffff00009ba6c338 x19: ffff00009ba6c338 x18: 00000000ffffffff [ 48.373528] x17: 000000040044ffff x16: ffffa31d4ae6dca8 x15: 072007740775076f [ 48.380853] x14: 0765076d07690774 x13: 00313a323a656369 x12: 767265733a637673 [ 48.388182] x11: 00000000000003f9 x10: ffffa31d4c7dea98 x9 : 0000000000000001 [ 48.395519] x8 : ffff00009a2aadc0 x7 : 0000000000000003 x6 : 0000000000000000 [ 48.402854] x5 : 0000000000000000 x4 : 0000000000000028 x3 : ffff000ef397a698 [ 48.410180] x2 : ffff00009a2aadc0 x1 : 0000000000000000 x0 : 00000000000000d0 [ 48.417506] Call trace: [ 48.420025] mutex_lock+0xc/0x54 (P) [ 48.423712] snd_soc_dapm_shutdown+0x44/0xbc [snd_soc_core] [ 48.429447] soc_cleanup_card_resources+0x30/0x2c0 [snd_soc_core] [ 48.435719] snd_soc_bind_card+0x4dc/0xcc0 [snd_soc_core] [ 48.441278] snd_soc_add_component+0x27c/0x2c8 [snd_soc_core] [ 48.447192] snd_soc_register_component+0x9c/0xf4 [snd_soc_core] [ 48.453371] devm_snd_soc_register_component+0x64/0xc4 [snd_soc_core] [ 48.459994] apm_probe+0xb4/0x110 [snd_q6apm] [ 48.464479] apr_device_probe+0x24/0x40 [apr] [ 48.468964] really_probe+0xbc/0x298 [ 48.472651] __driver_probe_device+0x78/0x12c [ 48.477132] driver_probe_device+0x40/0x160 [ 48.481435] __device_attach_driver+0xb8/0x134 [ 48.486011] bus_for_each_drv+0x80/0xdc [ 48.489964] __device_attach+0xa8/0x1b0 [ 48.493916] device_initial_probe+0x50/0x54 [ 48.498219] bus_probe_device+0x38/0xa0 [ 48.502170] device_add+0x590/0x760 [ 48.505761] device_register+0x20/0x30 [ 48.509623] of_register_apr_devices+0x1d8/0x318 [apr] [ 48.514905] apr_pd_status+0x2c/0x54 [apr] [ 48.519114] pdr_notifier_work+0x8c/0xe0 [pdr_interface] [ 48.524570] process_one_work+0x150/0x294 [ 48.528692] worker_thread+0x2d8/0x3d8 [ 48.532551] kthread+0x130/0x204 [ 48.535874] ret_from_fork+0x10/0x20 [ 48.539559] Code: d65f03c0 d5384102 d503201f d2800001 (c8e17c02) [ 48.545823] ---[ end trace 0000000000000000 ]--- Fixes: 5477518b8a0e ("ASoC: qdsp6: audioreach: add q6apm support") Cc: stable@vger.kernel.org Signed-off-by: Ravi Hothi <ravi.hothi@oss.qualcomm.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20260227144534.278568-1-ravi.hothi@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-05ASoC: cs35l56: More KUnit tests for speaker IDMark Brown
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: The first 3 patches in this series add some more KUnit testing for fetching speaker ID and combining it with the system name to create part of the qualifier for a firmware filename. Patch #4 enables GPIOLIB in KUnit 'alltests' builds. This can be taken separately from the first 3 patches. The GPIO tests will skip if GPIOLIB is not enabled, but obviously it would be ideal for 'kunit.py --alltests' runs to include these new test cases.
2026-03-05ALSA: usb-audio: Refine string-descriptor-based quirk matchingRong Zhang
Remove snd_usb_get_string() and use the manufacturer and product strings stored in struct usb_device directly to match quirk table entries. Their NULLity can be checked to determine if the device has no these strings. This simplifies the code a lot. Meanwhile, allow quirk table entries to match "no string" explicitly, and add appropriate comments to show the expected usages of DEVICE_STRING_FLG() and VENDOR_STRING_FLG(). These changes are tiny and doesn't form another separate patch, so that back-and-forth changes can be avoided. Suggested-by: Terry Junge <linuxsound@cosmicgizmosystems.com> Link: https://lore.kernel.org/r/b59da54a-9c80-4212-a337-c5ea98da52d1@cosmicgizmosystems.com Signed-off-by: Rong Zhang <i@rong.moe> Link: https://patch.msgid.link/20260305174711.1106324-1-i@rong.moe Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-05Merge tag 'asoc-fix-v7.0-rc2' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v7.0 A moderately large pile of fixes, though none of them are super major, plus a few new quirks and device IDs.
2026-03-05ASoC: cs35l56: KUnit tests for reading speaker ID from host GPIOsRichard Fitzgerald
Add test cases for the spk-id-gpios property used to read an integer speaker ID value from a set of GPIO inputs. There is a single parameterized test function, cs35l56_shared_test_get_speaker_id_from_host_gpio() that does the following: - Create a mock GPIO driver to simulate real GPIO inputs. - Create an array of struct software_node_ref_args to provide the content of the spk-id-gpios property. Each entry is a reference to a GPIO on the mock GPIO driver. The GPIO indexes are taken from test case parameterization. - Create a software node containing the spk-id-gpios property and set this as the node of the pseudo codec driver device. - Call cs35l56_get_speaker_id() and assert that the returned value matches the expected value defined in the test case parameterization. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260304162402.1714759-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-05ASoC: cs35l56: Some KUnit testing of cs35l56_get_speaker_id()Richard Fitzgerald
Add some KUnit tests for cs35l56_get_speaker_id(). These only test the simpler cases of reading the speaker ID from cs_amp_get_vendor_spkid() or the "cirrus,speaker-id" property. The untested case is reading it from GPIOs, which would require a dummy implementation of a GPIO driver. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260304162402.1714759-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-05ASoC: cs35l56: KUnit tests for setting dsp.system_nameRichard Fitzgerald
Add KUnit tests for setting the dsp.system_name string. There are two sources of the string: 1. PCI SSID from struct snd_soc_card. 2. "cirrus,firmware-uid" property. Either of these can then be qualified by a speaker ID integer. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20260304162402.1714759-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-05ALSA: usb-audio: Use strings in struct usb_dev for manufacturer & coTakashi Iwai
The USB core already prepares the strings for manufacturer, product and serial number, and we don't have to extract the string at each time. Replace the manual usb_string() calls with the corresponding pointers in struct usb_dev as a code cleanup. Link: https://patch.msgid.link/20260305130426.975604-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-05ALSA: us122l: drop redundant interface referencesJohan Hovold
Driver core holds a reference to the USB interface and its parent USB device while the interface is bound to a driver and there is no need to take additional references unless the structures are needed after disconnect. Similarly, USB core holds a reference to all interfaces in the active configuration so there is no need for a driver to take a reference to a sibling interface only to release it at disconnect either. Drop the redundant references to reduce cargo culting, make it easier to spot drivers where extra references are needed, and reduce the risk of memory leaks when drivers fail to release them. Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260305111810.18688-1-johan@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-04ASoC: amd: yc: Add DMI quirk for ASUS EXPERTBOOK PM1503CDAZhang Heng
Add a DMI quirk for the ASUS EXPERTBOOK PM1503CDA fixing the issue where the internal microphone was not detected. Link: https://bugzilla.kernel.org/show_bug.cgi?id=221070 Cc: stable@vger.kernel.org Signed-off-by: Zhang Heng <zhangheng@kylinos.cn> Link: https://patch.msgid.link/20260304063255.139331-1-zhangheng@kylinos.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-04ALSA: hda/senary: Add hardware init verbs and fixup frameworkwangdicheng
Port the essential hardware initialization logic from the vendor driver and introduce the standard HDA fixup framework to handle different machine configurations. Key changes: 1. Add hardware init verbs: - Implement `senary_init_verb` to send the vendor-specific initialization sequence required by the SN6186 chip. - Override pin capabilities for Node 0x19 to ensure proper headset microphone support. 2. Introduce fixup framework: - Define a default pin configuration table (`senary_pincfg_default`) to provide a fallback for devices with invalid BIOS configurations. - Establish a quirk table structure for future machine-specific fixes. - Since the standard quirk matching relies on Subsystem IDs, we manually apply the default fixup if `snd_hda_pick_fixup` does not find a specific match. This ensures the chip is correctly initialized during probe and resume, and provides a scalable mechanism for supporting specific hardware quirks. Signed-off-by: wangdicheng <wangdicheng@kylinos.cn> Link: https://patch.msgid.link/20260304070219.450083-1-wangdich9700@163.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-03-04ALSA: usb-audio: Apply linear volume quirk on MV-SILICON devicesRong Zhang
MV-SILICON is a SoC manufacturer producing multifunctional audio SoCs. Many devices built on top of their SDK share a common quirk that the Playback and Capture mixers use linear volume with val = 0/4096/1. The SDK seems to always report "MV-SILICON" for manufacturer string. Hence, match it so that we don't need to define quirk table entries separately for each devices. The "val = 0/4096/1" pattern is also checked against before applying the quirk, in order that the quirk won't accidentally break unseen variants. Quirky device samples: usb 7-1: New USB device found, idVendor=1235, idProduct=0003, bcdDevice= 1.00 usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 7-1: Product: G1 usb 7-1: Manufacturer: MV-SILICON usb 7-1: SerialNumber: 20190808 usb 7-1: New USB device found, idVendor=1235, idProduct=0003, bcdDevice= 1.00 usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 7-1: Product: mvsilicon B1 usb audio usb 7-1: Manufacturer: MV-SILICON usb 7-1: SerialNumber: 20190808 usb 5-1.4: New USB device found, idVendor=8888, idProduct=1719, bcdDevice= 1.00 usb 5-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 5-1.4: Product: HF310 USB Audio usb 5-1.4: Manufacturer: MV-SILICON usb 5-1.4: SerialNumber: 20190808 usb 7-1: New USB device found, idVendor=2717, idProduct=5086, bcdDevice= 1.00 usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 7-1: Product: Redmi 电脑音箱 usb 7-1: Manufacturer: MV-SILICON usb 7-1: SerialNumber: 20190808 usb 2-1.2: New USB device found, idVendor=3142, idProduct=a601, bcdDevice= 1.00 usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 2-1.2: Product: fifine Microphone usb 2-1.2: Manufacturer: MV-SILICON usb 2-1.2: SerialNumber: 20190808 * https://forum.ubuntu-it.org/viewtopic.php?t=659345 Signed-off-by: Rong Zhang <i@rong.moe> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260303194805.266158-9-i@rong.moe