1
0
Fork 0

watchdog: imx2_wdt: select pinctrl state during suspend/resume

To support suspend/resume from LPSR mode, we need to select default
pinctrl state in resume, so that IOMUXC settings can be restored.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
[Grzegorz: Fix compilation by including <linux/pinctrl/consumer.h> which
	   is required after porting this patch from kernel v4.14 to v5.4.]
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
zero-colors
Shawn Guo 2019-08-28 12:48:40 +02:00 committed by Grzegorz Jaszczyk
parent 3e25bb3ea4
commit 5a1d59d80b
1 changed files with 5 additions and 0 deletions

View File

@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/of_address.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/watchdog.h>
@ -378,6 +379,8 @@ static int imx2_wdt_suspend(struct device *dev)
clk_disable_unprepare(wdev->clk);
pinctrl_pm_select_sleep_state(dev);
return 0;
}
@ -388,6 +391,8 @@ static int imx2_wdt_resume(struct device *dev)
struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
int ret;
pinctrl_pm_select_default_state(dev);
ret = clk_prepare_enable(wdev->clk);
if (ret)
return ret;