aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-10-14 17:24:51 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-10-14 17:24:51 -0400
commit7e69a8c4d06b7ecb874f571e82b715a9f79bc3c4 (patch)
tree0248fb8f7a3e445cc3c744252abeecabb9205c05 /drivers/serial
parentb6825d2df55aa7d7341c715b577b73a6a03dc944 (diff)
parentd5120ae72a066b18f98e0c45ce73262f58030851 (diff)
Merge branch 's3c-move' into devel
Conflicts: arch/arm/mach-versatile/core.c
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/atmel_serial.c32
-rw-r--r--drivers/serial/s3c2400.c2
-rw-r--r--drivers/serial/s3c2410.c2
-rw-r--r--drivers/serial/s3c2412.c2
-rw-r--r--drivers/serial/s3c2440.c2
-rw-r--r--drivers/serial/samsung.c2
6 files changed, 24 insertions, 18 deletions
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 3a6da80b081c..61fb8b6d19af 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -131,7 +131,8 @@ struct atmel_uart_char {
131struct atmel_uart_port { 131struct atmel_uart_port {
132 struct uart_port uart; /* uart */ 132 struct uart_port uart; /* uart */
133 struct clk *clk; /* uart clock */ 133 struct clk *clk; /* uart clock */
134 unsigned short suspended; /* is port suspended? */ 134 int may_wakeup; /* cached value of device_may_wakeup for times we need to disable it */
135 u32 backup_imr; /* IMR saved during suspend */
135 int break_active; /* break being received */ 136 int break_active; /* break being received */
136 137
137 short use_dma_rx; /* enable PDC receiver */ 138 short use_dma_rx; /* enable PDC receiver */
@@ -984,8 +985,15 @@ static void atmel_serial_pm(struct uart_port *port, unsigned int state,
984 * This is called on uart_open() or a resume event. 985 * This is called on uart_open() or a resume event.
985 */ 986 */
986 clk_enable(atmel_port->clk); 987 clk_enable(atmel_port->clk);
988
989 /* re-enable interrupts if we disabled some on suspend */
990 UART_PUT_IER(port, atmel_port->backup_imr);
987 break; 991 break;
988 case 3: 992 case 3:
993 /* Back up the interrupt mask and disable all interrupts */
994 atmel_port->backup_imr = UART_GET_IMR(port);
995 UART_PUT_IDR(port, -1);
996
989 /* 997 /*
990 * Disable the peripheral clock for this serial port. 998 * Disable the peripheral clock for this serial port.
991 * This is called on uart_close() or a suspend event. 999 * This is called on uart_close() or a suspend event.
@@ -1475,13 +1483,12 @@ static int atmel_serial_suspend(struct platform_device *pdev,
1475 cpu_relax(); 1483 cpu_relax();
1476 } 1484 }
1477 1485
1478 if (device_may_wakeup(&pdev->dev) 1486 /* we can not wake up if we're running on slow clock */
1479 && !atmel_serial_clk_will_stop()) 1487 atmel_port->may_wakeup = device_may_wakeup(&pdev->dev);
1480 enable_irq_wake(port->irq); 1488 if (atmel_serial_clk_will_stop())
1481 else { 1489 device_set_wakeup_enable(&pdev->dev, 0);
1482 uart_suspend_port(&atmel_uart, port); 1490
1483 atmel_port->suspended = 1; 1491 uart_suspend_port(&atmel_uart, port);
1484 }
1485 1492
1486 return 0; 1493 return 0;
1487} 1494}
@@ -1491,11 +1498,8 @@ static int atmel_serial_resume(struct platform_device *pdev)
1491 struct uart_port *port = platform_get_drvdata(pdev); 1498 struct uart_port *port = platform_get_drvdata(pdev);
1492 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); 1499 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
1493 1500
1494 if (atmel_port->suspended) { 1501 uart_resume_port(&atmel_uart, port);
1495 uart_resume_port(&atmel_uart, port); 1502 device_set_wakeup_enable(&pdev->dev, atmel_port->may_wakeup);
1496 atmel_port->suspended = 0;
1497 } else
1498 disable_irq_wake(port->irq);
1499 1503
1500 return 0; 1504 return 0;
1501} 1505}
@@ -1513,6 +1517,8 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
1513 BUILD_BUG_ON(!is_power_of_2(ATMEL_SERIAL_RINGSIZE)); 1517 BUILD_BUG_ON(!is_power_of_2(ATMEL_SERIAL_RINGSIZE));
1514 1518
1515 port = &atmel_ports[pdev->id]; 1519 port = &atmel_ports[pdev->id];
1520 port->backup_imr = 0;
1521
1516 atmel_init_port(port, pdev); 1522 atmel_init_port(port, pdev);
1517 1523
1518 if (!atmel_use_dma_rx(&port->uart)) { 1524 if (!atmel_use_dma_rx(&port->uart)) {
diff --git a/drivers/serial/s3c2400.c b/drivers/serial/s3c2400.c
index c8b4266ac35f..4873f2978bd2 100644
--- a/drivers/serial/s3c2400.c
+++ b/drivers/serial/s3c2400.c
@@ -19,7 +19,7 @@
19 19
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21 21
22#include <asm/plat-s3c/regs-serial.h> 22#include <plat/regs-serial.h>
23#include <mach/regs-gpio.h> 23#include <mach/regs-gpio.h>
24 24
25#include "samsung.h" 25#include "samsung.h"
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 40a2531b5541..87c182ef71b8 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -21,7 +21,7 @@
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23 23
24#include <asm/plat-s3c/regs-serial.h> 24#include <plat/regs-serial.h>
25#include <mach/regs-gpio.h> 25#include <mach/regs-gpio.h>
26 26
27#include "samsung.h" 27#include "samsung.h"
diff --git a/drivers/serial/s3c2412.c b/drivers/serial/s3c2412.c
index d0170319c729..fd017b375568 100644
--- a/drivers/serial/s3c2412.c
+++ b/drivers/serial/s3c2412.c
@@ -21,7 +21,7 @@
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23 23
24#include <asm/plat-s3c/regs-serial.h> 24#include <plat/regs-serial.h>
25#include <mach/regs-gpio.h> 25#include <mach/regs-gpio.h>
26 26
27#include "samsung.h" 27#include "samsung.h"
diff --git a/drivers/serial/s3c2440.c b/drivers/serial/s3c2440.c
index d4a2b17b2498..317d239ab740 100644
--- a/drivers/serial/s3c2440.c
+++ b/drivers/serial/s3c2440.c
@@ -21,7 +21,7 @@
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23 23
24#include <asm/plat-s3c/regs-serial.h> 24#include <plat/regs-serial.h>
25#include <mach/regs-gpio.h> 25#include <mach/regs-gpio.h>
26 26
27#include "samsung.h" 27#include "samsung.h"
diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
index 5a88b3f9fe9b..1e219d3d0352 100644
--- a/drivers/serial/samsung.c
+++ b/drivers/serial/samsung.c
@@ -47,7 +47,7 @@
47 47
48#include <mach/hardware.h> 48#include <mach/hardware.h>
49 49
50#include <asm/plat-s3c/regs-serial.h> 50#include <plat/regs-serial.h>
51#include <mach/regs-gpio.h> 51#include <mach/regs-gpio.h>
52 52
53#include "samsung.h" 53#include "samsung.h"