diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/68328serial.c | 71 | ||||
-rw-r--r-- | drivers/serial/8250.c | 5 | ||||
-rw-r--r-- | drivers/serial/8250_early.c | 10 | ||||
-rw-r--r-- | drivers/serial/serial_core.c | 9 |
4 files changed, 20 insertions, 75 deletions
diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c index cad426c9711e..aad4012bbb30 100644 --- a/drivers/serial/68328serial.c +++ b/drivers/serial/68328serial.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/keyboard.h> | 33 | #include <linux/keyboard.h> |
34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
35 | #include <linux/pm.h> | 35 | #include <linux/pm.h> |
36 | #include <linux/pm_legacy.h> | ||
37 | #include <linux/bitops.h> | 36 | #include <linux/bitops.h> |
38 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
39 | 38 | ||
@@ -401,9 +400,9 @@ irqreturn_t rs_interrupt(int irq, void *dev_id) | |||
401 | return IRQ_HANDLED; | 400 | return IRQ_HANDLED; |
402 | } | 401 | } |
403 | 402 | ||
404 | static void do_softint(void *private) | 403 | static void do_softint(struct work_struct *work) |
405 | { | 404 | { |
406 | struct m68k_serial *info = (struct m68k_serial *) private; | 405 | struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue); |
407 | struct tty_struct *tty; | 406 | struct tty_struct *tty; |
408 | 407 | ||
409 | tty = info->tty; | 408 | tty = info->tty; |
@@ -425,9 +424,9 @@ static void do_softint(void *private) | |||
425 | * do_serial_hangup() -> tty->hangup() -> rs_hangup() | 424 | * do_serial_hangup() -> tty->hangup() -> rs_hangup() |
426 | * | 425 | * |
427 | */ | 426 | */ |
428 | static void do_serial_hangup(void *private) | 427 | static void do_serial_hangup(struct work_struct *work) |
429 | { | 428 | { |
430 | struct m68k_serial *info = (struct m68k_serial *) private; | 429 | struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup); |
431 | struct tty_struct *tty; | 430 | struct tty_struct *tty; |
432 | 431 | ||
433 | tty = info->tty; | 432 | tty = info->tty; |
@@ -1324,59 +1323,6 @@ static void show_serial_version(void) | |||
1324 | printk("MC68328 serial driver version 1.00\n"); | 1323 | printk("MC68328 serial driver version 1.00\n"); |
1325 | } | 1324 | } |
1326 | 1325 | ||
1327 | #ifdef CONFIG_PM_LEGACY | ||
1328 | /* Serial Power management | ||
1329 | * The console (currently fixed at line 0) is a special case for power | ||
1330 | * management because the kernel is so chatty. The console will be | ||
1331 | * explicitly disabled my our power manager as the last minute, so we won't | ||
1332 | * mess with it here. | ||
1333 | */ | ||
1334 | static struct pm_dev *serial_pm[NR_PORTS]; | ||
1335 | |||
1336 | static int serial_pm_callback(struct pm_dev *dev, pm_request_t request, void *data) | ||
1337 | { | ||
1338 | struct m68k_serial *info = (struct m68k_serial *)dev->data; | ||
1339 | |||
1340 | if(info == NULL) | ||
1341 | return -1; | ||
1342 | |||
1343 | /* special case for line 0 - pm restores it */ | ||
1344 | if(info->line == 0) | ||
1345 | return 0; | ||
1346 | |||
1347 | switch (request) { | ||
1348 | case PM_SUSPEND: | ||
1349 | shutdown(info); | ||
1350 | break; | ||
1351 | |||
1352 | case PM_RESUME: | ||
1353 | startup(info); | ||
1354 | break; | ||
1355 | } | ||
1356 | return 0; | ||
1357 | } | ||
1358 | |||
1359 | void shutdown_console(void) | ||
1360 | { | ||
1361 | struct m68k_serial *info = &m68k_soft[0]; | ||
1362 | |||
1363 | /* HACK: wait a bit for any pending printk's to be dumped */ | ||
1364 | { | ||
1365 | int i = 10000; | ||
1366 | while(i--); | ||
1367 | } | ||
1368 | |||
1369 | shutdown(info); | ||
1370 | } | ||
1371 | |||
1372 | void startup_console(void) | ||
1373 | { | ||
1374 | struct m68k_serial *info = &m68k_soft[0]; | ||
1375 | startup(info); | ||
1376 | } | ||
1377 | #endif /* CONFIG_PM_LEGACY */ | ||
1378 | |||
1379 | |||
1380 | static const struct tty_operations rs_ops = { | 1326 | static const struct tty_operations rs_ops = { |
1381 | .open = rs_open, | 1327 | .open = rs_open, |
1382 | .close = rs_close, | 1328 | .close = rs_close, |
@@ -1444,8 +1390,8 @@ rs68328_init(void) | |||
1444 | info->event = 0; | 1390 | info->event = 0; |
1445 | info->count = 0; | 1391 | info->count = 0; |
1446 | info->blocked_open = 0; | 1392 | info->blocked_open = 0; |
1447 | INIT_WORK(&info->tqueue, do_softint, info); | 1393 | INIT_WORK(&info->tqueue, do_softint); |
1448 | INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info); | 1394 | INIT_WORK(&info->tqueue_hangup, do_serial_hangup); |
1449 | init_waitqueue_head(&info->open_wait); | 1395 | init_waitqueue_head(&info->open_wait); |
1450 | init_waitqueue_head(&info->close_wait); | 1396 | init_waitqueue_head(&info->close_wait); |
1451 | info->line = i; | 1397 | info->line = i; |
@@ -1467,11 +1413,6 @@ rs68328_init(void) | |||
1467 | IRQ_FLG_STD, | 1413 | IRQ_FLG_STD, |
1468 | "M68328_UART", NULL)) | 1414 | "M68328_UART", NULL)) |
1469 | panic("Unable to attach 68328 serial interrupt\n"); | 1415 | panic("Unable to attach 68328 serial interrupt\n"); |
1470 | #ifdef CONFIG_PM_LEGACY | ||
1471 | serial_pm[i] = pm_register(PM_SYS_DEV, PM_SYS_COM, serial_pm_callback); | ||
1472 | if (serial_pm[i]) | ||
1473 | serial_pm[i]->data = info; | ||
1474 | #endif | ||
1475 | } | 1416 | } |
1476 | local_irq_restore(flags); | 1417 | local_irq_restore(flags); |
1477 | return 0; | 1418 | return 0; |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 0b3ec38ae614..2f5a5ac1b271 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2650,8 +2650,9 @@ static int __devinit serial8250_probe(struct platform_device *dev) | |||
2650 | ret = serial8250_register_port(&port); | 2650 | ret = serial8250_register_port(&port); |
2651 | if (ret < 0) { | 2651 | if (ret < 0) { |
2652 | dev_err(&dev->dev, "unable to register port at index %d " | 2652 | dev_err(&dev->dev, "unable to register port at index %d " |
2653 | "(IO%lx MEM%lx IRQ%d): %d\n", i, | 2653 | "(IO%lx MEM%llx IRQ%d): %d\n", i, |
2654 | p->iobase, p->mapbase, p->irq, ret); | 2654 | p->iobase, (unsigned long long)p->mapbase, |
2655 | p->irq, ret); | ||
2655 | } | 2656 | } |
2656 | } | 2657 | } |
2657 | return 0; | 2658 | return 0; |
diff --git a/drivers/serial/8250_early.c b/drivers/serial/8250_early.c index 947c20507e1f..150cad5c2eba 100644 --- a/drivers/serial/8250_early.c +++ b/drivers/serial/8250_early.c | |||
@@ -151,8 +151,9 @@ static int __init parse_options(struct early_serial8250_device *device, char *op | |||
151 | #else | 151 | #else |
152 | port->membase = ioremap(port->mapbase, 64); | 152 | port->membase = ioremap(port->mapbase, 64); |
153 | if (!port->membase) { | 153 | if (!port->membase) { |
154 | printk(KERN_ERR "%s: Couldn't ioremap 0x%lx\n", | 154 | printk(KERN_ERR "%s: Couldn't ioremap 0x%llx\n", |
155 | __FUNCTION__, port->mapbase); | 155 | __FUNCTION__, |
156 | (unsigned long long)port->mapbase); | ||
156 | return -ENOMEM; | 157 | return -ENOMEM; |
157 | } | 158 | } |
158 | #endif | 159 | #endif |
@@ -175,9 +176,10 @@ static int __init parse_options(struct early_serial8250_device *device, char *op | |||
175 | device->baud); | 176 | device->baud); |
176 | } | 177 | } |
177 | 178 | ||
178 | printk(KERN_INFO "Early serial console at %s 0x%lx (options '%s')\n", | 179 | printk(KERN_INFO "Early serial console at %s 0x%llx (options '%s')\n", |
179 | mmio ? "MMIO" : "I/O port", | 180 | mmio ? "MMIO" : "I/O port", |
180 | mmio ? port->mapbase : (unsigned long) port->iobase, | 181 | mmio ? (unsigned long long) port->mapbase |
182 | : (unsigned long long) port->iobase, | ||
181 | device->options); | 183 | device->options); |
182 | return 0; | 184 | return 0; |
183 | } | 185 | } |
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 9c57486c2e7f..030a6063541d 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -626,7 +626,7 @@ static int uart_get_info(struct uart_state *state, | |||
626 | tmp.hub6 = port->hub6; | 626 | tmp.hub6 = port->hub6; |
627 | tmp.io_type = port->iotype; | 627 | tmp.io_type = port->iotype; |
628 | tmp.iomem_reg_shift = port->regshift; | 628 | tmp.iomem_reg_shift = port->regshift; |
629 | tmp.iomem_base = (void *)port->mapbase; | 629 | tmp.iomem_base = (void *)(unsigned long)port->mapbase; |
630 | 630 | ||
631 | if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) | 631 | if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) |
632 | return -EFAULT; | 632 | return -EFAULT; |
@@ -1666,10 +1666,11 @@ static int uart_line_info(char *buf, struct uart_driver *drv, int i) | |||
1666 | return 0; | 1666 | return 0; |
1667 | 1667 | ||
1668 | mmio = port->iotype >= UPIO_MEM; | 1668 | mmio = port->iotype >= UPIO_MEM; |
1669 | ret = sprintf(buf, "%d: uart:%s %s%08lX irq:%d", | 1669 | ret = sprintf(buf, "%d: uart:%s %s%08llX irq:%d", |
1670 | port->line, uart_type(port), | 1670 | port->line, uart_type(port), |
1671 | mmio ? "mmio:0x" : "port:", | 1671 | mmio ? "mmio:0x" : "port:", |
1672 | mmio ? port->mapbase : (unsigned long) port->iobase, | 1672 | mmio ? (unsigned long long)port->mapbase |
1673 | : (unsigned long long) port->iobase, | ||
1673 | port->irq); | 1674 | port->irq); |
1674 | 1675 | ||
1675 | if (port->type == PORT_UNKNOWN) { | 1676 | if (port->type == PORT_UNKNOWN) { |
@@ -2069,7 +2070,7 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port) | |||
2069 | case UPIO_TSI: | 2070 | case UPIO_TSI: |
2070 | case UPIO_DWAPB: | 2071 | case UPIO_DWAPB: |
2071 | snprintf(address, sizeof(address), | 2072 | snprintf(address, sizeof(address), |
2072 | "MMIO 0x%lx", port->mapbase); | 2073 | "MMIO 0x%llx", (unsigned long long)port->mapbase); |
2073 | break; | 2074 | break; |
2074 | default: | 2075 | default: |
2075 | strlcpy(address, "*unknown*", sizeof(address)); | 2076 | strlcpy(address, "*unknown*", sizeof(address)); |