diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-02-04 07:01:41 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2013-02-08 18:31:16 -0500 |
commit | 5af4a21c6efd270a334202fb1fc4a347ea4624e3 (patch) | |
tree | f05851b12ef31af36976cc55f0dcfddaad977234 /arch/arm/mach-davinci/cpuidle.c | |
parent | 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7 (diff) |
Replace the flag by a simple global boolean in the cpuidle.c.
That will allow to cleanup the rest of the code right after,
because the ops won't make sense.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch/arm/mach-davinci/cpuidle.c')
-rw-r--r-- | arch/arm/mach-davinci/cpuidle.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c index 9107691adbdb..5fbd470d46ca 100644 --- a/arch/arm/mach-davinci/cpuidle.c +++ b/arch/arm/mach-davinci/cpuidle.c | |||
@@ -26,8 +26,8 @@ | |||
26 | #define DAVINCI_CPUIDLE_MAX_STATES 2 | 26 | #define DAVINCI_CPUIDLE_MAX_STATES 2 |
27 | 27 | ||
28 | struct davinci_ops { | 28 | struct davinci_ops { |
29 | void (*enter) (u32 flags); | 29 | void (*enter) (void); |
30 | void (*exit) (u32 flags); | 30 | void (*exit) (void); |
31 | u32 flags; | 31 | u32 flags; |
32 | }; | 32 | }; |
33 | 33 | ||
@@ -40,20 +40,17 @@ static int davinci_enter_idle(struct cpuidle_device *dev, | |||
40 | struct davinci_ops *ops = cpuidle_get_statedata(state_usage); | 40 | struct davinci_ops *ops = cpuidle_get_statedata(state_usage); |
41 | 41 | ||
42 | if (ops && ops->enter) | 42 | if (ops && ops->enter) |
43 | ops->enter(ops->flags); | 43 | ops->enter(); |
44 | 44 | ||
45 | index = cpuidle_wrap_enter(dev, drv, index, | 45 | index = cpuidle_wrap_enter(dev, drv, index, |
46 | arm_cpuidle_simple_enter); | 46 | arm_cpuidle_simple_enter); |
47 | 47 | ||
48 | if (ops && ops->exit) | 48 | if (ops && ops->exit) |
49 | ops->exit(ops->flags); | 49 | ops->exit(); |
50 | 50 | ||
51 | return index; | 51 | return index; |
52 | } | 52 | } |
53 | 53 | ||
54 | /* fields in davinci_ops.flags */ | ||
55 | #define DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN BIT(0) | ||
56 | |||
57 | static struct cpuidle_driver davinci_idle_driver = { | 54 | static struct cpuidle_driver davinci_idle_driver = { |
58 | .name = "cpuidle-davinci", | 55 | .name = "cpuidle-davinci", |
59 | .owner = THIS_MODULE, | 56 | .owner = THIS_MODULE, |
@@ -72,6 +69,7 @@ static struct cpuidle_driver davinci_idle_driver = { | |||
72 | 69 | ||
73 | static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device); | 70 | static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device); |
74 | static void __iomem *ddr2_reg_base; | 71 | static void __iomem *ddr2_reg_base; |
72 | static bool ddr2_pdown; | ||
75 | 73 | ||
76 | static void davinci_save_ddr_power(int enter, bool pdown) | 74 | static void davinci_save_ddr_power(int enter, bool pdown) |
77 | { | 75 | { |
@@ -92,14 +90,14 @@ static void davinci_save_ddr_power(int enter, bool pdown) | |||
92 | __raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET); | 90 | __raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET); |
93 | } | 91 | } |
94 | 92 | ||
95 | static void davinci_c2state_enter(u32 flags) | 93 | static void davinci_c2state_enter(void) |
96 | { | 94 | { |
97 | davinci_save_ddr_power(1, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN)); | 95 | davinci_save_ddr_power(1, ddr2_pdown); |
98 | } | 96 | } |
99 | 97 | ||
100 | static void davinci_c2state_exit(u32 flags) | 98 | static void davinci_c2state_exit(void) |
101 | { | 99 | { |
102 | davinci_save_ddr_power(0, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN)); | 100 | davinci_save_ddr_power(0, ddr2_pdown); |
103 | } | 101 | } |
104 | 102 | ||
105 | static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = { | 103 | static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = { |
@@ -124,8 +122,7 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev) | |||
124 | 122 | ||
125 | ddr2_reg_base = pdata->ddr2_ctlr_base; | 123 | ddr2_reg_base = pdata->ddr2_ctlr_base; |
126 | 124 | ||
127 | if (pdata->ddr2_pdown) | 125 | ddr2_pdown = pdata->ddr2_pdown; |
128 | davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN; | ||
129 | cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]); | 126 | cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]); |
130 | 127 | ||
131 | device->state_count = DAVINCI_CPUIDLE_MAX_STATES; | 128 | device->state_count = DAVINCI_CPUIDLE_MAX_STATES; |