Skip to content

Commit a3a96e9

Browse files
Srinivasa Rao Mandadapubroonie
authored andcommitted
ASoC: qcom: lpass-sc7280: Add system suspend/resume PM ops
Update lpass sc7280 platform driver with PM ops, such as system supend and resume callbacks. This update is required to disable clocks during supend and avoid XO shutdown issue. Signed-off-by: Srinivasa Rao Mandadapu <[email protected]> Tested-by: Rahul Ajmeriya <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 4cbb264 commit a3a96e9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

sound/soc/qcom/lpass-sc7280.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,27 @@ static int sc7280_lpass_exit(struct platform_device *pdev)
232232
struct lpass_data *drvdata = platform_get_drvdata(pdev);
233233

234234
clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks);
235+
return 0;
236+
}
237+
238+
static int sc7280_lpass_dev_resume(struct device *dev)
239+
{
240+
struct lpass_data *drvdata = dev_get_drvdata(dev);
241+
242+
return clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks);
243+
}
244+
245+
static int sc7280_lpass_dev_suspend(struct device *dev)
246+
{
247+
struct lpass_data *drvdata = dev_get_drvdata(dev);
235248

249+
clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks);
236250
return 0;
237251
}
238252

253+
static const struct dev_pm_ops sc7280_lpass_pm_ops = {
254+
SET_SYSTEM_SLEEP_PM_OPS(sc7280_lpass_dev_suspend, sc7280_lpass_dev_resume)
255+
};
239256
static struct lpass_variant sc7280_data = {
240257
.i2sctrl_reg_base = 0x1000,
241258
.i2sctrl_reg_stride = 0x1000,
@@ -426,6 +443,7 @@ static struct platform_driver sc7280_lpass_cpu_platform_driver = {
426443
.driver = {
427444
.name = "sc7280-lpass-cpu",
428445
.of_match_table = of_match_ptr(sc7280_lpass_cpu_device_id),
446+
.pm = &sc7280_lpass_pm_ops,
429447
},
430448
.probe = asoc_qcom_lpass_cpu_platform_probe,
431449
.remove = asoc_qcom_lpass_cpu_platform_remove,

0 commit comments

Comments
 (0)