/* Calucate the spdif's tx clock divider according the sample rate. */
static uint32_t spdif_cal_txclk_div(audio_ctrl_p ctrl, uint32_t sample_rate)
/* Calucate the spdif's tx clock divider according the sample rate. */
static uint32_t spdif_cal_txclk_div(audio_ctrl_p ctrl, uint32_t sample_rate)
{
    float val;
    val = (float)spdif_get_tx_clk_freq() / ((float)sample_rate * 32.0f * 2.0f) + 0.5f;
    return ((uint32_t) val - 1);
}