mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	gregkh@linuxfoundation.org, jirislaby@kernel.org,
	ilpo.jarvinen@linux.intel.com, macro@orcam.me.uk,
	jay.dolan@accesio.com, cang1@live.co.uk,
	u.kleine-koenig@pengutronix.de, wander@redhat.com,
	etremblay@distech-controls.com, jk@ozlabs.org,
	biju.das.jz@bp.renesas.com, geert+renesas@glider.be,
	phil.edworthy@renesas.com, lukas@wunner.de,
	UNGLinuxDriver@microchip.com
Subject: Re: [PATCH v4 tty-next 3/3] 8250: microchip: pci1xxxx: Add power management functions to quad-uart driver
Date: Fri, 11 Nov 2022 18:45:13 +0200	[thread overview]
Message-ID: <Y258GVGTxyt5zZnW@smile.fi.intel.com> (raw)
In-Reply-To: <20221111161130.2043882-4-kumaravel.thiagarajan@microchip.com>

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



      reply	other threads:[~2022-11-11 16:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 16:11 [PATCH v4 tty-next 0/3] 8250: microchip: pci1xxxx: Add driver for the pci1xxxx's quad-uart function Kumaravel Thiagarajan
2022-11-11 16:11 ` [PATCH v4 tty-next 1/3] 8250: microchip: pci1xxxx: Add driver for quad-uart support Kumaravel Thiagarajan
2022-11-11 16:39   ` Andy Shevchenko
2022-11-15  7:20     ` Tharunkumar.Pasumarthi
2022-11-15  8:46       ` Andy Shevchenko
2022-11-11 16:11 ` [PATCH v4 tty-next 2/3] 8250: microchip: pci1xxxx: Add rs485 support to quad-uart driver Kumaravel Thiagarajan
2022-11-11 16:42   ` Andy Shevchenko
2022-11-11 16:11 ` [PATCH v4 tty-next 3/3] 8250: microchip: pci1xxxx: Add power management functions " Kumaravel Thiagarajan
2022-11-11 16:45   ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y258GVGTxyt5zZnW@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cang1@live.co.uk \
    --cc=etremblay@distech-controls.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jay.dolan@accesio.com \
    --cc=jirislaby@kernel.org \
    --cc=jk@ozlabs.org \
    --cc=kumaravel.thiagarajan@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=macro@orcam.me.uk \
    --cc=phil.edworthy@renesas.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wander@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®