diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2019-05-08 10:33:30 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-06-01 20:40:16 +0300 |
commit | 5c0904488a20429e3de41d11f1d1adf28635e362 (patch) | |
tree | a09569e456a1b12206975ffb006608b2119ac1a4 /drivers/pinctrl/mediatek/pinctrl-paris.c | |
parent | fcae009397cd7c3c144e58e98027c97746559656 (diff) | |
download | linux-5c0904488a20429e3de41d11f1d1adf28635e362.tar.xz |
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/pinctrl-paris.c')
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-paris.c | 19 |
1 files changed, 19 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, return 0; } + +static int mtk_paris_pinctrl_suspend(struct device *device) +{ + struct mtk_pinctrl *pctl = dev_get_drvdata(device); + + return mtk_eint_do_suspend(pctl->eint); +} + +static int mtk_paris_pinctrl_resume(struct device *device) +{ + struct mtk_pinctrl *pctl = dev_get_drvdata(device); + + return mtk_eint_do_resume(pctl->eint); +} + +const struct dev_pm_ops mtk_paris_pinctrl_pm_ops = { + .suspend_noirq = mtk_paris_pinctrl_suspend, + .resume_noirq = mtk_paris_pinctrl_resume, +}; |