Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: shmobile: Consolidate 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>

authored by

Robert Lee and committed by
Len Brown
ee807dd8 d13e9261

+7 -24
+7 -24
arch/arm/mach-shmobile/cpuidle.c
··· 14 14 #include <linux/module.h> 15 15 #include <linux/err.h> 16 16 #include <asm/system.h> 17 + #include <asm/cpuidle.h> 17 18 #include <asm/io.h> 18 19 19 20 static void shmobile_enter_wfi(void) ··· 30 29 struct cpuidle_driver *drv, 31 30 int index) 32 31 { 33 - ktime_t before, after; 34 - 35 - before = ktime_get(); 36 - 37 - local_irq_disable(); 38 - local_fiq_disable(); 39 - 40 32 shmobile_cpuidle_modes[index](); 41 - 42 - local_irq_enable(); 43 - local_fiq_enable(); 44 - 45 - after = ktime_get(); 46 - dev->last_residency = ktime_to_ns(ktime_sub(after, before)) >> 10; 47 33 48 34 return index; 49 35 } 50 36 51 37 static struct cpuidle_device shmobile_cpuidle_dev; 52 38 static struct cpuidle_driver shmobile_cpuidle_driver = { 53 - .name = "shmobile_cpuidle", 54 - .owner = THIS_MODULE, 55 - .states[0] = { 56 - .name = "C1", 57 - .desc = "WFI", 58 - .exit_latency = 1, 59 - .target_residency = 1 * 2, 60 - .flags = CPUIDLE_FLAG_TIME_VALID, 61 - }, 62 - .safe_state_index = 0, /* C1 */ 63 - .state_count = 1, 39 + .name = "shmobile_cpuidle", 40 + .owner = THIS_MODULE, 41 + .en_core_tk_irqen = 1, 42 + .states[0] = ARM_CPUIDLE_WFI_STATE, 43 + .safe_state_index = 0, /* C1 */ 44 + .state_count = 1, 64 45 }; 65 46 66 47 void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);