Lines Matching defs:widget

572 	audiohd_widget_t		*widget;
583 widget = codec->widget[wid];
584 pin = (audiohd_pin_t *)widget->priv;
612 widget = codec->widget[wid];
613 pin = (audiohd_pin_t *)widget->priv;
678 audiohd_widget_t *widget;
682 widget = codec->widget[wid];
683 pin = (audiohd_pin_t *)widget->priv;
1081 audiohd_widget_t *widget;
1134 widget = codec->widget[wid];
1135 pin = (audiohd_pin_t *)widget->priv;
1150 audiohd_widget_t *widget;
1198 widget = codec->widget[wid];
1199 pin = (audiohd_pin_t *)widget->priv;
1216 audiohd_widget_t *widget, *w;
1234 widget = path->codec->widget[wid];
1235 pin = (audiohd_pin_t *)widget->priv;
1257 w = codec->widget[pin_wid];
1259 w = codec->widget[pin->adc_wid];
1267 w = codec->widget[path->sum_wid];
1290 audiohd_widget_t *widget;
1299 widget = codec->widget[pin->mg_wid[k]];
1316 for (i = 0; i < widget->used; i++) {
1323 widget->monitor_path_next[i]<<
1332 widget->monitor_path_next[i]<<
1362 w = path->codec->widget[wid];
1645 audiohd_widget_t *widget = NULL;
1661 widget = path->codec->widget[wid];
1662 pin = (audiohd_pin_t *)widget->priv;
1884 audiohd_widget_t *widget;
1905 widget = codec->widget[wid];
1906 pin = (audiohd_pin_t *)widget->priv;
1955 widget = codec->widget[path->beep_wid];
1956 if (widget->type == WTYPE_BEEP &&
2555 * Get connection list from every entry for a widget
2558 audiohd_get_conns_from_entry(hda_codec_t *codec, audiohd_widget_t *widget,
2565 widget->nconns < prop->conn_len;
2567 ASSERT(widget->nconns < AUDIOHD_MAX_CONN);
2570 if (widget->nconns == 0) {
2575 widget->avail_conn[widget->nconns++] =
2578 for (k = widget->avail_conn[widget->nconns-1] +
2580 ASSERT(widget->nconns <
2586 num = widget->nconns;
2587 widget->avail_conn[num] = k;
2588 widget->nconns++;
2595 widget->avail_conn[widget->nconns++] =
2605 * Get all connection list for a widget. The connection list is used for
2612 audiohd_widget_t *widget = codec->widget[wid];
2637 * widget capabilities already told us that this widget
2641 widget->nconns = 0;
2655 widget->avail_conn[0] = input_wid;
2656 widget->nconns = 1;
2659 widget->nconns = 0;
2663 audiohd_get_conns_from_entry(codec, widget, entry, &prop);
2671 audiohd_get_pin_config(audiohd_widget_t *widget)
2673 hda_codec_t *codec = widget->codec;
2678 wid_t wid = widget->wid_wid;
2690 widget->priv = pin;
2723 if ((widget->widget_cap & AUDIOHD_URCAP_MASK) &&
2769 audiohd_widget_t *widget;
2777 widget = (audiohd_widget_t *)
2779 codec->widget[wid] = widget;
2780 widget->codec = codec;
2781 widget->output_path_next = AUDIOHD_NULL_CONN;
2782 widget->input_path_next = AUDIOHD_NULL_CONN;
2783 widget->beep_path_next = AUDIOHD_NULL_CONN;
2784 widget->loopback_path_next = AUDIOHD_NULL_CONN;
2789 widget->wid_wid = wid;
2790 widget->type = type;
2791 widget->widget_cap = widcap;
2792 widget->finish = 0;
2793 widget->used = 0;
2807 * if this widget has format override, we read it.
2811 widget->pcm_format =
2815 widget->pcm_format = codec->pcm_format;
2819 * Input amplifier. Has the widget input amplifier ?
2828 widget->inamp_cap = codec->inamp_cap;
2830 widget->inamp_cap =
2835 widget->inamp_cap = 0;
2839 * output amplifier. Has this widget output amplifier ?
2843 widget->outamp_cap = codec->outamp_cap;
2845 widget->outamp_cap =
2850 widget->outamp_cap = 0;
2864 * Some codec(like ALC262) don't provide beep widget,
2872 caddr, widget->wid_wid,
2878 audiohd_get_pin_config(widget);
2883 * which is for turning on/off widget beep.
2891 (void) beep_init((void *) widget,
2913 if (codec->widget[i]) {
2914 kmem_free(codec->widget[i], sizeof (audiohd_widget_t));
2915 codec->widget[i] = NULL;
3130 * hda_codec_t *codec where the dac widget exists
3131 * wid_t wid the no. of a widget
3138 * 1) wid of the first shared widget in the path from
3140 * 2) wid of DAC widget;
3148 audiohd_widget_t *widget = codec->widget[wid];
3155 if (widget == NULL)
3160 * share any widget with other paths.
3163 if (widget->path_flags & AUDIOHD_PATH_DAC)
3166 if (widget->path_flags & AUDIOHD_PATH_DAC)
3170 switch (widget->type) {
3172 /* We need mixer widget, but the the mixer num is 0, failed */
3175 widget->path_flags |= AUDIOHD_PATH_DAC;
3176 widget->out_weight++;
3177 wdac = widget->wid_wid;
3184 for (int i = 0; i < widget->nconns; i++) {
3186 widget->avail_conn[i],
3190 if (widget->output_path_next ==
3192 widget->output_path_next = i;
3195 widget->path_flags |= AUDIOHD_PATH_DAC;
3196 widget->out_weight++;
3216 * int mixer whether the path needs mixer widget
3217 * int *mnum total of mixer widget in the path
3226 audiohd_widget_t *widget, *wdac;
3247 widget = codec->widget[pin->wid];
3249 widget->inamp_cap = 0;
3250 for (i = 0; i < widget->nconns; i++) {
3253 * widget on the path, or the return value is
3257 widget->avail_conn[i], mixer, mnum, exclusive,
3271 path->pin_wid[0] = widget->wid_wid;
3276 wdac = codec->widget[wid];
3280 widget->path_flags |= AUDIOHD_PATH_DAC;
3281 widget->out_weight++;
3282 widget->output_path_next = i;
3295 * First we try to search output path with mixer widget exclusively
3296 * Then we try to search shared output path with mixer widget.
3297 * Then we try to search output path without mixer widget exclusively.
3309 * We don't allow mixer widget on such path, which leads to speaker
3315 /* search an exclusive mixer widget path. This is preferred */
3318 /* search a shared mixer widget path for the remained pins */
3321 /* search an exclusive widget path without mixer for the remained pin */
3324 /* search a shared widget path without mixer for the remained pin */
3333 * Find the gain control and mute control widget
3339 audiohd_widget_t *w, *widget, *wpin, *wdac;
3353 wpin = codec->widget[wid];
3362 widget = wpin;
3363 while (widget) {
3364 if (widget->outamp_cap &
3366 pin->mute_wid = widget->wid_wid;
3370 if (widget->inamp_cap &
3372 pin->mute_wid = widget->wid_wid;
3376 next = widget->output_path_next;
3379 wid = widget->avail_conn[next];
3380 widget = codec->widget[wid];
3381 if (widget && widget->out_weight != weight)
3392 widget = wpin;
3393 while (widget) {
3394 gain = (widget->outamp_cap &
3399 pin->gain_wid = widget->wid_wid;
3401 gain = widget->inamp_cap &
3406 pin->gain_wid = widget->wid_wid;
3408 next = widget->output_path_next;
3411 wid = widget->avail_conn[next];
3412 widget = codec->widget[wid];
3413 if (widget && widget->out_weight != weight)
3432 wdac = codec->widget[path->adda_wid];
3435 w = codec->widget[wid];
3438 w = codec->widget[wid];
3442 widget = w;
3443 while (widget) {
3444 if (widget->outamp_cap &
3446 path->mute_wid = widget->wid_wid;
3451 if (widget->inamp_cap &
3453 path->mute_wid = widget->wid_wid;
3458 next = widget->output_path_next;
3461 wid = widget->avail_conn[next];
3462 widget = codec->widget[wid];
3467 widget = w;
3468 while (widget) {
3469 gain = (widget->outamp_cap &
3475 path->gain_wid = widget->wid_wid;
3477 gain = widget->inamp_cap &
3480 (widget->type != WTYPE_AUDIO_MIX)) {
3484 path->gain_wid = widget->wid_wid;
3486 next = widget->output_path_next;
3489 wid = widget->avail_conn[next];
3490 widget = codec->widget[wid];
3510 audiohd_widget_t *widget;
3522 widget = codec->widget[wid];
3523 pin = (audiohd_pin_t *)widget->priv;
3542 if (widget->outamp_cap) {
3551 widget->output_path_next);
3553 wid = widget->avail_conn[widget->output_path_next];
3554 widget = codec->widget[wid];
3556 while (widget) {
3561 if (widget->outamp_cap) {
3568 if (widget->inamp_cap) {
3574 (widget->output_path_next <<
3578 next = widget->output_path_next;
3585 if ((widget->type == WTYPE_AUDIO_SEL) &&
3586 (widget->nconns > 1))
3590 widget->output_path_next);
3592 wid = widget->avail_conn[next];
3593 widget = codec->widget[wid];
3604 * widget. Only the first real mixer/selector widget is permitted in
3614 audiohd_widget_t *widget = codec->widget[wid];
3624 if (widget == NULL)
3628 if (widget->path_flags & AUDIOHD_PATH_ADC ||
3629 widget->path_flags & AUDIOHD_PATH_DAC)
3632 switch (widget->type) {
3634 pin = (audiohd_pin_t *)widget->priv;
3653 widget->path_flags |= AUDIOHD_PATH_ADC;
3654 widget->in_weight++;
3663 * If the sum widget has only one input, we don't
3664 * consider it as a real sum widget.
3666 if (widget->nconns == 1) {
3667 widget->input_path_next = 0;
3669 widget->avail_conn[0],
3672 widget->path_flags |= AUDIOHD_PATH_ADC;
3673 widget->in_weight++;
3680 * This is a real sum widget, we will reject
3681 * other real sum widget when we find more in
3684 for (int i = 0; i < widget->nconns; i++) {
3686 widget->avail_conn[i], 0, depth + 1,
3689 widget->input_path_next = i;
3690 widget->in_weight++;
3694 widget->path_flags |=
3707 for (i = 0; i < widget->nconns; i++) {
3709 widget->avail_conn[i], 0, depth + 1,
3712 widget->input_path_next = i;
3713 widget->path_flags |= AUDIOHD_PATH_ADC;
3714 widget->in_weight++;
3736 audiohd_widget_t *widget;
3746 widget = codec->widget[wid];
3748 /* check if it is an ADC widget */
3749 if (widget == NULL || widget->type != WTYPE_AUDIO_IN)
3761 * Is there any ADC widget which has more than one input ??
3765 * widget. Because selector cannot perform mixer functionality,
3770 for (i = 0; i < widget->nconns; i++) {
3772 widget->avail_conn[i], 1, 0, path);
3780 widget->input_path_next = i;
3781 widget->priv = path;
3815 wadc = path->codec->widget[wid];
3840 w = path->codec->widget[wid];
3870 w = path->codec->widget[wid];
3880 w = path->codec->widget[wid];
3893 * is the widget's node id.
3896 wsum = path->codec->widget[wid]; /* sum widget */
3900 w = path->codec->widget[wid];
3909 w = path->codec->widget[wid];
3930 w = path->codec->widget[wid];
3937 w = path->codec->widget[wid];
3958 w = path->codec->widget[wid];
3987 w = path->codec->widget[wid];
4014 w = path->codec->widget[wid];
4018 * After exiting from the above loop, the widget pointed
4019 * by w can be a pin widget or select/mixer widget. If it
4020 * is a pin widget, we already finish "select connection"
4030 wsum = path->codec->widget[wid];
4059 w = path->codec->widget[wid];
4090 w = path->codec->widget[wid];
4104 * wid_t id no. of widget being searched
4111 audiohd_widget_t *widget, *w;
4116 widget = codec->widget[wid];
4117 if (widget == NULL)
4120 if (widget->type == WTYPE_PIN) {
4121 pin = (audiohd_pin_t *)widget->priv;
4130 widget->path_flags |= AUDIOHD_PATH_MON;
4136 /* the widget has been visited and can't be directed to input pin */
4137 if (widget->path_flags & AUDIOHD_PATH_NOMON) {
4140 /* the widget has been used by the monitor path, and we can share it */
4141 if (widget->path_flags & AUDIOHD_PATH_MON) {
4147 switch (widget->type) {
4149 for (i = 0; i < widget->nconns; i++) {
4150 if (widget->output_path_next == i)
4153 widget->avail_conn[i], mixer) ==
4155 w = widget;
4163 for (i = 0; i < widget->nconns; i++) {
4164 if (widget->output_path_next == i)
4167 widget->avail_conn[i], mixer) ==
4169 widget->monitor_path_next[0] = i;
4170 widget->path_flags |= AUDIOHD_PATH_MON;
4180 widget->path_flags |= AUDIOHD_PATH_NOMON;
4202 audiohd_widget_t *widget, *w;
4215 widget = codec->widget[wid];
4217 while (widget) {
4218 while (widget &&
4219 ((widget->type != WTYPE_AUDIO_MIX) ||
4220 (widget->nconns < 2))) {
4221 next = widget->output_path_next;
4224 wid = widget->avail_conn[next];
4225 widget = codec->widget[wid];
4233 if (widget == NULL ||
4234 widget->output_path_next ==
4239 for (k = 0; k < widget->nconns; k++) {
4244 * widget, we needn't waste time for
4247 if (widget->output_path_next == k)
4252 widget->avail_conn[k], 0) ==
4255 w = widget;
4264 widget->avail_conn[k], 1) ==
4267 w = widget;
4278 * we needn't check widget->output_path_next
4279 * here since this widget is a selector or
4284 widget->path_flags |=
4287 next = widget->output_path_next;
4288 wid = widget->avail_conn[next];
4289 widget = codec->widget[wid];
4312 audiohd_widget_t *widget = wgt;
4319 if (!widget || widget->finish)
4321 if (widget->path_flags & AUDIOHD_PATH_ADC)
4323 if ((widget->outamp_cap) && !share)
4325 widget->wid_wid, AUDIOHDC_VERB_SET_AMP_MUTE,
4327 if ((widget->inamp_cap) && !share) {
4328 for (i = 0; i < widget->used; i++) {
4330 widget->wid_wid, AUDIOHDC_VERB_SET_AMP_MUTE,
4332 (widget->monitor_path_next[i]
4336 if ((widget->type == WTYPE_AUDIO_SEL) && (widget->nconns > 1) &&
4338 (void) audioha_codec_verb_get(statep, caddr, widget->wid_wid,
4339 AUDIOHDC_VERB_SET_CONN_SEL, widget->monitor_path_next[0]);
4341 widget->finish = 1;
4342 if (widget->used == 0)
4344 if (widget->used > 0) {
4345 for (i = 0; i < widget->used; i++) {
4346 wid = widget->avail_conn[widget->monitor_path_next[i]];
4347 w = codec->widget[wid];
4363 audiohd_widget_t *widget;
4378 widget = codec->widget[wid];
4379 audiohd_do_finish_monitor_path(codec, widget);
4389 * Search for the gain control widget for the monitor path
4393 audiohd_widget_t *widget)
4395 audiohd_widget_t *w = widget;
4428 audiohd_do_build_monitor_amp(codec, pin, codec->widget[wid]);
4438 * Search gain control widget for every ostream monitor
4444 audiohd_widget_t *widget, *w;
4456 w = codec->widget[id];
4462 widget = codec->widget[wid];
4464 widget);
4477 * hda_codec_t *codec where the beep widget exists
4478 * wid_t wid the no. of a widget
4482 * 1) wid of Beep widget;
4488 audiohd_widget_t *widget = codec->widget[wid];
4495 if (widget == NULL)
4498 switch (widget->type) {
4500 widget->path_flags |= AUDIOHD_PATH_BEEP;
4501 wbeep = widget->wid_wid;
4505 for (int i = 0; i < widget->nconns; i++) {
4507 widget->avail_conn[i], depth + 1);
4509 if (widget->output_path_next !=
4512 widget->beep_path_next = i;
4514 widget->path_flags |= AUDIOHD_PATH_BEEP;
4538 audiohd_widget_t *widget;
4558 widget = codec->widget[pin->wid];
4560 widget->inamp_cap = 0;
4561 for (i = 0; i < widget->nconns; i++) {
4564 * widget on the path, or the return value is
4568 widget->avail_conn[i], 0);
4574 if (widget->output_path_next != AUDIOHD_NULL_CONN)
4580 path->pin_wid[0] = widget->wid_wid;
4586 widget->path_flags |= AUDIOHD_PATH_BEEP;
4587 widget->beep_path_next = i;
4600 widget = codec->widget[wid];
4602 if (widget->type == WTYPE_BEEP) {
4612 widget->path_flags |= AUDIOHD_PATH_BEEP;
4625 * Find the gain control and mute control widget
4631 audiohd_widget_t *widget, *wpin, *wbeep;
4644 wbeep = codec->widget[path->beep_wid];
4657 wpin = codec->widget[wid];
4658 wbeep = codec->widget[path->beep_wid];
4660 widget = wpin;
4661 while (widget) {
4662 if (widget->out_weight == 0 &&
4663 widget->outamp_cap &
4665 path->mute_wid = widget->wid_wid;
4670 next = widget->beep_path_next;
4673 wid = widget->avail_conn[next];
4674 widget = codec->widget[wid];
4678 widget = wpin;
4679 while (widget) {
4680 if (widget->out_weight == 0 &&
4681 widget->outamp_cap &
4683 gain = (widget->outamp_cap &
4690 widget->wid_wid;
4693 next = widget->beep_path_next;
4696 wid = widget->avail_conn[next];
4697 widget = codec->widget[wid];
4715 audiohd_widget_t *widget;
4725 widget = codec->widget[path->beep_wid];
4726 if (widget->outamp_cap) {
4733 if (widget->inamp_cap) {
4739 (widget->beep_path_next <<
4747 widget = codec->widget[wid];
4750 AUDIOHDC_VERB_SET_CONN_SEL, widget->beep_path_next);
4752 wid = widget->avail_conn[widget->beep_path_next];
4753 widget = codec->widget[wid];
4755 while (widget) {
4760 if (widget->out_weight != 0)
4762 if (widget->outamp_cap) {
4769 if (widget->inamp_cap) {
4775 (widget->beep_path_next <<
4779 next = widget->beep_path_next;
4786 if ((widget->type != WTYPE_AUDIO_MIX) &&
4787 (widget->nconns > 1))
4791 widget->beep_path_next);
4793 wid = widget->avail_conn[next];
4794 widget = codec->widget[wid];
4804 audiohd_widget_t *widget = codec->widget[wid];
4810 if (widget == NULL)
4813 switch (widget->type) {
4815 pin = (audiohd_pin_t *)widget->priv;
4827 widget->path_flags |= AUDIOHD_PATH_LOOPBACK;
4828 widget->in_weight++;
4840 * If the sum widget has only one input, we don't
4841 * consider it as a real sum widget.
4843 if (widget->nconns == 1) {
4844 widget->loopback_path_next = 0;
4846 widget->avail_conn[0], depth + 1, path);
4848 widget->path_flags |= AUDIOHD_PATH_LOOPBACK;
4849 widget->in_weight++;
4854 for (int i = 0; i < widget->nconns; i++) {
4856 widget->avail_conn[i], depth + 1, path);
4858 widget->loopback_path_next = i;
4859 widget->in_weight++;
4863 widget->path_flags |= AUDIOHD_PATH_LOOPBACK;
4879 audiohd_widget_t *widget;
4886 widget = codec->widget[wid];
4888 /* check if it is an ADC widget */
4889 if (widget == NULL || widget->type != WTYPE_AUDIO_IN)
4898 for (i = 0; i < widget->nconns; i++) {
4900 widget->avail_conn[i], 0, path);
4908 widget->loopback_path_next = i;
4909 widget->priv = path;
5211 * This routine is used to change the widget power betwen D0 and D2.
5221 audiohd_widget_t *widget;
5229 widget = codec->widget[wid];
5230 if (widget->widget_cap &
5273 audiohd_widget_t *widget;
5284 widget = codec->widget[pin->wid];
5285 if ((widget->widget_cap &
5363 /* set widget power to D0 */
5386 /* set widget power to D2 */
5438 audiohd_widget_t *widget;
5450 widget = path->codec->widget[wid];
5451 pin = (audiohd_pin_t *)widget->priv;
5462 widget = path->codec->widget[wid];
5463 pin = (audiohd_pin_t *)widget->priv;
5487 audiohd_widget_t *widget, *sumwgt = NULL;
5500 sumwgt = codec->widget[path->sum_wid];
5504 widget = codec->widget[wid];
5505 pin = (audiohd_pin_t *)widget->priv;
5545 * No selector widget in the path,
5593 widget = codec->widget[wid];
5594 if (widget == NULL)
5596 pin = (audiohd_pin_t *)widget->priv;
5636 audiohd_widget_t *widget;
5646 widget = codec->widget[id];
5647 if (widget == NULL)
5654 if ((widget->type == WTYPE_PIN) &&
5655 (pin = (audiohd_pin_t *)widget->priv) &&
5667 if ((widget->type == WTYPE_PIN) &&
5668 (pin = (audiohd_pin_t *)widget->priv) &&