Skip to content

Commit 6b11212

Browse files
committed
ASoC: rt712: don't wait codec init in resume
Move regmap sync to rt712_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 7499c7b commit 6b11212

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ static int rt712_sdca_update_status(struct sdw_slave *slave,
157157
enum sdw_slave_status status)
158158
{
159159
struct rt712_sdca_priv *rt712 = dev_get_drvdata(&slave->dev);
160+
int ret;
160161

161162
if (status == SDW_SLAVE_UNATTACHED)
162163
rt712->hw_init = false;
@@ -184,7 +185,15 @@ static int rt712_sdca_update_status(struct sdw_slave *slave,
184185
return 0;
185186

186187
/* perform I/O transfers required for Slave initialization */
187-
return rt712_sdca_io_init(&slave->dev, slave);
188+
ret = rt712_sdca_io_init(&slave->dev, slave);
189+
190+
if (slave->unattach_request) {
191+
regcache_cache_only(rt712->regmap, false);
192+
regcache_sync(rt712->regmap);
193+
regcache_cache_only(rt712->mbq_regmap, false);
194+
regcache_sync(rt712->mbq_regmap);
195+
}
196+
return ret;
188197
}
189198

190199
static int rt712_sdca_read_prop(struct sdw_slave *slave)
@@ -452,7 +461,6 @@ static int rt712_sdca_dev_resume(struct device *dev)
452461
{
453462
struct sdw_slave *slave = dev_to_sdw_dev(dev);
454463
struct rt712_sdca_priv *rt712 = dev_get_drvdata(dev);
455-
unsigned long time;
456464

457465
if (!rt712->first_hw_init)
458466
return 0;
@@ -468,15 +476,7 @@ static int rt712_sdca_dev_resume(struct device *dev)
468476
mutex_unlock(&rt712->disable_irq_lock);
469477
goto regmap_sync;
470478
}
471-
472-
time = wait_for_completion_timeout(&slave->initialization_complete,
473-
msecs_to_jiffies(RT712_PROBE_TIMEOUT));
474-
if (!time) {
475-
dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__);
476-
sdw_show_ping_status(slave->bus, true);
477-
478-
return -ETIMEDOUT;
479-
}
479+
return 0;
480480

481481
regmap_sync:
482482
slave->unattach_request = 0;

0 commit comments

Comments
 (0)