Skip to content

Commit 7499c7b

Browse files
committed
ASoC: rt722: don't wait codec init in resume
Move regmap sync to rt722_sdca_update_status() when unattach_request is set, and only do regmap sync in resume when no reattach needed. The change can shorten the resume time. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 3fc50b3 commit 7499c7b

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

sound/soc/codecs/rt722-sdca-sdw.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ static int rt722_sdca_update_status(struct sdw_slave *slave,
209209
enum sdw_slave_status status)
210210
{
211211
struct rt722_sdca_priv *rt722 = dev_get_drvdata(&slave->dev);
212+
int ret;
212213

213214
if (status == SDW_SLAVE_UNATTACHED)
214215
rt722->hw_init = false;
@@ -236,7 +237,12 @@ static int rt722_sdca_update_status(struct sdw_slave *slave,
236237
return 0;
237238

238239
/* perform I/O transfers required for Slave initialization */
239-
return rt722_sdca_io_init(&slave->dev, slave);
240+
ret = rt722_sdca_io_init(&slave->dev, slave);
241+
if (slave->unattach_request) {
242+
regcache_cache_only(rt722->regmap, false);
243+
regcache_sync(rt722->regmap);
244+
}
245+
return ret;
240246
}
241247

242248
static int rt722_sdca_read_prop(struct sdw_slave *slave)
@@ -501,7 +507,6 @@ static int rt722_sdca_dev_resume(struct device *dev)
501507
{
502508
struct sdw_slave *slave = dev_to_sdw_dev(dev);
503509
struct rt722_sdca_priv *rt722 = dev_get_drvdata(dev);
504-
unsigned long time;
505510

506511
if (!rt722->first_hw_init)
507512
return 0;
@@ -516,15 +521,7 @@ static int rt722_sdca_dev_resume(struct device *dev)
516521
mutex_unlock(&rt722->disable_irq_lock);
517522
goto regmap_sync;
518523
}
519-
520-
time = wait_for_completion_timeout(&slave->initialization_complete,
521-
msecs_to_jiffies(RT722_PROBE_TIMEOUT));
522-
if (!time) {
523-
dev_err(&slave->dev, "Initialization not complete, timed out\n");
524-
sdw_show_ping_status(slave->bus, true);
525-
526-
return -ETIMEDOUT;
527-
}
524+
return 0;
528525

529526
regmap_sync:
530527
slave->unattach_request = 0;

0 commit comments

Comments
 (0)