XilinxProcessorIPLib/drivers/clockps/src/xclockps_mux.c
static XStatus XClock_MuxEnable(u8 MuxIndex)
{
	u8  ParentType;
	u8  ParentIdx;
	u16 Parent;

	/* Validate arguments */
	XCLOCK_VALIDATE_INDEX(MUX, MuxIndex);

	/* Check for parent */
	if (((u8)XCLOCK_INVALID_PARENT) == Muxes[MuxIndex].ActiveParent) {
		Muxes[MuxIndex].ActiveParent = Muxes[MuxIndex].DefaultParent;
		Parent = Muxes[MuxIndex].Parent[Muxes[MuxIndex].DefaultParent];
	} else {
		Parent = Muxes[MuxIndex].Parent[Muxes[MuxIndex].ActiveParent];
	}

	if (XCLOCK_PARENT_EXTERNAL != Parent) {
		ParentType = XCLOCK_FETCH_PARENT_TYPE(Parent);
		ParentIdx = XCLOCK_FETCH_PARENT_INDEX(Parent);

		/* Enable parent node */
		if (XST_SUCCESS !=
				XClock_EnableClkNode((XClock_Types)ParentType, ParentIdx)) {
			return XST_FAILURE;
		}
	}

	Muxes[MuxIndex].EnableCount++;

	return XST_SUCCESS;
}
/*****************************************************************************/
/*
*
* Enable function for the mux.
*
* @param	MuxIndex is the database index of mux to enable.
*
* @return	XST_SUCCESS if successful.
*		XST_INVALID_PARAM if arguments are invalid.
*		XST_FAILURE otherwise.
*
* @note		None.
*
******************************************************************************/
Enable function for the mux.
Enable function for the mux .
static XStatus XClock_MuxEnable(u8 MuxIndex)
{
	u8  ParentType;
	u8  ParentIdx;
	u16 Parent;
	XCLOCK_VALIDATE_INDEX(MUX, MuxIndex);
	if (((u8)XCLOCK_INVALID_PARENT) == Muxes[MuxIndex].ActiveParent) {
		Muxes[MuxIndex].ActiveParent = Muxes[MuxIndex].DefaultParent;
		Parent = Muxes[MuxIndex].Parent[Muxes[MuxIndex].DefaultParent];
	} else {
		Parent = Muxes[MuxIndex].Parent[Muxes[MuxIndex].ActiveParent];
	}
	if (XCLOCK_PARENT_EXTERNAL != Parent) {
		ParentType = XCLOCK_FETCH_PARENT_TYPE(Parent);
		ParentIdx = XCLOCK_FETCH_PARENT_INDEX(Parent);
		if (XST_SUCCESS !=
				XClock_EnableClkNode((XClock_Types)ParentType, ParentIdx)) {
			return XST_FAILURE;
		}
	}
	Muxes[MuxIndex].EnableCount++;
	return XST_SUCCESS;
}
static XStatus XClock_MuxEnable ( u8 MuxIndex ) { u8 ParentType ; u8 ParentIdx ; u16 Parent ; XCLOCK_VALIDATE_INDEX ( MUX , MuxIndex ) ; if ( ( ( u8 ) XCLOCK_INVALID_PARENT ) == Muxes [ MuxIndex ] . ActiveParent ) { Muxes [ MuxIndex ] . ActiveParent = Muxes [ MuxIndex ] . DefaultParent ; Parent = Muxes [ MuxIndex ] . Parent [ Muxes [ MuxIndex ] . DefaultParent ] ; } else { Parent = Muxes [ MuxIndex ] . Parent [ Muxes [ MuxIndex ] . ActiveParent ] ; } if ( XCLOCK_PARENT_EXTERNAL != Parent ) { ParentType = XCLOCK_FETCH_PARENT_TYPE ( Parent ) ; ParentIdx = XCLOCK_FETCH_PARENT_INDEX ( Parent ) ; if ( XST_SUCCESS != XClock_EnableClkNode ( ( XClock_Types ) ParentType , ParentIdx ) ) { return XST_FAILURE ; } } Muxes [ MuxIndex ] . EnableCount ++ ; return XST_SUCCESS ; }
Enable function for the mux.
Enable function for the mux .
/* Validate arguments */ /* Check for parent */ /* Enable parent node */