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

Commit 025d7eb3 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_geni_serial: Add UART Console Port PM state callback"

parents 3d771dd9 22bdbaf6
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -1428,9 +1428,7 @@ static void msm_geni_serial_shutdown(struct uart_port *uport)
	msm_geni_serial_stop_rx(uport);
	spin_unlock_irqrestore(&uport->lock, flags);

	if (uart_console(uport)) {
		se_geni_resources_off(&msm_port->serial_rsc);
	} else {
	if (!uart_console(uport)) {
		msm_geni_serial_power_off(uport);
		if (msm_port->wakeup_irq > 0) {
			irq_set_irq_wake(msm_port->wakeup_irq, 0);
@@ -2080,6 +2078,21 @@ static void msm_geni_serial_debug_init(struct uart_port *uport)
		dev_err(uport->dev, "Failed to create dbg dir\n");
}

static void msm_geni_serial_cons_pm(struct uart_port *uport,
		unsigned int new_state, unsigned int old_state)
{
	struct msm_geni_serial_port *msm_port = GET_DEV_PORT(uport);

	if (unlikely(!uart_console(uport)))
		return;

	if (new_state == UART_PM_STATE_ON && old_state == UART_PM_STATE_OFF)
		se_geni_resources_on(&msm_port->serial_rsc);
	else if (new_state == UART_PM_STATE_OFF &&
			old_state == UART_PM_STATE_ON)
		se_geni_resources_off(&msm_port->serial_rsc);
}

static const struct uart_ops msm_geni_console_pops = {
	.tx_empty = msm_geni_serial_tx_empty,
	.stop_tx = msm_geni_serial_stop_tx,
@@ -2096,6 +2109,7 @@ static const struct uart_ops msm_geni_console_pops = {
	.poll_get_char	= msm_geni_serial_get_char,
	.poll_put_char	= msm_geni_serial_poll_put_char,
#endif
	.pm = msm_geni_serial_cons_pm,
};

static const struct uart_ops msm_geni_serial_pops = {
@@ -2420,7 +2434,6 @@ static int msm_geni_serial_sys_resume_noirq(struct device *dev)

	if (uart_console(uport) &&
	    console_suspend_enabled && uport->suspended) {
		se_geni_resources_on(&port->serial_rsc);
		uart_resume_port((struct uart_driver *)uport->private_data,
									uport);
		disable_irq(uport->irq);