linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 1/4] tty: serial: 8250 core: provide a function to export uart_8250_port
@ 2014-07-04 16:34 Sebastian Andrzej Siewior
  2014-07-04 16:34 ` [RFC PATCH 2/4] tty: serial: 8250 core: allow to overwrite & export serial8250_startup() Sebastian Andrzej Siewior
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-07-04 16:34 UTC (permalink / raw)
  To: linux-arm-kernel

There is no access to access a struct uart_8250_port for a specific
line. This is only required outside of the 8250/uart callbacks like for
devices' suspend & remove callbacks. For those the 8250-core provides
wrapper like serial8250_unregister_port() which passes the struct
to the proper function based on the line argument.

For runtime suspend I need access to this struct not only to make
serial_out() work but also to properly restore up->ier and up->mcr.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/tty/serial/8250/8250.h      | 2 ++
 drivers/tty/serial/8250/8250_core.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
index 1ebf853..34c3cd1 100644
--- a/drivers/tty/serial/8250/8250.h
+++ b/drivers/tty/serial/8250/8250.h
@@ -110,6 +110,8 @@ static inline void serial_dl_write(struct uart_8250_port *up, int value)
 	up->dl_write(up, value);
 }
 
+struct uart_8250_port *serial8250_get_port(int line);
+
 #if defined(__alpha__) && !defined(CONFIG_PCI)
 /*
  * Digital did something really horribly wrong with the OUT1 and OUT2
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 7a91c6d..0c90160 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -2755,6 +2755,12 @@ static struct uart_ops serial8250_pops = {
 
 static struct uart_8250_port serial8250_ports[UART_NR];
 
+struct uart_8250_port *serial8250_get_port(int line)
+{
+	return &serial8250_ports[line];
+}
+EXPORT_SYMBOL_GPL(serial8250_get_port);
+
 static void (*serial8250_isa_config)(int port, struct uart_port *up,
 	unsigned short *capabilities);
 
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-07-10  6:43 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04 16:34 [RFC PATCH 1/4] tty: serial: 8250 core: provide a function to export uart_8250_port Sebastian Andrzej Siewior
2014-07-04 16:34 ` [RFC PATCH 2/4] tty: serial: 8250 core: allow to overwrite & export serial8250_startup() Sebastian Andrzej Siewior
2014-07-07 13:09   ` One Thousand Gnomes
2014-07-09 17:39     ` Sebastian Andrzej Siewior
2014-07-04 16:34 ` [RFC PATCH 3/4] tty: serial: 8250 core: add runtime pm Sebastian Andrzej Siewior
2014-07-07 13:20   ` One Thousand Gnomes
2014-07-09 11:17     ` Tony Lindgren
2014-07-09 11:35       ` Sebastian Andrzej Siewior
2014-07-09 11:48         ` Tony Lindgren
2014-07-09 12:42           ` Sebastian Andrzej Siewior
2014-07-09 15:12             ` Tony Lindgren
2014-07-09 16:32               ` Sebastian Andrzej Siewior
2014-07-10  6:43                 ` Tony Lindgren
2014-07-04 16:34 ` [RFC PATCH 4/4] tty: serial: Add 8250-core based omap driver v2 Sebastian Andrzej Siewior
2014-07-07 13:09 ` [RFC PATCH 1/4] tty: serial: 8250 core: provide a function to export uart_8250_port One Thousand Gnomes
2014-07-09 17:23   ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).