Skip to content

Commit ce7240e

Browse files
Alan Coxgregkh
authored andcommitted
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>
1 parent 9833fac commit ce7240e

7 files changed

Lines changed: 67 additions & 60 deletions

File tree

‎drivers/char/mwave/mwavedd.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ static ssize_t mwave_write(struct file *file, const char __user *buf,
430430

431431
static int register_serial_portandirq(unsigned int port, int irq)
432432
{
433-
struct uart_port uart;
433+
struct uart_8250_port uart;
434434

435435
switch ( port ) {
436436
case 0x3f8:
@@ -462,14 +462,14 @@ static int register_serial_portandirq(unsigned int port, int irq)
462462
} /* switch */
463463
/* irq is okay */
464464

465-
memset(&uart, 0, sizeof(struct uart_port));
465+
memset(&uart, 0, sizeof(uart));
466466

467-
uart.uartclk = 1843200;
468-
uart.iobase = port;
469-
uart.irq = irq;
470-
uart.iotype = UPIO_PORT;
471-
uart.flags = UPF_SHARE_IRQ;
472-
return serial8250_register_port(&uart);
467+
uart.port.uartclk = 1843200;
468+
uart.port.iobase = port;
469+
uart.port.irq = irq;
470+
uart.port.iotype = UPIO_PORT;
471+
uart.port.flags = UPF_SHARE_IRQ;
472+
return serial8250_register_8250_port(&uart);
473473
}
474474

475475

‎drivers/misc/ibmasm/uart.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
void ibmasm_register_uart(struct service_processor *sp)
3535
{
36-
struct uart_port uport;
36+
struct uart_8250_port uart;
3737
void __iomem *iomem_base;
3838

3939
iomem_base = sp->base_address + SCOUT_COM_B_BASE;
@@ -47,14 +47,14 @@ void ibmasm_register_uart(struct service_processor *sp)
4747
return;
4848
}
4949

50-
memset(&uport, 0, sizeof(struct uart_port));
51-
uport.irq = sp->irq;
52-
uport.uartclk = 3686400;
53-
uport.flags = UPF_SHARE_IRQ;
54-
uport.iotype = UPIO_MEM;
55-
uport.membase = iomem_base;
50+
memset(&uart, 0, sizeof(uart));
51+
uart.port.irq = sp->irq;
52+
uart.port.uartclk = 3686400;
53+
uart.port.flags = UPF_SHARE_IRQ;
54+
uart.port.iotype = UPIO_MEM;
55+
uart.port.membase = iomem_base;
5656

57-
sp->serial_line = serial8250_register_port(&uport);
57+
sp->serial_line = serial8250_register_8250_port(&uart);
5858
if (sp->serial_line < 0) {
5959
dev_err(sp->dev, "Failed to register serial port\n");
6060
return;

‎drivers/net/ethernet/sgi/ioc3-eth.c‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,15 +1147,17 @@ static void __devinit ioc3_8250_register(struct ioc3_uartregs __iomem *uart)
11471147
{
11481148
#define COSMISC_CONSTANT 6
11491149

1150-
struct uart_port port = {
1151-
.irq = 0,
1152-
.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
1153-
.iotype = UPIO_MEM,
1154-
.regshift = 0,
1155-
.uartclk = (22000000 << 1) / COSMISC_CONSTANT,
1156-
1157-
.membase = (unsigned char __iomem *) uart,
1158-
.mapbase = (unsigned long) uart,
1150+
struct uart_8250_port port = {
1151+
.port = {
1152+
.irq = 0,
1153+
.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
1154+
.iotype = UPIO_MEM,
1155+
.regshift = 0,
1156+
.uartclk = (22000000 << 1) / COSMISC_CONSTANT,
1157+
1158+
.membase = (unsigned char __iomem *) uart,
1159+
.mapbase = (unsigned long) uart,
1160+
}
11591161
};
11601162
unsigned char lcr;
11611163

@@ -1164,7 +1166,7 @@ static void __devinit ioc3_8250_register(struct ioc3_uartregs __iomem *uart)
11641166
uart->iu_scr = COSMISC_CONSTANT,
11651167
uart->iu_lcr = lcr;
11661168
uart->iu_lcr;
1167-
serial8250_register_port(&port);
1169+
serial8250_register_8250_port(&port);
11681170
}
11691171

11701172
static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)

‎drivers/tty/serial/8250/8250.h‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,6 @@
1313

1414
#include <linux/serial_8250.h>
1515

16-
struct 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-
4616
struct old_serial_port {
4717
unsigned int uart;
4818
unsigned int baud_base;

‎drivers/tty/serial/8250/8250_dw.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int __devinit dw8250_probe(struct platform_device *pdev)
141141
dev_err(&pdev->dev, "no clock-frequency property set\n");
142142
return -EINVAL;
143143
}
144-
uart.uart.port.uartclk = val;
144+
uart.port.uartclk = val;
145145

146146
data->line = serial8250_register_8250_port(&uart);
147147
if (data->line < 0)

‎drivers/tty/serial/of_serial.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,15 @@ static int __devinit of_platform_serial_probe(struct platform_device *ofdev)
144144
switch (port_type) {
145145
#ifdef CONFIG_SERIAL_8250
146146
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);
148154
break;
155+
}
149156
#endif
150157
#ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
151158
case PORT_NWPSERIAL:

‎include/linux/serial_8250.h‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,36 @@ enum {
6565
* platform device. Using these will make your driver
6666
* dependent on the 8250 driver.
6767
*/
68-
struct uart_port;
69-
struct uart_8250_port;
68+
69+
struct 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+
};
7098

7199
int serial8250_register_8250_port(struct uart_8250_port *);
72100
void serial8250_unregister_port(int line);

0 commit comments

Comments
 (0)