Lines Matching +full:ctu +full:-

1 // SPDX-License-Identifier: GPL-2.0
3 // ctu.c
10 #define CTU_NAME "ctu"
13 * User needs to setup CTU by amixer, and its settings are
16 * CTUn_CPMDR : amixser set "CTU Pass"
17 * CTUn_SV0xR : amixser set "CTU SV0"
18 * CTUn_SV1xR : amixser set "CTU SV1"
19 * CTUn_SV2xR : amixser set "CTU SV2"
20 * CTUn_SV3xR : amixser set "CTU SV3"
22 * [CTU Pass]
37 * [CTU SVx]
50 * -----------------------------------------------------------------------
55 * H'00_0001 2.38 x 10^-7 -132
56 * H'00_0000 0 Mute H'FF_FFFF 2.38 x 10^-7 -132
59 * Ex) Input ch -> Output ch
60 * 1ch -> 0ch
61 * 0ch -> 1ch
63 * amixer set "CTU Reset" on
64 * amixer set "CTU Pass" 9,10
65 * amixer set "CTU SV0" 0,4194304
66 * amixer set "CTU SV1" 4194304,0
68 * amixer set "CTU Reset" on
69 * amixer set "CTU Pass" 2,1
83 #define rsnd_ctu_nr(priv) ((priv)->ctu_nr)
87 ((pos) = (struct rsnd_ctu *)(priv)->ctu + i); \
93 #define rsnd_ctu_get(priv, id) ((struct rsnd_ctu *)(priv->ctu) + id)
117 struct rsnd_ctu *ctu = rsnd_mod_to_ctu(mod); in rsnd_ctu_value_init() local
123 u32 val = rsnd_kctrl_valm(ctu->pass, i); in rsnd_ctu_value_init()
125 cpmdr |= val << (28 - (i * 4)); in rsnd_ctu_value_init()
127 if ((val > 0x8) && (scmdr < (val - 0x8))) in rsnd_ctu_value_init()
128 scmdr = val - 0x8; in rsnd_ctu_value_init()
145 rsnd_mod_write(mod, CTU_SVxxR(i, j), rsnd_kctrl_valm(ctu->sv[i], j)); in rsnd_ctu_value_init()
154 struct rsnd_ctu *ctu = rsnd_mod_to_ctu(mod); in rsnd_ctu_value_reset() local
157 if (!rsnd_kctrl_vals(ctu->reset)) in rsnd_ctu_value_reset()
161 rsnd_kctrl_valm(ctu->pass, i) = 0; in rsnd_ctu_value_reset()
162 rsnd_kctrl_valm(ctu->sv[0], i) = 0; in rsnd_ctu_value_reset()
163 rsnd_kctrl_valm(ctu->sv[1], i) = 0; in rsnd_ctu_value_reset()
164 rsnd_kctrl_valm(ctu->sv[2], i) = 0; in rsnd_ctu_value_reset()
165 rsnd_kctrl_valm(ctu->sv[3], i) = 0; in rsnd_ctu_value_reset()
167 rsnd_kctrl_vals(ctu->reset) = 0; in rsnd_ctu_value_reset()
202 struct rsnd_ctu *ctu = rsnd_mod_to_ctu(mod); in rsnd_ctu_pcm_new() local
205 if (rsnd_flags_has(ctu, KCTRL_INITIALIZED)) in rsnd_ctu_pcm_new()
208 /* CTU Pass */ in rsnd_ctu_pcm_new()
209 ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU Pass", in rsnd_ctu_pcm_new()
212 &ctu->pass, RSND_MAX_CHANNELS, in rsnd_ctu_pcm_new()
218 ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU SV0", in rsnd_ctu_pcm_new()
221 &ctu->sv[0], RSND_MAX_CHANNELS, in rsnd_ctu_pcm_new()
227 ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU SV1", in rsnd_ctu_pcm_new()
230 &ctu->sv[1], RSND_MAX_CHANNELS, in rsnd_ctu_pcm_new()
236 ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU SV2", in rsnd_ctu_pcm_new()
239 &ctu->sv[2], RSND_MAX_CHANNELS, in rsnd_ctu_pcm_new()
245 ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU SV3", in rsnd_ctu_pcm_new()
248 &ctu->sv[3], RSND_MAX_CHANNELS, in rsnd_ctu_pcm_new()
254 ret = rsnd_kctrl_new_s(mod, io, rtd, "CTU Reset", in rsnd_ctu_pcm_new()
257 &ctu->reset, 1); in rsnd_ctu_pcm_new()
259 rsnd_flags_set(ctu, KCTRL_INITIALIZED); in rsnd_ctu_pcm_new()
267 * ctu00: -> 0, ctu01: -> 0, ctu02: -> 0, ctu03: -> 0 in rsnd_ctu_id()
268 * ctu10: -> 1, ctu11: -> 1, ctu12: -> 1, ctu13: -> 1 in rsnd_ctu_id()
270 return mod->id / 4; in rsnd_ctu_id()
276 * ctu00: -> 0, ctu01: -> 1, ctu02: -> 2, ctu03: -> 3 in rsnd_ctu_id_sub()
277 * ctu10: -> 0, ctu11: -> 1, ctu12: -> 2, ctu13: -> 3 in rsnd_ctu_id_sub()
279 return mod->id % 4; in rsnd_ctu_id_sub()
321 struct rsnd_ctu *ctu; in rsnd_ctu_probe() local
336 ret = -EINVAL; in rsnd_ctu_probe()
340 ctu = devm_kcalloc(dev, nr, sizeof(*ctu), GFP_KERNEL); in rsnd_ctu_probe()
341 if (!ctu) { in rsnd_ctu_probe()
342 ret = -ENOMEM; in rsnd_ctu_probe()
346 priv->ctu_nr = nr; in rsnd_ctu_probe()
347 priv->ctu = ctu; in rsnd_ctu_probe()
352 ctu = rsnd_ctu_get(priv, i); in rsnd_ctu_probe()
368 ret = rsnd_mod_init(priv, rsnd_mod_get(ctu), &rsnd_ctu_ops, in rsnd_ctu_probe()
387 struct rsnd_ctu *ctu; in rsnd_ctu_remove() local
390 for_each_rsnd_ctu(ctu, priv, i) { in rsnd_ctu_remove()
391 rsnd_mod_quit(rsnd_mod_get(ctu)); in rsnd_ctu_remove()