mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 09:44:18 +08:00
b82b6cca48
The only place where the time is invalid is when the ACPI_CSTATE_FFH entry method is not set. Otherwise for all the drivers, the time can be correctly measured. Instead of duplicating the CPUIDLE_FLAG_TIME_VALID flag in all the drivers for all the states, just invert the logic by replacing it by the flag CPUIDLE_FLAG_TIME_INVALID, hence we can set this flag only for the acpi idle driver, remove the former flag from all the drivers and invert the logic with this flag in the different governor. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
37 lines
918 B
C
37 lines
918 B
C
/*
|
|
* Copyright (C) 2012 Freescale Semiconductor, Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#include <linux/cpuidle.h>
|
|
#include <linux/module.h>
|
|
#include <asm/system_misc.h>
|
|
|
|
static int imx5_cpuidle_enter(struct cpuidle_device *dev,
|
|
struct cpuidle_driver *drv, int index)
|
|
{
|
|
arm_pm_idle();
|
|
return index;
|
|
}
|
|
|
|
static struct cpuidle_driver imx5_cpuidle_driver = {
|
|
.name = "imx5_cpuidle",
|
|
.owner = THIS_MODULE,
|
|
.states[0] = {
|
|
.enter = imx5_cpuidle_enter,
|
|
.exit_latency = 2,
|
|
.target_residency = 1,
|
|
.name = "IMX5 SRPG",
|
|
.desc = "CPU state retained,powered off",
|
|
},
|
|
.state_count = 1,
|
|
};
|
|
|
|
int __init imx5_cpuidle_init(void)
|
|
{
|
|
return cpuidle_register(&imx5_cpuidle_driver, NULL);
|
|
}
|