aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRobert Lee <rob.lee@linaro.org>2012-03-20 16:22:47 -0400
committerLen Brown <len.brown@intel.com>2012-03-21 02:01:08 -0400
commitd13e9261ac026f90cccac1e6de3978fb18d4af7b (patch)
tree84c8e65dcc390fdef03ae6f13d2fb506269aa662 /arch
parent6da45dce3ce4a1f1f2548c9ad9954d57ab0625b3 (diff)
ARM: omap: Consolidate OMAP4 time keeping and irq enable
Enable core cpuidle timekeeping and irq enabling and remove that handling from this code. Signed-off-by: Robert Lee <rob.lee@linaro.org> Reviewed-by: Kevin Hilman <khilman@ti.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/cpuidle44xx.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index 72e018b9b260..f386cbe9c889 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -62,15 +62,9 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
62{ 62{
63 struct omap4_idle_statedata *cx = 63 struct omap4_idle_statedata *cx =
64 cpuidle_get_statedata(&dev->states_usage[index]); 64 cpuidle_get_statedata(&dev->states_usage[index]);
65 struct timespec ts_preidle, ts_postidle, ts_idle;
66 u32 cpu1_state; 65 u32 cpu1_state;
67 int idle_time;
68 int cpu_id = smp_processor_id(); 66 int cpu_id = smp_processor_id();
69 67
70 /* Used to keep track of the total time in idle */
71 getnstimeofday(&ts_preidle);
72
73 local_irq_disable();
74 local_fiq_disable(); 68 local_fiq_disable();
75 69
76 /* 70 /*
@@ -128,26 +122,17 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
128 if (index > 0) 122 if (index > 0)
129 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id); 123 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id);
130 124
131 getnstimeofday(&ts_postidle);
132 ts_idle = timespec_sub(ts_postidle, ts_preidle);
133
134 local_irq_enable();
135 local_fiq_enable(); 125 local_fiq_enable();
136 126
137 idle_time = ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * \
138 USEC_PER_SEC;
139
140 /* Update cpuidle counters */
141 dev->last_residency = idle_time;
142
143 return index; 127 return index;
144} 128}
145 129
146DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev); 130DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev);
147 131
148struct cpuidle_driver omap4_idle_driver = { 132struct cpuidle_driver omap4_idle_driver = {
149 .name = "omap4_idle", 133 .name = "omap4_idle",
150 .owner = THIS_MODULE, 134 .owner = THIS_MODULE,
135 .en_core_tk_irqen = 1,
151}; 136};
152 137
153static inline void _fill_cstate(struct cpuidle_driver *drv, 138static inline void _fill_cstate(struct cpuidle_driver *drv,