All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tty: serial: imx: Allow UART to be a source for wakeup
@ 2011-12-09 12:42 Fabio Estevam
  2011-12-09 12:42 ` [PATCH 2/2] ARM: mach-mx27_3ds: " Fabio Estevam
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Fabio Estevam @ 2011-12-09 12:42 UTC (permalink / raw)
  To: linux-arm-kernel

Allow UART to be a source for wakeup from low power mode.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 .../bindings/tty/serial/fsl-imx-uart.txt           |    2 +
 arch/arm/plat-mxc/include/mach/imx-uart.h          |    1 +
 drivers/tty/serial/imx.c                           |   35 ++++++++++++++++++++
 3 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt b/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
index a9c0406..676cc39 100644
--- a/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
+++ b/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
@@ -8,6 +8,8 @@ Required properties:
 Optional properties:
 - fsl,uart-has-rtscts : Indicate the uart has rts and cts
 - fsl,irda-mode : Indicate the uart supports irda mode
+- fsl,uart-can-wake : Indicate that uart can be a source for wakeup from
+low-power mode
 
 Example:
 
diff --git a/arch/arm/plat-mxc/include/mach/imx-uart.h b/arch/arm/plat-mxc/include/mach/imx-uart.h
index 4adec9b..0ba6c6b 100644
--- a/arch/arm/plat-mxc/include/mach/imx-uart.h
+++ b/arch/arm/plat-mxc/include/mach/imx-uart.h
@@ -21,6 +21,7 @@
 
 #define IMXUART_HAVE_RTSCTS (1<<0)
 #define IMXUART_IRDA        (1<<1)
+#define IMXUART_CANWAKE     (1<<2)
 
 struct imxuart_platform_data {
 	int (*init)(struct platform_device *pdev);
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 163fc90..f9bee68 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -200,6 +200,7 @@ struct imx_port {
 	int			txirq,rxirq,rtsirq;
 	unsigned int		have_rtscts:1;
 	unsigned int		use_irda:1;
+	unsigned int		can_wake:1;
 	unsigned int		irda_inv_rx:1;
 	unsigned int		irda_inv_tx:1;
 	unsigned short		trcv_delay; /* transceiver delay */
@@ -566,6 +567,9 @@ static irqreturn_t imx_int(int irq, void *dev_id)
 	if (sts & USR1_RTSD)
 		imx_rtsint(irq, dev_id);
 
+	if (sts & USR1_AWAKE)
+		writel(USR1_AWAKE, sport->port.membase + USR1);
+
 	return IRQ_HANDLED;
 }
 
@@ -660,6 +664,7 @@ static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode)
 static int imx_startup(struct uart_port *port)
 {
 	struct imx_port *sport = (struct imx_port *)port;
+	struct tty_struct *tty;
 	int retval;
 	unsigned long flags, temp;
 
@@ -791,6 +796,8 @@ static int imx_startup(struct uart_port *port)
 		if (pdata->irda_enable)
 			pdata->irda_enable(1);
 	}
+	tty = sport->port.state->port.tty;
+	device_set_wakeup_enable(tty->dev, 1);
 
 	return 0;
 
@@ -1269,6 +1276,15 @@ static struct uart_driver imx_reg = {
 static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
+
+	if (device_may_wakeup(&dev->dev)) {
+		enable_irq_wake(sport->rxirq);
+		/* enable wakeup from i.MX UART */
+		val = readl(sport->port.membase + UCR3);
+		val |= UCR3_AWAKEN;
+		writel(val, sport->port.membase + UCR3);
+	}
 
 	if (sport)
 		uart_suspend_port(&imx_reg, &sport->port);
@@ -1279,6 +1295,17 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 static int serial_imx_resume(struct platform_device *dev)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
+
+	if (device_may_wakeup(&dev->dev)) {
+		enable_irq_wake(sport->rxirq);
+		/* enable wakeup from i.MX UART */
+		val = readl(sport->port.membase + UCR3);
+		val &= ~UCR3_AWAKEN;
+		writel(val, sport->port.membase + UCR3);
+
+		disable_irq_wake(sport->rxirq);
+	}
 
 	if (sport)
 		uart_resume_port(&imx_reg, &sport->port);
@@ -1311,6 +1338,9 @@ static int serial_imx_probe_dt(struct imx_port *sport,
 	if (of_get_property(np, "fsl,irda-mode", NULL))
 		sport->use_irda = 1;
 
+	if (of_get_property(np, "fsl,uart-can-wake", NULL))
+		sport->can_wake = 1;
+
 	sport->devdata = of_id->data;
 
 	return 0;
@@ -1408,6 +1438,11 @@ static int serial_imx_probe(struct platform_device *pdev)
 		goto deinit;
 	platform_set_drvdata(pdev, &sport->port);
 
+	if (pdata && (pdata->flags & IMXUART_CANWAKE))
+		device_init_wakeup(&pdev->dev, 1);
+	else
+		device_init_wakeup(&pdev->dev, 0);
+
 	return 0;
 deinit:
 	if (pdata && pdata->exit)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/2] ARM: mach-mx27_3ds: Allow UART to be a source for wakeup.
  2011-12-09 12:42 [PATCH 1/2] tty: serial: imx: Allow UART to be a source for wakeup Fabio Estevam
@ 2011-12-09 12:42 ` Fabio Estevam
  2011-12-09 13:12 ` [PATCH v2 1/2] tty: serial: imx: " Fabio Estevam
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2011-12-09 12:42 UTC (permalink / raw)
  To: linux-arm-kernel

Allow UART to be a source for wakeup.

Tested by doing:

echo mem > /sys/power/state

and then pressing a key in the console will wakeup the sytem.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 arch/arm/mach-imx/mach-mx27_3ds.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index ba232d7..ee57521 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -144,7 +144,7 @@ static const int mx27pdk_pins[] __initconst = {
 };
 
 static const struct imxuart_platform_data uart_pdata __initconst = {
-	.flags = IMXUART_HAVE_RTSCTS,
+	.flags = IMXUART_HAVE_RTSCTS | IMXUART_CANWAKE,
 };
 
 /*
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 1/2] tty: serial: imx: Allow UART to be a source for wakeup
  2011-12-09 12:42 [PATCH 1/2] tty: serial: imx: Allow UART to be a source for wakeup Fabio Estevam
  2011-12-09 12:42 ` [PATCH 2/2] ARM: mach-mx27_3ds: " Fabio Estevam
