summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhou Jingyu <b02241@freescale.com>2010-08-23 16:06:06 +0800
committerZhou Jingyu <b02241@freescale.com>2010-08-23 16:06:06 +0800
commit92455c946b2a417f0d1a4e8b004d074ca11db3ae (patch)
treedb2c27598a6a4da77a510137fab9bf213f6f8606
parent3b07427a8362200716611035eb4101e9461a48e7 (diff)
ENGR00125875-2 mx28: add suspend/resume for LED driver
add suspend/resume for LED driver disable debug uart for suspend Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
-rw-r--r--drivers/leds/leds-mxs-pwm.c25
-rw-r--r--drivers/serial/mxs-duart.c2
2 files changed, 27 insertions, 0 deletions
diff --git a/drivers/leds/leds-mxs-pwm.c b/drivers/leds/leds-mxs-pwm.c
index c76821770446..a546900a44d0 100644
--- a/drivers/leds/leds-mxs-pwm.c
+++ b/drivers/leds/leds-mxs-pwm.c
@@ -165,10 +165,35 @@ static int __devexit mxs_pwm_led_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM
+static int mxs_led_suspend(struct platform_device *dev, pm_message_t state)
+{
+ int i;
+
+ for (i = 0; i < leds.led_num; i++)
+ led_classdev_suspend(&leds.leds[i].dev);
+ return 0;
+}
+
+static int mxs_led_resume(struct platform_device *dev)
+{
+ int i;
+
+ for (i = 0; i < leds.led_num; i++)
+ led_classdev_resume(&leds.leds[i].dev);
+ return 0;
+}
+#else
+#define mxs_led_suspend NULL
+#define mxs_led_resume NULL
+#endif
+
static struct platform_driver mxs_pwm_led_driver = {
.probe = mxs_pwm_led_probe,
.remove = __devexit_p(mxs_pwm_led_remove),
+ .suspend = mxs_led_suspend,
+ .resume = mxs_led_resume,
.driver = {
.name = "mxs-leds",
},
diff --git a/drivers/serial/mxs-duart.c b/drivers/serial/mxs-duart.c
index 171b8628faee..162a15f52982 100644
--- a/drivers/serial/mxs-duart.c
+++ b/drivers/serial/mxs-duart.c
@@ -742,6 +742,7 @@ static int duart_suspend(struct platform_device *pdev,
int ret = 0;
if (!duart_port.suspended) {
ret = uart_suspend_port(&duart_drv, &duart_port.port);
+ duart_shutdown((struct uart_port *)&duart_port);
if (!ret)
duart_port.suspended = 1;
}
@@ -754,6 +755,7 @@ static int duart_resume(struct platform_device *pdev,
int ret = 0;
if (duart_port.suspended) {
ret = uart_resume_port(&duart_drv, &duart_port.port);
+ duart_startup((struct uart_port *)&duart_port);
if (!ret)
duart_port.suspended = 0;
}