Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sound/soc/codecs/max98373-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ static __maybe_unused int max98373_resume(struct device *dev)
if (!slave->unattach_request)
goto regmap_sync;

slave->unattach_request = 0;

time = wait_for_completion_timeout(&slave->initialization_complete,
msecs_to_jiffies(MAX98373_PROBE_TIMEOUT));
if (!time) {
Expand All @@ -273,7 +275,6 @@ static __maybe_unused int max98373_resume(struct device *dev)
}

regmap_sync:
slave->unattach_request = 0;
regcache_cache_only(max98373->regmap, false);
regcache_sync(max98373->regmap);

Expand Down
3 changes: 2 additions & 1 deletion sound/soc/codecs/rt1308-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,8 @@ static int __maybe_unused rt1308_dev_resume(struct device *dev)
if (!slave->unattach_request)
goto regmap_sync;

slave->unattach_request = 0;

time = wait_for_completion_timeout(&slave->initialization_complete,
msecs_to_jiffies(RT1308_PROBE_TIMEOUT));
if (!time) {
Expand All @@ -723,7 +725,6 @@ static int __maybe_unused rt1308_dev_resume(struct device *dev)
}

regmap_sync:
slave->unattach_request = 0;
regcache_cache_only(rt1308->regmap, false);
regcache_sync_region(rt1308->regmap, 0xc000, 0xcfff);

Expand Down
3 changes: 2 additions & 1 deletion sound/soc/codecs/rt1316-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,8 @@ static int __maybe_unused rt1316_dev_resume(struct device *dev)
if (!slave->unattach_request)
goto regmap_sync;

slave->unattach_request = 0;

time = wait_for_completion_timeout(&slave->initialization_complete,
msecs_to_jiffies(RT1316_PROBE_TIMEOUT));
if (!time) {
Expand All @@ -727,7 +729,6 @@ static int __maybe_unused rt1316_dev_resume(struct device *dev)
}

regmap_sync:
slave->unattach_request = 0;
regcache_cache_only(rt1316->regmap, false);
regcache_sync(rt1316->regmap);

Expand Down
3 changes: 2 additions & 1 deletion sound/soc/codecs/rt5682-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,8 @@ static int __maybe_unused rt5682_dev_resume(struct device *dev)
if (!slave->unattach_request)
goto regmap_sync;

slave->unattach_request = 0;

time = wait_for_completion_timeout(&slave->initialization_complete,
msecs_to_jiffies(RT5682_PROBE_TIMEOUT));
if (!time) {
Expand All @@ -749,7 +751,6 @@ static int __maybe_unused rt5682_dev_resume(struct device *dev)
}

regmap_sync:
slave->unattach_request = 0;
regcache_cache_only(rt5682->regmap, false);
regcache_sync(rt5682->regmap);

Expand Down
3 changes: 2 additions & 1 deletion sound/soc/codecs/rt700-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@ static int __maybe_unused rt700_dev_resume(struct device *dev)
if (!slave->unattach_request)
goto regmap_sync;

slave->unattach_request = 0;

time = wait_for_completion_timeout(&slave->initialization_complete,
msecs_to_jiffies(RT700_PROBE_TIMEOUT));
if (!time) {
Expand All @@ -512,7 +514,6 @@ static int __maybe_unused rt700_dev_resume(struct device *dev)
}

regmap_sync:
slave->unattach_request = 0;
regcache_cache_only(rt700->regmap, false);
regcache_sync_region(rt700->regmap, 0x3000, 0x8fff);
regcache_sync_region(rt700->regmap, 0x752010, 0x75206b);
Expand Down
3 changes: 2 additions & 1 deletion sound/soc/codecs/rt711-sdca-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ static int __maybe_unused rt711_sdca_dev_resume(struct device *dev)
if (!slave->unattach_request)
goto regmap_sync;

slave->unattach_request = 0;

time = wait_for_completion_timeout(&slave->initialization_complete,
msecs_to_jiffies(RT711_PROBE_TIMEOUT));
if (!time) {
Expand All @@ -395,7 +397,6 @@ static int __maybe_unused rt711_sdca_dev_resume(struct device *dev)
}

regmap_sync:
slave->unattach_request = 0;
regcache_cache_only(rt711->regmap, false);
regcache_sync(rt711->regmap);
regcache_cache_only(rt711->mbq_regmap, false);
Expand Down
3 changes: 2 additions & 1 deletion sound/soc/codecs/rt711-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,8 @@ static int __maybe_unused rt711_dev_resume(struct device *dev)
if (!slave->unattach_request)
goto regmap_sync;

slave->unattach_request = 0;

time = wait_for_completion_timeout(&slave->initialization_complete,
msecs_to_jiffies(RT711_PROBE_TIMEOUT));
if (!time) {
Expand All @@ -515,7 +517,6 @@ static int __maybe_unused rt711_dev_resume(struct device *dev)
}

regmap_sync:
slave->unattach_request = 0;
regcache_cache_only(rt711->regmap, false);
regcache_sync_region(rt711->regmap, 0x3000, 0x8fff);
regcache_sync_region(rt711->regmap, 0x752009, 0x752091);
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/codecs/rt711.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,12 @@ static int rt711_set_amp_gain_put(struct snd_kcontrol *kcontrol,
break;
}

mutex_lock(&rt711->calibrate_mutex);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shumingfan Does rt711_set_bias_level() needs the mutex, too?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao Right, rt711_set_bias_level() should need the mutex. Thanks.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao if you want to close that PR and add a new one with more fixes that's fine with me. I am running out of time.

if (dapm->bias_level <= SND_SOC_BIAS_STANDBY)
regmap_write(rt711->regmap,
RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D3);
mutex_unlock(&rt711->calibrate_mutex);

return 0;
}

Expand Down
3 changes: 2 additions & 1 deletion sound/soc/codecs/rt715-sdca-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ static int __maybe_unused rt715_dev_resume(struct device *dev)
if (!slave->unattach_request)
goto regmap_sync;

slave->unattach_request = 0;

time = wait_for_completion_timeout(&slave->enumeration_complete,
msecs_to_jiffies(RT715_PROBE_TIMEOUT));
if (!time) {
Expand All @@ -238,7 +240,6 @@ static int __maybe_unused rt715_dev_resume(struct device *dev)
}

regmap_sync:
slave->unattach_request = 0;
regcache_cache_only(rt715->regmap, false);
regcache_sync_region(rt715->regmap,
SDW_SDCA_CTL(FUN_JACK_CODEC, RT715_SDCA_ST_EN, RT715_SDCA_ST_CTRL,
Expand Down
3 changes: 2 additions & 1 deletion sound/soc/codecs/rt715-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ static int __maybe_unused rt715_dev_resume(struct device *dev)
if (!slave->unattach_request)
goto regmap_sync;

slave->unattach_request = 0;

time = wait_for_completion_timeout(&slave->initialization_complete,
msecs_to_jiffies(RT715_PROBE_TIMEOUT));
if (!time) {
Expand All @@ -555,7 +557,6 @@ static int __maybe_unused rt715_dev_resume(struct device *dev)
}

regmap_sync:
slave->unattach_request = 0;
regcache_cache_only(rt715->regmap, false);
regcache_sync_region(rt715->regmap, 0x3000, 0x8fff);
regcache_sync_region(rt715->regmap, 0x752039, 0x752039);
Expand Down