Skip to content

Commit 7161bd5

Browse files
ChiYuan Huangbroonie
authored andcommitted
ASoC: rt9120: Make dev PM runtime bind AsoC component PM
RT9120 uses PM runtime autosuspend to decrease the frequently on/off spent time. This exists one case, when pcm is closed and dev PM is waiting for autosuspend time expired to enter runtime suspend state. At the mean time, system is going to enter suspend, dev PM runtime suspend won't be called. It makes the rt9120 suspend consumption current not as expected. This patch can fix the rt9120 dev PM issue during runtime autosuspend and system suspend by binding dev PM runtime and ASoC component PM. Fixes: 80b949f ("ASoC: rt9120: Use pm_runtime and regcache to optimize 'pwdnn' logic") Signed-off-by: ChiYuan Huang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 8a54f66 commit 7161bd5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sound/soc/codecs/rt9120.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,20 @@ static int rt9120_codec_probe(struct snd_soc_component *comp)
177177
return 0;
178178
}
179179

180+
static int rt9120_codec_suspend(struct snd_soc_component *comp)
181+
{
182+
return pm_runtime_force_suspend(comp->dev);
183+
}
184+
185+
static int rt9120_codec_resume(struct snd_soc_component *comp)
186+
{
187+
return pm_runtime_force_resume(comp->dev);
188+
}
189+
180190
static const struct snd_soc_component_driver rt9120_component_driver = {
181191
.probe = rt9120_codec_probe,
192+
.suspend = rt9120_codec_suspend,
193+
.resume = rt9120_codec_resume,
182194
.controls = rt9120_snd_controls,
183195
.num_controls = ARRAY_SIZE(rt9120_snd_controls),
184196
.dapm_widgets = rt9120_dapm_widgets,

0 commit comments

Comments
 (0)