aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-07-17 12:06:20 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-17 12:11:50 -0400
commitce7240e445303de3ca66e6d08f17a2ec278a5bf6 (patch)
tree8ee84f5ae903dcd72e0641ae4932da71cd9a7b4b
parent9833facf90c625f9757295bda6d970f82132b7be (diff)
8250: three way resolve of the 8250 diffs
This resolves the differences between the original 8250 patch, the revised 8250 patch and the independant clean up of the octeon driver (to use platform devices properly yay!) Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/char/mwave/mwavedd.c16
-rw-r--r--drivers/misc/ibmasm/uart.c16
-rw-r--r--drivers/net/ethernet/sgi/ioc3-eth.c22
-rw-r--r--drivers/tty/serial/8250/8250.h30
-rw-r--r--drivers/tty/serial/8250/8250_dw.c2
-rw-r--r--drivers/tty/serial/of_serial.c9
-rw-r--r--include/linux/serial_8250.h32
7 files changed, 67 insertions, 60 deletions
diff --git a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c
index 1d82d5838f0c..164544afd680 100644
--- a/drivers/char/mwave/mwavedd.c
+++ b/drivers/char/mwave/mwavedd.c
@@ -430,7 +430,7 @@ static ssize_t mwave_write(struct file *file, const char __user *buf,
430 430
431static int register_serial_portandirq(unsigned int port, int irq) 431static int register_serial_portandirq(unsigned int port, int irq)
432{ 432{
433 struct uart_port uart; 433 struct uart_8250_port uart;
434 434
435 switch ( port ) { 435 switch ( port ) {
436 case 0x3f8: 436 case 0x3f8:
@@ -462,14 +462,14 @@ static int register_serial_portandirq(unsigned int port, int irq)
462 } /* switch */ 462 } /* switch */
463 /* irq is okay */ 463 /* irq is okay */
464 464
465 memset(&uart, 0, sizeof(struct uart_port)); 465 memset(&uart, 0, sizeof(uart));
466 466
467 uart.uartclk = 1843200; 467 uart.port.uartclk = 1843200;
468 uart.iobase = port; 468 uart.port.iobase = port;
469 uart.irq = irq; 469 uart.port.irq = irq;
470 uart.iotype = UPIO_PORT; 470 uart.port.iotype = UPIO_PORT;
471 uart.flags = UPF_SHARE_IRQ; 471 uart.port.flags = UPF_SHARE_IRQ;
472 return serial8250_register_port(&uart); 472 return serial8250_register_8250_port(&uart);
473} 473}
474 474
475 475
diff --git a/drivers/misc/ibmasm/uart.c b/drivers/misc/ibmasm/uart.c
index 1dcb9ae1905a..01e2b0d7e590 100644
--- a/drivers/misc/ibmasm/uart.c
+++ b/drivers/misc/ibmasm/uart.c
@@ -33,7 +33,7 @@
33 33
34void ibmasm_register_uart(struct service_processor *sp) 34void ibmasm_register_uart(struct service_processor *sp)
35{ 35{
36 struct uart_port uport; 36 struct uart_8250_port uart;
37 void __iomem *iomem_base; 37 void __iomem *iomem_base;
38 38
39 iomem_base = sp->base_address + SCOUT_COM_B_BASE; 39 iomem_base = sp->base_address + SCOUT_COM_B_BASE;
@@ -47,14 +47,14 @@ void ibmasm_register_uart(struct service_processor *sp)
47 return; 47 return;
48 } 48 }
49 49
50 memset(&uport, 0, sizeof(struct uart_port)); 50 memset(&uart, 0, sizeof(uart));
51 uport.irq = sp->irq; 51 uart.port.irq = sp->irq;
52 uport.uartclk = 3686400; 52 uart.port.uartclk = 3686400;
53 uport.flags = UPF_SHARE_IRQ; 53 uart.port.flags = UPF_SHARE_IRQ;
54 uport.iotype = UPIO_MEM; 54 uart.port.iotype = UPIO_MEM;
55 uport.membase = iomem_base; 55 uart.port.membase = iomem_base;
56 56
57 sp->serial_line = serial8250_register_port(&uport); 57 sp->serial_line = serial8250_register_8250_port(&uart);
58 if (sp->serial_line < 0) { 58 if (sp->serial_line < 0) {
59 dev_err(sp->dev, "Failed to register serial port\n"); 59 dev_err(sp->dev, "Failed to register serial port\n");
60 return; 60 return;
diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
index ac149d99f78f..fcb5b0e0f260 100644
--- a/drivers/net/ethernet/sgi/ioc3-eth.c
+++ b/drivers/net/ethernet/sgi/ioc3-eth.c
@@ -1147,15 +1147,17 @@ static void __devinit ioc3_8250_register(struct ioc3_uartregs __iomem *uart)
1147{ 1147{
1148#define COSMISC_CONSTANT 6 1148#define COSMISC_CONSTANT 6
1149 1149
1150 struct uart_port port = { 1150 struct uart_8250_port port = {
1151 .irq = 0, 1151 .port = {
1152 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, 1152 .irq = 0,
1153 .iotype = UPIO_MEM, 1153 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
1154 .regshift = 0, 1154 .iotype = UPIO_MEM,
1155 .uartclk = (22000000 << 1) / COSMISC_CONSTANT, 1155 .regshift = 0,
1156 1156 .uartclk = (22000000 << 1) / COSMISC_CONSTANT,
1157 .membase = (unsigned char __iomem *) uart, 1157
1158 .mapbase = (unsigned long) uart, 1158 .membase = (unsigned char __iomem *) uart,
1159 .mapbase = (unsigned long) uart,
1160 }
1159 }; 1161 };
1160 unsigned char lcr; 1162 unsigned char lcr;
1161 1163
@@ -1164,7 +1166,7 @@ static void __devinit ioc3_8250_register(struct ioc3_uartregs __iomem *uart)
1164 uart->iu_scr = COSMISC_CONSTANT, 1166 uart->iu_scr = COSMISC_CONSTANT,
1165 uart->iu_lcr = lcr; 1167 uart->iu_lcr = lcr;
1166 uart->iu_lcr; 1168 uart->iu_lcr;
1167 serial8250_register_port(&port); 1169 serial8250_register_8250_port(&port);
1168} 1170}
1169 1171
1170static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3) 1172static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)
diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
index c335b2b23a5f..972b5212b58c 100644
--- a/drivers/tty/serial/8250/8250.h
+++ b/drivers/tty/serial/8250/8250.h
@@ -13,36 +13,6 @@
13 13
14#include <linux/serial_8250.h> 14#include <linux/serial_8250.h>
15 15
16struct uart_8250_port {
17 struct uart_port port;
18 struct timer_list timer; /* "no irq" timer */
19 struct list_head list; /* ports on this IRQ */
20 unsigned short capabilities; /* port capabilities */
21 unsigned short bugs; /* port bugs */
22 unsigned int tx_loadsz; /* transmit fifo load size */
23 unsigned char acr;
24 unsigned char ier;
25 unsigned char lcr;
26 unsigned char mcr;
27 unsigned char mcr_mask; /* mask of user bits */
28 unsigned char mcr_force; /* mask of forced bits */
29 unsigned char cur_iotype; /* Running I/O type */
30
31 /*
32 * Some bits in registers are cleared on a read, so they must
33 * be saved whenever the register is read but the bits will not
34 * be immediately processed.
35 */
36#define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS
37 unsigned char lsr_saved_flags;
38#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
39 unsigned char msr_saved_flags;
40
41 /* 8250 specific callbacks */
42 int (*dl_read)(struct uart_8250_port *);
43 void (*dl_write)(struct uart_8250_port *, int);
44};
45
46struct old_serial_port { 16struct old_serial_port {
47 unsigned int uart; 17 unsigned int uart;
48 unsigned int baud_base; 18 unsigned int baud_base;
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index afb955fdef03..c3b2ec0c8c0b 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -141,7 +141,7 @@ static int __devinit dw8250_probe(struct platform_device *pdev)
141 dev_err(&pdev->dev, "no clock-frequency property set\n"); 141 dev_err(&pdev->dev, "no clock-frequency property set\n");
142 return -EINVAL; 142 return -EINVAL;
143 } 143 }
144 uart.uart.port.uartclk = val; 144 uart.port.uartclk = val;
145 145
146 data->line = serial8250_register_8250_port(&uart); 146 data->line = serial8250_register_8250_port(&uart);
147 if (data->line < 0) 147 if (data->line < 0)
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 34e71874a892..ffc7879e85a4 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -144,8 +144,15 @@ static int __devinit of_platform_serial_probe(struct platform_device *ofdev)
144 switch (port_type) { 144 switch (port_type) {
145#ifdef CONFIG_SERIAL_8250 145#ifdef CONFIG_SERIAL_8250
146 case PORT_8250 ... PORT_MAX_8250: 146 case PORT_8250 ... PORT_MAX_8250:
147 ret = serial8250_register_port(&port); 147 {
148 /* For now the of bindings don't support the extra
149 8250 specific bits */
150 struct uart_8250_port port8250;
151 memset(&port8250, 0, sizeof(port8250));
152 port8250.port = port;
153 ret = serial8250_register_8250_port(&port8250);
148 break; 154 break;
155 }
149#endif 156#endif
150#ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL 157#ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
151 case PORT_NWPSERIAL: 158 case PORT_NWPSERIAL:
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index f41dcc949218..c174c90fb3fb 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -65,8 +65,36 @@ enum {
65 * platform device. Using these will make your driver 65 * platform device. Using these will make your driver
66 * dependent on the 8250 driver. 66 * dependent on the 8250 driver.
67 */ 67 */
68struct uart_port; 68
69struct uart_8250_port; 69struct uart_8250_port {
70 struct uart_port port;
71 struct timer_list timer; /* "no irq" timer */
72 struct list_head list; /* ports on this IRQ */
73 unsigned short capabilities; /* port capabilities */
74 unsigned short bugs; /* port bugs */
75 unsigned int tx_loadsz; /* transmit fifo load size */
76 unsigned char acr;
77 unsigned char ier;
78 unsigned char lcr;
79 unsigned char mcr;
80 unsigned char mcr_mask; /* mask of user bits */
81 unsigned char mcr_force; /* mask of forced bits */
82 unsigned char cur_iotype; /* Running I/O type */
83
84 /*
85 * Some bits in registers are cleared on a read, so they must
86 * be saved whenever the register is read but the bits will not
87 * be immediately processed.
88 */
89#define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS
90 unsigned char lsr_saved_flags;
91#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
92 unsigned char msr_saved_flags;
93
94 /* 8250 specific callbacks */
95 int (*dl_read)(struct uart_8250_port *);
96 void (*dl_write)(struct uart_8250_port *, int);
97};
70 98
71int serial8250_register_8250_port(struct uart_8250_port *); 99int serial8250_register_8250_port(struct uart_8250_port *);
72void serial8250_unregister_port(int line); 100void serial8250_unregister_port(int line);