diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2017-01-26 10:29:24 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-01-26 16:35:50 +0100 |
commit | 1fc8ad86f73689b4e47f8d3c89aab946120468f3 (patch) | |
tree | 81ef8eeb804534c9f584adcb4952cfeb9989c7d8 /drivers/pinctrl/samsung/pinctrl-samsung.c | |
parent | 991efb0f151fb9ee603818b2ee1e56666ff6a5eb (diff) | |
download | linux-1fc8ad86f73689b4e47f8d3c89aab946120468f3.tar.gz linux-1fc8ad86f73689b4e47f8d3c89aab946120468f3.tar.bz2 linux-1fc8ad86f73689b4e47f8d3c89aab946120468f3.zip |
pinctrl: samsung: Add infrastructure for pin-bank retention control
Pad retention control after suspend/resume cycle should be done from pin
controller driver instead of PMU (power management unit) driver to avoid
possible ordering and logical dependencies. Till now it worked fine only
because PMU driver registered its sys_ops after pin controller.
This patch adds infrastructure to handle pad retention during pin control
driver resume.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/samsung/pinctrl-samsung.c')
-rw-r--r-- | drivers/pinctrl/samsung/pinctrl-samsung.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 59f99ea7e65b..021abd7221f8 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -1060,6 +1060,13 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) if (res) drvdata->irq = res->start; + if (ctrl->retention_data) { + drvdata->retention_ctrl = ctrl->retention_data->init(drvdata, + ctrl->retention_data); + if (IS_ERR(drvdata->retention_ctrl)) + return PTR_ERR(drvdata->retention_ctrl); + } + ret = samsung_gpiolib_register(pdev, drvdata); if (ret) return ret; @@ -1126,6 +1133,8 @@ static void samsung_pinctrl_suspend_dev( if (drvdata->suspend) drvdata->suspend(drvdata); + if (drvdata->retention_ctrl && drvdata->retention_ctrl->enable) + drvdata->retention_ctrl->enable(drvdata); } /** @@ -1173,6 +1182,9 @@ static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) if (widths[type]) writel(bank->pm_save[type], reg + offs[type]); } + + if (drvdata->retention_ctrl && drvdata->retention_ctrl->disable) + drvdata->retention_ctrl->disable(drvdata); } /** |