plat/marvell/a8k/common/plat_pm.c
/*******************************************************************************
 * A8K handler called to check the validity of the power state
 * parameter.
 ******************************************************************************/
A8K handler called to check the validity of the power state
parameter.
A8K handler called to check the validity of the power state parameter .
static int a8k_validate_power_state(unsigned int power_state,
			    psci_power_state_t *req_state)
{
	int pstate = psci_get_pstate_type(power_state);
	int pwr_lvl = psci_get_pstate_pwrlvl(power_state);
	int i;
	if (pwr_lvl > PLAT_MAX_PWR_LVL)
		return PSCI_E_INVALID_PARAMS;
	if (pstate == PSTATE_TYPE_STANDBY) {
		if (pwr_lvl != MARVELL_PWR_LVL0)
			return PSCI_E_INVALID_PARAMS;
		req_state->pwr_domain_state[MARVELL_PWR_LVL0] =
					MARVELL_LOCAL_STATE_RET;
	} else {
		for (i = MARVELL_PWR_LVL0; i <= pwr_lvl; i++)
			req_state->pwr_domain_state[i] =
					MARVELL_LOCAL_STATE_OFF;
	}
	if (psci_get_pstate_id(power_state))
		return PSCI_E_INVALID_PARAMS;
	return PSCI_E_SUCCESS;
}
static int a8k_validate_power_state ( unsigned int power_state , psci_power_state_t * req_state ) { int pstate = psci_get_pstate_type ( power_state ) ; int pwr_lvl = psci_get_pstate_pwrlvl ( power_state ) ; int i ; if ( pwr_lvl > PLAT_MAX_PWR_LVL ) return PSCI_E_INVALID_PARAMS ; if ( pstate == PSTATE_TYPE_STANDBY ) { if ( pwr_lvl != MARVELL_PWR_LVL0 ) return PSCI_E_INVALID_PARAMS ; req_state -> pwr_domain_state [ MARVELL_PWR_LVL0 ] = MARVELL_LOCAL_STATE_RET ; } else { for ( i = MARVELL_PWR_LVL0 ; i <= pwr_lvl ; i ++ ) req_state -> pwr_domain_state [ i ] = MARVELL_LOCAL_STATE_OFF ; } if ( psci_get_pstate_id ( power_state ) ) return PSCI_E_INVALID_PARAMS ; return PSCI_E_SUCCESS ; }
A8K handler called to check the validity of the power state
 parameter.
A8K handler called to check the validity of the power state parameter .
/* Sanity check the requested state */ /*
		 * It's possible to enter standby only on power level 0
		 * Ignore any other power level.
		 */ /*
	 * We expect the 'state id' to be zero.
	 */