[3/5] serial/8250: export serial8250_read_char

Message ID 20180321025241.19785-4-jk@ozlabs.org
State New
Headers show
Series
  • serial: implement flow control for ASPEED VUART driver
Related show

Commit Message

Jeremy Kerr March 21, 2018, 2:52 a.m.
Currently, we export serial8250_rx_chars, which does a whole bunch of
reads from the 8250 data register, without any form of flow control
between reads.

An upcoming change to the aspeed vuart driver implements more
fine-grained flow control in the interrupt handler, requiring
character-at-a-time control over the rx path.

This change exports serial8250_read_char to allow this.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
 drivers/tty/serial/8250/8250_port.c | 3 ++-
 include/linux/serial_8250.h         | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Eddie James March 23, 2018, 3:51 p.m. | #1
On 03/20/2018 09:52 PM, Jeremy Kerr wrote:
> Currently, we export serial8250_rx_chars, which does a whole bunch of
> reads from the 8250 data register, without any form of flow control
> between reads.
>
> An upcoming change to the aspeed vuart driver implements more
> fine-grained flow control in the interrupt handler, requiring
> character-at-a-time control over the rx path.
>
> This change exports serial8250_read_char to allow this.

Tested-by: Eddie James <eajames@linux.vnet.ibm.com>

>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> ---
>   drivers/tty/serial/8250/8250_port.c | 3 ++-
>   include/linux/serial_8250.h         | 1 +
>   2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index a5fe0e66c607..ea435406936c 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -1650,7 +1650,7 @@ static void serial8250_enable_ms(struct uart_port *port)
>   	serial8250_rpm_put(up);
>   }
>
> -static void serial8250_read_char(struct uart_8250_port *up, unsigned char lsr)
> +void serial8250_read_char(struct uart_8250_port *up, unsigned char lsr)
>   {
>   	struct uart_port *port = &up->port;
>   	unsigned char ch;
> @@ -1710,6 +1710,7 @@ static void serial8250_read_char(struct uart_8250_port *up, unsigned char lsr)
>
>   	uart_insert_char(port, lsr, UART_LSR_OE, ch, flag);
>   }
> +EXPORT_SYMBOL_GPL(serial8250_read_char);
>
>   /*
>    * serial8250_rx_chars: processes according to the passed in LSR
> diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
> index 61fbb440449c..4639a3608614 100644
> --- a/include/linux/serial_8250.h
> +++ b/include/linux/serial_8250.h
> @@ -162,6 +162,7 @@ extern void serial8250_do_set_mctrl(struct uart_port *port, unsigned int mctrl);
>   extern int fsl8250_handle_irq(struct uart_port *port);
>   int serial8250_handle_irq(struct uart_port *port, unsigned int iir);
>   unsigned char serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr);
> +void serial8250_read_char(struct uart_8250_port *up, unsigned char lsr);
>   void serial8250_tx_chars(struct uart_8250_port *up);
>   unsigned int serial8250_modem_status(struct uart_8250_port *up);
>   void serial8250_init_port(struct uart_8250_port *up);

Patch

diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index a5fe0e66c607..ea435406936c 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -1650,7 +1650,7 @@  static void serial8250_enable_ms(struct uart_port *port)
 	serial8250_rpm_put(up);
 }
 
-static void serial8250_read_char(struct uart_8250_port *up, unsigned char lsr)
+void serial8250_read_char(struct uart_8250_port *up, unsigned char lsr)
 {
 	struct uart_port *port = &up->port;
 	unsigned char ch;
@@ -1710,6 +1710,7 @@  static void serial8250_read_char(struct uart_8250_port *up, unsigned char lsr)
 
 	uart_insert_char(port, lsr, UART_LSR_OE, ch, flag);
 }
+EXPORT_SYMBOL_GPL(serial8250_read_char);
 
 /*
  * serial8250_rx_chars: processes according to the passed in LSR
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 61fbb440449c..4639a3608614 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -162,6 +162,7 @@  extern void serial8250_do_set_mctrl(struct uart_port *port, unsigned int mctrl);
 extern int fsl8250_handle_irq(struct uart_port *port);
 int serial8250_handle_irq(struct uart_port *port, unsigned int iir);
 unsigned char serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr);
+void serial8250_read_char(struct uart_8250_port *up, unsigned char lsr);
 void serial8250_tx_chars(struct uart_8250_port *up);
 unsigned int serial8250_modem_status(struct uart_8250_port *up);
 void serial8250_init_port(struct uart_8250_port *up);