aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
authorTakashi Iwai <tiwai@suse.de>2026-06-26 07:33:15 +0200
committerTakashi Iwai <tiwai@suse.de>2026-06-26 07:33:15 +0200
commit677b16108a7457c1fa1cd1b39301e46dfc3aed06 (patch)
tree7fb2eeffe0f8036ad239f41c73fc7b41d5455baa /include
parent29b9667982e4df2ed7744f86b1144f8bb58eb698 (diff)
parentcf6f56990ea21172e085f0588e5bbf2089ce8f58 (diff)
downloadath-677b16108a7457c1fa1cd1b39301e46dfc3aed06.tar.gz
Merge tag 'asoc-fix-v7.2-merge-window' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v7.2 We've got a good collection of device specific fix here, plus a couple of stand out things: - Richard fixed some special cases with the new device_link creation by more gracefully handling any errors during creation. - Charles did some light refactoring of the SoundWire interfaces to fix some persistent randconfig issues that people kept running into.
Diffstat (limited to 'include')
-rw-r--r--include/linux/soundwire/sdw.h38
-rw-r--r--include/sound/soc-component.h4
-rw-r--r--include/sound/tas2781.h4
3 files changed, 36 insertions, 10 deletions
diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h
index a46cbaec59491..b484784e2690d 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 */
diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index 11bc9527653ff..aa423865dbe7c 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -10,6 +10,8 @@
#include <sound/soc.h>
+struct device_link;
+
/*
* Component probe and remove ordering levels for components with runtime
* dependencies.
@@ -216,6 +218,8 @@ struct snd_soc_component {
struct list_head card_aux_list; /* for auxiliary bound components */
struct list_head card_list;
+ struct device_link *card_device_link;
+
const struct snd_soc_component_driver *driver;
struct list_head dai_list;
diff --git a/include/sound/tas2781.h b/include/sound/tas2781.h
index d45f805b5d18b..b763da6137699 100644
--- a/include/sound/tas2781.h
+++ b/include/sound/tas2781.h
@@ -59,9 +59,9 @@
#define TASDEVICE_CHECKSUM_REG TASDEVICE_REG(0x0, 0x0, 0x7e)
/* XM_340 */
-#define TASDEVICE_XM_A1_REG TASDEVICE_REG(0x64, 0x63, 0x3c)
+#define TASDEVICE_XM_A1_REG TASDEVICE_REG(0x64, 0x02, 0x4c)
/* XM_341 */
-#define TASDEVICE_XM_A2_REG TASDEVICE_REG(0x64, 0x63, 0x38)
+#define TASDEVICE_XM_A2_REG TASDEVICE_REG(0x64, 0x02, 0x64)
/* Volume control */
#define TAS2563_DVC_LVL TASDEVICE_REG(0x00, 0x02, 0x0c)