mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
drivers: firmware: psci: move power_state handling to generic code
Functions implemented on arm64 to check if a power_state parameter is valid and if the power_state implies context loss are not arm64 specific and should be moved to generic code so that they can be reused on arm systems too. This patch moves the functions handling the power_state parameter to generic PSCI firmware layer code. Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Will Deacon <[email protected]> Acked-by: Sudeep Holla <[email protected]> Tested-by: Jisheng Zhang <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Mark Rutland <[email protected]>
This commit is contained in:
parent
2217d7c68e
commit
068654c200
3 changed files with 17 additions and 14 deletions
|
|
@ -70,6 +70,21 @@ enum psci_function {
|
|||
|
||||
static u32 psci_function_id[PSCI_FN_MAX];
|
||||
|
||||
#define PSCI_0_2_POWER_STATE_MASK \
|
||||
(PSCI_0_2_POWER_STATE_ID_MASK | \
|
||||
PSCI_0_2_POWER_STATE_TYPE_MASK | \
|
||||
PSCI_0_2_POWER_STATE_AFFL_MASK)
|
||||
|
||||
bool psci_power_state_loses_context(u32 state)
|
||||
{
|
||||
return state & PSCI_0_2_POWER_STATE_TYPE_MASK;
|
||||
}
|
||||
|
||||
bool psci_power_state_is_valid(u32 state)
|
||||
{
|
||||
return !(state & ~PSCI_0_2_POWER_STATE_MASK);
|
||||
}
|
||||
|
||||
static int psci_to_linux_errno(int errno)
|
||||
{
|
||||
switch (errno) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue