Expand SoundWire enumeration helper coverage
Subsystems (9)
Charles Keepax
maintainerv2 cover Expand SoundWire enumeration helper coverage
The patch series in [1] added a new helper to remove common boiler plate waiting for a device to enumerate on SoundWire, however, many devices also wait for enumeration during probe. This series updates things to be suitable such that we can call the same helper at probe time when the unattach_request is not valid.
There is one final step outstanding which is to add a core helper that waits for a device to drop off the bus. This is not include in this series and should be the last step of this process.
Thanks,
Charles
[1] https://lore.kernel.org/linux-sound/[email protected]/
Changes since v1:
- Completely remove the attached flag from cs42l43
Charles Keepax (10):
soundwire: Always wait for initialisation of unattached devices
ASoC: wsa881x: Use new SoundWire enumeration helper
mfd: cs42l43: Use new SoundWire enumeration helper
ASoC: rt5682: Use new SoundWire enumeration helper
ASoC: pm4125: Use new SoundWire enumeration helper
ASoC: wcd937x: Use new SoundWire enumeration helper
ASoC: wcd938x: Use new SoundWire enumeration helper
ASoC: wcd939x: Use new SoundWire enumeration helper
ASoC: SDCA: Use new SoundWire enumeration helper
ASoC: cs35l56: Remove unnecessary conditionals waiting for enumeration
drivers/mfd/cs42l43-i2c.c | 2 -- drivers/mfd/cs42l43-sdw.c | 7 ----- drivers/mfd/cs42l43.c | 15 ++++------ drivers/soundwire/bus.c | 3 -- include/linux/mfd/cs42l43.h | 2 -- sound/soc/codecs/cs35l56-sdw.c | 47 +++++++----------------------- sound/soc/codecs/cs35l56.h | 1 - sound/soc/codecs/pm4125.c | 11 ++----- sound/soc/codecs/rt5682.c | 14 +++------ sound/soc/codecs/wcd937x.c | 11 ++----- sound/soc/codecs/wcd938x.c | 11 ++----- sound/soc/codecs/wcd939x.c | 11 ++----- sound/soc/codecs/wsa881x.c | 10 +++---- sound/soc/sdca/sdca_class.c | 53 ++++------------------------------ sound/soc/sdca/sdca_class.h | 3 -- 15 files changed, 41 insertions(+), 160 deletions(-)
Signature · 1 line
2.47.3
Charles Keepax
maintainerPATCH v2 2/10 ASoC: wsa881x: Use new SoundWire enumeration helper
Now the new wait for SoundWire enumeration helper no longer depends on unattach_request it can be used for code that also doesn't check this flag. Update the driver to use the new core helper.
---
No change since v1.
sound/soc/codecs/wsa881x.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
sound/soc/codecs/wsa881x.c +4 -6
@@ -1167,16 +1167,14 @@ static int wsa881x_runtime_resume(struct device *dev)struct sdw_slave *slave =dev_to_sdw_dev (dev);struct regmap *regmap =dev_get_regmap (dev,NULL );struct wsa881x_priv *wsa881x =dev_get_drvdata (dev); -unsigned long time; +int ret;gpiod_direction_output (wsa881x->sd_n,0 ); - time =wait_for_completion_timeout (&slave->initialization_complete, -msecs_to_jiffies (WSA881X_PROBE_TIMEOUT )); -if (!time) { -dev_err (dev,"Initialization not complete, timed out\n" ); + ret =sdw_slave_wait_for_init (slave,WSA881X_PROBE_TIMEOUT ); +if (ret) {gpiod_direction_output (wsa881x->sd_n,1 ); -return -ETIMEDOUT ; +return ret; }regcache_cache_only (regmap, false);
Signature · 1 line
2.47.3
Charles Keepax
maintainerPATCH v2 4/10 ASoC: rt5682: Use new SoundWire enumeration helper
In reply to Charles KeepaxNow the new wait for SoundWire enumeration helper no longer depends on unattach_request it is safe to use from probe time. Update the driver to use the new core helper.
---
No change since v1.
sound/soc/codecs/rt5682.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
sound/soc/codecs/rt5682.c +4 -10
@@ -2929,20 +2929,14 @@ static int rt5682_probe(struct snd_soc_component *component) {struct rt5682_priv *rt5682 =snd_soc_component_get_drvdata (component);struct snd_soc_dapm_context *dapm =snd_soc_component_to_dapm (component); -struct sdw_slave *slave; -unsigned long time; +int ret; rt5682->component = component;if (rt5682->is_sdw) { - slave = rt5682->slave; - time =wait_for_completion_timeout ( - &slave->initialization_complete, -msecs_to_jiffies (RT5682_PROBE_TIMEOUT )); -if (!time) { -dev_err (&slave->dev,"Initialization not complete, timed out\n" ); -return -ETIMEDOUT ; - } + ret =sdw_slave_wait_for_init (rt5682->slave,RT5682_PROBE_TIMEOUT ); +if (ret) +return ret; }snd_soc_dapm_disable_pin (dapm,"MICBIAS" );
Signature · 1 line
2.47.3
Charles Keepax
maintainerPATCH v2 5/10 ASoC: pm4125: Use new SoundWire enumeration helper
In reply to Charles KeepaxNow the new wait for SoundWire enumeration helper no longer depends on unattach_request it is safe to use from probe time. Update the driver to use the new core helper.
---
No change since v1.
sound/soc/codecs/pm4125.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
sound/soc/codecs/pm4125.c +3 -8
@@ -1309,17 +1309,12 @@ static int pm4125_irq_init(struct pm4125_priv *pm4125, struct device *dev)static int pm4125_soc_codec_probe (struct snd_soc_component *component) {struct pm4125_priv *pm4125 =snd_soc_component_get_drvdata (component); -struct sdw_slave *tx_sdw_dev = pm4125->tx_sdw_dev;struct device *dev = component->dev; -unsigned long time_left;int i, ret; - time_left =wait_for_completion_timeout (&tx_sdw_dev->initialization_complete, -msecs_to_jiffies (5000 )); -if (!time_left) { -dev_err (dev,"soundwire device init timeout\n" ); -return -ETIMEDOUT ; - } + ret =sdw_slave_wait_for_init (pm4125->tx_sdw_dev,5000 ); +if (ret) +return ret;snd_soc_component_init_regmap (component, pm4125->regmap); ret =pm_runtime_resume_and_get (dev);
Signature · 1 line
2.47.3
Charles Keepax
maintainerPATCH v2 6/10 ASoC: wcd937x: Use new SoundWire enumeration helper
In reply to Charles KeepaxNow the new wait for SoundWire enumeration helper no longer depends on unattach_request it is safe to use from probe time. Update the driver to use the new core helper.
---
No change since v1.
sound/soc/codecs/wcd937x.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
sound/soc/codecs/wcd937x.c +3 -8
@@ -2499,18 +2499,13 @@ static int wcd937x_soc_codec_probe(struct snd_soc_component *component) {struct snd_soc_dapm_context *dapm =snd_soc_component_to_dapm (component);struct wcd937x_priv *wcd937x =snd_soc_component_get_drvdata (component); -struct sdw_slave *tx_sdw_dev = wcd937x->tx_sdw_dev;struct device *dev = component->dev; -unsigned long time_left;int i, ret;u32 chipid; - time_left =wait_for_completion_timeout (&tx_sdw_dev->initialization_complete, -msecs_to_jiffies (5000 )); -if (!time_left) { -dev_err (dev,"soundwire device init timeout\n" ); -return -ETIMEDOUT ; - } + ret =sdw_slave_wait_for_init (wcd937x->tx_sdw_dev,5000 ); +if (ret) +return ret;snd_soc_component_init_regmap (component, wcd937x->regmap); ret =pm_runtime_resume_and_get (dev);
Signature · 1 line
2.47.3
Charles Keepax
maintainerPATCH v2 7/10 ASoC: wcd938x: Use new SoundWire enumeration helper
In reply to Charles KeepaxNow the new wait for SoundWire enumeration helper no longer depends on unattach_request it is safe to use from probe time. Update the driver to use the new core helper.
---
No change since v1.
sound/soc/codecs/wcd938x.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
sound/soc/codecs/wcd938x.c +3 -8
@@ -3016,18 +3016,13 @@ static int wcd938x_irq_init(struct wcd938x_priv *wcd, struct device *dev)static int wcd938x_soc_codec_probe (struct snd_soc_component *component) {struct wcd938x_priv *wcd938x =snd_soc_component_get_drvdata (component); -struct sdw_slave *tx_sdw_dev = wcd938x->tx_sdw_dev;struct device *dev = component->dev; -unsigned long time_left;unsigned int variant;int ret, i; - time_left =wait_for_completion_timeout (&tx_sdw_dev->initialization_complete, -msecs_to_jiffies (2000 )); -if (!time_left) { -dev_err (dev,"soundwire device init timeout\n" ); -return -ETIMEDOUT ; - } + ret =sdw_slave_wait_for_init (wcd938x->tx_sdw_dev,2000 ); +if (ret) +return ret;snd_soc_component_init_regmap (component, wcd938x->regmap);
Signature · 1 line
2.47.3
Charles Keepax
maintainerPATCH v2 8/10 ASoC: wcd939x: Use new SoundWire enumeration helper
In reply to Charles KeepaxNow the new wait for SoundWire enumeration helper no longer depends on unattach_request it is safe to use from probe time. Update the driver to use the new core helper.
---
No change since v1.
sound/soc/codecs/wcd939x.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
sound/soc/codecs/wcd939x.c +3 -8
@@ -2968,17 +2968,12 @@ static int wcd939x_irq_init(struct wcd939x_priv *wcd, struct device *dev)static int wcd939x_soc_codec_probe (struct snd_soc_component *component) {struct wcd939x_priv *wcd939x =snd_soc_component_get_drvdata (component); -struct sdw_slave *tx_sdw_dev = wcd939x->tx_sdw_dev;struct device *dev = component->dev; -unsigned long time_left;int ret, i; - time_left =wait_for_completion_timeout (&tx_sdw_dev->initialization_complete, -msecs_to_jiffies (2000 )); -if (!time_left) { -dev_err (dev,"soundwire device init timeout\n" ); -return -ETIMEDOUT ; - } + ret =sdw_slave_wait_for_init (wcd939x->tx_sdw_dev,2000 ); +if (ret) +return ret;snd_soc_component_init_regmap (component, wcd939x->regmap);
Signature · 1 line
2.47.3
Charles Keepax
maintainerPATCH v2 3/10 mfd: cs42l43: Use new SoundWire enumeration helper
In reply to Charles KeepaxNow the new wait for SoundWire enumeration helper no longer depends on unattach_request it is safe to use from probe time. Update the driver to use the new core helper.
---
Changes since v1:
- Completely remove attached variable since it was now unused.
drivers/mfd/cs42l43-i2c.c | 2 -- drivers/mfd/cs42l43-sdw.c | 7 ------- drivers/mfd/cs42l43.c | 15 ++++++--------- include/linux/mfd/cs42l43.h | 2 -- 4 files changed, 6 insertions(+), 20 deletions(-)
drivers/mfd/cs42l43-i2c.c +0 -2
@@ -45,8 +45,6 @@ static int cs42l43_i2c_probe(struct i2c_client *i2c) cs42l43->dev = &i2c->dev; cs42l43->irq = i2c->irq; -/* A device on an I2C is always attached by definition. */ - cs42l43->attached = true; cs42l43->variant_id = (long )device_get_match_data (cs42l43->dev); cs42l43->regmap =devm_regmap_init_i2c (i2c, &cs42l43_i2c_regmap);
drivers/mfd/cs42l43-sdw.c +0 -7
@@ -100,17 +100,10 @@ static int cs42l43_sdw_update_status(struct sdw_slave *sdw, enum sdw_slave_statusdw_write_no_pm (sdw,CS42L43_GEN_INT_MASK_1 ,CS42L43_INT_STAT_GEN1_MASK ); - - cs42l43->attached = true; - -complete (&cs42l43->device_attach);break ;case SDW_SLAVE_UNATTACHED :dev_dbg (cs42l43->dev,"Device detach\n" ); - cs42l43->attached = false; - -reinit_completion (&cs42l43->device_attach);complete (&cs42l43->device_detach);break ;default :
drivers/mfd/cs42l43.c +6 -9
@@ -586,15 +586,13 @@ static int cs42l43_soft_reset(struct cs42l43 *cs42l43)*/ static int cs42l43_wait_for_attach (struct cs42l43 *cs42l43) { -if (!cs42l43->attached) { -unsigned long timeout =msecs_to_jiffies (CS42L43_SDW_ATTACH_TIMEOUT_MS ); -unsigned long time; +int ret; - time =wait_for_completion_timeout (&cs42l43->device_attach, timeout); -if (!time) { -dev_err (cs42l43->dev,"Timed out waiting for device re-attach\n" ); -return -ETIMEDOUT ; - } +if (cs42l43->sdw) { + ret =sdw_slave_wait_for_init (cs42l43->sdw, +CS42L43_SDW_ATTACH_TIMEOUT_MS ); +if (ret) +return ret; }regcache_cache_only (cs42l43->regmap, false);
@@ -1120,7 +1118,6 @@ int cs42l43_dev_probe(struct cs42l43 *cs42l43)dev_set_drvdata (cs42l43->dev, cs42l43);mutex_init (&cs42l43->pll_lock); -init_completion (&cs42l43->device_attach);init_completion (&cs42l43->device_detach);init_completion (&cs42l43->firmware_download);INIT_WORK (&cs42l43->boot_work, cs42l43_boot_work);
include/linux/mfd/cs42l43.h +0 -2
@@ -86,7 +86,6 @@ struct cs42l43 {struct regmap_irq_chip_data *irq_data;struct work_struct boot_work; -struct completion device_attach;struct completion device_detach;struct completion firmware_download;int firmware_error;
@@ -96,7 +95,6 @@ struct cs42l43 {struct mutex pll_lock;bool sdw_pll_active; -bool attached;bool hw_lock;long variant_id; };
Signature · 1 line
2.47.3
Charles Keepax
maintainerPATCH v2 9/10 ASoC: SDCA: Use new SoundWire enumeration helper
In reply to Charles KeepaxNow the new wait for SoundWire enumeration helper no longer depends on unattach_request it is safe to use from probe time. Update the driver to use the new core helper.
---
No change since v1.
sound/soc/sdca/sdca_class.c | 53 ++++--------------------------------- sound/soc/sdca/sdca_class.h | 3 --- 2 files changed, 5 insertions(+), 51 deletions(-)
sound/soc/sdca/sdca_class.c +5 -48
@@ -38,35 +38,8 @@ static int class_read_prop(struct sdw_slave *sdw)return 0 ; } -static int class_sdw_update_status (struct sdw_slave *sdw,enum sdw_slave_status status) -{ -struct sdca_class_drv *drv =dev_get_drvdata (&sdw->dev); - -switch (status) { -case SDW_SLAVE_ATTACHED : -dev_dbg (drv->dev,"device attach\n" ); - - drv->attached = true; - -complete (&drv->device_attach); -break ; -case SDW_SLAVE_UNATTACHED : -dev_dbg (drv->dev,"device detach\n" ); - - drv->attached = false; - -reinit_completion (&drv->device_attach); -break ; -default : -break ; - } - -return 0 ; -} -static const struct sdw_slave_ops class_sdw_ops = { .read_prop = class_read_prop, - .update_status = class_sdw_update_status, };static void class_regmap_lock (void *data)
@@ -83,24 +56,6 @@ static void class_regmap_unlock(void *data)mutex_unlock (lock); } -static int class_wait_for_attach (struct sdca_class_drv *drv) -{ -if (!drv->attached) { -unsigned long timeout =msecs_to_jiffies (CLASS_SDW_ATTACH_TIMEOUT_MS ); -unsigned long time; - - time =wait_for_completion_timeout (&drv->device_attach, timeout); -if (!time) { -dev_err (drv->dev,"timed out waiting for device re-attach\n" ); -return -ETIMEDOUT ; - } - } - -regcache_cache_only (drv->dev_regmap, false); - -return 0 ; -} -static bool class_dev_regmap_volatile (struct device *dev,unsigned int reg) {switch (reg) {
@@ -151,10 +106,12 @@ static void class_boot_work(struct work_struct *work) boot_work);int ret; - ret =class_wait_for_attach (drv); + ret =sdw_slave_wait_for_init (drv->sdw,CLASS_SDW_ATTACH_TIMEOUT_MS );if (ret) goto err; +regcache_cache_only (drv->dev_regmap, false); + drv->irq_info =sdca_irq_allocate (drv->dev, drv->dev_regmap, drv->sdw->irq);if (IS_ERR (drv->irq_info))
@@ -206,7 +163,6 @@ static int class_sdw_probe(struct sdw_slave *sdw, const struct sdw_device_id *iddev_set_drvdata (drv->dev, drv);INIT_WORK (&drv->boot_work, class_boot_work); -init_completion (&drv->device_attach); dev_config->lock_arg = &drv->regmap_lock;
@@ -290,10 +246,11 @@ static int class_runtime_resume(struct device *dev)struct sdca_class_drv *drv =dev_get_drvdata (dev);int ret; - ret =class_wait_for_attach (drv); + ret =sdw_slave_wait_for_init (drv->sdw,CLASS_SDW_ATTACH_TIMEOUT_MS );if (ret) goto err; +regcache_cache_only (drv->dev_regmap, false);regcache_mark_dirty (drv->dev_regmap); ret =regcache_sync (drv->dev_regmap);
sound/soc/sdca/sdca_class.h +0 -3
@@ -30,9 +30,6 @@ struct sdca_class_drv {/* Serialise function initialisations */ struct mutex init_lock; struct work_struct boot_work; -struct completion device_attach; - - bool attached; };#endif /* __SDCA_CLASS_H__ */
Signature · 1 line
2.47.3
Charles Keepax
maintainerPATCH v2 10/10 ASoC: cs35l56: Remove unnecessary conditionals waiting for enumeration
In reply to Charles KeepaxCommit [1] updated the core to use complete_all() which means that the wait_for_completion() will now simply return if the device is already attached, so skipping the completion isn't required anymore. Update the code to simply call sdw_slave_wait_for_init() unconditionally.
[1] c40d6b3249b1 ("soundwire: fix enumeration completion")
---
No change since v1.
sound/soc/codecs/cs35l56-sdw.c | 47 ++++++++-------------------------- sound/soc/codecs/cs35l56.h | 1 - 2 files changed, 10 insertions(+), 38 deletions(-)
sound/soc/codecs/cs35l56-sdw.c +10 -37
@@ -330,7 +330,6 @@ static int cs35l56_sdw_update_status(struct sdw_slave *peripheral,switch (status) {case SDW_SLAVE_ATTACHED : - cs35l56->sdw_in_clock_stop_1 = false;if (cs35l56->sdw_attached)break ;
@@ -352,31 +351,10 @@ static int cs35l56_sdw_update_status(struct sdw_slave *peripheral,return 0 ; } -static int __maybe_unused cs35l56_sdw_clk_stop (struct sdw_slave *peripheral, -enum sdw_clk_stop_mode mode, -enum sdw_clk_stop_type type) -{ -struct cs35l56_private *cs35l56 =dev_get_drvdata (&peripheral->dev); - -dev_dbg (cs35l56->base.dev,"%s: clock_stop_mode%d stage:%d\n" , __func__, mode, type); - -switch (type) { -case SDW_CLK_POST_PREPARE : -if (mode ==SDW_CLK_STOP_MODE1 ) - cs35l56->sdw_in_clock_stop_1 = true; -else - cs35l56->sdw_in_clock_stop_1 = false; -return 0 ; -default : -return 0 ; - } -} -static const struct sdw_slave_ops cs35l56_sdw_ops = { .read_prop = cs35l56_sdw_read_prop, .interrupt_callback = cs35l56_sdw_interrupt, .update_status = cs35l56_sdw_update_status, - .clk_stop = cs35l56_sdw_clk_stop, };static int __maybe_unused cs35l56_sdw_handle_unattach (struct cs35l56_private *cs35l56)
@@ -384,23 +362,18 @@ static int __maybe_unused cs35l56_sdw_handle_unattach(struct cs35l56_private *csstruct sdw_slave *peripheral = cs35l56->sdw_peripheral;int ret; -dev_dbg (cs35l56->base.dev,"attached:%u unattach_request:%u in_clock_stop_1:%u\n" , - cs35l56->sdw_attached, peripheral->unattach_request, cs35l56->sdw_in_clock_stop_1); +dev_dbg (cs35l56->base.dev,"attached:%u unattach_request:%u\n" , + cs35l56->sdw_attached, peripheral->unattach_request); -if (cs35l56->sdw_in_clock_stop_1 || peripheral->unattach_request) { -/* Cannot access registers until bus is re-initialized. */ -dev_dbg (cs35l56->base.dev,"Wait for initialization_complete\n" ); - ret =sdw_slave_wait_for_init (peripheral,5000 ); -if (ret) -return ret; - - cs35l56->sdw_in_clock_stop_1 = false; +/* Cannot access registers until bus is re-initialized. */ + ret =sdw_slave_wait_for_init (peripheral,5000 ); +if (ret) +return ret; -/* -* Don't call regcache_mark_dirty(), we can't be sure that the -* Manager really did issue a Bus Reset. -*/ - } +/* +* Don't call regcache_mark_dirty(), we can't be sure that the +* Manager really did issue a Bus Reset. +*/ return 0 ; }
sound/soc/codecs/cs35l56.h +0 -1
@@ -43,7 +43,6 @@ struct cs35l56_private {bool sdw_irq_no_unmask;bool soft_resetting;bool sdw_attached; -bool sdw_in_clock_stop_1;struct completion init_completion;int speaker_id;
Signature · 1 line
2.47.3
Charles Keepax
maintainerPATCH v2 1/10 soundwire: Always wait for initialisation of unattached devices
In reply to Charles KeepaxCurrently in sdw_slave_wait_for_init() the waiting can be skipped if unattach_request is not set. Doing so was added in [1] likely because the core used to do a complete() on the completion so waiting in the case an unattach hadn't actually happened would block for the full timeout. However patch [2] updated the core to use complete_all() which means that the wait_for_completion() will now simply return if the device is already attached skipping the completion doesn't add much.
Additionally, unatttach_request is only set if the host initiates a bus reset. However, the host doing a bus reset is not the only reason a device may be unattached from the bus. Other options could include the driver probing before the device enumerates, a sync-loss, or the device itself powering down.
Removing the skip using unattached_request, doesn't cost much in terms of efficiency and allows the sdw_slave_wiat_for_init() helper to be used outside of runtime resume.
[1] b2bd75f806c4 ("soundwire: sdw_slave: track unattach_request to handle all init sequences")
[2] c40d6b3249b1 ("soundwire: fix enumeration completion")
---
No change since v1.
drivers/soundwire/bus.c | 3 --- 1 file changed, 3 deletions(-)
drivers/soundwire/bus.c +0 -3
@@ -1386,9 +1386,6 @@ int sdw_slave_wait_for_init(struct sdw_slave *slave, int timeout_ms) {unsigned long time; -if (!slave->unattach_request) -return 0 ; - time =wait_for_completion_timeout (&slave->initialization_complete,msecs_to_jiffies (timeout_ms));if (!time) {
Signature · 1 line
2.47.3
Quoted 30 lines · Charles Keepax
The patch series in [1] added a new helper to remove common boiler plate waiting for a device to enumerate on SoundWire, however, many devices also wait for enumeration during probe. This series updates things to be suitable such that we can call the same helper at probe time when the
unattach_requestis not valid.There is one final step outstanding which is to add a core helper that waits for a device to drop off the bus. This is not include in this series and should be the last step of this process.
Thanks,
Charles[1] https://lore.kernel.org/linux-sound/[email protected]/
Changes since v1:
- Completely remove the attached flag from cs42l43Charles Keepax (10):
soundwire: Always wait for initialisation of unattached devices
ASoC: wsa881x: Use new SoundWire enumeration helper
mfd: cs42l43: Use new SoundWire enumeration helper
ASoC: rt5682: Use new SoundWire enumeration helper
ASoC: pm4125: Use new SoundWire enumeration helper
ASoC: wcd937x: Use new SoundWire enumeration helper
ASoC: wcd938x: Use new SoundWire enumeration helper
ASoC: wcd939x: Use new SoundWire enumeration helper
ASoC: SDCA: Use new SoundWire enumeration helper
ASoC: cs35l56: Remove unnecessary conditionals waiting for enumeration
Quoted 7 lines
drivers/mfd/cs42l43-i2c.c | 2 -- drivers/mfd/cs42l43-sdw.c | 7 ----- drivers/mfd/cs42l43.c | 15 ++++------ drivers/soundwire/bus.c | 3 -- include/linux/mfd/cs42l43.h | 2 -- sound/soc/codecs/cs35l56-sdw.c | 47 +++++++----------------------- sound/soc/codecs/cs35l56.h | 1 -
Thanks for the cleanup,
For all below Qualcomm codecs:
tested on Lenovo T14s.
Quoted 5 lines
sound/soc/codecs/pm4125.c | 11 ++----- sound/soc/codecs/wcd937x.c | 11 ++----- sound/soc/codecs/wcd938x.c | 11 ++----- sound/soc/codecs/wcd939x.c | 11 ++----- sound/soc/codecs/wsa881x.c | 10 +++----
--srini
Quoted 4 lines
sound/soc/sdca/sdca_class.c | 53 ++++------------------------------ sound/soc/sdca/sdca_class.h | 3 -- 15 files changed, 41 insertions(+), 160 deletions(-)
Srinivas Kandagatla
maintainerRe: [PATCH v2 01/10] soundwire: Always wait for initialisation of unattached devices
In reply to Charles Keepaxsome minor typos in commit msg.
Quoted 10 lines · Charles Keepax
Currently in
sdw_slave_wait_for_init()the waiting can be skipped ifunattach_requestis not set. Doing so was added in [1] likely because the core used to do acomplete()on the completion so waiting in the case an unattach hadn't actually happened would block for the full timeout. However patch [2] updated the core to usecomplete_all()which means that thewait_for_completion()will now simply return if the device is already attached skipping the completion doesn't add much.Additionally,
unatttach_requestis only set if the host initiates
s/unatttach/unattach
Quoted 7 lines
a bus reset. However, the host doing a bus reset is not the only reason a device may be unattached from the bus. Other options could include the driver probing before the device enumerates, a sync-loss, or the device itself powering down.
Removing the skip using
unattached_request, doesn't cost much in terms of efficiency and allows thesdw_slave_wiat_for_init()helper
s/wiat/wait
Quoted 28 lines
to be used outside of runtime resume.
[1]
b2bd75f806c4("soundwire:sdw_slave: trackunattach_requestto handle all init sequences")
[2]c40d6b3249b1("soundwire: fix enumeration completion")Acked-by Vinod Koul <[email protected]>Signed-off-by Charles Keepax <[email protected]>---
No change since v1.
drivers/soundwire/bus.c | 3 --- 1 file changed, 3 deletions(-)drivers/soundwire/bus.c +0
-3@@ -1386,9 +1386,6 @@ int sdw_slave_wait_for_init(struct sdw_slave *slave, int timeout_ms) {unsigned long time; -if (!slave->unattach_request) -return 0 ; - time =wait_for_completion_timeout (&slave->initialization_complete,msecs_to_jiffies (timeout_ms));if (!time) {
Charles Keepax
maintainerRe: [PATCH v2 01/10] soundwire: Always wait for initialisation of unattached devices
Quoted 16 lines · Srinivas Kandagatla
some minor typos in commit msg.
Quoted 10 lines · Charles Keepax
Currently in
sdw_slave_wait_for_init()the waiting can be skipped ifunattach_requestis not set. Doing so was added in [1] likely because the core used to do acomplete()on the completion so waiting in the case an unattach hadn't actually happened would block for the full timeout. However patch [2] updated the core to usecomplete_all()which means that thewait_for_completion()will now simply return if the device is already attached skipping the completion doesn't add much.Additionally,
unatttach_requestis only set if the host initiatess/unatttach/unattach
Quoted 9 lines
Quoted 7 lines
a bus reset. However, the host doing a bus reset is not the only reason a device may be unattached from the bus. Other options could include the driver probing before the device enumerates, a sync-loss, or the device itself powering down.
Removing the skip using
unattached_request, doesn't cost much in terms of efficiency and allows thesdw_slave_wiat_for_init()helpers/wiat/wait
Thanks I will do a spin early next week for these typos.
Thanks,
Charles