Lines Matching refs:adg

48 #define for_each_rsnd_clkin(pos, adg, i)	\  argument
50 (i < adg->clkin_size) && \
51 ((pos) = adg->clkin[i]); \
53 #define for_each_rsnd_clkout(pos, adg, i) \ argument
55 (i < adg->clkout_size) && \
56 ((pos) = adg->clkout[i]); \
58 #define rsnd_priv_to_adg(priv) ((struct rsnd_adg *)(priv)->adg)
125 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in __rsnd_adg_get_timesel_ratio() local
131 adg->clkin_rate[CLKA], /* 0000: CLKA */ in __rsnd_adg_get_timesel_ratio()
132 adg->clkin_rate[CLKB], /* 0001: CLKB */ in __rsnd_adg_get_timesel_ratio()
133 adg->clkin_rate[CLKC], /* 0010: CLKC */ in __rsnd_adg_get_timesel_ratio()
134 adg->brg_rate[ADG_HZ_441], /* 0011: BRGA */ in __rsnd_adg_get_timesel_ratio()
135 adg->brg_rate[ADG_HZ_48], /* 0100: BRGB */ in __rsnd_adg_get_timesel_ratio()
226 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_set_cmd_timsel_gen2() local
227 struct rsnd_mod *adg_mod = rsnd_mod_get(adg); in rsnd_adg_set_cmd_timsel_gen2()
251 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_set_src_timesel_gen2() local
252 struct rsnd_mod *adg_mod = rsnd_mod_get(adg); in rsnd_adg_set_src_timesel_gen2()
280 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_set_ssi_clk() local
281 struct rsnd_mod *adg_mod = rsnd_mod_get(adg); in rsnd_adg_set_ssi_clk()
305 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_clk_query() local
319 for_each_rsnd_clkin(clk, adg, i) in rsnd_adg_clk_query()
320 if (rate == adg->clkin_rate[i]) in rsnd_adg_clk_query()
326 if (rate == adg->brg_rate[ADG_HZ_441]) in rsnd_adg_clk_query()
329 if (rate == adg->brg_rate[ADG_HZ_48]) in rsnd_adg_clk_query()
345 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_ssi_clk_try_start() local
347 struct rsnd_mod *adg_mod = rsnd_mod_get(adg); in rsnd_adg_ssi_clk_try_start()
360 rsnd_mod_bset(adg_mod, BRGCKR, 0x80770000, adg->ckr | ckr); in rsnd_adg_ssi_clk_try_start()
364 (ckr) ? adg->brg_rate[ADG_HZ_48] : in rsnd_adg_ssi_clk_try_start()
365 adg->brg_rate[ADG_HZ_441]); in rsnd_adg_ssi_clk_try_start()
372 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_clk_control() local
373 struct rsnd_mod *adg_mod = rsnd_mod_get(adg); in rsnd_adg_clk_control()
378 rsnd_mod_bset(adg_mod, BRGCKR, 0x80770000, adg->ckr); in rsnd_adg_clk_control()
379 rsnd_mod_write(adg_mod, BRRA, adg->brga); in rsnd_adg_clk_control()
380 rsnd_mod_write(adg_mod, BRRB, adg->brgb); in rsnd_adg_clk_control()
383 for_each_rsnd_clkin(clk, adg, i) { in rsnd_adg_clk_control()
392 adg->clkin_rate[i] = clk_get_rate(clk); in rsnd_adg_clk_control()
417 struct rsnd_adg *adg = priv->adg; in rsnd_adg_null_clk_get() local
419 if (!adg->null_clk) { in rsnd_adg_null_clk_get()
422 adg->null_clk = rsnd_adg_create_null_clk(priv, name, NULL); in rsnd_adg_null_clk_get()
425 return adg->null_clk; in rsnd_adg_null_clk_get()
430 struct rsnd_adg *adg = priv->adg; in rsnd_adg_null_clk_clean() local
432 if (adg->null_clk) in rsnd_adg_null_clk_clean()
433 clk_unregister_fixed_rate(adg->null_clk); in rsnd_adg_null_clk_clean()
438 struct rsnd_adg *adg = priv->adg; in rsnd_adg_get_clkin() local
460 adg->clkin[i] = clk; in rsnd_adg_get_clkin()
463 adg->clkin_size = clkin_size; in rsnd_adg_get_clkin()
477 struct rsnd_adg *adg = priv->adg; in rsnd_adg_unregister_clkout() local
481 for_each_rsnd_clkout(clk, adg, i) in rsnd_adg_unregister_clkout()
487 struct rsnd_adg *adg = priv->adg; in rsnd_adg_get_clkout() local
565 for_each_rsnd_clkin(clk, adg, i) { in rsnd_adg_get_clkout()
578 if (!adg->brg_rate[ADG_HZ_441] && req_Hz[ADG_HZ_441] && (0 == rate % 44100)) { in rsnd_adg_get_clkout()
583 adg->brg_rate[ADG_HZ_441] = rate / div; in rsnd_adg_get_clkout()
597 if (!adg->brg_rate[ADG_HZ_48] && req_Hz[ADG_HZ_48] && (0 == rate % 48000)) { in rsnd_adg_get_clkout()
602 adg->brg_rate[ADG_HZ_48] = rate / div; in rsnd_adg_get_clkout()
612 if (!(adg->brg_rate[ADG_HZ_48] && req_Hz[ADG_HZ_48]) && in rsnd_adg_get_clkout()
613 !(adg->brg_rate[ADG_HZ_441] && req_Hz[ADG_HZ_441])) in rsnd_adg_get_clkout()
639 adg->clkout[CLKOUT] = clk; in rsnd_adg_get_clkout()
640 adg->clkout_size = 1; in rsnd_adg_get_clkout()
654 adg->clkout[i] = clk; in rsnd_adg_get_clkout()
656 adg->onecell.clks = adg->clkout; in rsnd_adg_get_clkout()
657 adg->onecell.clk_num = clkout_size; in rsnd_adg_get_clkout()
658 adg->clkout_size = clkout_size; in rsnd_adg_get_clkout()
660 &adg->onecell); in rsnd_adg_get_clkout()
664 adg->ckr = ckr; in rsnd_adg_get_clkout()
665 adg->brga = brga; in rsnd_adg_get_clkout()
666 adg->brgb = brgb; in rsnd_adg_get_clkout()
698 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_clk_dbg_info() local
703 for_each_rsnd_clkin(clk, adg, i) in rsnd_adg_clk_dbg_info()
708 adg->ckr, adg->brga, adg->brgb); in rsnd_adg_clk_dbg_info()
709 dbg_msg(dev, m, "BRGA (for 44100 base) = %d\n", adg->brg_rate[ADG_HZ_441]); in rsnd_adg_clk_dbg_info()
710 dbg_msg(dev, m, "BRGB (for 48000 base) = %d\n", adg->brg_rate[ADG_HZ_48]); in rsnd_adg_clk_dbg_info()
716 for_each_rsnd_clkout(clk, adg, i) in rsnd_adg_clk_dbg_info()
726 struct rsnd_adg *adg; in rsnd_adg_probe() local
730 adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL); in rsnd_adg_probe()
731 if (!adg) in rsnd_adg_probe()
734 ret = rsnd_mod_init(priv, &adg->mod, &adg_ops, in rsnd_adg_probe()
739 priv->adg = adg; in rsnd_adg_probe()