lib/sw_apps/zynqmp_pmufw/src/pm_power.c
s32 PmPowerDown(PmPower* const power)
{
	s32 status = XST_SUCCESS;

	if (PM_PWR_STATE_OFF == power->node.currState) {
		goto done;
	}

	if (NULL != power->powerDown) {
		status = power->powerDown();
	}

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

	PmNodeUpdateCurrState(&power->node, PM_PWR_STATE_OFF);

	if (NULL != power->node.clocks) {
		PmClockRelease(&power->node);
	}
	PmInfo("%s 1->0\r\n", power->node.name);
#ifdef DEBUG_MODE
	if ((pmPowerIslandRpu_g.power.node.currState == PM_PWR_STATE_OFF) &&
                        (pmPowerDomainFpd_g.power.node.currState == PM_PWR_STATE_OFF)) {
		PmRequirement* req;
#if (STDOUT_BASEADDRESS == XPMU_UART_0_BASEADDR)
		req = PmRequirementGetNoMaster(&pmSlaveUart0_g);
#elif (STDOUT_BASEADDRESS == XPMU_UART_1_BASEADDR)
		req = PmRequirementGetNoMaster(&pmSlaveUart1_g);
#endif
		status = PmRequirementUpdate(req, 0U);
		if (XST_SUCCESS != status) {
			goto done;
		}
	}
#endif

	/* Put SysOsc in sleep mode while going to deep sleep mode. */
	if ((pmPowerIslandRpu_g.power.node.currState == PM_PWR_STATE_OFF) &&
			(pmPowerDomainFpd_g.power.node.currState == PM_PWR_STATE_OFF) &&
			(pmPowerDomainPld_g.power.node.currState == PM_PWR_STATE_OFF) &&
			(pmIOpll_g.node.currState == PM_PLL_STATE_RESET) &&
			(pmRpll_g.node.currState == PM_PLL_STATE_RESET)) {
		PmPowerDownSysOsc();
	}

done:
	return status;
}
/**
 * PmPowerDown() - Power down the power node
 * @power       Power node in question
 *
 * @return      Status of powering down (what powerDown handler returns or
 *              XST_SUCCESS)
 */
Power down the power node
@power       Power node in question

@return      Status of powering down (what powerDown handler returns or
XST_SUCCESS)
Power down the power node @power Power node in question @return Status of powering down ( what powerDown handler returns or XST_SUCCESS )
s32 PmPowerDown(PmPower* const power)
{
	s32 status = XST_SUCCESS;
	if (PM_PWR_STATE_OFF == power->node.currState) {
		goto done;
	}
	if (NULL != power->powerDown) {
		status = power->powerDown();
	}
	if (XST_SUCCESS != status) {
		goto done;
	}
	PmNodeUpdateCurrState(&power->node, PM_PWR_STATE_OFF);
	if (NULL != power->node.clocks) {
		PmClockRelease(&power->node);
	}
	PmInfo("%s 1->0\r\n", power->node.name);
#ifdef DEBUG_MODE
	if ((pmPowerIslandRpu_g.power.node.currState == PM_PWR_STATE_OFF) &&
                        (pmPowerDomainFpd_g.power.node.currState == PM_PWR_STATE_OFF)) {
		PmRequirement* req;
#if (STDOUT_BASEADDRESS == XPMU_UART_0_BASEADDR)
		req = PmRequirementGetNoMaster(&pmSlaveUart0_g);
#elif (STDOUT_BASEADDRESS == XPMU_UART_1_BASEADDR)
		req = PmRequirementGetNoMaster(&pmSlaveUart1_g);
#endif
		status = PmRequirementUpdate(req, 0U);
		if (XST_SUCCESS != status) {
			goto done;
		}
	}
#endif
	if ((pmPowerIslandRpu_g.power.node.currState == PM_PWR_STATE_OFF) &&
			(pmPowerDomainFpd_g.power.node.currState == PM_PWR_STATE_OFF) &&
			(pmPowerDomainPld_g.power.node.currState == PM_PWR_STATE_OFF) &&
			(pmIOpll_g.node.currState == PM_PLL_STATE_RESET) &&
			(pmRpll_g.node.currState == PM_PLL_STATE_RESET)) {
		PmPowerDownSysOsc();
	}
done:
	return status;
}
s32 PmPowerDown ( PmPower * const power ) { s32 status = XST_SUCCESS ; if ( PM_PWR_STATE_OFF == power -> node . currState ) { goto done ; } if ( NULL != power -> powerDown ) { status = power -> powerDown ( ) ; } if ( XST_SUCCESS != status ) { goto done ; } PmNodeUpdateCurrState ( & power -> node , PM_PWR_STATE_OFF ) ; if ( NULL != power -> node . clocks ) { PmClockRelease ( & power -> node ) ; } PmInfo ( " \r \n " , power -> node . name ) ; #ifdef DEBUG_MODE if ( ( pmPowerIslandRpu_g . power . node . currState == PM_PWR_STATE_OFF ) && ( pmPowerDomainFpd_g . power . node . currState == PM_PWR_STATE_OFF ) ) { PmRequirement * req ; #if ( STDOUT_BASEADDRESS == XPMU_UART_0_BASEADDR ) req = PmRequirementGetNoMaster ( & pmSlaveUart0_g ) ; #elif ( STDOUT_BASEADDRESS == XPMU_UART_1_BASEADDR ) req = PmRequirementGetNoMaster ( & pmSlaveUart1_g ) ; #endif status = PmRequirementUpdate ( req , 0U ) ; if ( XST_SUCCESS != status ) { goto done ; } } #endif if ( ( pmPowerIslandRpu_g . power . node . currState == PM_PWR_STATE_OFF ) && ( pmPowerDomainFpd_g . power . node . currState == PM_PWR_STATE_OFF ) && ( pmPowerDomainPld_g . power . node . currState == PM_PWR_STATE_OFF ) && ( pmIOpll_g . node . currState == PM_PLL_STATE_RESET ) && ( pmRpll_g . node . currState == PM_PLL_STATE_RESET ) ) { PmPowerDownSysOsc ( ) ; } done : return status ; }
PmPowerDown() - Power down the power node
 @power       Power node in question
PmPowerDown () - Power down the power node @power Power node in question
/* Put SysOsc in sleep mode while going to deep sleep mode. */