diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/atmel_serial.c | 8 | ||||
-rw-r--r-- | drivers/serial/imx.c | 12 | ||||
-rw-r--r-- | drivers/serial/of_serial.c | 4 | ||||
-rw-r--r-- | drivers/serial/sh-sci.c | 18 |
4 files changed, 24 insertions, 18 deletions
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index b3497d7e5354..338b15c0a548 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -1104,11 +1104,13 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1104 | /* update the per-port timeout */ | 1104 | /* update the per-port timeout */ |
1105 | uart_update_timeout(port, termios->c_cflag, baud); | 1105 | uart_update_timeout(port, termios->c_cflag, baud); |
1106 | 1106 | ||
1107 | /* save/disable interrupts and drain transmitter */ | 1107 | /* |
1108 | * save/disable interrupts. The tty layer will ensure that the | ||
1109 | * transmitter is empty if requested by the caller, so there's | ||
1110 | * no need to wait for it here. | ||
1111 | */ | ||
1108 | imr = UART_GET_IMR(port); | 1112 | imr = UART_GET_IMR(port); |
1109 | UART_PUT_IDR(port, -1); | 1113 | UART_PUT_IDR(port, -1); |
1110 | while (!(UART_GET_CSR(port) & ATMEL_US_TXEMPTY)) | ||
1111 | cpu_relax(); | ||
1112 | 1114 | ||
1113 | /* disable receiver and transmitter */ | 1115 | /* disable receiver and transmitter */ |
1114 | UART_PUT_CR(port, ATMEL_US_TXDIS | ATMEL_US_RXDIS); | 1116 | UART_PUT_CR(port, ATMEL_US_TXDIS | ATMEL_US_RXDIS); |
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 285b414f3054..5d7b58f1fe42 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -924,11 +924,13 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, | |||
924 | rational_best_approximation(16 * div * baud, sport->port.uartclk, | 924 | rational_best_approximation(16 * div * baud, sport->port.uartclk, |
925 | 1 << 16, 1 << 16, &num, &denom); | 925 | 1 << 16, 1 << 16, &num, &denom); |
926 | 926 | ||
927 | tdiv64 = sport->port.uartclk; | 927 | if (port->info && port->info->port.tty) { |
928 | tdiv64 *= num; | 928 | tdiv64 = sport->port.uartclk; |
929 | do_div(tdiv64, denom * 16 * div); | 929 | tdiv64 *= num; |
930 | tty_encode_baud_rate(sport->port.info->port.tty, | 930 | do_div(tdiv64, denom * 16 * div); |
931 | (speed_t)tdiv64, (speed_t)tdiv64); | 931 | tty_encode_baud_rate(sport->port.info->port.tty, |
932 | (speed_t)tdiv64, (speed_t)tdiv64); | ||
933 | } | ||
932 | 934 | ||
933 | num -= 1; | 935 | num -= 1; |
934 | denom -= 1; | 936 | denom -= 1; |
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c index 14f8fa9135be..54483cd3529e 100644 --- a/drivers/serial/of_serial.c +++ b/drivers/serial/of_serial.c | |||
@@ -122,7 +122,7 @@ static int __devinit of_platform_serial_probe(struct of_device *ofdev, | |||
122 | 122 | ||
123 | info->type = port_type; | 123 | info->type = port_type; |
124 | info->line = ret; | 124 | info->line = ret; |
125 | ofdev->dev.driver_data = info; | 125 | dev_set_drvdata(&ofdev->dev, info); |
126 | return 0; | 126 | return 0; |
127 | out: | 127 | out: |
128 | kfree(info); | 128 | kfree(info); |
@@ -135,7 +135,7 @@ out: | |||
135 | */ | 135 | */ |
136 | static int of_platform_serial_remove(struct of_device *ofdev) | 136 | static int of_platform_serial_remove(struct of_device *ofdev) |
137 | { | 137 | { |
138 | struct of_serial_info *info = ofdev->dev.driver_data; | 138 | struct of_serial_info *info = dev_get_drvdata(&ofdev->dev); |
139 | switch (info->type) { | 139 | switch (info->type) { |
140 | #ifdef CONFIG_SERIAL_8250 | 140 | #ifdef CONFIG_SERIAL_8250 |
141 | case PORT_8250 ... PORT_MAX_8250: | 141 | case PORT_8250 ... PORT_MAX_8250: |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index a4cf1079b312..66f52674ca0c 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -1332,44 +1332,46 @@ err_unreg: | |||
1332 | return ret; | 1332 | return ret; |
1333 | } | 1333 | } |
1334 | 1334 | ||
1335 | static int sci_suspend(struct platform_device *dev, pm_message_t state) | 1335 | static int sci_suspend(struct device *dev) |
1336 | { | 1336 | { |
1337 | struct sh_sci_priv *priv = platform_get_drvdata(dev); | 1337 | struct sh_sci_priv *priv = dev_get_drvdata(dev); |
1338 | struct sci_port *p; | 1338 | struct sci_port *p; |
1339 | unsigned long flags; | 1339 | unsigned long flags; |
1340 | 1340 | ||
1341 | spin_lock_irqsave(&priv->lock, flags); | 1341 | spin_lock_irqsave(&priv->lock, flags); |
1342 | list_for_each_entry(p, &priv->ports, node) | 1342 | list_for_each_entry(p, &priv->ports, node) |
1343 | uart_suspend_port(&sci_uart_driver, &p->port); | 1343 | uart_suspend_port(&sci_uart_driver, &p->port); |
1344 | |||
1345 | spin_unlock_irqrestore(&priv->lock, flags); | 1344 | spin_unlock_irqrestore(&priv->lock, flags); |
1346 | 1345 | ||
1347 | return 0; | 1346 | return 0; |
1348 | } | 1347 | } |
1349 | 1348 | ||
1350 | static int sci_resume(struct platform_device *dev) | 1349 | static int sci_resume(struct device *dev) |
1351 | { | 1350 | { |
1352 | struct sh_sci_priv *priv = platform_get_drvdata(dev); | 1351 | struct sh_sci_priv *priv = dev_get_drvdata(dev); |
1353 | struct sci_port *p; | 1352 | struct sci_port *p; |
1354 | unsigned long flags; | 1353 | unsigned long flags; |
1355 | 1354 | ||
1356 | spin_lock_irqsave(&priv->lock, flags); | 1355 | spin_lock_irqsave(&priv->lock, flags); |
1357 | list_for_each_entry(p, &priv->ports, node) | 1356 | list_for_each_entry(p, &priv->ports, node) |
1358 | uart_resume_port(&sci_uart_driver, &p->port); | 1357 | uart_resume_port(&sci_uart_driver, &p->port); |
1359 | |||
1360 | spin_unlock_irqrestore(&priv->lock, flags); | 1358 | spin_unlock_irqrestore(&priv->lock, flags); |
1361 | 1359 | ||
1362 | return 0; | 1360 | return 0; |
1363 | } | 1361 | } |
1364 | 1362 | ||
1363 | static struct dev_pm_ops sci_dev_pm_ops = { | ||
1364 | .suspend = sci_suspend, | ||
1365 | .resume = sci_resume, | ||
1366 | }; | ||
1367 | |||
1365 | static struct platform_driver sci_driver = { | 1368 | static struct platform_driver sci_driver = { |
1366 | .probe = sci_probe, | 1369 | .probe = sci_probe, |
1367 | .remove = __devexit_p(sci_remove), | 1370 | .remove = __devexit_p(sci_remove), |
1368 | .suspend = sci_suspend, | ||
1369 | .resume = sci_resume, | ||
1370 | .driver = { | 1371 | .driver = { |
1371 | .name = "sh-sci", | 1372 | .name = "sh-sci", |
1372 | .owner = THIS_MODULE, | 1373 | .owner = THIS_MODULE, |
1374 | .pm = &sci_dev_pm_ops, | ||
1373 | }, | 1375 | }, |
1374 | }; | 1376 | }; |
1375 | 1377 | ||