Messages in this thread | | | Date | Fri, 11 Nov 2022 18:45:13 +0200 | From | Andy Shevchenko <> | Subject | Re: [PATCH v4 tty-next 3/3] 8250: microchip: pci1xxxx: Add power management functions to quad-uart driver |
| |
On Fri, Nov 11, 2022 at 09:41:30PM +0530, Kumaravel Thiagarajan wrote: > pci1xxxx's quad-uart function has the capability to wake up the host
UART
> from suspend state. Enable wakeup before entering into suspend and > disable wakeup on resume.
> Signed-off-by: Tharun Kumar P <tharunkumar.pasumarthi@microchip.com> > Signed-off-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>
No Co-developed-by?
> +static bool pci1xxxx_port_suspend(int line) > +{ > + struct uart_8250_port *up = serial8250_get_port(line); > + struct uart_port *port = &up->port; > + struct tty_port *tport = &port->state->port; > + unsigned long flags; > + bool ret = false; > + u8 wakeup_mask; > + > + mutex_lock(&tport->mutex); > + if (port->suspended == 0 && port->dev) { > + wakeup_mask = readb(up->port.membase + UART_WAKE_MASK_REG); > + > + spin_lock_irqsave(&port->lock, flags); > + port->mctrl &= ~TIOCM_OUT2; > + port->ops->set_mctrl(port, port->mctrl); > + spin_unlock_irqrestore(&port->lock, flags);
> + if ((wakeup_mask & UART_WAKE_SRCS) != UART_WAKE_SRCS) > + ret = true;
Can be ret = (wakeup_mask & UART_WAKE_SRCS) != UART_WAKE_SRCS;
> + } > + > + writeb(UART_WAKE_SRCS, port->membase + UART_WAKE_REG); > + mutex_unlock(&tport->mutex); > + > + return ret; > +}
-- With Best Regards, Andy Shevchenko
| |