Lines Matching refs:mp

192 	struct dai_intel_ssp_mn *mp = dai_get_mn(dp);  in dai_ssp_is_mclk_source_in_use()  local
196 for (i = 0; i < ARRAY_SIZE(mp->mclk_sources_ref); i++) { in dai_ssp_is_mclk_source_in_use()
197 if (mp->mclk_sources_ref[i] > 0) { in dai_ssp_is_mclk_source_in_use()
218 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_setup_initial_mclk_source() local
245 mp->mclk_source_clock = clk_index; in dai_ssp_setup_initial_mclk_source()
260 mp->mclk_sources_ref[mclk_id]++; in dai_ssp_setup_initial_mclk_source()
275 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_check_current_mclk_source() local
279 LOG_INF("MCLK %d, source = %d", mclk_rate, mp->mclk_source_clock); in dai_ssp_check_current_mclk_source()
281 if (ft[mp->mclk_source_clock].freq % mclk_rate != 0) { in dai_ssp_check_current_mclk_source()
283 mclk_rate, mp->mclk_source_clock); in dai_ssp_check_current_mclk_source()
288 if (mp->mclk_sources_ref[mclk_id] > 0) { in dai_ssp_check_current_mclk_source()
289 if (mp->mclk_rate[mclk_id] != mclk_rate) { in dai_ssp_check_current_mclk_source()
291 mclk_id, mclk_rate, mp->mclk_rate[mclk_id]); in dai_ssp_check_current_mclk_source()
295 mp->mclk_sources_ref[mclk_id]++; in dai_ssp_check_current_mclk_source()
303 mp->mclk_sources_ref[mclk_id]++; in dai_ssp_check_current_mclk_source()
340 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_mn_set_mclk() local
349 key = k_spin_lock(&mp->lock); in dai_ssp_mn_set_mclk()
361 LOG_INF("mclk_rate %d, mclk_source_clock %d", mclk_rate, mp->mclk_source_clock); in dai_ssp_mn_set_mclk()
363 ret = dai_ssp_set_mclk_divider(dp, mclk_id, ft[mp->mclk_source_clock].freq / mclk_rate); in dai_ssp_mn_set_mclk()
365 mp->mclk_rate[mclk_id] = mclk_rate; in dai_ssp_mn_set_mclk()
369 k_spin_unlock(&mp->lock, key); in dai_ssp_mn_set_mclk()
384 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_mn_release_mclk() local
388 key = k_spin_lock(&mp->lock); in dai_ssp_mn_release_mclk()
390 mp->mclk_sources_ref[mclk_id]--; in dai_ssp_mn_release_mclk()
393 if (!mp->mclk_sources_ref[mclk_id]) { in dai_ssp_mn_release_mclk()
409 mp->mclk_source_clock = 0; in dai_ssp_mn_release_mclk()
411 k_spin_unlock(&mp->lock, key); in dai_ssp_mn_release_mclk()
491 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_find_bclk_source() local
496 if (dai_ssp_find_mn(ft[mp->mclk_source_clock].freq, bclk, scr_div, m, n)) { in dai_ssp_find_bclk_source()
497 return mp->mclk_source_clock; in dai_ssp_find_bclk_source()
501 ft[mp->mclk_source_clock].freq); in dai_ssp_find_bclk_source()
548 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_is_bclk_source_in_use() local
552 for (i = 0; i < ARRAY_SIZE(mp->bclk_sources); i++) { in dai_ssp_is_bclk_source_in_use()
553 if (mp->bclk_sources[i] == clk_src) { in dai_ssp_is_bclk_source_in_use()
576 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_setup_initial_bclk_mn_source() local
585 mp->bclk_source_mn_clock = clk_index; in dai_ssp_setup_initial_bclk_mn_source()
607 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_reset_bclk_mn_source() local
624 mp->bclk_source_mn_clock = clk_index; in dai_ssp_reset_bclk_mn_source()
640 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_setup_current_bclk_mn_source() local
644 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()
649 bclk, mp->bclk_source_mn_clock); in dai_ssp_setup_current_bclk_mn_source()
667 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_mn_set_bclk() local
674 key = k_spin_lock(&mp->lock); in dai_ssp_mn_set_bclk()
676 mp->bclk_sources[dai_index] = MN_BCLK_SOURCE_NONE; in dai_ssp_mn_set_bclk()
681 mp->bclk_sources[dai_index] = MN_BCLK_SOURCE_XTAL; in dai_ssp_mn_set_bclk()
695 mp->bclk_sources[dai_index] = MN_BCLK_SOURCE_MN; in dai_ssp_mn_set_bclk()
705 k_spin_unlock(&mp->lock, key); in dai_ssp_mn_set_bclk()
712 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_mn_release_bclk() local
716 key = k_spin_lock(&mp->lock); in dai_ssp_mn_release_bclk()
717 mp->bclk_sources[ssp_index] = MN_BCLK_SOURCE_NONE; in dai_ssp_mn_release_bclk()
725 k_spin_unlock(&mp->lock, key); in dai_ssp_mn_release_bclk()
730 struct dai_intel_ssp_mn *mp = dai_get_mn(dp); in dai_ssp_mn_reset_bclk_divider() local
733 key = k_spin_lock(&mp->lock); in dai_ssp_mn_reset_bclk_divider()
738 k_spin_unlock(&mp->lock, key); in dai_ssp_mn_reset_bclk_divider()