From: Kevin Hilman <khilman@deeprootsystems.com>
To: linux-serial@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Subject: [PATCH] 8250: Allow platform to register PM hook
Date: Wed, 26 Nov 2008 16:25:22 -0800 [thread overview]
Message-ID: <1227745523-5408-1-git-send-email-khilman@deeprootsystems.com> (raw)
Allow platform code to register a PM hook with the 8250 driver. This
enables platform specific code to be run for suspend/resume events.
Since the per-port PM hook is local to the 8250 driver ('struct
uart_port' doesn't have a PM hook) I pass the pm hook from the
platform probe via serial8250_register_port().
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
drivers/serial/8250.c | 7 +++++--
include/linux/serial_8250.h | 7 ++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 5f383d8..993a242 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2842,7 +2842,7 @@ static int __devinit serial8250_probe(struct platform_device *dev)
port.dev = &dev->dev;
if (share_irqs)
port.flags |= UPF_SHARE_IRQ;
- ret = serial8250_register_port(&port);
+ ret = serial8250_register_port(&port, p->pm);
if (ret < 0) {
dev_err(&dev->dev, "unable to register port at index %d "
"(IO%lx MEM%llx IRQ%d): %d\n", i,
@@ -2966,7 +2966,9 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
*
* On success the port is ready to use and the line number is returned.
*/
-int serial8250_register_port(struct uart_port *port)
+int serial8250_register_port(struct uart_port *port,
+ void (*pm)(struct uart_port *, unsigned int state,
+ unsigned int oldstate))
{
struct uart_8250_port *uart;
int ret = -ENOSPC;
@@ -2990,6 +2992,7 @@ int serial8250_register_port(struct uart_port *port)
uart->port.flags = port->flags | UPF_BOOT_AUTOCONF;
uart->port.mapbase = port->mapbase;
uart->port.private_data = port->private_data;
+ uart->pm = pm;
if (port->dev)
uart->port.dev = port->dev;
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 3d37c94..97723c5 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -28,6 +28,9 @@ struct plat_serial8250_port {
unsigned char iotype; /* UPIO_* */
unsigned char hub6;
upf_t flags; /* UPF_* flags */
+
+ void (*pm)(struct uart_port *, unsigned int state,
+ unsigned int oldstate);
};
/*
@@ -57,7 +60,9 @@ enum {
*/
struct uart_port;
-int serial8250_register_port(struct uart_port *);
+int serial8250_register_port(struct uart_port *,
+ void (*pm)(struct uart_port *, unsigned int state,
+ unsigned int oldstate));
void serial8250_unregister_port(int line);
void serial8250_suspend_port(int line);
void serial8250_resume_port(int line);
--
1.6.0.3
next reply other threads:[~2008-11-27 0:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-27 0:25 Kevin Hilman [this message]
2008-11-27 0:25 ` [PATCH] 8250: when waking, PM hook should be called before accessing port Kevin Hilman
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=1227745523-5408-1-git-send-email-khilman@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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