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

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

	/* Check enabled status */
	if (!Muxes[MuxIndex].EnableCount) {
		return XST_SUCCESS;
	}

	/* check for parent */
	Parent = Muxes[MuxIndex].Parent[Muxes[MuxIndex].ActiveParent];

	if (((u8)XCLOCK_INVALID_PARENT) == Muxes[MuxIndex].ActiveParent) {
		if (!Muxes[MuxIndex].EnableCount) {
			return XST_FAILURE;
		} else {
			return XST_SUCCESS;
		}
	}

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

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

	Muxes[MuxIndex].EnableCount--;

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