Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit baf69320 authored by Patrick Daly's avatar Patrick Daly
Browse files

tty: serial: msm: Use recommended clock rate during hibernation



Set the rate as recommended to avoid issues where the clock driver skips
reconfiguring the clock hardware during hibernation resume.

Change-Id: I64e0dc381b6ed4ea9b1f5b3eef917d0616bdcf44
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent d5546ff2
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -1858,10 +1858,35 @@ static int msm_serial_resume(struct device *dev)

	return 0;
}

static int msm_serial_freeze(struct device *dev)
{
	struct uart_port *port = dev_get_drvdata(dev);
	struct msm_port *msm_port = UART_TO_MSM(port);
	int ret;

	ret = msm_serial_suspend(dev);
	if (ret)
		return ret;

	/*
	 * Set the rate as recommended to avoid issues where the clock
	 * driver skips reconfiguring the clock hardware during
	 * hibernation resume.
	 */
	return clk_set_rate(msm_port->clk, 19200000);
}
#endif

static const struct dev_pm_ops msm_serial_pm_ops = {
	SET_SYSTEM_SLEEP_PM_OPS(msm_serial_suspend, msm_serial_resume)
#ifdef CONFIG_PM_SLEEP
	.suspend = msm_serial_suspend,
	.resume = msm_serial_resume,
	.freeze = msm_serial_freeze,
	.thaw = msm_serial_resume,
	.poweroff = msm_serial_suspend,
	.restore = msm_serial_resume,
#endif
};

static struct platform_driver msm_platform_driver = {