summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2015-09-21 14:17:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-04 18:38:45 +0100
commitc73942e22aa4a3d910f9be8d48de4080c3a52086 (patch)
treeb5650651f3913cf4f32fefd7b728bcdda9b44f58 /drivers/tty
parent9e08fa50b2f5935a219a323df5380d28f675c585 (diff)
downloadop-kernel-dev-c73942e22aa4a3d910f9be8d48de4080c3a52086.zip
op-kernel-dev-c73942e22aa4a3d910f9be8d48de4080c3a52086.tar.gz
serial: 8250_dw: proper support for UARTs without busy functionality
If the DW_apb_uart is configured with UART_16550_COMPATIBLE configuration parameter set, then the Busy Functionality is not available. These UARTs will never generate the Busy detect indication interrupt, and therefore don't need handling for it. This creates a small optimization for the DW_apb_uarts configured without the busy functionality, but more importantly, it removes the small but real risk of hitting potential issues caused by busy functionality handling when no busy functionality exist. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@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_dw.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 5c6a819..7ed0580 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -65,6 +65,7 @@ struct dw8250_data {
struct uart_8250_dma dma;
unsigned int skip_autocfg:1;
+ unsigned int uart_16550_compatible:1;
};
#define BYT_PRV_CLK 0x800
@@ -317,8 +318,9 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
p->iotype = UPIO_MEM32;
p->regshift = 2;
p->serial_in = dw8250_serial_in32;
- p->serial_out = dw8250_serial_out32;
p->set_termios = dw8250_set_termios;
+ /* So far none of there implement the Busy Functionality */
+ data->uart_16550_compatible = true;
}
/* Platforms with iDMA */
@@ -375,6 +377,9 @@ static int dw8250_probe(struct platform_device *pdev)
data->usr_reg = DW_UART_USR;
p->private_data = data;
+ data->uart_16550_compatible = device_property_read_bool(p->dev,
+ "snps,uart-16550-compatible");
+
err = device_property_read_u32(p->dev, "reg-shift", &val);
if (!err)
p->regshift = val;
@@ -461,6 +466,12 @@ static int dw8250_probe(struct platform_device *pdev)
dw8250_quirks(p, data);
+ /* If the Busy Functionality is not implemented, don't handle it */
+ if (data->uart_16550_compatible) {
+ p->serial_out = NULL;
+ p->handle_irq = NULL;
+ }
+
if (!data->skip_autocfg)
dw8250_setup_port(&uart);
OpenPOWER on IntegriCloud