1 From 85b9e8fe08a8c85096be91cb8eb60d5450dac71d Mon Sep 17 00:00:00 2001
2 From: Rajendra Nayak <rnayak@ti.com>
3 Date: Tue, 5 Apr 2011 15:22:36 +0530
4 Subject: [PATCH 2/6] OMAP2+: clockdomain: Add SoC support for clkdm_is_idle
6 Add the SoC specific implemenation for clkdm_is_idle
9 Signed-off-by: Rajendra Nayak <rnayak@ti.com>
11 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c | 12 ++++++++++++
12 arch/arm/mach-omap2/clockdomain44xx.c | 7 +++++++
13 2 files changed, 19 insertions(+), 0 deletions(-)
15 diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
16 index 48d0db7..db49baa 100644
17 --- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
18 +++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
22 #include <linux/types.h>
23 +#include <linux/errno.h>
24 #include <plat/prcm.h>
26 #include "prm2xxx_3xxx.h"
27 @@ -146,6 +147,15 @@ static void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
28 _clkdm_del_autodeps(clkdm);
31 +static int omap2_clkdm_is_idle(struct clockdomain *clkdm)
33 + if (!clkdm->clktrctrl_mask)
36 + return omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
37 + clkdm->clktrctrl_mask);
40 static void _enable_hwsup(struct clockdomain *clkdm)
42 if (cpu_is_omap24xx())
43 @@ -252,6 +262,7 @@ struct clkdm_ops omap2_clkdm_operations = {
44 .clkdm_wakeup = omap2_clkdm_wakeup,
45 .clkdm_allow_idle = omap2_clkdm_allow_idle,
46 .clkdm_deny_idle = omap2_clkdm_deny_idle,
47 + .clkdm_is_idle = omap2_clkdm_is_idle,
48 .clkdm_clk_enable = omap2_clkdm_clk_enable,
49 .clkdm_clk_disable = omap2_clkdm_clk_disable,
51 @@ -269,6 +280,7 @@ struct clkdm_ops omap3_clkdm_operations = {
52 .clkdm_wakeup = omap3_clkdm_wakeup,
53 .clkdm_allow_idle = omap3_clkdm_allow_idle,
54 .clkdm_deny_idle = omap3_clkdm_deny_idle,
55 + .clkdm_is_idle = omap2_clkdm_is_idle,
56 .clkdm_clk_enable = omap2_clkdm_clk_enable,
57 .clkdm_clk_disable = omap2_clkdm_clk_disable,
59 diff --git a/arch/arm/mach-omap2/clockdomain44xx.c b/arch/arm/mach-omap2/clockdomain44xx.c
60 index a1a4ecd..4b10727 100644
61 --- a/arch/arm/mach-omap2/clockdomain44xx.c
62 +++ b/arch/arm/mach-omap2/clockdomain44xx.c
63 @@ -93,6 +93,12 @@ static void omap4_clkdm_deny_idle(struct clockdomain *clkdm)
64 clkdm->cm_inst, clkdm->clkdm_offs);
67 +static int omap4_clkdm_is_idle(struct clockdomain *clkdm)
69 + return omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
70 + clkdm->cm_inst, clkdm->clkdm_offs);
73 static int omap4_clkdm_clk_enable(struct clockdomain *clkdm)
76 @@ -132,6 +138,7 @@ struct clkdm_ops omap4_clkdm_operations = {
77 .clkdm_wakeup = omap4_clkdm_wakeup,
78 .clkdm_allow_idle = omap4_clkdm_allow_idle,
79 .clkdm_deny_idle = omap4_clkdm_deny_idle,
80 + .clkdm_is_idle = omap4_clkdm_is_idle,
81 .clkdm_clk_enable = omap4_clkdm_clk_enable,
82 .clkdm_clk_disable = omap4_clkdm_clk_disable,