lkml.org 
[lkml]   [2015]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] amba: add no_pm_pclk_management flag to amba_driver
Date
This patch introduces no_pm_pclk_management flag in struct amba_driver.
It causes that pclk is not touched in pm_runtime callbacks. This allows
to manage clock in device driver independently of power domain management.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---
drivers/amba/bus.c | 6 ++++--
include/linux/amba/bus.h | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index f009936..75035f0 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -140,9 +140,10 @@ static struct device_attribute amba_dev_attrs[] = {
static int amba_pm_runtime_suspend(struct device *dev)
{
struct amba_device *pcdev = to_amba_device(dev);
+ struct amba_driver *pcdrv = to_amba_driver(dev->driver);
int ret = pm_generic_runtime_suspend(dev);

- if (ret == 0 && dev->driver) {
+ if (ret == 0 && dev->driver && !pcdrv->no_pm_pclk_management) {
if (pm_runtime_is_irq_safe(dev))
clk_disable(pcdev->pclk);
else
@@ -155,9 +156,10 @@ static int amba_pm_runtime_suspend(struct device *dev)
static int amba_pm_runtime_resume(struct device *dev)
{
struct amba_device *pcdev = to_amba_device(dev);
+ struct amba_driver *pcdrv = to_amba_driver(dev->driver);
int ret;

- if (dev->driver) {
+ if (dev->driver && !pcdrv->no_pm_pclk_management) {
if (pm_runtime_is_irq_safe(dev))
ret = clk_enable(pcdev->pclk);
else
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index 50fc668..a77378c 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -44,6 +44,7 @@ struct amba_driver {
int (*suspend)(struct amba_device *, pm_message_t);
int (*resume)(struct amba_device *);
const struct amba_id *id_table;
+ unsigned int no_pm_pclk_management:1;
};

/*
--
1.9.1


\
 
 \ /
  Last update: 2015-04-16 16:21    [W:0.170 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site