summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPradeep Goudagunta <pgoudagunta@nvidia.com>2012-08-30 21:12:47 +0530
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-11-09 06:03:29 -0800
commitc287cdc25c170c7cd13af663bfbfaafd030e5352 (patch)
tree4a9bba4d33bf3d9386cc7440986d2491d8fc7834 /drivers
parentb0db2a9a808d2ff8b9fbcf79ef62d72d5332cbff (diff)
tty: serial: tegra: Add stub runtime power management
Add stub runtime_pm calls which go through the flow of enabling and disabling but don't actually do anything with the device itself as there's nothing useful we can do. This provides the core PM framework with information about when the device is idle, enabling chip wide power savings. Bug 887359 Change-Id: I159f7798dbf141813ec1aa56ddb06cc8ca6595f4 Signed-off-by: Pradeep Goudagunta <pgoudagunta@nvidia.com> Reviewed-on: http://git-master/r/159835 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/tegra_hsuart.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/tty/serial/tegra_hsuart.c b/drivers/tty/serial/tegra_hsuart.c
index 4ece2a699337..51a9a0a69993 100644
--- a/drivers/tty/serial/tegra_hsuart.c
+++ b/drivers/tty/serial/tegra_hsuart.c
@@ -40,6 +40,7 @@
#include <linux/workqueue.h>
#include <linux/tegra_uart.h>
#include <linux/tty_flip.h>
+#include <linux/pm_runtime.h>
#include <mach/dma.h>
#include <mach/clk.h>
@@ -758,6 +759,7 @@ static void tegra_uart_hw_deinit(struct tegra_uart_port *t)
spin_unlock_irqrestore(&t->uport.lock, flags);
clk_disable(t->clk);
+ pm_runtime_put_sync((&t->uport)->dev);
}
static void tegra_uart_free_rx_dma_buffer(struct tegra_uart_port *t)
@@ -792,6 +794,7 @@ static int tegra_uart_hw_init(struct tegra_uart_port *t)
t->ier_shadow = 0;
t->baud = 0;
+ pm_runtime_get_sync((&t->uport)->dev);
clk_enable(t->clk);
/* Reset the UART controller to clear all previous status.*/
@@ -1609,6 +1612,7 @@ static int __init tegra_uart_probe(struct platform_device *pdev)
}
}
tasklet_init(&t->tlet, tegra_uart_tasklet_action, (unsigned long) t);
+ pm_runtime_enable((&t->uport)->dev);
return ret;
@@ -1635,6 +1639,7 @@ static int __devexit tegra_uart_remove(struct platform_device *pdev)
u = &t->uport;
tasklet_kill(&t->tlet);
+ pm_runtime_disable(u->dev);
uart_remove_one_port(&tegra_uart_driver, u);
tegra_uart_free_rx_dma_buffer(t);
@@ -1661,6 +1666,7 @@ static int tegra_uart_suspend(struct platform_device *pdev, pm_message_t state)
/* enable clock before calling suspend so that controller
register can be accessible */
if (t->uart_state == TEGRA_UART_CLOCK_OFF) {
+ pm_runtime_get_sync(u->dev);
clk_enable(t->clk);
t->uart_state = TEGRA_UART_OPENED;
}
@@ -1707,9 +1713,10 @@ void tegra_uart_request_clock_off(struct uart_port *uport)
}
spin_unlock_irqrestore(&uport->lock, flags);
- if (is_clk_disable)
+ if (is_clk_disable) {
clk_disable(t->clk);
-
+ pm_runtime_put_sync(uport->dev);
+ }
return;
}
@@ -1731,9 +1738,10 @@ void tegra_uart_request_clock_on(struct uart_port *uport)
}
spin_unlock_irqrestore(&uport->lock, flags);
- if (is_clk_enable)
+ if (is_clk_enable) {
+ pm_runtime_get_sync(uport->dev);
clk_enable(t->clk);
-
+ }
return;
}