aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/8250
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-07-12 07:59:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-12 17:46:22 -0400
commit2655a2c76f80d91da34faa8f4e114d1793435ed3 (patch)
treea8bdc6b4a9b18bbc77da738f1b71000c978a4636 /drivers/tty/serial/8250
parent000c74d9fa14ec61411310187cfa9e43581593b5 (diff)
8250: use the 8250 register interface not the legacy one
The old interface just copies bits over and calls the newer one. In addition we can now pass more information. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250')
-rw-r--r--drivers/tty/serial/8250/8250.c71
-rw-r--r--drivers/tty/serial/8250/8250_acorn.c22
-rw-r--r--drivers/tty/serial/8250/8250_dw.c38
-rw-r--r--drivers/tty/serial/8250/8250_gsc.c26
-rw-r--r--drivers/tty/serial/8250/8250_hp300.c26
-rw-r--r--drivers/tty/serial/8250/8250_pci.c92
-rw-r--r--drivers/tty/serial/8250/8250_pnp.c28
-rw-r--r--drivers/tty/serial/8250/serial_cs.c30
8 files changed, 155 insertions, 178 deletions
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index 8123f784bcd..2b2468506e0 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -2979,36 +2979,36 @@ void serial8250_resume_port(int line)
2979static int __devinit serial8250_probe(struct platform_device *dev) 2979static int __devinit serial8250_probe(struct platform_device *dev)
2980{ 2980{
2981 struct plat_serial8250_port *p = dev->dev.platform_data; 2981 struct plat_serial8250_port *p = dev->dev.platform_data;
2982 struct uart_port port; 2982 struct uart_8250_port uart;
2983 int ret, i, irqflag = 0; 2983 int ret, i, irqflag = 0;
2984 2984
2985 memset(&port, 0, sizeof(struct uart_port)); 2985 memset(&uart, 0, sizeof(uart));
2986 2986
2987 if (share_irqs) 2987 if (share_irqs)
2988 irqflag = IRQF_SHARED; 2988 irqflag = IRQF_SHARED;
2989 2989
2990 for (i = 0; p && p->flags != 0; p++, i++) { 2990 for (i = 0; p && p->flags != 0; p++, i++) {
2991 port.iobase = p->iobase; 2991 uart.port.iobase = p->iobase;
2992 port.membase = p->membase; 2992 uart.port.membase = p->membase;
2993 port.irq = p->irq; 2993 uart.port.irq = p->irq;
2994 port.irqflags = p->irqflags; 2994 uart.port.irqflags = p->irqflags;
2995 port.uartclk = p->uartclk; 2995 uart.port.uartclk = p->uartclk;
2996 port.regshift = p->regshift; 2996 uart.port.regshift = p->regshift;
2997 port.iotype = p->iotype; 2997 uart.port.iotype = p->iotype;
2998 port.flags = p->flags; 2998 uart.port.flags = p->flags;
2999 port.mapbase = p->mapbase; 2999 uart.port.mapbase = p->mapbase;
3000 port.hub6 = p->hub6; 3000 uart.port.hub6 = p->hub6;
3001 port.private_data = p->private_data; 3001 uart.port.private_data = p->private_data;
3002 port.type = p->type; 3002 uart.port.type = p->type;
3003 port.serial_in = p->serial_in; 3003 uart.port.serial_in = p->serial_in;
3004 port.serial_out = p->serial_out; 3004 uart.port.serial_out = p->serial_out;
3005 port.handle_irq = p->handle_irq; 3005 uart.port.handle_irq = p->handle_irq;
3006 port.handle_break = p->handle_break; 3006 uart.port.handle_break = p->handle_break;
3007 port.set_termios = p->set_termios; 3007 uart.port.set_termios = p->set_termios;
3008 port.pm = p->pm; 3008 uart.port.pm = p->pm;
3009 port.dev = &dev->dev; 3009 uart.port.dev = &dev->dev;
3010 port.irqflags |= irqflag; 3010 uart.port.irqflags |= irqflag;
3011 ret = serial8250_register_port(&port); 3011 ret = serial8250_register_8250_port(&uart);
3012 if (ret < 0) { 3012 if (ret < 0) {
3013 dev_err(&dev->dev, "unable to register port at index %d " 3013 dev_err(&dev->dev, "unable to register port at index %d "
3014 "(IO%lx MEM%llx IRQ%d): %d\n", i, 3014 "(IO%lx MEM%llx IRQ%d): %d\n", i,
@@ -3081,7 +3081,7 @@ static struct platform_driver serial8250_isa_driver = {
3081static struct platform_device *serial8250_isa_devs; 3081static struct platform_device *serial8250_isa_devs;
3082 3082
3083/* 3083/*
3084 * serial8250_register_port and serial8250_unregister_port allows for 3084 * serial8250_register_8250_port and serial8250_unregister_port allows for
3085 * 16x50 serial ports to be configured at run-time, to support PCMCIA 3085 * 16x50 serial ports to be configured at run-time, to support PCMCIA
3086 * modems and PCI multiport cards. 3086 * modems and PCI multiport cards.
3087 */ 3087 */
@@ -3198,29 +3198,6 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
3198EXPORT_SYMBOL(serial8250_register_8250_port); 3198EXPORT_SYMBOL(serial8250_register_8250_port);
3199 3199
3200/** 3200/**
3201 * serial8250_register_port - register a serial port
3202 * @port: serial port template
3203 *
3204 * Configure the serial port specified by the request. If the
3205 * port exists and is in use, it is hung up and unregistered
3206 * first.
3207 *
3208 * The port is then probed and if necessary the IRQ is autodetected
3209 * If this fails an error is returned.
3210 *
3211 * On success the port is ready to use and the line number is returned.
3212 */
3213int serial8250_register_port(struct uart_port *port)
3214{
3215 struct uart_8250_port up;
3216
3217 memset(&up, 0, sizeof(up));
3218 memcpy(&up.port, port, sizeof(*port));
3219 return serial8250_register_8250_port(&up);
3220}
3221EXPORT_SYMBOL(serial8250_register_port);
3222
3223/**
3224 * serial8250_unregister_port - remove a 16x50 serial port at runtime 3201 * serial8250_unregister_port - remove a 16x50 serial port at runtime
3225 * @line: serial line number 3202 * @line: serial line number
3226 * 3203 *
diff --git a/drivers/tty/serial/8250/8250_acorn.c b/drivers/tty/serial/8250/8250_acorn.c
index b0ce8c56f1a..857498312a9 100644
--- a/drivers/tty/serial/8250/8250_acorn.c
+++ b/drivers/tty/serial/8250/8250_acorn.c
@@ -43,7 +43,7 @@ serial_card_probe(struct expansion_card *ec, const struct ecard_id *id)
43{ 43{
44 struct serial_card_info *info; 44 struct serial_card_info *info;
45 struct serial_card_type *type = id->data; 45 struct serial_card_type *type = id->data;
46 struct uart_port port; 46 struct uart_8250_port uart;
47 unsigned long bus_addr; 47 unsigned long bus_addr;
48 unsigned int i; 48 unsigned int i;
49 49
@@ -62,19 +62,19 @@ serial_card_probe(struct expansion_card *ec, const struct ecard_id *id)
62 62
63 ecard_set_drvdata(ec, info); 63 ecard_set_drvdata(ec, info);
64 64
65 memset(&port, 0, sizeof(struct uart_port)); 65 memset(&uart, 0, sizeof(struct uart_8250_port));
66 port.irq = ec->irq; 66 uart.port.irq = ec->irq;
67 port.flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ; 67 uart.port.flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
68 port.uartclk = type->uartclk; 68 uart.port.uartclk = type->uartclk;
69 port.iotype = UPIO_MEM; 69 uart.port.iotype = UPIO_MEM;
70 port.regshift = 2; 70 uart.port.regshift = 2;
71 port.dev = &ec->dev; 71 uart.port.dev = &ec->dev;
72 72
73 for (i = 0; i < info->num_ports; i ++) { 73 for (i = 0; i < info->num_ports; i ++) {
74 port.membase = info->vaddr + type->offset[i]; 74 uart.port.membase = info->vaddr + type->offset[i];
75 port.mapbase = bus_addr + type->offset[i]; 75 uart.port.mapbase = bus_addr + type->offset[i];
76 76
77 info->ports[i] = serial8250_register_port(&port); 77 info->ports[i] = serial8250_register_8250_port(&uart);
78 } 78 }
79 79
80 return 0; 80 return 0;
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index f574eef3075..afb955fdef0 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -89,7 +89,7 @@ static int dw8250_handle_irq(struct uart_port *p)
89 89
90static int __devinit dw8250_probe(struct platform_device *pdev) 90static int __devinit dw8250_probe(struct platform_device *pdev)
91{ 91{
92 struct uart_port port = {}; 92 struct uart_8250_port uart = {};
93 struct resource *regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 93 struct resource *regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
94 struct resource *irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 94 struct resource *irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
95 struct device_node *np = pdev->dev.of_node; 95 struct device_node *np = pdev->dev.of_node;
@@ -104,28 +104,28 @@ static int __devinit dw8250_probe(struct platform_device *pdev)
104 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); 104 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
105 if (!data) 105 if (!data)
106 return -ENOMEM; 106 return -ENOMEM;
107 port.private_data = data; 107 uart.port.private_data = data;
108 108
109 spin_lock_init(&port.lock); 109 spin_lock_init(&uart.port.lock);
110 port.mapbase = regs->start; 110 uart.port.mapbase = regs->start;
111 port.irq = irq->start; 111 uart.port.irq = irq->start;
112 port.handle_irq = dw8250_handle_irq; 112 uart.port.handle_irq = dw8250_handle_irq;
113 port.type = PORT_8250; 113 uart.port.type = PORT_8250;
114 port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP | 114 uart.port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP |
115 UPF_FIXED_PORT | UPF_FIXED_TYPE; 115 UPF_FIXED_PORT | UPF_FIXED_TYPE;
116 port.dev = &pdev->dev; 116 uart.port.dev = &pdev->dev;
117 117
118 port.iotype = UPIO_MEM; 118 uart.port.iotype = UPIO_MEM;
119 port.serial_in = dw8250_serial_in; 119 uart.port.serial_in = dw8250_serial_in;
120 port.serial_out = dw8250_serial_out; 120 uart.port.serial_out = dw8250_serial_out;
121 if (!of_property_read_u32(np, "reg-io-width", &val)) { 121 if (!of_property_read_u32(np, "reg-io-width", &val)) {
122 switch (val) { 122 switch (val) {
123 case 1: 123 case 1:
124 break; 124 break;
125 case 4: 125 case 4:
126 port.iotype = UPIO_MEM32; 126 uart.port.iotype = UPIO_MEM32;
127 port.serial_in = dw8250_serial_in32; 127 uart.port.serial_in = dw8250_serial_in32;
128 port.serial_out = dw8250_serial_out32; 128 uart.port.serial_out = dw8250_serial_out32;
129 break; 129 break;
130 default: 130 default:
131 dev_err(&pdev->dev, "unsupported reg-io-width (%u)\n", 131 dev_err(&pdev->dev, "unsupported reg-io-width (%u)\n",
@@ -135,15 +135,15 @@ static int __devinit dw8250_probe(struct platform_device *pdev)
135 } 135 }
136 136
137 if (!of_property_read_u32(np, "reg-shift", &val)) 137 if (!of_property_read_u32(np, "reg-shift", &val))
138 port.regshift = val; 138 uart.port.regshift = val;
139 139
140 if (of_property_read_u32(np, "clock-frequency", &val)) { 140 if (of_property_read_u32(np, "clock-frequency", &val)) {
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 port.uartclk = val; 144 uart.uart.port.uartclk = val;
145 145
146 data->line = serial8250_register_port(&port); 146 data->line = serial8250_register_8250_port(&uart);
147 if (data->line < 0) 147 if (data->line < 0)
148 return data->line; 148 return data->line;
149 149
diff --git a/drivers/tty/serial/8250/8250_gsc.c b/drivers/tty/serial/8250/8250_gsc.c
index d8c0ffbfa6e..097dff9c08a 100644
--- a/drivers/tty/serial/8250/8250_gsc.c
+++ b/drivers/tty/serial/8250/8250_gsc.c
@@ -26,7 +26,7 @@
26 26
27static int __init serial_init_chip(struct parisc_device *dev) 27static int __init serial_init_chip(struct parisc_device *dev)
28{ 28{
29 struct uart_port port; 29 struct uart_8250_port uart;
30 unsigned long address; 30 unsigned long address;
31 int err; 31 int err;
32 32
@@ -48,21 +48,21 @@ static int __init serial_init_chip(struct parisc_device *dev)
48 if (dev->id.sversion != 0x8d) 48 if (dev->id.sversion != 0x8d)
49 address += 0x800; 49 address += 0x800;
50 50
51 memset(&port, 0, sizeof(port)); 51 memset(&uart, 0, sizeof(uart));
52 port.iotype = UPIO_MEM; 52 uart.port.iotype = UPIO_MEM;
53 /* 7.272727MHz on Lasi. Assumed the same for Dino, Wax and Timi. */ 53 /* 7.272727MHz on Lasi. Assumed the same for Dino, Wax and Timi. */
54 port.uartclk = 7272727; 54 uart.port.uartclk = 7272727;
55 port.mapbase = address; 55 uart.port.mapbase = address;
56 port.membase = ioremap_nocache(address, 16); 56 uart.port.membase = ioremap_nocache(address, 16);
57 port.irq = dev->irq; 57 uart.port.irq = dev->irq;
58 port.flags = UPF_BOOT_AUTOCONF; 58 uart.port.flags = UPF_BOOT_AUTOCONF;
59 port.dev = &dev->dev; 59 uart.port.dev = &dev->dev;
60 60
61 err = serial8250_register_port(&port); 61 err = serial8250_register_8250_port(&uart);
62 if (err < 0) { 62 if (err < 0) {
63 printk(KERN_WARNING 63 printk(KERN_WARNING
64 "serial8250_register_port returned error %d\n", err); 64 "serial8250_register_8250_port returned error %d\n", err);
65 iounmap(port.membase); 65 iounmap(uart.port.membase);
66 return err; 66 return err;
67 } 67 }
68 68
diff --git a/drivers/tty/serial/8250/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c
index c13438c9301..8f1dd2cc00a 100644
--- a/drivers/tty/serial/8250/8250_hp300.c
+++ b/drivers/tty/serial/8250/8250_hp300.c
@@ -171,7 +171,7 @@ static int __devinit hpdca_init_one(struct dio_dev *d,
171 return 0; 171 return 0;
172 } 172 }
173#endif 173#endif
174 memset(&port, 0, sizeof(struct uart_port)); 174 memset(&uart, 0, sizeof(uart));
175 175
176 /* Memory mapped I/O */ 176 /* Memory mapped I/O */
177 port.iotype = UPIO_MEM; 177 port.iotype = UPIO_MEM;
@@ -182,7 +182,7 @@ static int __devinit hpdca_init_one(struct dio_dev *d,
182 port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE); 182 port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE);
183 port.regshift = 1; 183 port.regshift = 1;
184 port.dev = &d->dev; 184 port.dev = &d->dev;
185 line = serial8250_register_port(&port); 185 line = serial8250_register_8250_port(&uart);
186 186
187 if (line < 0) { 187 if (line < 0) {
188 printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d" 188 printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d"
@@ -210,7 +210,7 @@ static int __init hp300_8250_init(void)
210#ifdef CONFIG_HPAPCI 210#ifdef CONFIG_HPAPCI
211 int line; 211 int line;
212 unsigned long base; 212 unsigned long base;
213 struct uart_port uport; 213 struct uart_8250_port uart;
214 struct hp300_port *port; 214 struct hp300_port *port;
215 int i; 215 int i;
216#endif 216#endif
@@ -248,26 +248,26 @@ static int __init hp300_8250_init(void)
248 if (!port) 248 if (!port)
249 return -ENOMEM; 249 return -ENOMEM;
250 250
251 memset(&uport, 0, sizeof(struct uart_port)); 251 memset(&uart, 0, sizeof(uart));
252 252
253 base = (FRODO_BASE + FRODO_APCI_OFFSET(i)); 253 base = (FRODO_BASE + FRODO_APCI_OFFSET(i));
254 254
255 /* Memory mapped I/O */ 255 /* Memory mapped I/O */
256 uport.iotype = UPIO_MEM; 256 uart.port.iotype = UPIO_MEM;
257 uport.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ \ 257 uart.port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ \
258 | UPF_BOOT_AUTOCONF; 258 | UPF_BOOT_AUTOCONF;
259 /* XXX - no interrupt support yet */ 259 /* XXX - no interrupt support yet */
260 uport.irq = 0; 260 uart.port.irq = 0;
261 uport.uartclk = HPAPCI_BAUD_BASE * 16; 261 uart.port.uartclk = HPAPCI_BAUD_BASE * 16;
262 uport.mapbase = base; 262 uart.port.mapbase = base;
263 uport.membase = (char *)(base + DIO_VIRADDRBASE); 263 uart.port.membase = (char *)(base + DIO_VIRADDRBASE);
264 uport.regshift = 2; 264 uart.port.regshift = 2;
265 265
266 line = serial8250_register_port(&uport); 266 line = serial8250_register_8250_port(&uart);
267 267
268 if (line < 0) { 268 if (line < 0) {
269 printk(KERN_NOTICE "8250_hp300: register_serial() APCI" 269 printk(KERN_NOTICE "8250_hp300: register_serial() APCI"
270 " %d irq %d failed\n", i, uport.irq); 270 " %d irq %d failed\n", i, uart.port.irq);
271 kfree(port); 271 kfree(port);
272 continue; 272 continue;
273 } 273 }
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 66e5909d0a1..2ef9a075eec 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -44,7 +44,7 @@ struct pci_serial_quirk {
44 int (*init)(struct pci_dev *dev); 44 int (*init)(struct pci_dev *dev);
45 int (*setup)(struct serial_private *, 45 int (*setup)(struct serial_private *,
46 const struct pciserial_board *, 46 const struct pciserial_board *,
47 struct uart_port *, int); 47 struct uart_8250_port *, int);
48 void (*exit)(struct pci_dev *dev); 48 void (*exit)(struct pci_dev *dev);
49}; 49};
50 50
@@ -59,7 +59,7 @@ struct serial_private {
59}; 59};
60 60
61static int pci_default_setup(struct serial_private*, 61static int pci_default_setup(struct serial_private*,
62 const struct pciserial_board*, struct uart_port*, int); 62 const struct pciserial_board*, struct uart_8250_port *, int);
63 63
64static void moan_device(const char *str, struct pci_dev *dev) 64static void moan_device(const char *str, struct pci_dev *dev)
65{ 65{
@@ -74,7 +74,7 @@ static void moan_device(const char *str, struct pci_dev *dev)
74} 74}
75 75
76static int 76static int
77setup_port(struct serial_private *priv, struct uart_port *port, 77setup_port(struct serial_private *priv, struct uart_8250_port *port,
78 int bar, int offset, int regshift) 78 int bar, int offset, int regshift)
79{ 79{
80 struct pci_dev *dev = priv->dev; 80 struct pci_dev *dev = priv->dev;
@@ -93,17 +93,17 @@ setup_port(struct serial_private *priv, struct uart_port *port,
93 if (!priv->remapped_bar[bar]) 93 if (!priv->remapped_bar[bar])
94 return -ENOMEM; 94 return -ENOMEM;
95 95
96 port->iotype = UPIO_MEM; 96 port->port.iotype = UPIO_MEM;
97 port->iobase = 0; 97 port->port.iobase = 0;
98 port->mapbase = base + offset; 98 port->port.mapbase = base + offset;
99 port->membase = priv->remapped_bar[bar] + offset; 99 port->port.membase = priv->remapped_bar[bar] + offset;
100 port->regshift = regshift; 100 port->port.regshift = regshift;
101 } else { 101 } else {
102 port->iotype = UPIO_PORT; 102 port->port.iotype = UPIO_PORT;
103 port->iobase = base + offset; 103 port->port.iobase = base + offset;
104 port->mapbase = 0; 104 port->port.mapbase = 0;
105 port->membase = NULL; 105 port->port.membase = NULL;
106 port->regshift = 0; 106 port->port.regshift = 0;
107 } 107 }
108 return 0; 108 return 0;
109} 109}
@@ -113,7 +113,7 @@ setup_port(struct serial_private *priv, struct uart_port *port,
113 */ 113 */
114static int addidata_apci7800_setup(struct serial_private *priv, 114static int addidata_apci7800_setup(struct serial_private *priv,
115 const struct pciserial_board *board, 115 const struct pciserial_board *board,
116 struct uart_port *port, int idx) 116 struct uart_8250_port *port, int idx)
117{ 117{
118 unsigned int bar = 0, offset = board->first_offset; 118 unsigned int bar = 0, offset = board->first_offset;
119 bar = FL_GET_BASE(board->flags); 119 bar = FL_GET_BASE(board->flags);
@@ -140,7 +140,7 @@ static int addidata_apci7800_setup(struct serial_private *priv,
140 */ 140 */
141static int 141static int
142afavlab_setup(struct serial_private *priv, const struct pciserial_board *board, 142afavlab_setup(struct serial_private *priv, const struct pciserial_board *board,
143 struct uart_port *port, int idx) 143 struct uart_8250_port *port, int idx)
144{ 144{
145 unsigned int bar, offset = board->first_offset; 145 unsigned int bar, offset = board->first_offset;
146 146
@@ -195,7 +195,7 @@ static int pci_hp_diva_init(struct pci_dev *dev)
195static int 195static int
196pci_hp_diva_setup(struct serial_private *priv, 196pci_hp_diva_setup(struct serial_private *priv,
197 const struct pciserial_board *board, 197 const struct pciserial_board *board,
198 struct uart_port *port, int idx) 198 struct uart_8250_port *port, int idx)
199{ 199{
200 unsigned int offset = board->first_offset; 200 unsigned int offset = board->first_offset;
201 unsigned int bar = FL_GET_BASE(board->flags); 201 unsigned int bar = FL_GET_BASE(board->flags);
@@ -370,7 +370,7 @@ static void __devexit pci_ni8430_exit(struct pci_dev *dev)
370/* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */ 370/* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */
371static int 371static int
372sbs_setup(struct serial_private *priv, const struct pciserial_board *board, 372sbs_setup(struct serial_private *priv, const struct pciserial_board *board,
373 struct uart_port *port, int idx) 373 struct uart_8250_port *port, int idx)
374{ 374{
375 unsigned int bar, offset = board->first_offset; 375 unsigned int bar, offset = board->first_offset;
376 376
@@ -525,7 +525,7 @@ static int pci_siig_init(struct pci_dev *dev)
525 525
526static int pci_siig_setup(struct serial_private *priv, 526static int pci_siig_setup(struct serial_private *priv,
527 const struct pciserial_board *board, 527 const struct pciserial_board *board,
528 struct uart_port *port, int idx) 528 struct uart_8250_port *port, int idx)
529{ 529{
530 unsigned int bar = FL_GET_BASE(board->flags) + idx, offset = 0; 530 unsigned int bar = FL_GET_BASE(board->flags) + idx, offset = 0;
531 531
@@ -619,7 +619,7 @@ static int pci_timedia_init(struct pci_dev *dev)
619static int 619static int
620pci_timedia_setup(struct serial_private *priv, 620pci_timedia_setup(struct serial_private *priv,
621 const struct pciserial_board *board, 621 const struct pciserial_board *board,
622 struct uart_port *port, int idx) 622 struct uart_8250_port *port, int idx)
623{ 623{
624 unsigned int bar = 0, offset = board->first_offset; 624 unsigned int bar = 0, offset = board->first_offset;
625 625
@@ -653,7 +653,7 @@ pci_timedia_setup(struct serial_private *priv,
653static int 653static int
654titan_400l_800l_setup(struct serial_private *priv, 654titan_400l_800l_setup(struct serial_private *priv,
655 const struct pciserial_board *board, 655 const struct pciserial_board *board,
656 struct uart_port *port, int idx) 656 struct uart_8250_port *port, int idx)
657{ 657{
658 unsigned int bar, offset = board->first_offset; 658 unsigned int bar, offset = board->first_offset;
659 659
@@ -754,7 +754,7 @@ static int pci_ni8430_init(struct pci_dev *dev)
754static int 754static int
755pci_ni8430_setup(struct serial_private *priv, 755pci_ni8430_setup(struct serial_private *priv,
756 const struct pciserial_board *board, 756 const struct pciserial_board *board,
757 struct uart_port *port, int idx) 757 struct uart_8250_port *port, int idx)
758{ 758{
759 void __iomem *p; 759 void __iomem *p;
760 unsigned long base, len; 760 unsigned long base, len;
@@ -781,7 +781,7 @@ pci_ni8430_setup(struct serial_private *priv,
781 781
782static int pci_netmos_9900_setup(struct serial_private *priv, 782static int pci_netmos_9900_setup(struct serial_private *priv,
783 const struct pciserial_board *board, 783 const struct pciserial_board *board,
784 struct uart_port *port, int idx) 784 struct uart_8250_port *port, int idx)
785{ 785{
786 unsigned int bar; 786 unsigned int bar;
787 787
@@ -1035,7 +1035,7 @@ static int pci_oxsemi_tornado_init(struct pci_dev *dev)
1035static int 1035static int
1036pci_default_setup(struct serial_private *priv, 1036pci_default_setup(struct serial_private *priv,
1037 const struct pciserial_board *board, 1037 const struct pciserial_board *board,
1038 struct uart_port *port, int idx) 1038 struct uart_8250_port *port, int idx)
1039{ 1039{
1040 unsigned int bar, offset = board->first_offset, maxnr; 1040 unsigned int bar, offset = board->first_offset, maxnr;
1041 1041
@@ -1057,15 +1057,15 @@ pci_default_setup(struct serial_private *priv,
1057static int 1057static int
1058ce4100_serial_setup(struct serial_private *priv, 1058ce4100_serial_setup(struct serial_private *priv,
1059 const struct pciserial_board *board, 1059 const struct pciserial_board *board,
1060 struct uart_port *port, int idx) 1060 struct uart_8250_port *port, int idx)
1061{ 1061{
1062 int ret; 1062 int ret;
1063 1063
1064 ret = setup_port(priv, port, 0, 0, board->reg_shift); 1064 ret = setup_port(priv, port, 0, 0, board->reg_shift);
1065 port->iotype = UPIO_MEM32; 1065 port->port.iotype = UPIO_MEM32;
1066 port->type = PORT_XSCALE; 1066 port->port.type = PORT_XSCALE;
1067 port->flags = (port->flags | UPF_FIXED_PORT | UPF_FIXED_TYPE); 1067 port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
1068 port->regshift = 2; 1068 port->port.regshift = 2;
1069 1069
1070 return ret; 1070 return ret;
1071} 1071}
@@ -1073,16 +1073,16 @@ ce4100_serial_setup(struct serial_private *priv,
1073static int 1073static int
1074pci_omegapci_setup(struct serial_private *priv, 1074pci_omegapci_setup(struct serial_private *priv,
1075 const struct pciserial_board *board, 1075 const struct pciserial_board *board,
1076 struct uart_port *port, int idx) 1076 struct uart_8250_port *port, int idx)
1077{ 1077{
1078 return setup_port(priv, port, 2, idx * 8, 0); 1078 return setup_port(priv, port, 2, idx * 8, 0);
1079} 1079}
1080 1080
1081static int skip_tx_en_setup(struct serial_private *priv, 1081static int skip_tx_en_setup(struct serial_private *priv,
1082 const struct pciserial_board *board, 1082 const struct pciserial_board *board,
1083 struct uart_port *port, int idx) 1083 struct uart_8250_port *port, int idx)
1084{ 1084{
1085 port->flags |= UPF_NO_TXEN_TEST; 1085 port->port.flags |= UPF_NO_TXEN_TEST;
1086 printk(KERN_DEBUG "serial8250: skipping TxEn test for device " 1086 printk(KERN_DEBUG "serial8250: skipping TxEn test for device "
1087 "[%04x:%04x] subsystem [%04x:%04x]\n", 1087 "[%04x:%04x] subsystem [%04x:%04x]\n",
1088 priv->dev->vendor, 1088 priv->dev->vendor,
@@ -1131,11 +1131,11 @@ static unsigned int kt_serial_in(struct uart_port *p, int offset)
1131 1131
1132static int kt_serial_setup(struct serial_private *priv, 1132static int kt_serial_setup(struct serial_private *priv,
1133 const struct pciserial_board *board, 1133 const struct pciserial_board *board,
1134 struct uart_port *port, int idx) 1134 struct uart_8250_port *port, int idx)
1135{ 1135{
1136 port->flags |= UPF_BUG_THRE; 1136 port->port.flags |= UPF_BUG_THRE;
1137 port->serial_in = kt_serial_in; 1137 port->port.serial_in = kt_serial_in;
1138 port->handle_break = kt_handle_break; 1138 port->port.handle_break = kt_handle_break;
1139 return skip_tx_en_setup(priv, board, port, idx); 1139 return skip_tx_en_setup(priv, board, port, idx);
1140} 1140}
1141 1141
@@ -1151,9 +1151,9 @@ static int pci_eg20t_init(struct pci_dev *dev)
1151static int 1151static int
1152pci_xr17c154_setup(struct serial_private *priv, 1152pci_xr17c154_setup(struct serial_private *priv,
1153 const struct pciserial_board *board, 1153 const struct pciserial_board *board,
1154 struct uart_port *port, int idx) 1154 struct uart_8250_port *port, int idx)
1155{ 1155{
1156 port->flags |= UPF_EXAR_EFR; 1156 port->port.flags |= UPF_EXAR_EFR;
1157 return pci_default_setup(priv, board, port, idx); 1157 return pci_default_setup(priv, board, port, idx);
1158} 1158}
1159 1159
@@ -2720,7 +2720,7 @@ serial_pci_matches(const struct pciserial_board *board,
2720struct serial_private * 2720struct serial_private *
2721pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board) 2721pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
2722{ 2722{
2723 struct uart_port serial_port; 2723 struct uart_8250_port uart;
2724 struct serial_private *priv; 2724 struct serial_private *priv;
2725 struct pci_serial_quirk *quirk; 2725 struct pci_serial_quirk *quirk;
2726 int rc, nr_ports, i; 2726 int rc, nr_ports, i;
@@ -2760,22 +2760,22 @@ pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
2760 priv->dev = dev; 2760 priv->dev = dev;
2761 priv->quirk = quirk; 2761 priv->quirk = quirk;
2762 2762
2763 memset(&serial_port, 0, sizeof(struct uart_port)); 2763 memset(&uart, 0, sizeof(uart));
2764 serial_port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ; 2764 uart.port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
2765 serial_port.uartclk = board->base_baud * 16; 2765 uart.port.uartclk = board->base_baud * 16;
2766 serial_port.irq = get_pci_irq(dev, board); 2766 uart.port.irq = get_pci_irq(dev, board);
2767 serial_port.dev = &dev->dev; 2767 uart.port.dev = &dev->dev;
2768 2768
2769 for (i = 0; i < nr_ports; i++) { 2769 for (i = 0; i < nr_ports; i++) {
2770 if (quirk->setup(priv, board, &serial_port, i)) 2770 if (quirk->setup(priv, board, &uart, i))
2771 break; 2771 break;
2772 2772
2773#ifdef SERIAL_DEBUG_PCI 2773#ifdef SERIAL_DEBUG_PCI
2774 printk(KERN_DEBUG "Setup PCI port: port %lx, irq %d, type %d\n", 2774 printk(KERN_DEBUG "Setup PCI port: port %lx, irq %d, type %d\n",
2775 serial_port.iobase, serial_port.irq, serial_port.iotype); 2775 uart.port.iobase, uart.port.irq, uart.port.iotype);
2776#endif 2776#endif
2777 2777
2778 priv->line[i] = serial8250_register_port(&serial_port); 2778 priv->line[i] = serial8250_register_8250_port(&uart);
2779 if (priv->line[i] < 0) { 2779 if (priv->line[i] < 0) {
2780 printk(KERN_WARNING "Couldn't register serial port %s: %d\n", pci_name(dev), priv->line[i]); 2780 printk(KERN_WARNING "Couldn't register serial port %s: %d\n", pci_name(dev), priv->line[i]);
2781 break; 2781 break;
diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
index a2f236510ff..fde5aa60d51 100644
--- a/drivers/tty/serial/8250/8250_pnp.c
+++ b/drivers/tty/serial/8250/8250_pnp.c
@@ -424,7 +424,7 @@ static int __devinit serial_pnp_guess_board(struct pnp_dev *dev, int *flags)
424static int __devinit 424static int __devinit
425serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) 425serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
426{ 426{
427 struct uart_port port; 427 struct uart_8250_port uart;
428 int ret, line, flags = dev_id->driver_data; 428 int ret, line, flags = dev_id->driver_data;
429 429
430 if (flags & UNKNOWN_DEV) { 430 if (flags & UNKNOWN_DEV) {
@@ -433,32 +433,32 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
433 return ret; 433 return ret;
434 } 434 }
435 435
436 memset(&port, 0, sizeof(struct uart_port)); 436 memset(&uart, 0, sizeof(uart));
437 if (pnp_irq_valid(dev, 0)) 437 if (pnp_irq_valid(dev, 0))
438 port.irq = pnp_irq(dev, 0); 438 uart.port.irq = pnp_irq(dev, 0);
439 if (pnp_port_valid(dev, 0)) { 439 if (pnp_port_valid(dev, 0)) {
440 port.iobase = pnp_port_start(dev, 0); 440 uart.port.iobase = pnp_port_start(dev, 0);
441 port.iotype = UPIO_PORT; 441 uart.port.iotype = UPIO_PORT;
442 } else if (pnp_mem_valid(dev, 0)) { 442 } else if (pnp_mem_valid(dev, 0)) {
443 port.mapbase = pnp_mem_start(dev, 0); 443 uart.port.mapbase = pnp_mem_start(dev, 0);
444 port.iotype = UPIO_MEM; 444 uart.port.iotype = UPIO_MEM;
445 port.flags = UPF_IOREMAP; 445 uart.port.flags = UPF_IOREMAP;
446 } else 446 } else
447 return -ENODEV; 447 return -ENODEV;
448 448
449#ifdef SERIAL_DEBUG_PNP 449#ifdef SERIAL_DEBUG_PNP
450 printk(KERN_DEBUG 450 printk(KERN_DEBUG
451 "Setup PNP port: port %x, mem 0x%lx, irq %d, type %d\n", 451 "Setup PNP port: port %x, mem 0x%lx, irq %d, type %d\n",
452 port.iobase, port.mapbase, port.irq, port.iotype); 452 uart.port.iobase, uart.port.mapbase, uart.port.irq, uart.port.iotype);
453#endif 453#endif
454 454
455 port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; 455 uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
456 if (pnp_irq_flags(dev, 0) & IORESOURCE_IRQ_SHAREABLE) 456 if (pnp_irq_flags(dev, 0) & IORESOURCE_IRQ_SHAREABLE)
457 port.flags |= UPF_SHARE_IRQ; 457 uart.port.flags |= UPF_SHARE_IRQ;
458 port.uartclk = 1843200; 458 uart.port.uartclk = 1843200;
459 port.dev = &dev->dev; 459 uart.port.dev = &dev->dev;
460 460
461 line = serial8250_register_port(&port); 461 line = serial8250_register_8250_port(&uart);
462 if (line < 0) 462 if (line < 0)
463 return -ENODEV; 463 return -ENODEV;
464 464
diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
index 29b695d041e..b7d48b34639 100644
--- a/drivers/tty/serial/8250/serial_cs.c
+++ b/drivers/tty/serial/8250/serial_cs.c
@@ -73,7 +73,7 @@ struct serial_quirk {
73 unsigned int prodid; 73 unsigned int prodid;
74 int multi; /* 1 = multifunction, > 1 = # ports */ 74 int multi; /* 1 = multifunction, > 1 = # ports */
75 void (*config)(struct pcmcia_device *); 75 void (*config)(struct pcmcia_device *);
76 void (*setup)(struct pcmcia_device *, struct uart_port *); 76 void (*setup)(struct pcmcia_device *, struct uart_8250_port *);
77 void (*wakeup)(struct pcmcia_device *); 77 void (*wakeup)(struct pcmcia_device *);
78 int (*post)(struct pcmcia_device *); 78 int (*post)(struct pcmcia_device *);
79}; 79};
@@ -105,9 +105,9 @@ struct serial_cfg_mem {
105 * Elan VPU16551 UART with 14.7456MHz oscillator 105 * Elan VPU16551 UART with 14.7456MHz oscillator
106 * manfid 0x015D, 0x4C45 106 * manfid 0x015D, 0x4C45
107 */ 107 */
108static void quirk_setup_brainboxes_0104(struct pcmcia_device *link, struct uart_port *port) 108static void quirk_setup_brainboxes_0104(struct pcmcia_device *link, struct uart_8250_port *uart)
109{ 109{
110 port->uartclk = 14745600; 110 uart->port.uartclk = 14745600;
111} 111}
112 112
113static int quirk_post_ibm(struct pcmcia_device *link) 113static int quirk_post_ibm(struct pcmcia_device *link)
@@ -343,25 +343,25 @@ static void serial_detach(struct pcmcia_device *link)
343static int setup_serial(struct pcmcia_device *handle, struct serial_info * info, 343static int setup_serial(struct pcmcia_device *handle, struct serial_info * info,
344 unsigned int iobase, int irq) 344 unsigned int iobase, int irq)
345{ 345{
346 struct uart_port port; 346 struct uart_8250_port uart;
347 int line; 347 int line;
348 348
349 memset(&port, 0, sizeof (struct uart_port)); 349 memset(&uart, 0, sizeof(uart));
350 port.iobase = iobase; 350 uart.port.iobase = iobase;
351 port.irq = irq; 351 uart.port.irq = irq;
352 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ; 352 uart.port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
353 port.uartclk = 1843200; 353 uart.port.uartclk = 1843200;
354 port.dev = &handle->dev; 354 uart.port.dev = &handle->dev;
355 if (buggy_uart) 355 if (buggy_uart)
356 port.flags |= UPF_BUGGY_UART; 356 uart.port.flags |= UPF_BUGGY_UART;
357 357
358 if (info->quirk && info->quirk->setup) 358 if (info->quirk && info->quirk->setup)
359 info->quirk->setup(handle, &port); 359 info->quirk->setup(handle, &uart);
360 360
361 line = serial8250_register_port(&port); 361 line = serial8250_register_8250_port(&uart);
362 if (line < 0) { 362 if (line < 0) {
363 printk(KERN_NOTICE "serial_cs: serial8250_register_port() at " 363 pr_err("serial_cs: serial8250_register_8250_port() at 0x%04lx, irq %d failed\n",
364 "0x%04lx, irq %d failed\n", (u_long)iobase, irq); 364 (unsigned long)iobase, irq);
365 return -EINVAL; 365 return -EINVAL;
366 } 366 }
367 367