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)
132 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in __rsnd_adg_get_timesel_ratio() local
138 adg->clkin_rate[CLKA], /* 0000: CLKA */ in __rsnd_adg_get_timesel_ratio()
139 adg->clkin_rate[CLKB], /* 0001: CLKB */ in __rsnd_adg_get_timesel_ratio()
140 adg->clkin_rate[CLKC], /* 0010: CLKC */ in __rsnd_adg_get_timesel_ratio()
141 adg->brg_rate[ADG_HZ_441], /* 0011: BRGA */ in __rsnd_adg_get_timesel_ratio()
142 adg->brg_rate[ADG_HZ_48], /* 0100: BRGB */ in __rsnd_adg_get_timesel_ratio()
233 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_set_cmd_timsel_gen2() local
234 struct rsnd_mod *adg_mod = rsnd_mod_get(adg); in rsnd_adg_set_cmd_timsel_gen2()
258 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_set_src_timesel_gen2() local
259 struct rsnd_mod *adg_mod = rsnd_mod_get(adg); in rsnd_adg_set_src_timesel_gen2()
287 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_set_ssi_clk() local
288 struct rsnd_mod *adg_mod = rsnd_mod_get(adg); in rsnd_adg_set_ssi_clk()
312 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_clk_query() local
326 for_each_rsnd_clkin(clk, adg, i) in rsnd_adg_clk_query()
327 if (rate == adg->clkin_rate[i]) in rsnd_adg_clk_query()
333 if (rate == adg->brg_rate[ADG_HZ_441]) in rsnd_adg_clk_query()
336 if (rate == adg->brg_rate[ADG_HZ_48]) in rsnd_adg_clk_query()
352 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_ssi_clk_try_start() local
354 struct rsnd_mod *adg_mod = rsnd_mod_get(adg); in rsnd_adg_ssi_clk_try_start()
367 rsnd_mod_bset(adg_mod, BRGCKR, 0x80770000, adg->ckr | ckr); in rsnd_adg_ssi_clk_try_start()
371 (ckr) ? adg->brg_rate[ADG_HZ_48] : in rsnd_adg_ssi_clk_try_start()
372 adg->brg_rate[ADG_HZ_441]); in rsnd_adg_ssi_clk_try_start()
379 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_clk_control() local
380 struct rsnd_mod *adg_mod = rsnd_mod_get(adg); in rsnd_adg_clk_control()
385 rsnd_mod_bset(adg_mod, BRGCKR, 0x80770000, adg->ckr); in rsnd_adg_clk_control()
386 rsnd_mod_write(adg_mod, BRRA, adg->brga); in rsnd_adg_clk_control()
387 rsnd_mod_write(adg_mod, BRRB, adg->brgb); in rsnd_adg_clk_control()
390 for_each_rsnd_clkin(clk, adg, i) { in rsnd_adg_clk_control()
399 adg->clkin_rate[i] = clk_get_rate(clk); in rsnd_adg_clk_control()
424 struct rsnd_adg *adg = priv->adg; in rsnd_adg_null_clk_get() local
426 if (!adg->null_clk) { in rsnd_adg_null_clk_get()
429 adg->null_clk = rsnd_adg_create_null_clk(priv, name, NULL); in rsnd_adg_null_clk_get()
432 return adg->null_clk; in rsnd_adg_null_clk_get()
437 struct rsnd_adg *adg = priv->adg; in rsnd_adg_null_clk_clean() local
439 if (adg->null_clk) in rsnd_adg_null_clk_clean()
440 clk_unregister_fixed_rate(adg->null_clk); in rsnd_adg_null_clk_clean()
445 struct rsnd_adg *adg = priv->adg; in rsnd_adg_get_clkin() local
467 adg->clkin[i] = clk; in rsnd_adg_get_clkin()
470 adg->clkin_size = clkin_size; in rsnd_adg_get_clkin()
484 struct rsnd_adg *adg = priv->adg; in rsnd_adg_unregister_clkout() local
488 for_each_rsnd_clkout(clk, adg, i) in rsnd_adg_unregister_clkout()
494 struct rsnd_adg *adg = priv->adg; in rsnd_adg_get_clkout() local
572 for_each_rsnd_clkin(clk, adg, i) { in rsnd_adg_get_clkout()
585 if (!adg->brg_rate[ADG_HZ_441] && req_Hz[ADG_HZ_441] && (0 == rate % 44100)) { in rsnd_adg_get_clkout()
590 adg->brg_rate[ADG_HZ_441] = rate / div; in rsnd_adg_get_clkout()
604 if (!adg->brg_rate[ADG_HZ_48] && req_Hz[ADG_HZ_48] && (0 == rate % 48000)) { in rsnd_adg_get_clkout()
609 adg->brg_rate[ADG_HZ_48] = rate / div; in rsnd_adg_get_clkout()
619 if (!(adg->brg_rate[ADG_HZ_48] && req_Hz[ADG_HZ_48]) && in rsnd_adg_get_clkout()
620 !(adg->brg_rate[ADG_HZ_441] && req_Hz[ADG_HZ_441])) in rsnd_adg_get_clkout()
646 adg->clkout[CLKOUT] = clk; in rsnd_adg_get_clkout()
647 adg->clkout_size = 1; in rsnd_adg_get_clkout()
661 adg->clkout[i] = clk; in rsnd_adg_get_clkout()
663 adg->onecell.clks = adg->clkout; in rsnd_adg_get_clkout()
664 adg->onecell.clk_num = clkout_size; in rsnd_adg_get_clkout()
665 adg->clkout_size = clkout_size; in rsnd_adg_get_clkout()
667 &adg->onecell); in rsnd_adg_get_clkout()
671 adg->ckr = ckr; in rsnd_adg_get_clkout()
672 adg->brga = brga; in rsnd_adg_get_clkout()
673 adg->brgb = brgb; in rsnd_adg_get_clkout()
705 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); in rsnd_adg_clk_dbg_info() local
710 for_each_rsnd_clkin(clk, adg, i) in rsnd_adg_clk_dbg_info()
715 adg->ckr, adg->brga, adg->brgb); in rsnd_adg_clk_dbg_info()
716 dbg_msg(dev, m, "BRGA (for 44100 base) = %d\n", adg->brg_rate[ADG_HZ_441]); in rsnd_adg_clk_dbg_info()
717 dbg_msg(dev, m, "BRGB (for 48000 base) = %d\n", adg->brg_rate[ADG_HZ_48]); in rsnd_adg_clk_dbg_info()
723 for_each_rsnd_clkout(clk, adg, i) in rsnd_adg_clk_dbg_info()
733 struct rsnd_adg *adg; in rsnd_adg_probe() local
737 adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL); in rsnd_adg_probe()
738 if (!adg) in rsnd_adg_probe()
741 ret = rsnd_mod_init(priv, &adg->mod, &adg_ops, in rsnd_adg_probe()
746 priv->adg = adg; in rsnd_adg_probe()