From: Park Bumgyu Date: Tue, 3 May 2016 10:01:36 +0000 (+0900) Subject: [COMMON] arm64: psci: Reappear psci_power_state_pack X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=129679b44faef206b28dfc1b67320c91e48a75c4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] arm64: psci: Reappear psci_power_state_pack psci_power_state_pack which combines PSCI power state information to integer is removed by commit c8cc427("arm64: psci: kill psci_power_state"). In case of exynos, it needs to reconstitute PSCI power state to support extra power mode which cpuidle does not support. To resonstitute PSCI power state, psci_power_state_pack is added. It will be used in psci_suspend_customized_finisher. Change-Id: I506e690965e73cdd1d6acee7664b5cf4cfc049a0 Signed-off-by: Park Bumgyu --- diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c index c80ec1d03274..b7244b7b4507 100644 --- a/drivers/firmware/psci.c +++ b/drivers/firmware/psci.c @@ -405,6 +405,23 @@ static int psci_suspend_finisher(unsigned long index) __pa_symbol(cpu_resume)); } +/** + * Pack PSCI power state to integer + * + * @id : indicates system power mode. 0 means non system power mode. + * @type : not used. + * @affinity_level : indicates power down scope. + */ +static u32 psci_power_state_pack(u32 id, u32 type, u32 affinity_level) +{ + return ((id << PSCI_0_2_POWER_STATE_ID_SHIFT) + & PSCI_0_2_POWER_STATE_ID_MASK) | + ((type << PSCI_0_2_POWER_STATE_TYPE_SHIFT) + & PSCI_0_2_POWER_STATE_TYPE_MASK) | + ((affinity_level << PSCI_0_2_POWER_STATE_AFFL_SHIFT) + & PSCI_0_2_POWER_STATE_AFFL_MASK); +} + int psci_cpu_suspend_enter(unsigned long index) { int ret;