lib/sw_apps/zynqmp_pmufw/src/pm_gpp.c
static s32 PmGppFsmHandler(PmSlave* const slave, const PmStateId nextState)
{
	s32 status = XST_PM_INTERNAL;
	PmSlaveGpp* gpp = (PmSlaveGpp*)slave->node.derived;

	switch (slave->node.currState) {
	case PM_GPP_SLAVE_STATE_ON:
		if (PM_GPP_SLAVE_STATE_OFF == nextState) {
			/* ON -> OFF*/
			status = (s32)gpp->PwrDn();
		} else {
			status = XST_NO_FEATURE;
		}
		break;
	case PM_GPP_SLAVE_STATE_OFF:
		if (PM_GPP_SLAVE_STATE_ON == nextState) {
			/* OFF -> ON */
			status = (s32)gpp->PwrUp();
			if ((XST_SUCCESS == status) && (NULL != gpp->reset)) {
				status = (s32)gpp->reset();
			}
		} else {
			status = XST_NO_FEATURE;
		}
		break;
	default:
		PmNodeLogUnknownState(&slave->node, slave->node.currState);
		break;
	}

	return status;
}
/**
 * PmGppFsmHandler() - FSM handler of a GPP slave
 * @slave	Slave whose state should be changed
 * @nextState	State the slave should enter
 *
 * @return	Status of performing transition action
 */
FSM handler of a GPP slave
@slave       Slave whose state should be changed
@nextState   State the slave should enter

@return      Status of performing transition action
FSM handler of a GPP slave @slave Slave whose state should be changed @nextState State the slave should enter @return Status of performing transition action
static s32 PmGppFsmHandler(PmSlave* const slave, const PmStateId nextState)
{
	s32 status = XST_PM_INTERNAL;
	PmSlaveGpp* gpp = (PmSlaveGpp*)slave->node.derived;
	switch (slave->node.currState) {
	case PM_GPP_SLAVE_STATE_ON:
		if (PM_GPP_SLAVE_STATE_OFF == nextState) {
			status = (s32)gpp->PwrDn();
		} else {
			status = XST_NO_FEATURE;
		}
		break;
	case PM_GPP_SLAVE_STATE_OFF:
		if (PM_GPP_SLAVE_STATE_ON == nextState) {
			status = (s32)gpp->PwrUp();
			if ((XST_SUCCESS == status) && (NULL != gpp->reset)) {
				status = (s32)gpp->reset();
			}
		} else {
			status = XST_NO_FEATURE;
		}
		break;
	default:
		PmNodeLogUnknownState(&slave->node, slave->node.currState);
		break;
	}
	return status;
}
static s32 PmGppFsmHandler ( PmSlave * const slave , const PmStateId nextState ) { s32 status = XST_PM_INTERNAL ; PmSlaveGpp * gpp = ( PmSlaveGpp * ) slave -> node . derived ; switch ( slave -> node . currState ) { case PM_GPP_SLAVE_STATE_ON : if ( PM_GPP_SLAVE_STATE_OFF == nextState ) { status = ( s32 ) gpp -> PwrDn ( ) ; } else { status = XST_NO_FEATURE ; } break ; case PM_GPP_SLAVE_STATE_OFF : if ( PM_GPP_SLAVE_STATE_ON == nextState ) { status = ( s32 ) gpp -> PwrUp ( ) ; if ( ( XST_SUCCESS == status ) && ( NULL != gpp -> reset ) ) { status = ( s32 ) gpp -> reset ( ) ; } } else { status = XST_NO_FEATURE ; } break ; default : PmNodeLogUnknownState ( & slave -> node , slave -> node . currState ) ; break ; } return status ; }
PmGppFsmHandler() - FSM handler of a GPP slave
 @slave       Slave whose state should be changed
 @nextState   State the slave should enter
PmGppFsmHandler () - FSM handler of a GPP slave @slave Slave whose state should be changed @nextState State the slave should enter
/* ON -> OFF*/ /* OFF -> ON */