Lines Matching refs:bclk
424 static bool dai_ssp_find_mn(uint32_t freq, uint32_t bclk, uint32_t *out_scr_div, uint32_t *out_m, in dai_ssp_find_mn() argument
428 uint32_t scr_div = freq / bclk; in dai_ssp_find_mn()
430 LOG_INF("for freq %d bclk %d", freq, bclk); in dai_ssp_find_mn()
432 if (freq % bclk == 0 && scr_div < (SSCR0_SCR_MASK >> 8) + 1) { in dai_ssp_find_mn()
441 if ((bclk * 2) >= freq) { in dai_ssp_find_mn()
459 mn_div = dai_ssp_gcd(bclk, freq / scr_div); in dai_ssp_find_mn()
461 m = bclk / mn_div; in dai_ssp_find_mn()
487 static int dai_ssp_find_bclk_source(struct dai_intel_ssp *dp, uint32_t bclk, uint32_t *scr_div, in dai_ssp_find_bclk_source() argument
496 if (dai_ssp_find_mn(ft[mp->mclk_source_clock].freq, bclk, scr_div, m, n)) { in dai_ssp_find_bclk_source()
500 LOG_WRN("BCLK %d warning: cannot use MCLK source %d", bclk, in dai_ssp_find_bclk_source()
506 if (ft[i].freq % bclk == 0) { in dai_ssp_find_bclk_source()
507 *scr_div = ft[i].freq / bclk; in dai_ssp_find_bclk_source()
513 if (dai_ssp_find_mn(ft[i].freq, bclk, scr_div, m, n)) { in dai_ssp_find_bclk_source()
571 static int dai_ssp_setup_initial_bclk_mn_source(struct dai_intel_ssp *dp, uint32_t bclk, in dai_ssp_setup_initial_bclk_mn_source() argument
577 int clk_index = dai_ssp_find_bclk_source(dp, bclk, scr_div, m, n); in dai_ssp_setup_initial_bclk_mn_source()
580 LOG_ERR("BCLK %d, no valid source", bclk); in dai_ssp_setup_initial_bclk_mn_source()
635 static int dai_ssp_setup_current_bclk_mn_source(struct dai_intel_ssp *dp, uint32_t bclk, in dai_ssp_setup_current_bclk_mn_source() argument
643 if (dai_ssp_find_mn(ft[mp->bclk_source_mn_clock].freq, bclk, scr_div, m, n)) { in dai_ssp_setup_current_bclk_mn_source()
648 bclk, mp->bclk_source_mn_clock); in dai_ssp_setup_current_bclk_mn_source()
656 static bool dai_ssp_check_bclk_xtal_source(uint32_t bclk, bool mn_in_use, in dai_ssp_check_bclk_xtal_source() argument