Lines Matching refs:ctl

202 	    index == NULL || devinfo->ctl == NULL ||  in hdaa_audio_ctl_each()
206 return (&devinfo->ctl[(*index)++]); in hdaa_audio_ctl_each()
213 struct hdaa_audio_ctl *ctl; in hdaa_audio_ctl_amp_get() local
216 if (devinfo == NULL || devinfo->ctl == NULL) in hdaa_audio_ctl_amp_get()
220 while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { in hdaa_audio_ctl_amp_get()
221 if (ctl->enable == 0) in hdaa_audio_ctl_amp_get()
223 if (ctl->widget->nid != nid) in hdaa_audio_ctl_amp_get()
225 if (dir && ctl->ndir != dir) in hdaa_audio_ctl_amp_get()
227 if (index >= 0 && ctl->ndir == HDAA_CTL_IN && in hdaa_audio_ctl_amp_get()
228 ctl->dir == ctl->ndir && ctl->index != index) in hdaa_audio_ctl_amp_get()
232 return (ctl); in hdaa_audio_ctl_amp_get()
384 struct hdaa_audio_ctl *ctl; in hdaa_hpredir_handler() local
395 ctl = hdaa_audio_ctl_amp_get(devinfo, in hdaa_hpredir_handler()
397 if (ctl != NULL && ctl->mute) { in hdaa_hpredir_handler()
400 if (val != ctl->forcemute) { in hdaa_hpredir_handler()
401 ctl->forcemute = val; in hdaa_hpredir_handler()
402 hdaa_audio_ctl_amp_set(ctl, in hdaa_hpredir_handler()
425 ctl = hdaa_audio_ctl_amp_get(devinfo, in hdaa_hpredir_handler()
427 if (ctl != NULL && ctl->mute) { in hdaa_hpredir_handler()
430 if (val == ctl->forcemute) in hdaa_hpredir_handler()
432 ctl->forcemute = val; in hdaa_hpredir_handler()
433 hdaa_audio_ctl_amp_set(ctl, in hdaa_hpredir_handler()
1675 hdaa_audio_ctl_amp_set(struct hdaa_audio_ctl *ctl, uint32_t mute, in hdaa_audio_ctl_amp_set() argument
1681 nid = ctl->widget->nid; in hdaa_audio_ctl_amp_set()
1685 ctl->muted = mute; in hdaa_audio_ctl_amp_set()
1687 ctl->left = left; in hdaa_audio_ctl_amp_set()
1689 ctl->right = right; in hdaa_audio_ctl_amp_set()
1691 if (ctl->forcemute) { in hdaa_audio_ctl_amp_set()
1697 lmute = HDAA_AMP_LEFT_MUTED(ctl->muted); in hdaa_audio_ctl_amp_set()
1698 rmute = HDAA_AMP_RIGHT_MUTED(ctl->muted); in hdaa_audio_ctl_amp_set()
1699 left = ctl->left; in hdaa_audio_ctl_amp_set()
1700 right = ctl->right; in hdaa_audio_ctl_amp_set()
1703 if (ctl->dir & HDAA_CTL_OUT) in hdaa_audio_ctl_amp_set()
1704 hdaa_audio_ctl_amp_set_internal(ctl->widget->devinfo, nid, ctl->index, in hdaa_audio_ctl_amp_set()
1706 if (ctl->dir & HDAA_CTL_IN) in hdaa_audio_ctl_amp_set()
1707 hdaa_audio_ctl_amp_set_internal(ctl->widget->devinfo, nid, ctl->index, in hdaa_audio_ctl_amp_set()
2323 hdaa_audio_ctl_dev_set(struct hdaa_audio_ctl *ctl, int ossdev, in hdaa_audio_ctl_dev_set() argument
2328 ctl->devleft[ossdev] = *left; in hdaa_audio_ctl_dev_set()
2329 ctl->devright[ossdev] = *right; in hdaa_audio_ctl_dev_set()
2330 ctl->devmute[ossdev] = mute; in hdaa_audio_ctl_dev_set()
2333 sleft += ctl->devleft[i]; in hdaa_audio_ctl_dev_set()
2334 sright += ctl->devright[i]; in hdaa_audio_ctl_dev_set()
2335 smute |= ctl->devmute[i]; in hdaa_audio_ctl_dev_set()
2338 zleft += ctl->devleft[i]; in hdaa_audio_ctl_dev_set()
2339 zright += ctl->devright[i]; in hdaa_audio_ctl_dev_set()
2341 lval = QDB2VAL(ctl, sleft); in hdaa_audio_ctl_dev_set()
2342 rval = QDB2VAL(ctl, sright); in hdaa_audio_ctl_dev_set()
2343 hdaa_audio_ctl_amp_set(ctl, smute, lval, rval); in hdaa_audio_ctl_dev_set()
2344 *left -= VAL2QDB(ctl, lval) - VAL2QDB(ctl, QDB2VAL(ctl, zleft)); in hdaa_audio_ctl_dev_set()
2345 *right -= VAL2QDB(ctl, rval) - VAL2QDB(ctl, QDB2VAL(ctl, zright)); in hdaa_audio_ctl_dev_set()
2357 struct hdaa_audio_ctl *ctl; in hdaa_audio_ctl_source_volume() local
2380 ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_IN, in hdaa_audio_ctl_source_volume()
2382 if (ctl) in hdaa_audio_ctl_source_volume()
2383 hdaa_audio_ctl_dev_set(ctl, ossdev, mute, &left, &right); in hdaa_audio_ctl_source_volume()
2406 ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_OUT, -1, 1); in hdaa_audio_ctl_source_volume()
2407 if (ctl) in hdaa_audio_ctl_source_volume()
2408 hdaa_audio_ctl_dev_set(ctl, ossdev, mute, &left, &right); in hdaa_audio_ctl_source_volume()
2434 struct hdaa_audio_ctl *ctl; in hdaa_audio_ctl_dest_volume() local
2468 ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, in hdaa_audio_ctl_dest_volume()
2470 if (ctl) in hdaa_audio_ctl_dest_volume()
2471 hdaa_audio_ctl_dev_set(ctl, ossdev, mute, &left, &right); in hdaa_audio_ctl_dest_volume()
2486 ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, in hdaa_audio_ctl_dest_volume()
2488 if (ctl) in hdaa_audio_ctl_dest_volume()
2489 hdaa_audio_ctl_dev_set(ctl, ossdev, mute, &cleft, &cright); in hdaa_audio_ctl_dest_volume()
2684 struct hdaa_audio_ctl *ctl; in hdaa_audio_ctl_recsel_comm() local
2713 ctl = hdaa_audio_ctl_amp_get(devinfo, in hdaa_audio_ctl_recsel_comm()
2715 if (ctl == NULL) in hdaa_audio_ctl_recsel_comm()
2720 if (muted != ctl->forcemute) { in hdaa_audio_ctl_recsel_comm()
2721 ctl->forcemute = muted; in hdaa_audio_ctl_recsel_comm()
2722 hdaa_audio_ctl_amp_set(ctl, in hdaa_audio_ctl_recsel_comm()
2760 struct hdaa_audio_ctl *ctl; in hdaa_audio_ctl_ossmixer_setrecsrc() local
2798 while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { in hdaa_audio_ctl_ossmixer_setrecsrc()
2799 if (ctl->enable == 0 || in hdaa_audio_ctl_ossmixer_setrecsrc()
2800 !(ctl->ossmask & pdevinfo->recsrc)) in hdaa_audio_ctl_ossmixer_setrecsrc()
2803 ctl->widget->bindas == pdevinfo->playas) || in hdaa_audio_ctl_ossmixer_setrecsrc()
2805 ctl->widget->bindas == pdevinfo->recas) || in hdaa_audio_ctl_ossmixer_setrecsrc()
2807 ctl->widget->bindas == -2))) in hdaa_audio_ctl_ossmixer_setrecsrc()
2811 ctl->devleft[j] = 0; in hdaa_audio_ctl_ossmixer_setrecsrc()
2812 ctl->devright[j] = 0; in hdaa_audio_ctl_ossmixer_setrecsrc()
2813 ctl->devmute[j] = 0; in hdaa_audio_ctl_ossmixer_setrecsrc()
3155 devinfo->ctl = ctls; in hdaa_audio_ctl_parse()
4151 struct hdaa_audio_ctl *ctl; in hdaa_audio_disable_useless() local
4186 while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { in hdaa_audio_disable_useless()
4187 if (ctl->enable == 0) in hdaa_audio_disable_useless()
4189 if (ctl->widget->enable == 0 || in hdaa_audio_disable_useless()
4190 (ctl->childwidget != NULL && in hdaa_audio_disable_useless()
4191 ctl->childwidget->enable == 0)) { in hdaa_audio_disable_useless()
4192 ctl->forcemute = 1; in hdaa_audio_disable_useless()
4193 ctl->muted = HDAA_AMP_MUTE_ALL; in hdaa_audio_disable_useless()
4194 ctl->left = 0; in hdaa_audio_disable_useless()
4195 ctl->right = 0; in hdaa_audio_disable_useless()
4196 ctl->enable = 0; in hdaa_audio_disable_useless()
4197 if (ctl->ndir == HDAA_CTL_IN) in hdaa_audio_disable_useless()
4198 ctl->widget->connsenable[ctl->index] = 0; in hdaa_audio_disable_useless()
4204 ctl->widget->nid, in hdaa_audio_disable_useless()
4205 (ctl->childwidget != NULL)? in hdaa_audio_disable_useless()
4206 ctl->childwidget->nid:-1); in hdaa_audio_disable_useless()
4285 struct hdaa_audio_ctl *ctl; in hdaa_audio_disable_unas() local
4324 ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, in hdaa_audio_disable_unas()
4326 if (ctl && ctl->enable) { in hdaa_audio_disable_unas()
4327 ctl->forcemute = 1; in hdaa_audio_disable_unas()
4328 ctl->muted = HDAA_AMP_MUTE_ALL; in hdaa_audio_disable_unas()
4329 ctl->left = 0; in hdaa_audio_disable_unas()
4330 ctl->right = 0; in hdaa_audio_disable_unas()
4331 ctl->enable = 0; in hdaa_audio_disable_unas()
4334 ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, in hdaa_audio_disable_unas()
4336 if (ctl && ctl->enable) { in hdaa_audio_disable_unas()
4337 ctl->forcemute = 1; in hdaa_audio_disable_unas()
4338 ctl->muted = HDAA_AMP_MUTE_ALL; in hdaa_audio_disable_unas()
4339 ctl->left = 0; in hdaa_audio_disable_unas()
4340 ctl->right = 0; in hdaa_audio_disable_unas()
4341 ctl->enable = 0; in hdaa_audio_disable_unas()
4359 ctl = hdaa_audio_ctl_amp_get(devinfo, k, in hdaa_audio_disable_unas()
4361 if (ctl && ctl->enable) { in hdaa_audio_disable_unas()
4362 ctl->forcemute = 1; in hdaa_audio_disable_unas()
4363 ctl->muted = HDAA_AMP_MUTE_ALL; in hdaa_audio_disable_unas()
4364 ctl->left = 0; in hdaa_audio_disable_unas()
4365 ctl->right = 0; in hdaa_audio_disable_unas()
4366 ctl->enable = 0; in hdaa_audio_disable_unas()
4414 struct hdaa_audio_ctl *ctl; in hdaa_audio_disable_crossas() local
4464 while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { in hdaa_audio_disable_crossas()
4465 if (ctl->enable == 0 || ctl->childwidget == NULL) in hdaa_audio_disable_crossas()
4468 if (ctl->widget->bindas == -2) in hdaa_audio_disable_crossas()
4471 if (ctl->childwidget->bindas == -2 && in hdaa_audio_disable_crossas()
4472 ctl->widget->bindas >= 0 && in hdaa_audio_disable_crossas()
4473 ases[ctl->widget->bindas].dir == HDAA_CTL_OUT) in hdaa_audio_disable_crossas()
4476 if (ctl->childwidget->bindas == -2 && in hdaa_audio_disable_crossas()
4477 ctl->widget->bindas >= 0 && in hdaa_audio_disable_crossas()
4478 ases[ctl->widget->bindas].mixed) in hdaa_audio_disable_crossas()
4481 if ((ctl->widget->pflags & HDAA_ADC_MONITOR) && in hdaa_audio_disable_crossas()
4482 ctl->childwidget->bindas >= 0 && in hdaa_audio_disable_crossas()
4483 ases[ctl->childwidget->bindas].dir == HDAA_CTL_IN) in hdaa_audio_disable_crossas()
4486 if (ctl->widget->bindas == ctl->childwidget->bindas && in hdaa_audio_disable_crossas()
4487 (ctl->widget->bindseqmask & ctl->childwidget->bindseqmask) != 0) in hdaa_audio_disable_crossas()
4489 ctl->forcemute = 1; in hdaa_audio_disable_crossas()
4490 ctl->muted = HDAA_AMP_MUTE_ALL; in hdaa_audio_disable_crossas()
4491 ctl->left = 0; in hdaa_audio_disable_crossas()
4492 ctl->right = 0; in hdaa_audio_disable_crossas()
4493 ctl->enable = 0; in hdaa_audio_disable_crossas()
4494 if (ctl->ndir == HDAA_CTL_IN) in hdaa_audio_disable_crossas()
4495 ctl->widget->connsenable[ctl->index] = 0; in hdaa_audio_disable_crossas()
4500 ctl->widget->nid, in hdaa_audio_disable_crossas()
4501 ctl->childwidget->nid); in hdaa_audio_disable_crossas()
4516 struct hdaa_audio_ctl *ctl; in hdaa_audio_ctl_source_amp() local
4539 ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_IN, in hdaa_audio_ctl_source_amp()
4541 if (ctl) { in hdaa_audio_ctl_source_amp()
4542 ctl->ossmask |= (1 << ossdev); in hdaa_audio_ctl_source_amp()
4545 *minamp += MINQDB(ctl); in hdaa_audio_ctl_source_amp()
4546 *maxamp += MAXQDB(ctl); in hdaa_audio_ctl_source_amp()
4574 ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_OUT, -1, 1); in hdaa_audio_ctl_source_amp()
4575 if (ctl) { in hdaa_audio_ctl_source_amp()
4576 ctl->ossmask |= (1 << ossdev); in hdaa_audio_ctl_source_amp()
4579 *minamp += MINQDB(ctl); in hdaa_audio_ctl_source_amp()
4580 *maxamp += MAXQDB(ctl); in hdaa_audio_ctl_source_amp()
4623 struct hdaa_audio_ctl *ctl; in hdaa_audio_ctl_dest_amp() local
4657 ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, in hdaa_audio_ctl_dest_amp()
4659 if (ctl) { in hdaa_audio_ctl_dest_amp()
4660 ctl->ossmask |= (1 << ossdev); in hdaa_audio_ctl_dest_amp()
4663 *minamp += MINQDB(ctl); in hdaa_audio_ctl_dest_amp()
4664 *maxamp += MAXQDB(ctl); in hdaa_audio_ctl_dest_amp()
4681 ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, in hdaa_audio_ctl_dest_amp()
4683 if (ctl) { in hdaa_audio_ctl_dest_amp()
4684 ctl->ossmask |= (1 << ossdev); in hdaa_audio_ctl_dest_amp()
4687 tminamp += MINQDB(ctl); in hdaa_audio_ctl_dest_amp()
4688 tmaxamp += MAXQDB(ctl); in hdaa_audio_ctl_dest_amp()
5106 struct hdaa_audio_ctl *ctl; in hdaa_audio_ctl_commit() local
5110 while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { in hdaa_audio_ctl_commit()
5111 if (ctl->enable == 0 || ctl->ossmask != 0) { in hdaa_audio_ctl_commit()
5115 hdaa_audio_ctl_amp_set(ctl, HDAA_AMP_MUTE_ALL, 0, 0); in hdaa_audio_ctl_commit()
5119 z = ctl->offset; in hdaa_audio_ctl_commit()
5120 if (z > ctl->step) in hdaa_audio_ctl_commit()
5121 z = ctl->step; in hdaa_audio_ctl_commit()
5122 hdaa_audio_ctl_amp_set(ctl, HDAA_AMP_MUTE_NONE, z, z); in hdaa_audio_ctl_commit()
5549 struct hdaa_audio_ctl *ctl; in hdaa_dump_ctls() local
5565 while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { in hdaa_dump_ctls()
5566 if (ctl->enable == 0 || in hdaa_dump_ctls()
5567 ctl->widget->enable == 0) in hdaa_dump_ctls()
5570 ctl->widget->bindas == pdevinfo->playas) || in hdaa_dump_ctls()
5572 ctl->widget->bindas == pdevinfo->recas) || in hdaa_dump_ctls()
5573 (ctl->widget->bindas == -2 && pdevinfo->index == 0))) in hdaa_dump_ctls()
5575 if ((ctl->ossmask & (1 << j)) == 0) in hdaa_dump_ctls()
5596 ctl->widget->nid, in hdaa_dump_ctls()
5597 (ctl->ndir == HDAA_CTL_IN)?"in ":"out"); in hdaa_dump_ctls()
5598 if (ctl->ndir == HDAA_CTL_IN && ctl->ndir == ctl->dir) in hdaa_dump_ctls()
5599 printf(" %2d): ", ctl->index); in hdaa_dump_ctls()
5602 if (ctl->step > 0) { in hdaa_dump_ctls()
5604 MINQDB(ctl) / 4, in hdaa_dump_ctls()
5605 MAXQDB(ctl) / 4, in hdaa_dump_ctls()
5606 ctl->step + 1, in hdaa_dump_ctls()
5607 ctl->mute?" + mute":""); in hdaa_dump_ctls()
5609 printf("%s\n", ctl->mute?"mute":""); in hdaa_dump_ctls()
6109 struct hdaa_audio_ctl *ctl; in hdaa_configure() local
6231 while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { in hdaa_configure()
6233 (ctl->widget != NULL) ? ctl->widget->nid : -1, in hdaa_configure()
6234 (ctl->ndir == HDAA_CTL_IN)?"in ":"out", in hdaa_configure()
6235 (ctl->dir == HDAA_CTL_IN)?"in ":"out", in hdaa_configure()
6236 ctl->index); in hdaa_configure()
6237 if (ctl->childwidget != NULL) in hdaa_configure()
6238 printf(" cnid %3d", ctl->childwidget->nid); in hdaa_configure()
6242 ctl->ossmask); in hdaa_configure()
6245 ctl->mute, ctl->step, ctl->size, ctl->offset, in hdaa_configure()
6246 (ctl->enable == 0) ? " [DISABLED]" : in hdaa_configure()
6247 ((ctl->ossmask == 0) ? " [UNUSED]" : "")); in hdaa_configure()
6264 free(devinfo->ctl, M_HDAA); in hdaa_unconfigure()
6265 devinfo->ctl = NULL; in hdaa_unconfigure()