lib/sw_apps/zynqmp_pmufw/src/pm_power.c
s32 PmPowerUpdateLatencyReq(const PmNode* const node)
{
	s32 status = XST_SUCCESS;
	PmPower* power = node->parent;

	if (PM_PWR_STATE_ON == power->node.currState) {
		/* Try to power down the node if all conditions are ok */
		PmPowerDownCond(power);
		if (PM_PWR_STATE_OFF == power->node.currState) {
			if (NULL != power->node.parent) {
				PmPowerReleaseParent(&power->node);
			}
		}
		goto done;
	}

	/* Power is down, check if latency requirements trigger the power up */
	if (node->latencyMarg < (power->pwrDnLatency + power->pwrUpLatency)) {
		power->node.latencyMarg = 0U;
		if (NULL != power->node.parent) {
			status = PmPowerRequestParent(&power->node);
			if (XST_SUCCESS != status) {
				goto done;
			}
		}
		status = PmPowerUp(power);
	}

done:
	return status;
}
/**
 * PmPowerUpdateLatencyReq() - Child updates its power parent about latency req
 * @node	Child node whose latency requirement have changed
 *
 * @return	If the change of the latency requirement caused the power up of
 *		the power parent, the status of performing power up operation
 *		is returned. Otherwise, XST_SUCCESS.
 */
Child updates its power parent about latency req
@node        Child node whose latency requirement have changed

@return      If the change of the latency requirement caused the power up of
the power parent, the status of performing power up operation
is returned.
Child updates its power parent about latency req @node Child node whose latency requirement have changed @return If the change of the latency requirement caused the power up of the power parent the status of performing power up operation is returned .
s32 PmPowerUpdateLatencyReq(const PmNode* const node)
{
	s32 status = XST_SUCCESS;
	PmPower* power = node->parent;
	if (PM_PWR_STATE_ON == power->node.currState) {
		PmPowerDownCond(power);
		if (PM_PWR_STATE_OFF == power->node.currState) {
			if (NULL != power->node.parent) {
				PmPowerReleaseParent(&power->node);
			}
		}
		goto done;
	}
	if (node->latencyMarg < (power->pwrDnLatency + power->pwrUpLatency)) {
		power->node.latencyMarg = 0U;
		if (NULL != power->node.parent) {
			status = PmPowerRequestParent(&power->node);
			if (XST_SUCCESS != status) {
				goto done;
			}
		}
		status = PmPowerUp(power);
	}
done:
	return status;
}
s32 PmPowerUpdateLatencyReq ( const PmNode * const node ) { s32 status = XST_SUCCESS ; PmPower * power = node -> parent ; if ( PM_PWR_STATE_ON == power -> node . currState ) { PmPowerDownCond ( power ) ; if ( PM_PWR_STATE_OFF == power -> node . currState ) { if ( NULL != power -> node . parent ) { PmPowerReleaseParent ( & power -> node ) ; } } goto done ; } if ( node -> latencyMarg < ( power -> pwrDnLatency + power -> pwrUpLatency ) ) { power -> node . latencyMarg = 0U ; if ( NULL != power -> node . parent ) { status = PmPowerRequestParent ( & power -> node ) ; if ( XST_SUCCESS != status ) { goto done ; } } status = PmPowerUp ( power ) ; } done : return status ; }
PmPowerUpdateLatencyReq() - Child updates its power parent about latency req
 @node        Child node whose latency requirement have changed
PmPowerUpdateLatencyReq () - Child updates its power parent about latency req @node Child node whose latency requirement have changed
/* Try to power down the node if all conditions are ok */ /* Power is down, check if latency requirements trigger the power up */