Lines Matching refs:ctl
161 memcpy(wm->ctl, snd_wm8766_default_ctl, sizeof(wm->ctl)); in snd_wm8766_init()
218 uinfo->count = (wm->ctl[n].flags & WM8766_FLAG_STEREO) ? 2 : 1; in snd_wm8766_volume_info()
219 uinfo->value.integer.min = wm->ctl[n].min; in snd_wm8766_volume_info()
220 uinfo->value.integer.max = wm->ctl[n].max; in snd_wm8766_volume_info()
231 return snd_ctl_enum_info(uinfo, 1, wm->ctl[n].max, in snd_wm8766_enum_info()
232 wm->ctl[n].enum_names); in snd_wm8766_enum_info()
242 if (wm->ctl[n].get) in snd_wm8766_ctl_get()
243 wm->ctl[n].get(wm, &val1, &val2); in snd_wm8766_ctl_get()
245 val1 = wm->regs[wm->ctl[n].reg1] & wm->ctl[n].mask1; in snd_wm8766_ctl_get()
246 val1 >>= __ffs(wm->ctl[n].mask1); in snd_wm8766_ctl_get()
247 if (wm->ctl[n].flags & WM8766_FLAG_STEREO) { in snd_wm8766_ctl_get()
248 val2 = wm->regs[wm->ctl[n].reg2] & wm->ctl[n].mask2; in snd_wm8766_ctl_get()
249 val2 >>= __ffs(wm->ctl[n].mask2); in snd_wm8766_ctl_get()
250 if (wm->ctl[n].flags & WM8766_FLAG_VOL_UPDATE) in snd_wm8766_ctl_get()
254 if (wm->ctl[n].flags & WM8766_FLAG_INVERT) { in snd_wm8766_ctl_get()
255 val1 = wm->ctl[n].max - (val1 - wm->ctl[n].min); in snd_wm8766_ctl_get()
256 val2 = wm->ctl[n].max - (val2 - wm->ctl[n].min); in snd_wm8766_ctl_get()
259 if (wm->ctl[n].flags & WM8766_FLAG_STEREO) in snd_wm8766_ctl_get()
275 if (wm->ctl[n].flags & WM8766_FLAG_INVERT) { in snd_wm8766_ctl_put()
276 regval1 = wm->ctl[n].max - (regval1 - wm->ctl[n].min); in snd_wm8766_ctl_put()
277 regval2 = wm->ctl[n].max - (regval2 - wm->ctl[n].min); in snd_wm8766_ctl_put()
279 if (wm->ctl[n].set) in snd_wm8766_ctl_put()
280 wm->ctl[n].set(wm, regval1, regval2); in snd_wm8766_ctl_put()
282 val = wm->regs[wm->ctl[n].reg1] & ~wm->ctl[n].mask1; in snd_wm8766_ctl_put()
283 val |= regval1 << __ffs(wm->ctl[n].mask1); in snd_wm8766_ctl_put()
285 if (wm->ctl[n].flags & WM8766_FLAG_STEREO && in snd_wm8766_ctl_put()
286 wm->ctl[n].reg1 == wm->ctl[n].reg2) { in snd_wm8766_ctl_put()
287 val &= ~wm->ctl[n].mask2; in snd_wm8766_ctl_put()
288 val |= regval2 << __ffs(wm->ctl[n].mask2); in snd_wm8766_ctl_put()
290 snd_wm8766_write(wm, wm->ctl[n].reg1, val); in snd_wm8766_ctl_put()
292 if (wm->ctl[n].flags & WM8766_FLAG_STEREO && in snd_wm8766_ctl_put()
293 wm->ctl[n].reg1 != wm->ctl[n].reg2) { in snd_wm8766_ctl_put()
294 val = wm->regs[wm->ctl[n].reg2] & ~wm->ctl[n].mask2; in snd_wm8766_ctl_put()
295 val |= regval2 << __ffs(wm->ctl[n].mask2); in snd_wm8766_ctl_put()
296 if (wm->ctl[n].flags & WM8766_FLAG_VOL_UPDATE) in snd_wm8766_ctl_put()
298 snd_wm8766_write(wm, wm->ctl[n].reg2, val); in snd_wm8766_ctl_put()
308 struct snd_kcontrol *ctl; in snd_wm8766_add_control() local
313 cont.name = wm->ctl[num].name; in snd_wm8766_add_control()
315 if (wm->ctl[num].flags & WM8766_FLAG_LIM || in snd_wm8766_add_control()
316 wm->ctl[num].flags & WM8766_FLAG_ALC) in snd_wm8766_add_control()
322 switch (wm->ctl[num].type) { in snd_wm8766_add_control()
326 cont.tlv.p = wm->ctl[num].tlv; in snd_wm8766_add_control()
329 wm->ctl[num].max = 1; in snd_wm8766_add_control()
330 if (wm->ctl[num].flags & WM8766_FLAG_STEREO) in snd_wm8766_add_control()
341 ctl = snd_ctl_new1(&cont, wm); in snd_wm8766_add_control()
342 if (!ctl) in snd_wm8766_add_control()
344 wm->ctl[num].kctl = ctl; in snd_wm8766_add_control()
346 return snd_ctl_add(wm->card, ctl); in snd_wm8766_add_control()
354 if (wm->ctl[i].name) { in snd_wm8766_build_controls()