lib/sw_apps/zynqmp_pmufw/src/pm_requirement.c
s32 PmRequirementUpdate(PmRequirement* const masterReq, const u32 caps)
{
	s32 status;
	u32 tmpCaps;

	/* Check if slave has a state with requested capabilities */
	status = PmCheckCapabilities(masterReq->slave, caps);

	if (XST_SUCCESS != status) {
		goto done;
	}

	/* Configure requested capabilities */
	tmpCaps = masterReq->currReq;
	masterReq->currReq = (u8)caps;
	status = PmUpdateSlave(masterReq->slave);

	if (XST_SUCCESS == status) {
		/* All capabilities requested in active state are constant */
		masterReq->nextReq = masterReq->currReq;
	} else {
		/* Remember the last setting, will report an error */
		masterReq->currReq = (u8)tmpCaps;
	}

done:
	return status;
}
/**
 * PmRequirementUpdate() - Set slaves capabilities according to the master's
 * requirements
 * @masterReq   Pointer to structure keeping information about the
 *              master's requirement
 * @caps        Capabilities of a slave requested by the master
 *
 * @return      Status of the operation
 */
Set slaves capabilities according to the master's
requirements
@masterReq   Pointer to structure keeping information about the
master's requirement
@caps        Capabilities of a slave requested by the master

@return      Status of the operation
Set slaves capabilities according to the master ' s requirements @masterReq Pointer to structure keeping information about the master ' s requirement @caps Capabilities of a slave requested by the master @return Status of the operation
s32 PmRequirementUpdate(PmRequirement* const masterReq, const u32 caps)
{
	s32 status;
	u32 tmpCaps;
	status = PmCheckCapabilities(masterReq->slave, caps);
	if (XST_SUCCESS != status) {
		goto done;
	}
	tmpCaps = masterReq->currReq;
	masterReq->currReq = (u8)caps;
	status = PmUpdateSlave(masterReq->slave);
	if (XST_SUCCESS == status) {
		masterReq->nextReq = masterReq->currReq;
	} else {
		masterReq->currReq = (u8)tmpCaps;
	}
done:
	return status;
}
s32 PmRequirementUpdate ( PmRequirement * const masterReq , const u32 caps ) { s32 status ; u32 tmpCaps ; status = PmCheckCapabilities ( masterReq -> slave , caps ) ; if ( XST_SUCCESS != status ) { goto done ; } tmpCaps = masterReq -> currReq ; masterReq -> currReq = ( u8 ) caps ; status = PmUpdateSlave ( masterReq -> slave ) ; if ( XST_SUCCESS == status ) { masterReq -> nextReq = masterReq -> currReq ; } else { masterReq -> currReq = ( u8 ) tmpCaps ; } done : return status ; }
PmRequirementUpdate() - Set slaves capabilities according to the master's
 requirements
 @masterReq   Pointer to structure keeping information about the
              master's requirement
 @caps        Capabilities of a slave requested by the master
PmRequirementUpdate () - Set slaves capabilities according to the master ' s requirements @masterReq Pointer to structure keeping information about the master ' s requirement @caps Capabilities of a slave requested by the master
/* Check if slave has a state with requested capabilities */ /* Configure requested capabilities */ /* All capabilities requested in active state are constant */ /* Remember the last setting, will report an error */