lib/sw_apps/zynqmp_pmufw/src/pm_requirement.c
s32 PmRequirementSetConfig(PmRequirement* const req, const u32 flags,
			   const u32 currReq, const u32 defaultReq)
{
	s32 status;

	status = PmCheckCapabilities(req->slave, currReq);
	if (XST_SUCCESS != status) {
		status = XST_FAILURE;
		goto error;
	}

	status = PmCheckCapabilities(req->slave, defaultReq);
	if (XST_SUCCESS != status) {
		status = XST_FAILURE;
		goto error;
	}

	if (0U != (PM_MASTER_REQUESTED_SLAVE_MASK & flags)) {
		req->info |= PM_MASTER_REQUESTED_SLAVE_MASK;
		req->currReq = (u8)currReq;
		req->nextReq = (u8)currReq;
		PmClockSave(&req->slave->node);
	}
	req->preReq = (u8)currReq;
	req->defaultReq = (u8)defaultReq;
	req->latencyReq = MAX_LATENCY;
	goto done;

error:
	PmErr("%s has no state with caps 0x%lx\r\n",
	      req->slave->node.name, currReq);

done:
	return status;
}
/**
 * PmRequirementSetConfig() - Set requirement configuration
 * @req         Requirement structure to configure
 * @flags       Flags to configure (is the slave currently used by the master)
 * @currReq     Current requirements of the master
 * @defaultReq  Default requirement of the master
 *
 * @return      XST_SUCCESS if requirements are configured properly,
 *              XST_FAILURE otherwise
 */
Set requirement configuration
@req         Requirement structure to configure
@flags       Flags to configure (is the slave currently used by the master)
@currReq     Current requirements of the master
@defaultReq  Default requirement of the master

@return      XST_SUCCESS if requirements are configured properly,
XST_FAILURE otherwise
Set requirement configuration @req Requirement structure to configure @flags Flags to configure ( is the slave currently used by the master ) @currReq Current requirements of the master @defaultReq Default requirement of the master @return XST_SUCCESS if requirements are configured properly XST_FAILURE otherwise
s32 PmRequirementSetConfig(PmRequirement* const req, const u32 flags,
			   const u32 currReq, const u32 defaultReq)
{
	s32 status;
	status = PmCheckCapabilities(req->slave, currReq);
	if (XST_SUCCESS != status) {
		status = XST_FAILURE;
		goto error;
	}
	status = PmCheckCapabilities(req->slave, defaultReq);
	if (XST_SUCCESS != status) {
		status = XST_FAILURE;
		goto error;
	}
	if (0U != (PM_MASTER_REQUESTED_SLAVE_MASK & flags)) {
		req->info |= PM_MASTER_REQUESTED_SLAVE_MASK;
		req->currReq = (u8)currReq;
		req->nextReq = (u8)currReq;
		PmClockSave(&req->slave->node);
	}
	req->preReq = (u8)currReq;
	req->defaultReq = (u8)defaultReq;
	req->latencyReq = MAX_LATENCY;
	goto done;
error:
	PmErr("%s has no state with caps 0x%lx\r\n",
	      req->slave->node.name, currReq);
done:
	return status;
}
s32 PmRequirementSetConfig ( PmRequirement * const req , const u32 flags , const u32 currReq , const u32 defaultReq ) { s32 status ; status = PmCheckCapabilities ( req -> slave , currReq ) ; if ( XST_SUCCESS != status ) { status = XST_FAILURE ; goto error ; } status = PmCheckCapabilities ( req -> slave , defaultReq ) ; if ( XST_SUCCESS != status ) { status = XST_FAILURE ; goto error ; } if ( 0U != ( PM_MASTER_REQUESTED_SLAVE_MASK & flags ) ) { req -> info |= PM_MASTER_REQUESTED_SLAVE_MASK ; req -> currReq = ( u8 ) currReq ; req -> nextReq = ( u8 ) currReq ; PmClockSave ( & req -> slave -> node ) ; } req -> preReq = ( u8 ) currReq ; req -> defaultReq = ( u8 ) defaultReq ; req -> latencyReq = MAX_LATENCY ; goto done ; error : PmErr ( " \r \n " , req -> slave -> node . name , currReq ) ; done : return status ; }
PmRequirementSetConfig() - Set requirement configuration
 @req         Requirement structure to configure
 @flags       Flags to configure (is the slave currently used by the master)
 @currReq     Current requirements of the master
 @defaultReq  Default requirement of the master
PmRequirementSetConfig () - Set requirement configuration @req Requirement structure to configure @flags Flags to configure ( is the slave currently used by the master ) @currReq Current requirements of the master @defaultReq Default requirement of the master