[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 11 Nov 2022 18:45:13 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Kumaravel Thiagarajan <kumaravel.thiagarajan@...rochip.com>
Cc: linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
gregkh@...uxfoundation.org, jirislaby@...nel.org,
ilpo.jarvinen@...ux.intel.com, macro@...am.me.uk,
jay.dolan@...esio.com, cang1@...e.co.uk,
u.kleine-koenig@...gutronix.de, wander@...hat.com,
etremblay@...tech-controls.com, jk@...abs.org,
biju.das.jz@...renesas.com, geert+renesas@...der.be,
phil.edworthy@...esas.com, lukas@...ner.de,
UNGLinuxDriver@...rochip.com
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@...rochip.com>
> Signed-off-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@...rochip.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
Powered by blists - more mailing lists