summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-06-27 12:15:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-06-27 12:15:23 -0700
commit14923571e78ae448ff4cc250d46d6f5fa442761c (patch)
tree1ee3e4f8c71082d4d9240dd4090cfdda75c08bb1 /include/linux
parent4bf54e47525dcacd4c6cdd97fb5902592414dd7a (diff)
parente1e31e0ec8a609e17fd2e86b77bc00d9cbb24d7c (diff)
Merge tag 'sound-fix-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of small bug fixes accumulated over the last week. Most are device-specific fixes while there are a few core fixes as well. Here are the highlights: ALSA Core: - A fix for an uninitialised heap leak in ALSA sequencer core - A fix for error handling/resource leak in compress-offload API USB-audio: - A teardown-ordering fix in USB MIDI 2.0 to prevent use-after-free - Bounds and length checks for packet data in Native Instruments caiaq / Traktor Kontrol input parsers - Avoidance of expensive kobject path lookups in DualSense controller matches - Robustness/memory leak fixes for Qualcomm USB offload driver - Focusrite Control Protocol (FCP) NULL-pointer dereference fix and a new device quirk (ISA C8X) - Device-specific quirks for Yamaha CDS3000 and SC13A HD-Audio: - A bunch of quirks and mute/mic-mute LED fixups for various laptops (Acer, Clevo, Lenovo, HP) ASoC & SoundWire: - Avoid failing card registration if the device_link creation fails - A workaround for SoundWire randconfig build failures by making helper functions static inline - Corrected MCLK reference validation for CS530x codecs - Clean up of untested, problematic guard() macro replacements in Rockchip SAI driver - Fix for eDMA maxburst misalignment with channel count in Freescale ASRC - Miscellaneous hardware-specific fixes (qcom, rt5650, tlv320aic3x, tas2781/3) Others: - Bounds and length checks for packet data in Apple iSight" * tag 'sound-fix-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (46 commits) ALSA: FCP: Fix NULL pointer dereference in interface lookup ALSA: hda/realtek: Update Acer Nitro ANV15-41 quirk to enable mute LED ASoC: fsl_asrc_dma: fix eDMA maxburst misalignment with channel count ASoC: codecs: pcm512x: only print info once on no sclk ASoC: tas2781: Update default register address to TAS2563 ALSA: firewire: isight: bound the sample count to the packet payload ALSA: usb-audio: qcom: Free QMI handle ALSA: hda: Add Lenovo Legion 7i 16IAX7 17AA3874 quirk ALSA: usb-audio: avoid kobject path lookup in DualSense match ALSA: hda/realtek: Add quirk for Acer Nitro ANV15-41 ASoC: soc-core: Don't fail if device_link could not be created ASoC: rockchip: rockchip_sai: #include <linux/platform_device.h> explicitly ALSA: seq: Fix uninitialised heap leak in snd_seq_event_dup() ASoC: rt5575: Use __le32 for SPI burst write address ASoC: tas2783: Update loaded firmware names to linux-firmware 20260519 ASoC: SDCA: Validate written enum value in ge_put_enum_double() ASoC: realtek: Add back local call to sdw_show_ping_status() ASoC: ti: Add back local call to sdw_show_ping_status() ASoC: max98373: Add back local call to sdw_show_ping_status() ASoC: es9356: Add back local call to sdw_show_ping_status() ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/soundwire/sdw.h38
1 files changed, 30 insertions, 8 deletions
diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h
index a46cbaec5949..b484784e2690 100644
--- a/include/linux/soundwire/sdw.h
+++ b/include/linux/soundwire/sdw.h
@@ -11,6 +11,7 @@
#include <linux/idr.h>
#include <linux/irq.h>
#include <linux/irqdomain.h>
+#include <linux/jiffies.h>
#include <linux/lockdep_types.h>
#include <linux/mod_devicetable.h>
#include <linux/mutex.h>
@@ -1093,8 +1094,6 @@ int sdw_slave_get_current_bank(struct sdw_slave *sdev);
int sdw_slave_get_scale_index(struct sdw_slave *slave, u8 *base);
-int sdw_slave_wait_for_init(struct sdw_slave *slave, int timeout_ms);
-
/* messaging and data APIs */
int sdw_read(struct sdw_slave *slave, u32 addr);
int sdw_write(struct sdw_slave *slave, u32 addr, u8 value);
@@ -1138,12 +1137,6 @@ static inline int sdw_slave_get_current_bank(struct sdw_slave *sdev)
return -EINVAL;
}
-static inline int sdw_slave_wait_for_init(struct sdw_slave *slave, int timeout_ms)
-{
- WARN_ONCE(1, "SoundWire API is disabled");
- return -EINVAL;
-}
-
/* messaging and data APIs */
static inline int sdw_read(struct sdw_slave *slave, u32 addr)
{
@@ -1207,4 +1200,33 @@ static inline int sdw_update_no_pm(struct sdw_slave *slave, u32 addr, u8 mask, u
#endif /* CONFIG_SOUNDWIRE */
+/**
+ * sdw_slave_wait_for_init - Wait for device initialisation
+ * @slave: Pointer to the SoundWire peripheral.
+ * @timeout_ms: Timeout in milliseconds.
+ *
+ * Wait for a peripheral device to enumerate and be initialised by the
+ * SoundWire core.
+ *
+ * Return: Zero on success, and a negative error code on failure.
+ */
+static inline int sdw_slave_wait_for_init(struct sdw_slave *slave, int timeout_ms)
+{
+ unsigned long time;
+
+ if (!slave)
+ return 0;
+
+ time = wait_for_completion_timeout(&slave->initialization_complete,
+ msecs_to_jiffies(timeout_ms));
+ if (!time) {
+ dev_err(&slave->dev, "Initialization not complete\n");
+ return -ETIMEDOUT;
+ }
+
+ slave->unattach_request = 0;
+
+ return 0;
+}
+
#endif /* __SOUNDWIRE_H */