aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/cpuidle.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2013-02-04 07:01:43 -0500
committerLen Brown <len.brown@intel.com>2013-02-08 18:31:16 -0500
commit36ce8d4f5fecc20c2dfb08f24fe01c5eb81f6245 (patch)
tree9a4c4d3da61df7927385f719b619fce11f4bd036 /arch/arm/mach-davinci/cpuidle.c
parent8d60143a2367616a9d4f7c11656ade8521eb1874 (diff)
davinci: cpuidle - remove the ops
With one function handling the idle state and a single variable, the usage of the davinci_ops is overkill. This patch removes these ops and simplify the code. Furthermore, the 'driver_data' field is no longer used, we have 1 of the 3 remaining user of this field removed. 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.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c
index 697febe5a8e5..5e430bffb5d8 100644
--- a/arch/arm/mach-davinci/cpuidle.c
+++ b/arch/arm/mach-davinci/cpuidle.c
@@ -25,12 +25,6 @@
25 25
26#define DAVINCI_CPUIDLE_MAX_STATES 2 26#define DAVINCI_CPUIDLE_MAX_STATES 2
27 27
28struct davinci_ops {
29 void (*enter) (void);
30 void (*exit) (void);
31 u32 flags;
32};
33
34static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device); 28static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device);
35static void __iomem *ddr2_reg_base; 29static void __iomem *ddr2_reg_base;
36static bool ddr2_pdown; 30static bool ddr2_pdown;
@@ -54,39 +48,17 @@ static void davinci_save_ddr_power(int enter, bool pdown)
54 __raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET); 48 __raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET);
55} 49}
56 50
57static void davinci_c2state_enter(void)
58{
59 davinci_save_ddr_power(1, ddr2_pdown);
60}
61
62static void davinci_c2state_exit(void)
63{
64 davinci_save_ddr_power(0, ddr2_pdown);
65}
66
67static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = {
68 [1] = {
69 .enter = davinci_c2state_enter,
70 .exit = davinci_c2state_exit,
71 },
72};
73
74/* Actual code that puts the SoC in different idle states */ 51/* Actual code that puts the SoC in different idle states */
75static int davinci_enter_idle(struct cpuidle_device *dev, 52static int davinci_enter_idle(struct cpuidle_device *dev,
76 struct cpuidle_driver *drv, 53 struct cpuidle_driver *drv,
77 int index) 54 int index)
78{ 55{
79 struct cpuidle_state_usage *state_usage = &dev->states_usage[index]; 56 davinci_save_ddr_power(1, ddr2_pdown);
80 struct davinci_ops *ops = cpuidle_get_statedata(state_usage);
81
82 if (ops && ops->enter)
83 ops->enter();
84 57
85 index = cpuidle_wrap_enter(dev, drv, index, 58 index = cpuidle_wrap_enter(dev, drv, index,
86 arm_cpuidle_simple_enter); 59 arm_cpuidle_simple_enter);
87 60
88 if (ops && ops->exit) 61 davinci_save_ddr_power(0, ddr2_pdown);
89 ops->exit();
90 62
91 return index; 63 return index;
92} 64}
@@ -123,7 +95,6 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev)
123 ddr2_reg_base = pdata->ddr2_ctlr_base; 95 ddr2_reg_base = pdata->ddr2_ctlr_base;
124 96
125 ddr2_pdown = pdata->ddr2_pdown; 97 ddr2_pdown = pdata->ddr2_pdown;
126 cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]);
127 98
128 device->state_count = DAVINCI_CPUIDLE_MAX_STATES; 99 device->state_count = DAVINCI_CPUIDLE_MAX_STATES;
129 100