mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
cpuidle: introduce CPU_PM_CPU_IDLE_ENTER macro for ARM{32, 64}
The function arm_enter_idle_state is exactly the same in both generic
ARM{32,64} CPUIdle driver and will be the same even on ARM64 backend
for ACPI processor idle driver. So we can unify it and move it to a
common place by introducing CPU_PM_CPU_IDLE_ENTER macro that can be
used in all places avoiding duplication.
This is in preparation of reuse of the generic cpuidle entry function
for ACPI LPI support on ARM64.
Suggested-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Sudeep Holla <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
ce3ad71026
commit
220276e09b
2 changed files with 24 additions and 20 deletions
|
|
@ -36,26 +36,12 @@
|
|||
static int arm_enter_idle_state(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv, int idx)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!idx) {
|
||||
cpu_do_idle();
|
||||
return idx;
|
||||
}
|
||||
|
||||
ret = cpu_pm_enter();
|
||||
if (!ret) {
|
||||
/*
|
||||
* Pass idle state index to cpu_suspend which in turn will
|
||||
* call the CPU ops suspend protocol with idle index as a
|
||||
* parameter.
|
||||
*/
|
||||
ret = arm_cpuidle_suspend(idx);
|
||||
|
||||
cpu_pm_exit();
|
||||
}
|
||||
|
||||
return ret ? -1 : idx;
|
||||
/*
|
||||
* Pass idle state index to arm_cpuidle_suspend which in turn
|
||||
* will call the CPU ops suspend protocol with idle index as a
|
||||
* parameter.
|
||||
*/
|
||||
return CPU_PM_CPU_IDLE_ENTER(arm_cpuidle_suspend, idx);
|
||||
}
|
||||
|
||||
static struct cpuidle_driver arm_idle_driver = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue