tty: serial: imx: add pinctrl sleep/default mode switch for suspend
On some i.MX SoCs' low power mode, such as i.MX7D's LPSR(low power state retention), UART iomux settings will be lost, need to add pinctrl sleep/default mode switch during suspend/resume to make sure UART iomux settings are correct after resume. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
07b5e16e98
commit
fcfed1be53
@ -24,6 +24,7 @@
|
|||||||
#include <linux/serial.h>
|
#include <linux/serial.h>
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
|
#include <linux/pinctrl/consumer.h>
|
||||||
#include <linux/rational.h>
|
#include <linux/rational.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
@ -2444,6 +2445,8 @@ static int imx_uart_suspend_noirq(struct device *dev)
|
|||||||
|
|
||||||
clk_disable(sport->clk_ipg);
|
clk_disable(sport->clk_ipg);
|
||||||
|
|
||||||
|
pinctrl_pm_select_sleep_state(dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2452,6 +2455,8 @@ static int imx_uart_resume_noirq(struct device *dev)
|
|||||||
struct imx_port *sport = dev_get_drvdata(dev);
|
struct imx_port *sport = dev_get_drvdata(dev);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
pinctrl_pm_select_default_state(dev);
|
||||||
|
|
||||||
ret = clk_enable(sport->clk_ipg);
|
ret = clk_enable(sport->clk_ipg);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user