summaryrefslogtreecommitdiff
path: root/include/sound
AgeCommit message (Collapse)Author
10 hoursMerge branch 'headers' of git://git.infradead.org/users/willy/pagecache.gitMark Brown
# Conflicts: # drivers/gpu/drm/amd/amdkfd/kfd_migrate.c # net/ceph/osd_client.c
11 hoursMerge branch 'for-next' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
11 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
11 hoursMerge branch 'drm-next' of https://gitlab.freedesktop.org/drm/kernel.gitMark Brown
# Conflicts: # drivers/firmware/qcom/Kconfig # drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c # drivers/gpu/drm/vc4/vc4_v3d.c # drivers/soc/qcom/qcom-geni-se.c # rust/kernel/mem.rs
13 hoursMerge asoc/for-7.4 into asoc-nextMark Brown
18 hoursALSA: vmaster: Serialize hook registration with control callbacksCen Zhang
An HDA virtual-master hook must have its private argument initialized before a control callback can invoke it. snd_hda_add_vmaster_hook() installs the trampoline through snd_ctl_add_vmaster_hook(), which stores master->hook before master->hook_private_data without serialization. When a codec with a vmaster mute hook binds to an already registered card, snd_hda_gen_build_controls() publishes and initializes the Master Playback Switch before installing the hook. A native write that changes the switch can then run in the following order: 1. The codec bind path publishes and initializes the master control in __snd_hda_add_vmaster(), then calls snd_hda_add_vmaster_hook(). 2. The hook setter stores master->hook, but has not yet stored its private argument. 3. SNDRV_CTL_IOCTL_ELEM_WRITE takes controls_rwsem and calls master_put() while the setter remains between those stores. 4. master_put() sees the callback and invokes vmaster_hook() with a NULL argument. The trampoline dereferences it before the setter can complete publication. The write lock held by snd_ctl_elem_write() does not exclude the hook setter, so this can cause a NULL pointer dereference. Take the same controls_rwsem for writing inside snd_ctl_add_vmaster_hook() so the callback and its argument are installed together with respect to native control callbacks. Pass the card into the helper and update the HDA caller, keeping the lock in the ALSA core. Release it when registration returns, before the caller synchronizes the hook. KASAN report as below: Oops: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] CPU: 1 UID: 0 PID: 499 Comm: alsa-vmaster-tr Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #1 PREEMPT(lazy) Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:vmaster_hook+0x35/0xb0 Code: f5 53 48 89 fb 48 83 ec 08 e8 57 f0 9a fc eb 50 e8 50 f0 9a fc 48 8d 7b 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75 59 48 8d 7b 10 48 8b 43 08 48 ba 00 00 00 00 00 fc RSP: 0018:ffff888117647cd0 EFLAGS: 00010212 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff84e9ff50 RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000008 RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff89427457 R11: ffff888115ad1d00 R12: ffffffff84e9ff30 R13: ffff888114943ca0 R14: 0000000000000000 R15: 0000000000000001 FS: 00007fe8167b3780(0000) GS:ffff88826b7e3000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000557c8c2842a8 CR3: 000000011579f005 CR4: 0000000000770ef0 PKRU: 55555554 Call Trace: <TASK> master_put+0x20e/0x2b0 snd_ctl_elem_write+0x37f/0x5e0 snd_ctl_ioctl+0x997/0xdd0 ? __pfx_snd_ctl_ioctl+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? selinux_file_ioctl+0xaa/0x280 ? __pfx_snd_ctl_ioctl+0x10/0x10 __x64_sys_ioctl+0x163/0x1d0 do_syscall_64+0x115/0x6a0 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe8168c291b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007fffab0cb150 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fe8168c291b RDX: 00007fffab0cb310 RSI: 00000000c4c85513 RDI: 0000000000000003 RBP: 00007fffab0cb310 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fffab0cb1c0 R14: 0000000000000001 R15: 0000557c4f71fd10 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]--- Fixes: ee52e56e7b12 ("ALSA: hda - Fix mute-LED fixed mode") Signed-off-by: Cen Zhang <zzzccc427@gmail.com> Assisted-by: LLM Link: https://patch.msgid.link/pm-pmb-c2667fb9cc42fbb7943c-v4-b7bc2fe90e950accb3f7@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
18 hoursRevert "ALSA: hda/tas2781: Enable bass speakers support"Takashi Iwai
This reverts commit 3bc4fc135ec741c5657cba6b2300bf8bf81179d2. The problem will be addressed in a more proper way later. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 daysASoC: core: Create new components in sane stateMark Brown
Cezary Rojewski <cezary.rojewski@intel.com> says: There is a gap between snd_soc_component_alloc() and snd_soc_register_component(). A driver that obtains a component object through snd_soc_component_alloc() receives an object in uninitialized state. soc_component_initialize() is the function responsible for bringing it into a sane one but it is not accessible by the framework users. Example of the uninitialized members are the lists e.g.: comp->dai_list. The framework shall prevent manipulation of uninitialized components. Introduce snd_soc_component_new() which acts as a constructor: allocates and initializes the component object before returning it to the caller. Given the quite recent discussion related to all things component-register [1], decided to stick to the "register" wording and renamed soc_component_add() to snd_soc_component_register(). With that, register/unregister pattern is kept. At the same time, the update brings a clear division between: 1) snd_soc_component_register(component..) 2) snd_soc_register_component(dev..) A driver uses 1) when operating on pre-constructed component object explicitly and 2) when they want the ASoC framework to do everything for them. Parameter "name" is added to the ctor parameter list as it is one of the fields that is always initialized, see the 'if (!component->name)' within soc_component_initialize(). Private data on the other hand is not so opted out of including it. And thus snd_soc_component_set_priv() remains intact. [1]: https://lore.kernel.org/all/87y0f2rz8l.wl-kuninori.morimoto.gx@renesas.com/ Link: https://patch.msgid.link/20261007133353.455185-1-cezary.rojewski@intel.com
2 daysASoC: core: Remove unused component-register membersCezary Rojewski
With the new component constructor, functions snd_soc_component_alloc(), snd_soc_component_set_name() and soc_component_initialize() become unused. Remove them and drop the generic macro as there is only one snd_soc_register_component() function. Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20261007133353.455185-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2 daysASoC: core: Rename and export soc_component_add()Cezary Rojewski
To keep the register/unregister pattern intact, rename to the function before exporting it. This concludes the registration update, leaving the following two options available to the callers: 1) snd_soc_component_register(component..) 2) snd_soc_register_component(dev..) A driver uses 1) when attempting to register a pre-constructed component object explicitly and 2) when they want the ASoC framework to do the entire job for them. Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20261007133353.455185-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2 daysASoC: core: Add component constructorCezary Rojewski
There is a gap between snd_soc_component_alloc() and snd_soc_register_component(). A driver that obtains a component object through snd_soc_component_alloc() receives an object in uninitialized state. soc_component_initialize() is the function responsible for bringing it into a sane one but it is not accessible by the framework users. The framework shall prevent manipulation of uninitialized components. Introduce snd_soc_component_new() which acts as a constructor: allocates and initializes the component object before returning it to the caller. Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20261007133353.455185-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
3 daysMerge branch 'for-linus' into for-nextTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
6 daysBackMerge tag 'v7.3-rc6' into drm-nextDave Airlie
Linux 7.3-rc6 This was requested by Thomas to have a new base to start some branch from Signed-off-by: Dave Airlie <airlied@redhat.com>
7 daysALSA: hda: Make hdac_device.registered a plain boolTakashi Iwai
The registered field of hdac_device is a bitfield sharing the same word with other bitfields like lazy_cache, and those are updated in a non-atomic read-modify-write manner without any lock. Meanwhile, the registered flag is read from the unsolicited event worker concurrently, so the concurrent updates of the neighboring bitfields may race with it. Convert it to a plain bool for avoiding such a subtle race. Also replace the assignments of 0/1 with false/true accordingly. Assisted-by: LLM Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20261007215650.159871-4-tiwai@suse.de
7 daysALSA: hda: Stop unsol events and jack polling before codec unbindTakashi Iwai
At unbinding a codec driver, hda_codec_driver_remove() calls the codec's remove callback that releases the driver resources, followed by snd_hda_codec_cleanup_for_unbind(). Meanwhile, the unsolicited events are processed asynchronously in bus->unsol_work, and snd_hdac_bus_process_unsol_events() checks only codec->registered flag before calling the driver's unsol_event callback without the lock. Since codec->registered is cleared only in snd_hda_codec_cleanup_for_unbind(), and there is no flush of the unsol work at unbinding, the unsol event handler may run concurrently during the running remove callback, which may lead to a UAF. The same problem applies to the jack polling work, which is canceled only after the remove callback. For addressing those races, introduce a new flag unsol_disabled to hdac_device, to be checked it in the unsol event worker, while a new helper snd_hdac_device_disable_unsol() sets this flag and flushes the pending unsol work. The helper is called at hda_codec_driver_remove() together with the cancel of jackpoll_work to assure that no asynchronous jack handling can run. The flag is cleared again at probing the codec driver, while the events are still blocked by the registered flag until the codec gets registered. Reported-by: Sashiko <sashiko-bot@kernel.org> Assisted-by: LLM Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20261007215650.159871-2-tiwai@suse.de
7 daysALSA: hda: Use linked list for jack tableTakashi Iwai
So far we've used snd_array infrastructure for managing the hda_jack_tbl elements, but it turned out that this may lead to a UAF when a different order of destruction procedure is applied; namely, each hda_jack_tbl object creates a snd_jack object and sets the private_data pointing to the hda_jack_tbl, and private_free to release it. It looks harmless, but since snd_array may reallocate the whole table at growing, the formerly referred jack pointer may become stale. Fortunately, currently there is no call pattern that triggers this issue, so it's only hypothetical, but we should address it in anyway. There are several ways to address this, and at this time, we rather redesign the hda_jack_tbl allocations: instead of snd_array(), do a normal kmalloc() + linked list. There will be more kmalloc calls than the original code, but as the number of jacks are usually at most handful, it must not be a problem. This change allows us the persistent jack pointer, so no stale pointer access can happen any longer. This also fixes another reported issue about the stale jack pointer reference in snd_hda_jack_tbl_new(), too. Fixes: 31ef22579302 ("ALSA: hda - Integrate input-jack stuff into kctl-jack") Reported-by: Sashiko <sashiko-bot@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20261007171057.7462-1-tiwai@suse.de
8 daysASoC: cs35l56: Add DAI for SDCA OT25 streamRichard Fitzgerald
Add a DAI for the SDCA OT25 stream on SoundWire DP4. The SDCA-defined OT25 stream is an amp reference feedback, typically used for AEC. The firmware outputs this on DP4. The firmware owns all control registers for this stream so there are no mixer controls or any other configuration options. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20261005155235.1386525-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysALSA compress / ASoC compress / SOF: Compressed audio support with IPC4Mark Brown
Peter Ujfalusi <peter.ujfalusi@linux.intel.com> says: This series adds compressed audio support for SOF with IPC4 firmware. Supported formats are PCM, MP3, AAC and VORBIS, the feature set is PAUSE_PUSH/RELEASE, DRAIN and position reporting. Patches 1-5 are prerequisites in the ALSA compress core and in soc-compress.c. These are core fixes rather than driver level workarounds on purpose. The other users of compressed DPCM have DSP internal ports on their BEs, driven by code they own. An Intel/SOF BE ends at a third party CODEC driver which is shared with the non DPCM case and has no reason to know that the FE is compressed. That set of CODECs is open ended, so teaching each of them to cope with a compressed FE does not scale. The core has to hand a BE the same substream state whether the FE is a PCM or a compressed one. Two of these patches change behaviour for the existing users of compressed DPCM, so they would need a look from Qualcomm and NXP: - "ASoC: soc-compress: Implement trigger FE-BE sequencing as with normal PCMs" makes the FE/BE trigger order follow dai_link->trigger[], the way dpcm_fe_dai_do_trigger() does it. Neither sound/soc/qcom/ nor sound/soc/fsl/ sets it, so both default to SND_SOC_DPCM_TRIGGER_PRE: START keeps the current order, but STOP, SUSPEND and PAUSE_PUSH now trigger the BE before the FE. - "ASoC: soc-compress: Stop running dpcm on free" sends a STOP trigger from soc_compr_free_fe() if the DPCM is still in START state, which is the case when the last trigger the stream received was a DRAIN. Patches 6-20 implement the IPC4 compressed support, patch 21 is a Kconfig cleanup. The last two patches enable the feature, in Kconfig for TGL and later and in the topology parser, so the compressed device type only becomes usable once the code behind it is in place. Testing: - IPC4: Arrow Lake, compressed playback on speaker and headphone (cs42l43), MP3, AAC and VORBIS. - IPC3: tested by NXP. This does not cover the STOP on free path above, as they do not implement DRAIN. Link: https://patch.msgid.link/20261007084955.1256-1-peter.ujfalusi@linux.intel.com
8 daysASoC: SOF: ipc4: Handle compressed drain done notification from firmwarePeter Ujfalusi
The decoder module sends a drain done notification when the last chunk of the stream after the EOS from host has been decoded. The notification is a module notification with 0xc0c0 as magic number in event_id upper 16 bit. Call sof_ipc4_compr_drain_done() when the notification arrives to handle it. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://patch.msgid.link/20261007084955.1256-26-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysASoC: SOF: ipc4/ipc4-loader: Add SOF_INFO and CODEC_INFO to fw_config_paramsPeter Ujfalusi
SOF_INFO (id == 35) tuple holds tuple structured information about SOF features. The first entry in SOF_INFO is the SOF_CODEC_INFO (id == 0) which contains information about the supported codecs for decode/encode in the booted firmware. If present in the fw_config payload, make a copy of it and store it sof_ipc4_fw_data->codec_info to be used by the compressed code. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://patch.msgid.link/20261007084955.1256-20-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysASoC: SOF: ipc4: Add definition of module data in init_ext object typePeter Ujfalusi
The object array of the MODULE_INIT message can carry different types of objects, identified by SOF_IPC4_MOD_INIT_EXT_OBJ_ID in the object header. Add the SOF_IPC4_MOD_INIT_DATA_ID_MODULE_DATA type to pass module specific initialization data to a module. Unlike the existing DP_DATA object, its content is opaque to the driver and its size is variable, defined by the module itself. It is going to be used to configure the decoder and encoder process modules. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://patch.msgid.link/20261007084955.1256-17-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysALSA: compress: stop active streams on disconnectPeter Ujfalusi
Track open compressed streams per device so disconnect can stop active streams and wake waiters before snd_unregister_device(). This aligns compressed stream teardown with PCM disconnect behavior and prevents active userspace streams from running into unregister races. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20261007084955.1256-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysALSA: hda: Discard pm_runtime_put_autosuspend() return valueBrian Norris
snd_hdac_power_down() and snd_hdac_power_down_pm() are defined to return an int, but their return values are never used by any caller. snd_hdac_power_down() also passes the return value of pm_runtime_put_autosuspend() to the caller, which is not very useful. Returning an error code from pm_runtime_put_autosuspend() merely means that it has not queued up a timer or work item to check whether or not the device can be suspended and there are many perfectly valid situations in which that can happen, like after writing "on" to the device's runtime PM "control" attribute in sysfs for one example. Modify snd_hdac_power_down() to discard the pm_runtime_put_autosuspend() return value and change the return types of snd_hdac_power_down() and snd_hdac_power_down_pm() to void. No intentional functional impact. This will facilitate a planned change of the pm_runtime_put_autosuspend() return type to void in the future, similar to commit 3afd8df02433 ("PM: runtime: Change pm_runtime_put() return type to void"). Signed-off-by: Brian Norris <briannorris@chromium.org> Link: https://patch.msgid.link/20261006161337.8.Idcada3ae757100bf3a38f7e71bac37f827be06c6@changeid Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 daysASoC: aw88399: fix BSTS check using vendor driver logicMark Brown
Marco Giunta <marco_giunta@outlook.it> says: The aw88399 sysst check requires BSTS (boost finished) to assert during startup. On hardware where the boost converter is bypassed via external power supply (EN_HVBAT in BSTCTRL10, i.e. register 0x69 bit 2), BSTS never asserts and init fails. The vendor's generic Android driver (aw883xx, [1]) handles this by reading EN_HVBAT and conditionally skipping the BSTS check. When the original aw88399 driver was ported to the in-tree ASoC driver, this logic was not included. During the development of the HDA side codec driver, I worked around this with a per-instance bsts_unreliable flag set from the HDA scodec driver's per-model quirk table. While functional, this approach requires every new device where the boost converter is bypassed to carry a quirk entry, and prevents users from testing the driver on such devices via the model= alc269 module parameter without a custom kernel to add the entry. This series adds the correct hardware-based check from the vendor driver (patch 1) and removes the now-unnecessary workaround (patch 2), simplifying the code and removing a barrier to testing on new devices. [1] https://www.awinic.com/en/driver/AW88399QNR/594 Link: https://patch.msgid.link/SN6PR19MB230304C2E75499FE23B53885FC8F2@SN6PR19MB2303.namprd19.prod.outlook.com
10 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>
10 daysASoC: aw88399: skip BSTS check when boost converter is bypassedMarco Giunta
The sysst check in aw_dev_check_sysst() requires BSTS (boost finished) to assert, but on hardware where the boost converter is bypassed via external power supply (BSTCTRL10 register 0x69, EN_HVBAT bit 2 set), BSTS (SYSST register 0x01, bit 9) will never assert. The vendor's generic driver (aw883xx) handles this by reading EN_HVBAT and conditionally masking out BSTS from the sysst check. The in-tree driver missed this logic when the original code was ported upstream. Add the same conditional check, matching the vendor driver's aw_dev_sysst_check() implementation. Fixes: 8ade6cc7e261 ("ASoC: codecs: Add aw88399 amplifier driver") Signed-off-by: Marco Giunta <marco_giunta@outlook.it> Link: https://patch.msgid.link/SN6PR19MB2303FF1922BF5F876378066FFC8F2@SN6PR19MB2303.namprd19.prod.outlook.com Signed-off-by: Mark Brown <broonie@kernel.org>
10 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>
12 daysALSA: Drop unused snd_card_free_on_error()Takashi Iwai
Now that all users of snd_card_free_on_error() are gone by refactoring with auto-cleanup, let's drop the superfluous function. Also, update the documentation for reflecting the recommended error handling procedure, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20261002085517.693510-33-tiwai@suse.de
12 daysMerge branch 'for-linus' into for-nextTakashi Iwai
Pull again 7.3-devel branch for working on snd_card_free auto-clean changes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 daysALSA: core: Define auto-cleanup for snd_card_free()Takashi Iwai
For the errors at the probe time, we'd need to call rather snd_card_free() instead of the snd_card_unref() -- the former calls explicitly snd_card_disconnect() that cleans up the registered devices, etc, while the latter may leak in corner cases. For convenience, define a new auto-clean with snd_card_free. Link: https://patch.msgid.link/20261001151039.592033-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 daysASoC: tas2781: Refactor register error log with unified macroShenghao Ding
Add reusable TAS_REG_ERR_LOG macro in tas2781 header, replace all duplicated error logging code in register read/write/bulk ops and update_bits functions. Add channel ID to error log for better debuggability. Signed-off-by: Shenghao Ding <shenghao-ding@ti.com> Link: https://patch.msgid.link/20261001024049.93-2-shenghao-ding@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-29ASoC: tas2781: Add TAS2573 calibration supportShenghao Ding
This patch adds complete calibration workflow support for TAS2573. Signed-off-by: Shenghao Ding <shenghao-ding@ti.com> Link: https://patch.msgid.link/20260915044735.1305-1-shenghao-ding@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-29ASoC: SDCA: add class_ops with populate_functionSrinivas Kandagatla
Add struct sdca_class_ops with a populate_function callback that lets codec drivers supply the SDCA topology (entities, clusters, init_table, ...) from static tables in place of sdca_parse_function() on DT/non-DisCo platforms. The callback is a pure data source and performs no bus I/O. Codec drivers embed sdca_class_drv in their own priv and register their populate_function through class_ops passed to sdca_class_probe(). Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20260925161049.758913-5-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-29ASoC: SDCA: expose class SoundWire probe/remove as librarySrinivas Kandagatla
Split the internal class_sdw_probe/class_sdw_remove functions into caller-friendly library helpers: sdca_class_probe(sdw, drv) sdca_class_remove(drv) The class_sdw_probe/class_sdw_remove callbacks of the built-in class_sdw_driver are now thin wrappers that allocate a bare sdca_class_drv, stash it in drvdata, and defer to the exported helpers. The exported sdca_class_probe() takes a caller-owned struct sdca_class_drv * so codec-specific SoundWire drivers can embed the class state in their own priv struct, own dev_set_drvdata() themselves, and avoid a second allocation. No functional change for the built-in driver. This lays the groundwork for codec-specific SDCA SoundWire drivers that want to compose the class-side probe with their own quirks; the next patches add the class_ops mechanism on top. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20260925161049.758913-4-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-29ASoC: SDCA: export PM helpers keyed on sdca_class_drvSrinivas Kandagatla
The class PM callbacks pull sdca_class_drv out of drvdata, so the built-in class_sdw_driver owns the drvdata slot. That works for the generic case but blocks codec drivers that want to embed sdca_class_drv in their own private struct -- they need drvdata for their codec priv. Split the four callbacks into exported helpers that take a struct sdca_class_drv * directly: sdca_class_system_suspend() sdca_class_system_resume() sdca_class_runtime_suspend() sdca_class_runtime_resume() Codec drivers can now compose these into their own dev_pm_ops without going through drvdata. For the built-in class_sdw_driver, add small dev_pm_ops wrappers that fetch drv from drvdata and wire them into sdca_class_pm_ops. The ops struct itself stays private to this file; codec drivers build their own dev_pm_ops from the four exported helpers above. No functional change: the built-in class_sdw_driver keeps the same PM semantics; only the internal plumbing shifts to operate on sdca_class_drv instead of struct device *dev. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20260925161049.758913-3-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-29ASoC: SDCA: allow building without ACPISrinivas Kandagatla
The SDCA class driver is useful on non-ACPI platforms where the topology is supplied statically via sdca_class_ops.populate_function. Drop 'depends on ACPI' from SND_SOC_SDCA and guard the ACPI-specific enumeration helpers (sdca_lookup_functions, sdca_lookup_swft, sdca_lookup_interface_revision) in sdca_device.c and sdca_functions.c with IS_ENABLED(CONFIG_ACPI), providing empty stubs when ACPI is off. The fwnode-based DisCo parser (sdca_parse_function() and its helpers in sdca_functions.c) stays compiled unconditionally: it uses only fwnode_* APIs and can in principle be reached from any firmware backend that supplies a matching device tree. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20260925161049.758913-2-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-28Merge branch 'for-linus' into for-nextTakashi Iwai
Pull 7.3 devel branch for applying the further HD-audio quirks more cleanly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-09-28ASoC: add new DAI functionsMark Brown
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> says: This is v2 patch-set. I'm now posting ASoC Capsuling patches. Current status, and this patch-set postion is below. x: done o: This patch-set [x] move DAI functions [o] add new DAI functions [ ] move Component functions [ ] move Card functions [ ] add new Component functions [ ] rename DAI/Component list [ ] move Card functions [ ] add new Card functions [ ] adjust Test [ ] use new Card register [ ] use new functions on all drivers -- (A) [ ] Capsule DAI/Component/Card This patch-set adds new DAI functions to get dai->xxx, because each driver will not be access to them directly when capsuling has done. This patch-set just adds new functions. Basically it is just adding new function, but it will update driver in the same time if it user was very few. All user will use them at (A) timing. Link: https://lore.kernel.org/r/87qziwliaj.wl-kuninori.morimoto.gx@renesas.com Link: https://patch.msgid.link/87pkybjq02.wl-kuninori.morimoto.gx@renesas.com
2026-09-28ASoC: soc-dai: rename snd_soc_dai_action() to snd_soc_dai_active_update()Kuninori Morimoto
We have snd_soc_dai_action() to update .active. and in the same time, we have snd_soc_dai_active() to get .active. They are confusing name. Let's rename _action() to _active_update(). And in the same time, we have snd_soc_dai_action() and has its wrapper macro _activate/deactivate(). But callers are using both original/wrapper. Let's remove wrapper to remove confusion. It is used only from ASoC framework, let's move it to soc-internal.h Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com> Link: https://patch.msgid.link/87cxubjpqu.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-28ASoC: soc-dai: add snd_soc_dai_{set/to}_priv()Kuninori Morimoto
DAI parameter will be capsuled soon, will be not enable to access from each drivers. DAI priv has been mainly referred from SoundWire driver. Let's add snd_soc_dai_{set/to}_priv() for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com> Link: https://patch.msgid.link/87fqz7jpst.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-28ASoC: soc-dai: add snd_soc_dai_get_symmetric_xxx()Kuninori Morimoto
DAI parameter will be capsuled soon, will be not enable to access from each drivers. Add snd_soc_dai_get_symmetric_xxx() to get symmetric param from DAI. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com> Link: https://patch.msgid.link/87h5jnjpug.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-28ASoC: soc-dai: add snd_soc_dai_{to/from}_list()Kuninori Morimoto
DAI parameter will be capsuled soon, will be not enable to access from each drivers. Add snd_soc_dai_{to/from}_list() to use for_each macro. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com> Link: https://patch.msgid.link/87ik43jpvk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-28ASoC: soc-dai: add snd_soc_dai_to_driver()Kuninori Morimoto
DAI parameter will be capsuled soon, will be not enable to access from each drivers. Add snd_soc_dai_to_driver() to get driver from DAI. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com> Link: https://patch.msgid.link/87jyojjpvv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-28ASoC: soc-dai: add snd_soc_dai_to_component()Kuninori Morimoto
DAI parameter will be capsuled soon, will be not enable to access from each drivers. Add snd_soc_dai_to_component() to get component from DAI. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com> Link: https://patch.msgid.link/87ld8zjpw1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-28ASoC: soc-dai: add snd_soc_dai_id()Kuninori Morimoto
DAI parameter will be capsuled soon, will be not enable to access from each drivers. Add snd_soc_dai_id() to get ID from DAI. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com> Link: https://patch.msgid.link/87mrtfjpy6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-22Backmerge tag 'v7.3-rc4' into drm-nextDave Airlie
Linux 7.3-rc4 Requested by Philipp Stanner for 2ab510e63197360945f915dd5631a77c63ac6b27 would be needed as a groundlayer for further patches that extend the locking in drm_sched Signed-off-by: Dave Airlie <airlied@redhat.com>
2026-09-18ASoC: Add support for Airoha AN7581Mark Brown
Christian Marangi <ansuelsmth@gmail.com> says: Add all the patch and documentation to support Airoha AN7581 sound driver. The card follows similar implementation with Mediatek with the codec present on i2c but with a simplified implementation register wise and additional frequency supported. Link: https://patch.msgid.link/20260908090448.3332-1-ansuelsmth@gmail.com
2026-09-15ASoC: generic: Free jack GPIOs on card removeMark Brown
Chancel Liu <chancel.liu@oss.nxp.com> says: simple_util_init_jack() acquires a jack detection GPIO with gpiod_get_optional() and passes it to snd_soc_jack_add_gpios(), which also installs an IRQ handler, a PM notifier, a delayed work and a sysfs export for it. None of simple-card, audio-graph-card or audio-graph-card2 implements a card->remove() callback, so none of this is ever released. That goes unnoticed while the card is only torn down together with its platform device, because the devres cleanup registered by snd_soc_jack_add_gpios() is tied to that platform device. It becomes a problem once the card alone is unregistered and registered again while the platform device stays bound - for instance when a codec component is unbound and bound again. card->probe() then runs a second time and gpiod_get_optional() fails with -EBUSY, because the descriptor is still held by the previous bind. The card is not registered again and audio stays broken until the platform device itself is unbound. Patch 1 adds the simple_util_remove_jack() helper, patches 2-4 wire it up in the three generic card drivers. Verified with audio-graph-card2 and a wm8962 codec using hp-det-gpios. Before the series, the first echo 3-001a > /sys/bus/i2c/drivers/wm8962/unbind echo 3-001a > /sys/bus/i2c/drivers/wm8962/bind leaves the GPIO line and IRQ claimed while the card is gone, and the re-bind fails with ASoC error (-16): at graph_util_card_probe() ASoC error (-16): at snd_soc_card_probe() on wm8962-audio after which the sound card never comes back. With the series applied, both codec unbind/bind and platform unbind/bind cycles release the GPIO and IRQ on unbind and fully restore the card. Link: https://patch.msgid.link/20260913102502.2805912-1-chancel.liu@oss.nxp.com
2026-09-15ASoC: audio-graph-card: Free jack GPIOs on card removeChancel Liu
graph_util_card_probe() sets up the headphone and microphone jacks, which takes a reference on the jack detection GPIO and registers an IRQ, a PM notifier, a delayed work and a sysfs export for it. audio-graph-card has no card->remove() callback, so none of this is released when the card is torn down. This goes unnoticed while the card is only torn down together with its platform device, because the devres cleanup registered by snd_soc_jack_add_gpios() is tied to that platform device. It becomes a problem once the card alone is unregistered and registered again while the platform device stays bound - for example when a codec component is unbound and bound again. card->probe() then runs a second time and gpiod_get_optional() fails with -EBUSY, because the descriptor is still held by the previous bind. The card is not registered again and audio stays broken until the platform device itself is unbound. Add graph_util_card_remove() as the counterpart of graph_util_card_probe() and hook it to card->remove. It lives in simple-card-utils.c so that audio-graph-card2 can use it as well. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20260913102502.2805912-4-chancel.liu@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-15ASoC: simple-card-utils: Add simple_util_remove_jack()Chancel Liu
simple_util_init_jack() acquires a GPIO descriptor with gpiod_get_optional() and hands it to snd_soc_jack_add_gpios(), which additionally installs an IRQ handler, a PM notifier, a delayed work and a sysfs export for it. simple-card-utils has no counterpart that releases any of this again. Add simple_util_remove_jack(), the counterpart of simple_util_init_jack(). It releases the jack GPIO and everything snd_soc_jack_add_gpios() installed for it via snd_soc_jack_free_gpios(), and clears sjack->gpio.desc so the descriptor is not left dangling after it has been put. This gives the generic card drivers a card->remove() path to release the jack when the card goes away. The devres cleanup alone is not enough: it is tied to the platform device, so it does not run when the card is unregistered and re-registered while the platform device stays bound - for example when a codec component is unbound and bound again. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Link: https://patch.msgid.link/20260913102502.2805912-2-chancel.liu@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>