forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
d13e9261ac
commit
ee807dd89c
@ -14,6 +14,7 @@
|
|||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
|
#include <asm/cpuidle.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
static void shmobile_enter_wfi(void)
|
static void shmobile_enter_wfi(void)
|
||||||
@ -29,37 +30,19 @@ static int shmobile_cpuidle_enter(struct cpuidle_device *dev,
|
|||||||
struct cpuidle_driver *drv,
|
struct cpuidle_driver *drv,
|
||||||
int index)
|
int index)
|
||||||
{
|
{
|
||||||
ktime_t before, after;
|
|
||||||
|
|
||||||
before = ktime_get();
|
|
||||||
|
|
||||||
local_irq_disable();
|
|
||||||
local_fiq_disable();
|
|
||||||
|
|
||||||
shmobile_cpuidle_modes[index]();
|
shmobile_cpuidle_modes[index]();
|
||||||
|
|
||||||
local_irq_enable();
|
|
||||||
local_fiq_enable();
|
|
||||||
|
|
||||||
after = ktime_get();
|
|
||||||
dev->last_residency = ktime_to_ns(ktime_sub(after, before)) >> 10;
|
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct cpuidle_device shmobile_cpuidle_dev;
|
static struct cpuidle_device shmobile_cpuidle_dev;
|
||||||
static struct cpuidle_driver shmobile_cpuidle_driver = {
|
static struct cpuidle_driver shmobile_cpuidle_driver = {
|
||||||
.name = "shmobile_cpuidle",
|
.name = "shmobile_cpuidle",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.states[0] = {
|
.en_core_tk_irqen = 1,
|
||||||
.name = "C1",
|
.states[0] = ARM_CPUIDLE_WFI_STATE,
|
||||||
.desc = "WFI",
|
.safe_state_index = 0, /* C1 */
|
||||||
.exit_latency = 1,
|
.state_count = 1,
|
||||||
.target_residency = 1 * 2,
|
|
||||||
.flags = CPUIDLE_FLAG_TIME_VALID,
|
|
||||||
},
|
|
||||||
.safe_state_index = 0, /* C1 */
|
|
||||||
.state_count = 1,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);
|
void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);
|
||||||
|
Loading…
Reference in New Issue
Block a user