summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorZidan Wang <zidan.wang@freescale.com>2015-08-27 16:53:40 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 09:24:20 -0500
commit0091949c152a12b48a96fa82a1bb08a039124d48 (patch)
treef6bee59e25f7795e0bc7578c21d7173a988caaea /sound
parent8f2ab3c66fc7c859f8ebb5a0987f5619b9c5d1f1 (diff)
MLK-11436 ASoC: fsl_mqs: restore pin setting for mqs
restore pin setting for mqs in suspend/resume. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/fsl_mqs.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sound/soc/codecs/fsl_mqs.c b/sound/soc/codecs/fsl_mqs.c
index c7555f3a8a42..22c13c0de8e6 100644
--- a/sound/soc/codecs/fsl_mqs.c
+++ b/sound/soc/codecs/fsl_mqs.c
@@ -204,13 +204,30 @@ static int fsl_mqs_remove(struct platform_device *pdev)
return 0;
}
+#if CONFIG_PM_SLEEP
+static int fsl_mqs_suspend(struct device *dev)
+{
+ pinctrl_pm_select_sleep_state(dev);
+ return 0;
+}
+
+static int fsl_mqs_resume(struct device *dev)
+{
+ pinctrl_pm_select_default_state(dev);
+ return 0;
+}
+#endif /* CONFIG_PM_SLEEP */
+
+static const struct dev_pm_ops fsl_mqs_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(fsl_mqs_suspend, fsl_mqs_resume)
+};
+
static const struct of_device_id fsl_mqs_dt_ids[] = {
{ .compatible = "fsl,imx6sx-mqs", },
{}
};
MODULE_DEVICE_TABLE(of, fsl_mqs_dt_ids);
-
static struct platform_driver fsl_mqs_driver = {
.probe = fsl_mqs_probe,
.remove = fsl_mqs_remove,
@@ -218,6 +235,7 @@ static struct platform_driver fsl_mqs_driver = {
.name = "fsl-mqs",
.owner = THIS_MODULE,
.of_match_table = fsl_mqs_dt_ids,
+ .pm = &fsl_mqs_pm_ops,
},
};