@ 2011-12-09 13:12 ` Fabio Estevam
  2011-12-09 15:55 ` [PATCH v3 " Fabio Estevam
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2011-12-09 13:12 UTC (permalink / raw)
  To: linux-arm-kernel

Allow UART to be a source for wakeup from low power mode.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Pass the can-wake property via DT correctly

 .../bindings/tty/serial/fsl-imx-uart.txt           |    2 +
 arch/arm/plat-mxc/include/mach/imx-uart.h          |    1 +
 drivers/tty/serial/imx.c                           |   38 ++++++++++++++++++++
 3 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt b/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
index a9c0406..676cc39 100644
--- a/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
+++ b/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
@@ -8,6 +8,8 @@ Required properties:
 Optional properties:
 - fsl,uart-has-rtscts : Indicate the uart has rts and cts
 - fsl,irda-mode : Indicate the uart supports irda mode
+- fsl,uart-can-wake : Indicate that uart can be a source for wakeup from
+low-power mode
 
 Example:
 
diff --git a/arch/arm/plat-mxc/include/mach/imx-uart.h b/arch/arm/plat-mxc/include/mach/imx-uart.h
index 4adec9b..0ba6c6b 100644
--- a/arch/arm/plat-mxc/include/mach/imx-uart.h
+++ b/arch/arm/plat-mxc/include/mach/imx-uart.h
@@ -21,6 +21,7 @@
 
 #define IMXUART_HAVE_RTSCTS (1<<0)
 #define IMXUART_IRDA        (1<<1)
+#define IMXUART_CANWAKE     (1<<2)
 
 struct imxuart_platform_data {
 	int (*init)(struct platform_device *pdev);
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 163fc90..cd66046 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -200,6 +200,7 @@ struct imx_port {
 	int			txirq,rxirq,rtsirq;
 	unsigned int		have_rtscts:1;
 	unsigned int		use_irda:1;
+	unsigned int		can_wake:1;
 	unsigned int		irda_inv_rx:1;
 	unsigned int		irda_inv_tx:1;
 	unsigned short		trcv_delay; /* transceiver delay */
@@ -566,6 +567,9 @@ static irqreturn_t imx_int(int irq, void *dev_id)
 	if (sts & USR1_RTSD)
 		imx_rtsint(irq, dev_id);
 
+	if (sts & USR1_AWAKE)
+		writel(USR1_AWAKE, sport->port.membase + USR1);
+
 	return IRQ_HANDLED;
 }
 
@@ -660,6 +664,7 @@ static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode)
 static int imx_startup(struct uart_port *port)
 {
 	struct imx_port *sport = (struct imx_port *)port;
+	struct tty_struct *tty;
 	int retval;
 	unsigned long flags, temp;
 
@@ -791,6 +796,8 @@ static int imx_startup(struct uart_port *port)
 		if (pdata->irda_enable)
 			pdata->irda_enable(1);
 	}
+	tty = sport->port.state->port.tty;
+	device_set_wakeup_enable(tty->dev, 1);
 
 	return 0;
 
@@ -1269,6 +1276,15 @@ static struct uart_driver imx_reg = {
 static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
+
+	if (device_may_wakeup(&dev->dev)) {
+		enable_irq_wake(sport->rxirq);
+		/* enable wakeup from i.MX UART */
+		val = readl(sport->port.membase + UCR3);
+		val |= UCR3_AWAKEN;
+		writel(val, sport->port.membase + UCR3);
+	}
 
 	if (sport)
 		uart_suspend_port(&imx_reg, &sport->port);
@@ -1279,6 +1295,17 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 static int serial_imx_resume(struct platform_device *dev)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
+
+	if (device_may_wakeup(&dev->dev)) {
+		enable_irq_wake(sport->rxirq);
+		/* enable wakeup from i.MX UART */
+		val = readl(sport->port.membase + UCR3);
+		val &= ~UCR3_AWAKEN;
+		writel(val, sport->port.membase + UCR3);
+
+		disable_irq_wake(sport->rxirq);
+	}
 
 	if (sport)
 		uart_resume_port(&imx_reg, &sport->port);
@@ -1311,6 +1338,9 @@ static int serial_imx_probe_dt(struct imx_port *sport,
 	if (of_get_property(np, "fsl,irda-mode", NULL))
 		sport->use_irda = 1;
 
+	if (of_get_property(np, "fsl,uart-can-wake", NULL))
+		sport->can_wake = 1;
+
 	sport->devdata = of_id->data;
 
 	return 0;
@@ -1339,6 +1369,9 @@ static void serial_imx_probe_pdata(struct imx_port *sport,
 
 	if (pdata->flags & IMXUART_IRDA)
 		sport->use_irda = 1;
+
+	if (pdata->flags & IMXUART_CANWAKE)
+		sport->can_wake = 1;
 }
 
 static int serial_imx_probe(struct platform_device *pdev)
@@ -1408,6 +1441,11 @@ static int serial_imx_probe(struct platform_device *pdev)
 		goto deinit;
 	platform_set_drvdata(pdev, &sport->port);
 
+	if (sport->can_wake)
+		device_init_wakeup(&pdev->dev, 1);
+	else
+		device_init_wakeup(&pdev->dev, 0);
+
 	return 0;
 deinit:
 	if (pdata && pdata->exit)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 1/2] tty: serial: imx: Allow UART to be a source for wakeup
  2011-12-09 12:42 [PATCH 1/2] tty: serial: imx: Allow UART to be a source for wakeup Fabio Estevam
  2011-12-09 12:42 ` [PATCH 2/2] ARM: mach-mx27_3ds: " Fabio Estevam
  2011-12-09 13:12 ` [PATCH v2 1/2] tty: serial: imx: " Fabio Estevam
@ 2011-12-09 15:55 ` Fabio Estevam
  2011-12-09 18:41 ` [PATCH v4] " Fabio Estevam
  2011-12-13  3:23   ` Fabio Estevam
  4 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2011-12-09 15:55 UTC (permalink / raw)
  To: linux-arm-kernel

Allow UART to be a source for wakeup from low power mode.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- Remove incorrect enable_irq_wake from serial_imx_resume
Changes since v1:
- Pass the can-wake property via DT correctly
 .../bindings/tty/serial/fsl-imx-uart.txt           |    2 +
 arch/arm/plat-mxc/include/mach/imx-uart.h          |    1 +
 drivers/tty/serial/imx.c                           |   36 ++++++++++++++++++++
 3 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt b/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
index a9c0406..676cc39 100644
--- a/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
+++ b/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
@@ -8,6 +8,8 @@ Required properties:
 Optional properties:
 - fsl,uart-has-rtscts : Indicate the uart has rts and cts
 - fsl,irda-mode : Indicate the uart supports irda mode
+- fsl,uart-can-wake : Indicate that uart can be a source for wakeup from
+low-power mode
 
 Example:
 
diff --git a/arch/arm/plat-mxc/include/mach/imx-uart.h b/arch/arm/plat-mxc/include/mach/imx-uart.h
index 4adec9b..0ba6c6b 100644
--- a/arch/arm/plat-mxc/include/mach/imx-uart.h
+++ b/arch/arm/plat-mxc/include/mach/imx-uart.h
@@ -21,6 +21,7 @@
 
 #define IMXUART_HAVE_RTSCTS (1<<0)
 #define IMXUART_IRDA        (1<<1)
+#define IMXUART_CANWAKE     (1<<2)
 
 struct imxuart_platform_data {
 	int (*init)(struct platform_device *pdev);
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 163fc90..f0b736e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -200,6 +200,7 @@ struct imx_port {
 	int			txirq,rxirq,rtsirq;
 	unsigned int		have_rtscts:1;
 	unsigned int		use_irda:1;
+	unsigned int		can_wake:1;
 	unsigned int		irda_inv_rx:1;
 	unsigned int		irda_inv_tx:1;
 	unsigned short		trcv_delay; /* transceiver delay */
@@ -566,6 +567,9 @@ static irqreturn_t imx_int(int irq, void *dev_id)
 	if (sts & USR1_RTSD)
 		imx_rtsint(irq, dev_id);
 
+	if (sts & USR1_AWAKE)
+		writel(USR1_AWAKE, sport->port.membase + USR1);
+
 	return IRQ_HANDLED;
 }
 
@@ -660,6 +664,7 @@ static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode)
 static int imx_startup(struct uart_port *port)
 {
 	struct imx_port *sport = (struct imx_port *)port;
+	struct tty_struct *tty;
 	int retval;
 	unsigned long flags, temp;
 
@@ -791,6 +796,8 @@ static int imx_startup(struct uart_port *port)
 		if (pdata->irda_enable)
 			pdata->irda_enable(1);
 	}
+	tty = sport->port.state->port.tty;
+	device_set_wakeup_enable(tty->dev, 1);
 
 	return 0;
 
@@ -1269,6 +1276,15 @@ static struct uart_driver imx_reg = {
 static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
+
+	if (device_may_wakeup(&dev->dev)) {
+		enable_irq_wake(sport->rxirq);
+		/* enable wakeup from i.MX UART */
+		val = readl(sport->port.membase + UCR3);
+		val |= UCR3_AWAKEN;
+		writel(val, sport->port.membase + UCR3);
+	}
 
 	if (sport)
 		uart_suspend_port(&imx_reg, &sport->port);
@@ -1279,6 +1295,15 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 static int serial_imx_resume(struct platform_device *dev)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
+
+	if (device_may_wakeup(&dev->dev)) {
+		/* disable wakeup from i.MX UART */
+		val = readl(sport->port.membase + UCR3);
+		val &= ~UCR3_AWAKEN;
+		writel(val, sport->port.membase + UCR3);
+		disable_irq_wake(sport->rxirq);
+	}
 
 	if (sport)
 		uart_resume_port(&imx_reg, &sport->port);
@@ -1311,6 +1336,9 @@ static int serial_imx_probe_dt(struct imx_port *sport,
 	if (of_get_property(np, "fsl,irda-mode", NULL))
 		sport->use_irda = 1;
 
+	if (of_get_property(np, "fsl,uart-can-wake", NULL))
+		sport->can_wake = 1;
+
 	sport->devdata = of_id->data;
 
 	return 0;
@@ -1339,6 +1367,9 @@ static void serial_imx_probe_pdata(struct imx_port *sport,
 
 	if (pdata->flags & IMXUART_IRDA)
 		sport->use_irda = 1;
+
+	if (pdata->flags & IMXUART_CANWAKE)
+		sport->can_wake = 1;
 }
 
 static int serial_imx_probe(struct platform_device *pdev)
@@ -1408,6 +1439,11 @@ static int serial_imx_probe(struct platform_device *pdev)
 		goto deinit;
 	platform_set_drvdata(pdev, &sport->port);
 
+	if (sport->can_wake)
+		device_init_wakeup(&pdev->dev, 1);
+	else
+		device_init_wakeup(&pdev->dev, 0);
+
 	return 0;
 deinit:
 	if (pdata && pdata->exit)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4] tty: serial: imx: Allow UART to be a source for wakeup
  2011-12-09 12:42 [PATCH 1/2] tty: serial: imx: Allow UART to be a source for wakeup Fabio Estevam
                   ` (2 preceding siblings ...)
  2011-12-09 15:55 ` [PATCH v3 " Fabio Estevam
@ 2011-12-09 18:41 ` Fabio Estevam
  2011-12-11  6:01   ` Shawn Guo
  2011-12-13  3:23   ` Fabio Estevam
  4 siblings, 1 reply; 14+ messages in thread
From: Fabio Estevam @ 2011-12-09 18:41 UTC (permalink / raw)
  To: linux-arm-kernel

Allow UART to be a source for wakeup from low power mode.

Tested on a MX27PDK by doing:

echo enabled > /sys/devices/platform/imx21-uart.0/power/wakeup

echo mem > /sys/power/state

and then pressing a key in the console will wakeup the sytem.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v3:
- Remove IMXUART_CANWAKE flag. Let userspace write in /sys/ file
in order to enable UART wakeup source.
Changes since v2:
- Remove incorrect enable_irq_wake from serial_imx_resume
Changes since v1:
- Pass the can-wake property via DT correctly
 drivers/tty/serial/imx.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 163fc90..283bf21 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -566,6 +566,9 @@ static irqreturn_t imx_int(int irq, void *dev_id)
 	if (sts & USR1_RTSD)
 		imx_rtsint(irq, dev_id);
 
+	if (sts & USR1_AWAKE)
+		writel(USR1_AWAKE, sport->port.membase + USR1);
+
 	return IRQ_HANDLED;
 }
 
@@ -1269,6 +1272,15 @@ static struct uart_driver imx_reg = {
 static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
+
+	if (device_may_wakeup(&dev->dev)) {
+		enable_irq_wake(sport->rxirq);
+		/* enable wakeup from i.MX UART */
+		val = readl(sport->port.membase + UCR3);
+		val |= UCR3_AWAKEN;
+		writel(val, sport->port.membase + UCR3);
+	}
 
 	if (sport)
 		uart_suspend_port(&imx_reg, &sport->port);
@@ -1279,6 +1291,15 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 static int serial_imx_resume(struct platform_device *dev)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
+
+	if (device_may_wakeup(&dev->dev)) {
+		/* disable wakeup from i.MX UART */
+		val = readl(sport->port.membase + UCR3);
+		val &= ~UCR3_AWAKEN;
+		writel(val, sport->port.membase + UCR3);
+		disable_irq_wake(sport->rxirq);
+	}
 
 	if (sport)
 		uart_resume_port(&imx_reg, &sport->port);
@@ -1408,6 +1429,9 @@ static int serial_imx_probe(struct platform_device *pdev)
 		goto deinit;
 	platform_set_drvdata(pdev, &sport->port);
 
+	device_init_wakeup(&pdev->dev, 1);
+	device_set_wakeup_enable(&pdev->dev, 0);
+
 	return 0;
 deinit:
 	if (pdata && pdata->exit)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4] tty: serial: imx: Allow UART to be a source for wakeup
  2011-12-09 18:41 ` [PATCH v4] " Fabio Estevam
@ 2011-12-11  6:01   ` Shawn Guo
  2011-12-12 18:17     ` Fabio Estevam
  0 siblings, 1 reply; 14+ messages in thread
From: Shawn Guo @ 2011-12-11  6:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Dec 09, 2011 at 04:41:05PM -0200, Fabio Estevam wrote:
> Allow UART to be a source for wakeup from low power mode.
> 
> Tested on a MX27PDK by doing:
> 
> echo enabled > /sys/devices/platform/imx21-uart.0/power/wakeup
> 
> echo mem > /sys/power/state
> 
> and then pressing a key in the console will wakeup the sytem.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Changes since v3:
> - Remove IMXUART_CANWAKE flag. Let userspace write in /sys/ file
> in order to enable UART wakeup source.
> Changes since v2:
> - Remove incorrect enable_irq_wake from serial_imx_resume
> Changes since v1:
> - Pass the can-wake property via DT correctly
>  drivers/tty/serial/imx.c |   24 ++++++++++++++++++++++++
>  1 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index 163fc90..283bf21 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -566,6 +566,9 @@ static irqreturn_t imx_int(int irq, void *dev_id)
>  	if (sts & USR1_RTSD)
>  		imx_rtsint(irq, dev_id);
>  
> +	if (sts & USR1_AWAKE)
> +		writel(USR1_AWAKE, sport->port.membase + USR1);
> +
>  	return IRQ_HANDLED;
>  }
>  
> @@ -1269,6 +1272,15 @@ static struct uart_driver imx_reg = {
>  static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
>  {
>  	struct imx_port *sport = platform_get_drvdata(dev);
> +	unsigned int val;
> +
> +	if (device_may_wakeup(&dev->dev)) {
> +		enable_irq_wake(sport->rxirq);
> +		/* enable wakeup from i.MX UART */
> +		val = readl(sport->port.membase + UCR3);
> +		val |= UCR3_AWAKEN;
> +		writel(val, sport->port.membase + UCR3);
> +	}
>  
>  	if (sport)
>  		uart_suspend_port(&imx_reg, &sport->port);
> @@ -1279,6 +1291,15 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
>  static int serial_imx_resume(struct platform_device *dev)
>  {
>  	struct imx_port *sport = platform_get_drvdata(dev);
> +	unsigned int val;
> +
> +	if (device_may_wakeup(&dev->dev)) {
> +		/* disable wakeup from i.MX UART */
> +		val = readl(sport->port.membase + UCR3);
> +		val &= ~UCR3_AWAKEN;
> +		writel(val, sport->port.membase + UCR3);
> +		disable_irq_wake(sport->rxirq);
> +	}
>  
>  	if (sport)
>  		uart_resume_port(&imx_reg, &sport->port);
> @@ -1408,6 +1429,9 @@ static int serial_imx_probe(struct platform_device *pdev)
>  		goto deinit;
>  	platform_set_drvdata(pdev, &sport->port);
>  
> +	device_init_wakeup(&pdev->dev, 1);
> +	device_set_wakeup_enable(&pdev->dev, 0);
> +
Rather than calling these two functions, simply calling 

	device_set_wakeup_capable(&pdev->dev, true);

can just do what we want to do here.

Other than that,

Acked-by: Shawn Guo <shawn.guo@linaro.org>

(Tested on i.MX6Q ARM2 board)

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v4] tty: serial: imx: Allow UART to be a source for wakeup
  2011-12-11  6:01   ` Shawn Guo
@ 2011-12-12 18:17     ` Fabio Estevam
  2011-12-13  3:17       ` Shawn Guo
  0 siblings, 1 reply; 14+ messages in thread
From: Fabio Estevam @ 2011-12-12 18:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 11, 2011 at 4:01 AM, Shawn Guo <shawn.guo@freescale.com> wrote:

>> + ? ? device_init_wakeup(&pdev->dev, 1);
>> + ? ? device_set_wakeup_enable(&pdev->dev, 0);
>> +
> Rather than calling these two functions, simply calling
>
> ? ? ? ?device_set_wakeup_capable(&pdev->dev, true);
>
> can just do what we want to do here.

Yes, this is correct.

After checking the code it seems to me that  neither of this calls are needed.

serial_core.c already calls:
		device_init_wakeup(tty_dev, 1);
		device_set_wakeup_enable(tty_dev, 0);

and we can see a wakeup entry at:

/sys/devices/platform/imx21-uart.0/tty/ttymxc0/power/wakeup

However, if I send "enabled" to this file the
"if (device_may_wakeup(&dev->dev)" statement is never true.

I am not sure what would be the correct argument for device_may_wakeup
to "see" the original wakeup entry.

Regards,

Fabio Estevam



>
> Other than that,
>
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
>
> (Tested on i.MX6Q ARM2 board)
>
> --
> Regards,
> Shawn
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v4] tty: serial: imx: Allow UART to be a source for wakeup
  2011-12-12 18:17     ` Fabio Estevam
@ 2011-12-13  3:17       ` Shawn Guo
  0 siblings, 0 replies; 14+ messages in thread
