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

Commit bc40c40e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents fc9975f1 baf69320
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 = {