lib/sw_apps/zynqmp_pmufw/src/pm_usb.c
static s32 PmUsbFsmHandler(PmSlave* const slave, const PmStateId nextState)
{
	s32 status;
	PmSlaveUsb* usb = (PmSlaveUsb*)slave->node.derived;

	switch (slave->node.currState) {
	case PM_USB_STATE_ON:
		if ((PM_USB_STATE_OFF == nextState) ||
		    (PM_USB_STATE_UNUSED == nextState)) {
			/* ON -> OFF*/
			XPfw_AibEnable(usb->aibId);
			status = (s32)usb->PwrDn();
		} else {
			status = XST_NO_FEATURE;
		}
		break;
	case PM_USB_STATE_OFF:
	case PM_USB_STATE_UNUSED:
		if (PM_USB_STATE_ON == nextState) {
			/* OFF -> ON */
			status = (s32)usb->PwrUp();
			XPfw_AibDisable(usb->aibId);
			if (XST_SUCCESS == status) {
				status = PmResetAssertInt(usb->rstId,
						PM_RESET_ACTION_PULSE);
			}
		} else {
			status = XST_NO_FEATURE;
		}
		break;
	default:
		status = XST_PM_INTERNAL;
		PmNodeLogUnknownState(&slave->node, slave->node.currState);
		break;
	}

	return status;
}
/**
 * PmUsbFsmHandler() - Usb FSM handler, performs transition actions
 * @slave       Slave whose state should be changed
 * @nextState   State the slave should enter
 *
 * @return      Status of performing transition action
 */
Usb FSM handler, performs transition actions
@slave       Slave whose state should be changed
@nextState   State the slave should enter

@return      Status of performing transition action
Usb FSM handler performs transition actions @slave Slave whose state should be changed @nextState State the slave should enter @return Status of performing transition action
static s32 PmUsbFsmHandler(PmSlave* const slave, const PmStateId nextState)
{
	s32 status;
	PmSlaveUsb* usb = (PmSlaveUsb*)slave->node.derived;
	switch (slave->node.currState) {
	case PM_USB_STATE_ON:
		if ((PM_USB_STATE_OFF == nextState) ||
		    (PM_USB_STATE_UNUSED == nextState)) {
			XPfw_AibEnable(usb->aibId);
			status = (s32)usb->PwrDn();
		} else {
			status = XST_NO_FEATURE;
		}
		break;
	case PM_USB_STATE_OFF:
	case PM_USB_STATE_UNUSED:
		if (PM_USB_STATE_ON == nextState) {
			status = (s32)usb->PwrUp();
			XPfw_AibDisable(usb->aibId);
			if (XST_SUCCESS == status) {
				status = PmResetAssertInt(usb->rstId,
						PM_RESET_ACTION_PULSE);
			}
		} else {
			status = XST_NO_FEATURE;
		}
		break;
	default:
		status = XST_PM_INTERNAL;
		PmNodeLogUnknownState(&slave->node, slave->node.currState);
		break;
	}
	return status;
}
static s32 PmUsbFsmHandler ( PmSlave * const slave , const PmStateId nextState ) { s32 status ; PmSlaveUsb * usb = ( PmSlaveUsb * ) slave -> node . derived ; switch ( slave -> node . currState ) { case PM_USB_STATE_ON : if ( ( PM_USB_STATE_OFF == nextState ) || ( PM_USB_STATE_UNUSED == nextState ) ) { XPfw_AibEnable ( usb -> aibId ) ; status = ( s32 ) usb -> PwrDn ( ) ; } else { status = XST_NO_FEATURE ; } break ; case PM_USB_STATE_OFF : case PM_USB_STATE_UNUSED : if ( PM_USB_STATE_ON == nextState ) { status = ( s32 ) usb -> PwrUp ( ) ; XPfw_AibDisable ( usb -> aibId ) ; if ( XST_SUCCESS == status ) { status = PmResetAssertInt ( usb -> rstId , PM_RESET_ACTION_PULSE ) ; } } else { status = XST_NO_FEATURE ; } break ; default : status = XST_PM_INTERNAL ; PmNodeLogUnknownState ( & slave -> node , slave -> node . currState ) ; break ; } return status ; }
PmUsbFsmHandler() - Usb FSM handler, performs transition actions
 @slave       Slave whose state should be changed
 @nextState   State the slave should enter
PmUsbFsmHandler () - Usb FSM handler performs transition actions @slave Slave whose state should be changed @nextState State the slave should enter
/* ON -> OFF*/ /* OFF -> ON */