From: Shawn Guo @ 2011-12-13  3:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 12, 2011 at 04:17:04PM -0200, Fabio Estevam wrote:
> On Sun, Dec 11, 2011 at 4:01 AM, Shawn Guo <shawn.guo@freescale.com> wrote:
> 
> >> + ? ? device_init_wakeup(&pdev->dev, 1);
> >> + ? ? device_set_wakeup_enable(&pdev->dev, 0);
> >> +
> > Rather than calling these two functions, simply calling
> >
> > ? ? ? ?device_set_wakeup_capable(&pdev->dev, true);
> >
> > can just do what we want to do here.
> 
> Yes, this is correct.
> 
> After checking the code it seems to me that  neither of this calls are needed.
> 
> serial_core.c already calls:
> 		device_init_wakeup(tty_dev, 1);
> 		device_set_wakeup_enable(tty_dev, 0);
> 
> and we can see a wakeup entry at:
> 
> /sys/devices/platform/imx21-uart.0/tty/ttymxc0/power/wakeup
> 
> However, if I send "enabled" to this file the
> "if (device_may_wakeup(&dev->dev)" statement is never true.
> 
That's because &pdev->dev and tty_dev above point to different
'struct dev'.

> I am not sure what would be the correct argument for device_may_wakeup
> to "see" the original wakeup entry.
> 
It seems difficult to figure out the tty_dev in imx driver.  And I do
not think we need to.  We can simply remove the device_may_wakeup
check and rxirq enable/disable from serial_imx_suspend/resume, because
both of these two things have been taken care of by serial_core.

