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

Commit 5bf99fff authored by Archit Saxena's avatar Archit Saxena Committed by Gerrit - the friendly Code Review server
Browse files

driver: tty: qcom: Enable suspend/resume of serial driver



Console driver does not register with suspend and resume framework
hence does not disable its resources resulting in suspend failure.
Enable the same for achiving suspend and resume.

Change-Id: I04d7a5458afd0c9243dbc0ec7fd78ca00dfc7418
Signed-off-by: default avatarArchit Saxena <archsaxe@codeaurora.org>
parent 34dacfee
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -1820,11 +1820,36 @@ static const struct of_device_id msm_match_table[] = {
};
MODULE_DEVICE_TABLE(of, msm_match_table);

#ifdef CONFIG_PM_SLEEP
static int msm_serial_suspend(struct device *dev)
{
	struct msm_port *port = dev_get_drvdata(dev);

	uart_suspend_port(&msm_uart_driver, &port->uart);

	return 0;
}

static int msm_serial_resume(struct device *dev)
{
	struct msm_port *port = dev_get_drvdata(dev);

	uart_resume_port(&msm_uart_driver, &port->uart);

	return 0;
}
#endif /* CONFIG_PM_SLEEP */

static const struct dev_pm_ops msm_serial_dev_pm_ops = {
	SET_SYSTEM_SLEEP_PM_OPS(msm_serial_suspend, msm_serial_resume)
};

static struct platform_driver msm_platform_driver = {
	.remove = msm_serial_remove,
	.probe = msm_serial_probe,
	.driver = {
		.name = "msm_serial",
		.pm = &msm_serial_dev_pm_ops,
		.of_match_table = msm_match_table,
	},
};