/* This function is used to set the clock to the passed frequency.  */
s32 XSdPs_SetClock(XSdPs *InstancePtr, u32 SelFreq)
/* This function is used to set the clock to the passed frequency.  */
s32 XSdPs_SetClock(XSdPs *InstancePtr, u32 SelFreq)
{
    u16 ClockReg;
    s32 Status;
    XSdPs_WriteReg16(InstancePtr->Config.BaseAddress,
            XSDPS_CLK_CTRL_OFFSET, 0U);
    if (SelFreq == 0U) {
        Status = XST_SUCCESS;
        goto RETURN_PATH ;
    }
    ClockReg = XSdPs_CalcClock(InstancePtr, SelFreq);
    Status = XSdPs_EnableClock(InstancePtr, ClockReg);
    if (Status != XST_SUCCESS) {
        Status = XST_FAILURE;
    }
RETURN_PATH:
    return Status;
}