The following change works for me.

8<----

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 163fc90..1722230 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -566,6 +566,9 @@ static irqreturn_t imx_int(int irq, void *dev_id)
        if (sts & USR1_RTSD)
                imx_rtsint(irq, dev_id);

+       if (sts & USR1_AWAKE)
+               writel(USR1_AWAKE, sport->port.membase + USR1);
+
        return IRQ_HANDLED;
 }

@@ -1269,6 +1272,12 @@ static struct uart_driver imx_reg = {
 static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 {
        struct imx_port *sport = platform_get_drvdata(dev);
+       unsigned int val;
+
+       /* enable wakeup from i.MX UART */
+       val = readl(sport->port.membase + UCR3);
+       val |= UCR3_AWAKEN;
+       writel(val, sport->port.membase + UCR3);

        if (sport)
                uart_suspend_port(&imx_reg, &sport->port);
@@ -1279,6 +1288,11 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 static int serial_imx_resume(struct platform_device *dev)
 {
        struct imx_port *sport = platform_get_drvdata(dev);
+       unsigned int val;
+
+       val = readl(sport->port.membase + UCR3);
+       val &= ~UCR3_AWAKEN;
+       writel(val, sport->port.membase + UCR3);

        if (sport)
                uart_resume_port(&imx_reg, &sport->port);

--->8

-- 
Regards,
Shawn

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v5] tty: serial: imx: Allow UART to be a source for wakeup
  2011-12-09 12:42 [PATCH 1/2] tty: serial: imx: Allow UART to be a source for wakeup Fabio Estevam
@ 2011-12-13  3:23   ` Fabio Estevam
  2011-12-09 13:12 ` [PATCH v2 1/2] tty: serial: imx: " Fabio Estevam
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2011-12-13  3:23 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: kernel, shawn.guo, alan, linux-serial, Fabio Estevam

Allow UART to be a source for wakeup from low power mode.

Tested on a MX27PDK by doing:

echo enabled > /sys/devices/platform/imx21-uart.0/tty/ttymxc0/power/wakeup

echo mem > /sys/power/state

and then pressing a key in the console will wakeup the sytem.

Suggested-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v4:
- Let serial core handle device_init_wakeup/device_set_wakeup_enable.
Changes since v3:
- Remove IMXUART_CANWAKE flag. Let userspace write in /sys/ file
in order to enable UART wakeup source.
Changes since v2:
- Remove incorrect enable_irq_wake from serial_imx_resume
Changes since v1:
- Pass the can-wake property via DT correctly
 drivers/tty/serial/imx.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 163fc90..0022bbd 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -566,6 +566,9 @@ static irqreturn_t imx_int(int irq, void *dev_id)
 	if (sts & USR1_RTSD)
 		imx_rtsint(irq, dev_id);
 
+	if (sts & USR1_AWAKE)
+		writel(USR1_AWAKE, sport->port.membase + USR1);
+
 	return IRQ_HANDLED;
 }
 
@@ -1269,6 +1272,12 @@ static struct uart_driver imx_reg = {
 static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
+
+	/* enable wakeup from i.MX UART */
+	val = readl(sport->port.membase + UCR3);
+	val |= UCR3_AWAKEN;
+	writel(val, sport->port.membase + UCR3);
 
 	if (sport)
 		uart_suspend_port(&imx_reg, &sport->port);
@@ -1279,7 +1288,13 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 static int serial_imx_resume(struct platform_device *dev)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
 
+	/* disable wakeup from i.MX UART */
+	val = readl(sport->port.membase + UCR3);
+	val &= ~UCR3_AWAKEN;
+	writel(val, sport->port.membase + UCR3);
+
 	if (sport)
 		uart_resume_port(&imx_reg, &sport->port);
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v5] tty: serial: imx: Allow UART to be a source for wakeup
@ 2011-12-13  3:23   ` Fabio Estevam
  0 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2011-12-13  3:23 UTC (permalink / raw)
  To: linux-arm-kernel

Allow UART to be a source for wakeup from low power mode.

Tested on a MX27PDK by doing:

echo enabled > /sys/devices/platform/imx21-uart.0/tty/ttymxc0/power/wakeup

echo mem > /sys/power/state

and then pressing a key in the console will wakeup the sytem.

Suggested-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v4:
- Let serial core handle device_init_wakeup/device_set_wakeup_enable.
Changes since v3:
- Remove IMXUART_CANWAKE flag. Let userspace write in /sys/ file
in order to enable UART wakeup source.
Changes since v2:
- Remove incorrect enable_irq_wake from serial_imx_resume
Changes since v1:
- Pass the can-wake property via DT correctly
 drivers/tty/serial/imx.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 163fc90..0022bbd 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -566,6 +566,9 @@ static irqreturn_t imx_int(int irq, void *dev_id)
 	if (sts & USR1_RTSD)
 		imx_rtsint(irq, dev_id);
 
+	if (sts & USR1_AWAKE)
+		writel(USR1_AWAKE, sport->port.membase + USR1);
+
 	return IRQ_HANDLED;
 }
 
@@ -1269,6 +1272,12 @@ static struct uart_driver imx_reg = {
 static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
+
+	/* enable wakeup from i.MX UART */
+	val = readl(sport->port.membase + UCR3);
+	val |= UCR3_AWAKEN;
+	writel(val, sport->port.membase + UCR3);
 
 	if (sport)
 		uart_suspend_port(&imx_reg, &sport->port);
@@ -1279,7 +1288,13 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
 static int serial_imx_resume(struct platform_device *dev)
 {
 	struct imx_port *sport = platform_get_drvdata(dev);
+	unsigned int val;
 
+	/* disable wakeup from i.MX UART */
+	val = readl(sport->port.membase + UCR3);
+	val &= ~UCR3_AWAKEN;
+	writel(val, sport->port.membase + UCR3);
+
 	if (sport)
 		uart_resume_port(&imx_reg, &sport->port);
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v5] tty: serial: imx: Allow UART to be a source for wakeup
  2011-12-13  3:23   ` Fabio Estevam
@ 2011-12-14  0:44     ` Richard Zhao
  -1 siblings, 0 replies; 14+ messages in thread
From: Richard Zhao @ 2011-12-14  0:44 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: linux-arm-kernel, Fabio Estevam, linux-serial, shawn.guo, kernel, alan

On Tue, Dec 13, 2011 at 01:23:48AM -0200, Fabio Estevam wrote:
> Allow UART to be a source for wakeup from low power mode.
> 
> Tested on a MX27PDK by doing:
> 
> echo enabled > /sys/devices/platform/imx21-uart.0/tty/ttymxc0/power/wakeup
> 
> echo mem > /sys/power/state
> 
> and then pressing a key in the console will wakeup the sytem.
> 
> Suggested-by: Shawn Guo <shawn.guo@freescale.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
For imx6q sabrelite,
Tested-by: Richard Zhao <richard.zhao@freescale.com>
> ---
> Changes since v4:
> - Let serial core handle device_init_wakeup/device_set_wakeup_enable.
> Changes since v3:
> - Remove IMXUART_CANWAKE flag. Let userspace write in /sys/ file
> in order to enable UART wakeup source.
> Changes since v2:
> - Remove incorrect enable_irq_wake from serial_imx_resume
> Changes since v1:
> - Pass the can-wake property via DT correctly
>  drivers/tty/serial/imx.c |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index 163fc90..0022bbd 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -566,6 +566,9 @@ static irqreturn_t imx_int(int irq, void *dev_id)
>  	if (sts & USR1_RTSD)
>  		imx_rtsint(irq, dev_id);
>  
> +	if (sts & USR1_AWAKE)
> +		writel(USR1_AWAKE, sport->port.membase + USR1);
> +
>  	return IRQ_HANDLED;
>  }
>  
> @@ -1269,6 +1272,12 @@ static struct uart_driver imx_reg = {
>  static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
>  {
>  	struct imx_port *sport = platform_get_drvdata(dev);
> +	unsigned int val;
> +
> +	/* enable wakeup from i.MX UART */
> +	val = readl(sport->port.membase + UCR3);
> +	val |= UCR3_AWAKEN;
> +	writel(val, sport->port.membase + UCR3);
>  
>  	if (sport)
>  		uart_suspend_port(&imx_reg, &sport->port);
> @@ -1279,7 +1288,13 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
>  static int serial_imx_resume(struct platform_device *dev)
>  {
>  	struct imx_port *sport = platform_get_drvdata(dev);
> +	unsigned int val;
>  
> +	/* disable wakeup from i.MX UART */
> +	val = readl(sport->port.membase + UCR3);
> +	val &= ~UCR3_AWAKEN;
> +	writel(val, sport->port.membase + UCR3);
> +
>  	if (sport)
>  		uart_resume_port(&imx_reg, &sport->port);
>  
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v5] tty: serial: imx: Allow UART to be a source for wakeup
@ 2011-12-14  0:44     ` Richard Zhao
  0 siblings, 0 replies; 14+ messages in thread
From: Richard Zhao @ 2011-12-14  0:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Dec 13, 2011 at 01:23:48AM -0200, Fabio Estevam wrote:
> Allow UART to be a source for wakeup from low power mode.
> 
> Tested on a MX27PDK by doing:
> 
> echo enabled > /sys/devices/platform/imx21-uart.0/tty/ttymxc0/power/wakeup
> 
> echo mem > /sys/power/state
> 
> and then pressing a key in the console will wakeup the sytem.
> 
> Suggested-by: Shawn Guo <shawn.guo@freescale.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
For imx6q sabrelite,
Tested-by: Richard Zhao <richard.zhao@freescale.com>
> ---
> Changes since v4:
> - Let serial core handle device_init_wakeup/device_set_wakeup_enable.
> Changes since v3:
> - Remove IMXUART_CANWAKE flag. Let userspace write in /sys/ file
> in order to enable UART wakeup source.
> Changes since v2:
> - Remove incorrect enable_irq_wake from serial_imx_resume
> Changes since v1:
> - Pass the can-wake property via DT correctly
>  drivers/tty/serial/imx.c |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index 163fc90..0022bbd 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -566,6 +566,9 @@ static irqreturn_t imx_int(int irq, void *dev_id)
>  	if (sts & USR1_RTSD)
>  		imx_rtsint(irq, dev_id);
>  
> +	if (sts & USR1_AWAKE)
> +		writel(USR1_AWAKE, sport->port.membase + USR1);
> +
>  	return IRQ_HANDLED;
>  }
>  
> @@ -1269,6 +1272,12 @@ static struct uart_driver imx_reg = {
>  static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
>  {
>  	struct imx_port *sport = platform_get_drvdata(dev);
> +	unsigned int val;
> +
> +	/* enable wakeup from i.MX UART */
> +	val = readl(sport->port.membase + UCR3);
> +	val |= UCR3_AWAKEN;
> +	writel(val, sport->port.membase + UCR3);
>  
>  	if (sport)
>  		uart_suspend_port(&imx_reg, &sport->port);
> @@ -1279,7 +1288,13 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
>  static int serial_imx_resume(struct platform_device *dev)
>  {
>  	struct imx_port *sport = platform_get_drvdata(dev);
> +	unsigned int val;
>  
> +	/* disable wakeup from i.MX UART */
> +	val = readl(sport->port.membase + UCR3);
> +	val &= ~UCR3_AWAKEN;
> +	writel(val, sport->port.membase + UCR3);
> +
>  	if (sport)
>  		uart_resume_port(&imx_reg, &sport->port);
>  
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5] tty: serial: imx: Allow UART to be a source for wakeup
  2011-12-13  3:23   ` Fabio Estevam
@ 2011-12-26  1:53     ` Shawn Guo
  -1 siblings, 0 replies; 14+ messages in thread
From: Shawn Guo @ 2011-12-26  1:53 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: linux-arm-kernel, kernel, alan, linux-serial, Fabio Estevam,
	Greg Kroah-Hartman

On Tue, Dec 13, 2011 at 01:23:48AM -0200, Fabio Estevam wrote:
> Allow UART to be a source for wakeup from low power mode.
> 
> Tested on a MX27PDK by doing:
> 
> echo enabled > /sys/devices/platform/imx21-uart.0/tty/ttymxc0/power/wakeup
> 
> echo mem > /sys/power/state
> 
> and then pressing a key in the console will wakeup the sytem.
> 
> Suggested-by: Shawn Guo <shawn.guo@freescale.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---

I queued this for 3.3, and will send a pull-request to Greg.

-- 
Regards,
Shawn


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v5] tty: serial: imx: Allow UART to be a source for wakeup
@ 2011-12-26  1:53     ` Shawn Guo
  0 siblings, 0 replies; 14+ messages in thread
From: Shawn Guo @ 2011-12-26  1:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Dec 13, 2011 at 01:23:48AM -0200, Fabio Estevam wrote:
> Allow UART to be a source for wakeup from low power mode.
> 
> Tested on a MX27PDK by doing:
> 
> echo enabled > /sys/devices/platform/imx21-uart.0/tty/ttymxc0/power/wakeup
> 
> echo mem > /sys/power/state
> 
> and then pressing a key in the console will wakeup the sytem.
> 
> Suggested-by: Shawn Guo <shawn.guo@freescale.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---

I queued this for 3.3, and will send a pull-request to Greg.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-12-26  1:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-09 12:42 [PATCH 1/2] tty: serial: imx: Allow UART to be a source for wakeup Fabio Estevam
2011-12-09 12:42 ` [PATCH 2/2] ARM: mach-mx27_3ds: " Fabio Estevam
2011-12-09 13:12 ` [PATCH v2 1/2] tty: serial: imx: " Fabio Estevam
2011-12-09 15:55 ` [PATCH v3 " Fabio Estevam
2011-12-09 18:41 ` [PATCH v4] " Fabio Estevam
2011-12-11  6:01   ` Shawn Guo
2011-12-12 18:17     ` Fabio Estevam
2011-12-13  3:17       ` Shawn Guo
2011-12-13  3:23 ` [PATCH v5] " Fabio Estevam
2011-12-13  3:23   ` Fabio Estevam
2011-12-14  0:44   ` Richard Zhao
2011-12-14  0:44     ` Richard Zhao
2011-12-26  1:53   ` Shawn Guo
2011-12-26  1:53     ` Shawn Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.