summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/mediatek
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2019-05-08 03:33:30 -0400
committerLinus Walleij <linus.walleij@linaro.org>2019-06-01 13:40:16 -0400
commit5c0904488a20429e3de41d11f1d1adf28635e362 (patch)
treea09569e456a1b12206975ffb006608b2119ac1a4 /drivers/pinctrl/mediatek
parentfcae009397cd7c3c144e58e98027c97746559656 (diff)
pinctrl: mediatek: Add pm_ops to pinctrl-paris
pinctrl variants that include pinctrl-paris.h (and not pinctrl-mtk-common.h) also need to use pm_ops to setup wake mask properly, so copy over the pm_ops from common to paris variant. It is not easy to merge the 2 copies (or move mtk_eint_suspend/resume to mtk-eint.c), as we need to dereference pctrl->eint, and struct mtk_pinctrl *pctl has a different structure definition for v1 and v2 (which is what paris variant uses). Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Acked-by: Sean Wang <sean.wang@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/mediatek')
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-paris.c19
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-paris.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
index d3b34e9a7507..923264d0e9ef 100644
--- a/drivers/pinctrl/mediatek/pinctrl-paris.c
+++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
@@ -926,3 +926,22 @@ int mtk_paris_pinctrl_probe(struct platform_device *pdev,
926 926
927 return 0; 927 return 0;
928} 928}
929
930static int mtk_paris_pinctrl_suspend(struct device *device)
931{
932 struct mtk_pinctrl *pctl = dev_get_drvdata(device);
933
934 return mtk_eint_do_suspend(pctl->eint);
935}
936
937static int mtk_paris_pinctrl_resume(struct device *device)
938{
939 struct mtk_pinctrl *pctl = dev_get_drvdata(device);
940
941 return mtk_eint_do_resume(pctl->eint);
942}
943
944const struct dev_pm_ops mtk_paris_pinctrl_pm_ops = {
945 .suspend_noirq = mtk_paris_pinctrl_suspend,
946 .resume_noirq = mtk_paris_pinctrl_resume,
947};
diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.h b/drivers/pinctrl/mediatek/pinctrl-paris.h
index 37146caa667d..3d43771074e6 100644
--- a/drivers/pinctrl/mediatek/pinctrl-paris.h
+++ b/drivers/pinctrl/mediatek/pinctrl-paris.h
@@ -60,4 +60,6 @@
60int mtk_paris_pinctrl_probe(struct platform_device *pdev, 60int mtk_paris_pinctrl_probe(struct platform_device *pdev,
61 const struct mtk_pin_soc *soc); 61 const struct mtk_pin_soc *soc);
62 62
63extern const struct dev_pm_ops mtk_paris_pinctrl_pm_ops;
64
63#endif /* __PINCTRL_PARIS_H */ 65#endif /* __PINCTRL_PARIS_H */