Lines Matching full:ctl
147 memcpy(wm->ctl, snd_wm8766_default_ctl, sizeof(wm->ctl)); in snd_wm8766_init()
188 uinfo->count = (wm->ctl[n].flags & WM8766_FLAG_STEREO) ? 2 : 1; in snd_wm8766_volume_info()
189 uinfo->value.integer.min = wm->ctl[n].min; in snd_wm8766_volume_info()
190 uinfo->value.integer.max = wm->ctl[n].max; in snd_wm8766_volume_info()
201 return snd_ctl_enum_info(uinfo, 1, wm->ctl[n].max, in snd_wm8766_enum_info()
202 wm->ctl[n].enum_names); in snd_wm8766_enum_info()
212 if (wm->ctl[n].get) in snd_wm8766_ctl_get()
213 wm->ctl[n].get(wm, &val1, &val2); in snd_wm8766_ctl_get()
215 val1 = wm->regs[wm->ctl[n].reg1] & wm->ctl[n].mask1; in snd_wm8766_ctl_get()
216 val1 >>= __ffs(wm->ctl[n].mask1); in snd_wm8766_ctl_get()
217 if (wm->ctl[n].flags & WM8766_FLAG_STEREO) { in snd_wm8766_ctl_get()
218 val2 = wm->regs[wm->ctl[n].reg2] & wm->ctl[n].mask2; in snd_wm8766_ctl_get()
219 val2 >>= __ffs(wm->ctl[n].mask2); in snd_wm8766_ctl_get()
220 if (wm->ctl[n].flags & WM8766_FLAG_VOL_UPDATE) in snd_wm8766_ctl_get()
224 if (wm->ctl[n].flags & WM8766_FLAG_INVERT) { in snd_wm8766_ctl_get()
225 val1 = wm->ctl[n].max - (val1 - wm->ctl[n].min); in snd_wm8766_ctl_get()
226 if (wm->ctl[n].flags & WM8766_FLAG_STEREO) in snd_wm8766_ctl_get()
227 val2 = wm->ctl[n].max - (val2 - wm->ctl[n].min); in snd_wm8766_ctl_get()
230 if (wm->ctl[n].flags & WM8766_FLAG_STEREO) in snd_wm8766_ctl_get()
246 if (wm->ctl[n].flags & WM8766_FLAG_INVERT) { in snd_wm8766_ctl_put()
247 regval1 = wm->ctl[n].max - (regval1 - wm->ctl[n].min); in snd_wm8766_ctl_put()
248 regval2 = wm->ctl[n].max - (regval2 - wm->ctl[n].min); in snd_wm8766_ctl_put()
250 if (wm->ctl[n].set) in snd_wm8766_ctl_put()
251 wm->ctl[n].set(wm, regval1, regval2); in snd_wm8766_ctl_put()
253 val = wm->regs[wm->ctl[n].reg1] & ~wm->ctl[n].mask1; in snd_wm8766_ctl_put()
254 val |= regval1 << __ffs(wm->ctl[n].mask1); in snd_wm8766_ctl_put()
256 if (wm->ctl[n].flags & WM8766_FLAG_STEREO && in snd_wm8766_ctl_put()
257 wm->ctl[n].reg1 == wm->ctl[n].reg2) { in snd_wm8766_ctl_put()
258 val &= ~wm->ctl[n].mask2; in snd_wm8766_ctl_put()
259 val |= regval2 << __ffs(wm->ctl[n].mask2); in snd_wm8766_ctl_put()
261 snd_wm8766_write(wm, wm->ctl[n].reg1, val); in snd_wm8766_ctl_put()
263 if (wm->ctl[n].flags & WM8766_FLAG_STEREO && in snd_wm8766_ctl_put()
264 wm->ctl[n].reg1 != wm->ctl[n].reg2) { in snd_wm8766_ctl_put()
265 val = wm->regs[wm->ctl[n].reg2] & ~wm->ctl[n].mask2; in snd_wm8766_ctl_put()
266 val |= regval2 << __ffs(wm->ctl[n].mask2); in snd_wm8766_ctl_put()
267 if (wm->ctl[n].flags & WM8766_FLAG_VOL_UPDATE) in snd_wm8766_ctl_put()
269 snd_wm8766_write(wm, wm->ctl[n].reg2, val); in snd_wm8766_ctl_put()
279 struct snd_kcontrol *ctl; in snd_wm8766_add_control() local
284 cont.name = wm->ctl[num].name; in snd_wm8766_add_control()
286 if (wm->ctl[num].flags & WM8766_FLAG_LIM || in snd_wm8766_add_control()
287 wm->ctl[num].flags & WM8766_FLAG_ALC) in snd_wm8766_add_control()
293 switch (wm->ctl[num].type) { in snd_wm8766_add_control()
297 cont.tlv.p = wm->ctl[num].tlv; in snd_wm8766_add_control()
300 wm->ctl[num].max = 1; in snd_wm8766_add_control()
301 if (wm->ctl[num].flags & WM8766_FLAG_STEREO) in snd_wm8766_add_control()
312 ctl = snd_ctl_new1(&cont, wm); in snd_wm8766_add_control()
313 if (!ctl) in snd_wm8766_add_control()
315 wm->ctl[num].kctl = ctl; in snd_wm8766_add_control()
317 return snd_ctl_add(wm->card, ctl); in snd_wm8766_add_control()
325 if (wm->ctl[i].name) { in snd_wm8766_build_controls()