diff options
author | Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad@intel.com> | 2016-04-06 00:06:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-30 12:26:55 -0400 |
commit | 144ef5c2df9b473dad7eab375adcf5b11d0b1e47 (patch) | |
tree | 432a465af40a3ce4d1a99eb74ab947f4dd2519bc /drivers/tty | |
parent | eeeabba024191c810b83592578cfc6183c4059fa (diff) |
serial: 8250: export get_mctrl function
Exposes get_mctrl() function so that it can be overriden with platform
specific implementation.
Signed-off-by: Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/8250/8250_core.c | 3 | ||||
-rw-r--r-- | drivers/tty/serial/8250/8250_port.c | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 2f4f5ee651db..0fbd7c033a25 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c | |||
@@ -830,6 +830,7 @@ static int serial8250_probe(struct platform_device *dev) | |||
830 | uart.port.handle_irq = p->handle_irq; | 830 | uart.port.handle_irq = p->handle_irq; |
831 | uart.port.handle_break = p->handle_break; | 831 | uart.port.handle_break = p->handle_break; |
832 | uart.port.set_termios = p->set_termios; | 832 | uart.port.set_termios = p->set_termios; |
833 | uart.port.get_mctrl = p->get_mctrl; | ||
833 | uart.port.pm = p->pm; | 834 | uart.port.pm = p->pm; |
834 | uart.port.dev = &dev->dev; | 835 | uart.port.dev = &dev->dev; |
835 | uart.port.irqflags |= irqflag; | 836 | uart.port.irqflags |= irqflag; |
@@ -1022,6 +1023,8 @@ int serial8250_register_8250_port(struct uart_8250_port *up) | |||
1022 | /* Possibly override set_termios call */ | 1023 | /* Possibly override set_termios call */ |
1023 | if (up->port.set_termios) | 1024 | if (up->port.set_termios) |
1024 | uart->port.set_termios = up->port.set_termios; | 1025 | uart->port.set_termios = up->port.set_termios; |
1026 | if (up->port.get_mctrl) | ||
1027 | uart->port.get_mctrl = up->port.get_mctrl; | ||
1025 | if (up->port.set_mctrl) | 1028 | if (up->port.set_mctrl) |
1026 | uart->port.set_mctrl = up->port.set_mctrl; | 1029 | uart->port.set_mctrl = up->port.set_mctrl; |
1027 | if (up->port.startup) | 1030 | if (up->port.startup) |
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 00ad2637b08c..a803ddfd5a59 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c | |||
@@ -1882,7 +1882,7 @@ static unsigned int serial8250_tx_empty(struct uart_port *port) | |||
1882 | return (lsr & BOTH_EMPTY) == BOTH_EMPTY ? TIOCSER_TEMT : 0; | 1882 | return (lsr & BOTH_EMPTY) == BOTH_EMPTY ? TIOCSER_TEMT : 0; |
1883 | } | 1883 | } |
1884 | 1884 | ||
1885 | static unsigned int serial8250_get_mctrl(struct uart_port *port) | 1885 | unsigned int serial8250_do_get_mctrl(struct uart_port *port) |
1886 | { | 1886 | { |
1887 | struct uart_8250_port *up = up_to_u8250p(port); | 1887 | struct uart_8250_port *up = up_to_u8250p(port); |
1888 | unsigned int status; | 1888 | unsigned int status; |
@@ -1903,6 +1903,14 @@ static unsigned int serial8250_get_mctrl(struct uart_port *port) | |||
1903 | ret |= TIOCM_CTS; | 1903 | ret |= TIOCM_CTS; |
1904 | return ret; | 1904 | return ret; |
1905 | } | 1905 | } |
1906 | EXPORT_SYMBOL_GPL(serial8250_do_get_mctrl); | ||
1907 | |||
1908 | static unsigned int serial8250_get_mctrl(struct uart_port *port) | ||
1909 | { | ||
1910 | if (port->get_mctrl) | ||
1911 | return port->get_mctrl(port); | ||
1912 | return serial8250_do_get_mctrl(port); | ||
1913 | } | ||
1906 | 1914 | ||
1907 | void serial8250_do_set_mctrl(struct uart_port *port, unsigned int mctrl) | 1915 | void serial8250_do_set_mctrl(struct uart_port *port, unsigned int mctrl) |
1908 | { | 1916 | { |