aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2005-07-29 17:03:30 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-29 18:01:13 -0400
commit655a0a7799cddf9a469916c07ac22f1106abc2be (patch)
tree68046518782408b540c41645ee75ac155f3b332a
parent3d483f47579461a4715db33c68ef8752e5a97a2d (diff)
[PATCH] serial: add MMIO support to 8250_pnp
Add support for UARTs in MMIO space and clean up a little whitespace. HP legacy-free ia64 machines need this. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/serial/8250_pnp.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c
index 18c58fb73899..6b321e82cafb 100644
--- a/drivers/serial/8250_pnp.c
+++ b/drivers/serial/8250_pnp.c
@@ -394,7 +394,7 @@ static int __devinit serial_pnp_guess_board(struct pnp_dev *dev, int *flags)
394} 394}
395 395
396static int __devinit 396static int __devinit
397serial_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id) 397serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
398{ 398{
399 struct uart_port port; 399 struct uart_port port;
400 int ret, line, flags = dev_id->driver_data; 400 int ret, line, flags = dev_id->driver_data;
@@ -406,15 +406,23 @@ serial_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id)
406 } 406 }
407 407
408 memset(&port, 0, sizeof(struct uart_port)); 408 memset(&port, 0, sizeof(struct uart_port));
409 port.irq = pnp_irq(dev,0); 409 port.irq = pnp_irq(dev, 0);
410 port.iobase = pnp_port_start(dev, 0); 410 if (pnp_port_valid(dev, 0)) {
411 port.iobase = pnp_port_start(dev, 0);
412 port.iotype = UPIO_PORT;
413 } else if (pnp_mem_valid(dev, 0)) {
414 port.mapbase = pnp_mem_start(dev, 0);
415 port.iotype = UPIO_MEM;
416 port.flags = UPF_IOREMAP;
417 } else
418 return -ENODEV;
411 419
412#ifdef SERIAL_DEBUG_PNP 420#ifdef SERIAL_DEBUG_PNP
413 printk("Setup PNP port: port %x, irq %d, type %d\n", 421 printk("Setup PNP port: port %x, mem 0x%lx, irq %d, type %d\n",
414 port.iobase, port.irq, port.iotype); 422 port.iobase, port.mapbase, port.irq, port.iotype);
415#endif 423#endif
416 424
417 port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; 425 port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
418 port.uartclk = 1843200; 426 port.uartclk = 1843200;
419 port.dev = &dev->dev; 427 port.dev = &dev->dev;
420 428
@@ -426,7 +434,7 @@ serial_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id)
426 434
427} 435}
428 436
429static void __devexit serial_pnp_remove(struct pnp_dev * dev) 437static void __devexit serial_pnp_remove(struct pnp_dev *dev)
430{ 438{
431 long line = (long)pnp_get_drvdata(dev); 439 long line = (long)pnp_get_drvdata(dev);
432 if (line) 440 if (line)