XilinxProcessorIPLib/drivers/v_hdmitxss1/examples/xhdmi_example/idt_8t49n24x.c
int IDT_8T49N24x_I2cClk(void *IicPtr, u8 IICAddress,
		u32 InFreq, u32 OutFreq)
{
	u32 Status;

	/* Reset I2C controller before issuing new transaction. This is
	 * required to recover the IIC controller in case a previous transaction
	 * is pending.
	 */
	IDT_8T49N24x_I2cReset(IicPtr);

	/* Free running mode */
	if (InFreq == 0) {
		Status = IDT_8T49N24x_SetClock((IicPtr), (IICAddress),
								(IDT_8T49N24X_XTAL_FREQ), OutFreq, TRUE);

		if (Status != (XST_SUCCESS)) {
			xil_printf("Error programming IDT_8T49N241\r\n");
			return XST_FAILURE;
		}
	}

	/* Locked mode */
	else {
		Status = IDT_8T49N24x_SetClock((IicPtr), (IICAddress),
								InFreq, OutFreq, FALSE);

		if (Status != (XST_SUCCESS)) {
			xil_printf("Error programming IDT_8T49N241\r\n");
			return XST_FAILURE;
		}
	}
	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function setup IDT 8T49N24x clock generator either in free or
* locked mode.
*
* @param  IicPtr IIC instance pointer.
* @param  IICAddress device's IIC bus address.
* @param  InFreq input frequency 0-free running mode.
* @param  OutFreq requested output frequency.
*
* @return
*   - 0 XST_SUCCESS.
*   - 1 XST_FAILURE.
*
* @note   None.
*
******************************************************************************/
This function setup IDT 8T49N24x clock generator either in free or
locked mode.
This function setup IDT 8T49N24x clock generator either in free or locked mode .
int IDT_8T49N24x_I2cClk(void *IicPtr, u8 IICAddress,
		u32 InFreq, u32 OutFreq)
{
	u32 Status;
	IDT_8T49N24x_I2cReset(IicPtr);
	if (InFreq == 0) {
		Status = IDT_8T49N24x_SetClock((IicPtr), (IICAddress),
								(IDT_8T49N24X_XTAL_FREQ), OutFreq, TRUE);
		if (Status != (XST_SUCCESS)) {
			xil_printf("Error programming IDT_8T49N241\r\n");
			return XST_FAILURE;
		}
	}
	else {
		Status = IDT_8T49N24x_SetClock((IicPtr), (IICAddress),
								InFreq, OutFreq, FALSE);
		if (Status != (XST_SUCCESS)) {
			xil_printf("Error programming IDT_8T49N241\r\n");
			return XST_FAILURE;
		}
	}
	return XST_SUCCESS;
}
int IDT_8T49N24x_I2cClk ( void * IicPtr , u8 IICAddress , u32 InFreq , u32 OutFreq ) { u32 Status ; IDT_8T49N24x_I2cReset ( IicPtr ) ; if ( InFreq == 0 ) { Status = IDT_8T49N24x_SetClock ( ( IicPtr ) , ( IICAddress ) , ( IDT_8T49N24X_XTAL_FREQ ) , OutFreq , TRUE ) ; if ( Status != ( XST_SUCCESS ) ) { xil_printf ( " \r \n " ) ; return XST_FAILURE ; } } else { Status = IDT_8T49N24x_SetClock ( ( IicPtr ) , ( IICAddress ) , InFreq , OutFreq , FALSE ) ; if ( Status != ( XST_SUCCESS ) ) { xil_printf ( " \r \n " ) ; return XST_FAILURE ; } } return XST_SUCCESS ; }
This function setup IDT 8T49N24x clock generator either in free or
locked mode.
This function setup IDT 8T49N24x clock generator either in free or locked mode .
/* Reset I2C controller before issuing new transaction. This is
	 * required to recover the IIC controller in case a previous transaction
	 * is pending.
	 */ /* Free running mode */ /* Locked mode */