Lines Matching refs:codec

353 		    "couldn't create codec");
578 hda_codec_t *codec = path->codec;
583 widget = codec->widget[wid];
588 codec->index,
597 codec->index,
602 * We find that on intel ICH10 chipset with codec
607 if (codec->codec_info->flags & NO_SPDIF)
612 widget = codec->widget[wid];
621 codec->index,
628 codec->index,
655 codec->index,
663 codec->index,
674 hda_codec_t *codec = path->codec;
682 widget = codec->widget[wid];
692 codec->index,
701 codec->index,
722 codec->index,
728 codec->index,
1029 path->codec->index,
1042 path->codec->index,
1049 path->codec->index,
1059 path->codec->index,
1067 path->codec->index,
1084 hda_codec_t *codec;
1131 codec = path->codec;
1134 widget = codec->widget[wid];
1153 hda_codec_t *codec;
1195 codec = path->codec;
1198 widget = codec->widget[wid];
1213 hda_codec_t *codec;
1234 widget = path->codec->widget[wid];
1239 path->codec->index, pin->wid);
1241 codec = path->codec;
1245 path->codec->index, pin->wid);
1257 w = codec->widget[pin_wid];
1259 w = codec->widget[pin->adc_wid];
1267 w = codec->widget[path->sum_wid];
1272 statep, codec->index, path->sum_wid,
1285 audiohd_set_pin_monitor_gain(hda_codec_t *codec, audiohd_state_t *statep,
1299 widget = codec->widget[pin->mg_wid[k]];
1359 caddr = path->codec->index;
1362 w = path->codec->widget[wid];
1364 audiohd_set_pin_monitor_gain(path->codec, statep,
1376 hda_codec_t *codec;
1388 codec = path->codec;
1389 vid = codec->vid;
1395 * Sigmatel HD codec specific operation.
1397 * Due to Sigmatel HD codec hardware problem,
1409 codec->index,
1435 path->codec->index,
1449 path->codec->index,
1456 path->codec->index,
1465 path->codec->index,
1473 path->codec->index,
1661 widget = path->codec->widget[wid];
1667 path->codec->index, wid,
1670 path->codec->index, wid,
1676 path->codec->index,
1685 path->codec->index, wid,
1688 path->codec->index, wid,
1886 hda_codec_t *codec;
1901 codec = path->codec;
1905 widget = codec->widget[wid];
1955 widget = codec->widget[path->beep_wid];
2009 hda_codec_t *codec = ((audiohd_widget_t *)arg)->codec;
2010 audiohd_state_t *statep = codec->statep;
2011 int caddr = codec->index;
2023 hda_codec_t *codec = ((audiohd_widget_t *)arg)->codec;
2024 audiohd_state_t *statep = codec->statep;
2025 int caddr = codec->index;
2037 hda_codec_t *codec = ((audiohd_widget_t *)arg)->codec;
2038 audiohd_state_t *statep = codec->statep;
2039 uint32_t vid = codec->vid >> 16;
2054 * Sigmatel HD codec specification:
2385 * This routine is used to re-initialize HD controller and codec.
2485 /* check codec */
2489 "no codec exists");
2558 audiohd_get_conns_from_entry(hda_codec_t *codec, audiohd_widget_t *widget,
2571 if (input_wid < codec->first_wid ||
2572 (input_wid > codec->last_wid)) {
2582 if (k < codec->first_wid ||
2583 (k > codec->last_wid)) {
2593 if ((codec->first_wid <= input_wid) && (input_wid <=
2594 codec->last_wid))
2609 audiohd_get_conns(hda_codec_t *codec, wid_t wid)
2611 audiohd_state_t *statep = codec->statep;
2612 audiohd_widget_t *widget = codec->widget[wid];
2613 uint8_t caddr = codec->index;
2651 if ((input_wid < codec->first_wid) ||
2652 (input_wid > codec->last_wid)) {
2663 audiohd_get_conns_from_entry(codec, widget, entry, &prop);
2673 hda_codec_t *codec = widget->codec;
2674 audiohd_state_t *statep = codec->statep;
2677 int caddr = codec->index;
2735 if (codec->first_pin == NULL) {
2736 codec->first_pin = pin;
2739 p = codec->first_pin;
2753 pin->next = codec->first_pin;
2754 codec->first_pin = pin;
2764 * All widgets are created and stored in an array of codec
2767 audiohd_create_widgets(hda_codec_t *codec)
2770 audiohd_state_t *statep = codec->statep;
2773 int caddr = codec->index;
2775 for (wid = codec->first_wid;
2776 wid <= codec->last_wid; wid++) {
2779 codec->widget[wid] = widget;
2780 widget->codec = codec;
2797 audiohd_get_conns(codec, wid);
2815 widget->pcm_format = codec->pcm_format;
2828 widget->inamp_cap = codec->inamp_cap;
2843 widget->outamp_cap = codec->outamp_cap;
2864 * Some codec(like ALC262) don't provide beep widget,
2870 if ((codec->codec_info->flags & EN_PIN_BEEP) == 0) {
2910 audiohd_destroy_widgets(hda_codec_t *codec)
2913 if (codec->widget[i]) {
2914 kmem_free(codec->widget[i], sizeof (audiohd_widget_t));
2915 codec->widget[i] = NULL;
2926 * to hold codec structure.
2931 hda_codec_t *codec;
2947 codec = (hda_codec_t *)kmem_zalloc(
2949 codec->index = i;
2950 codec->vid = audioha_codec_verb_get(statep, i,
2953 if (codec->vid == (uint32_t)(-1)) {
2954 kmem_free(codec, sizeof (hda_codec_t));
2958 codec->revid =
2967 kmem_free(codec, sizeof (hda_codec_t));
2974 * Assume that each codec has just one audio function group
2982 codec->wid_afg = wid;
2987 if (codec->wid_afg == 0) {
2988 kmem_free(codec, sizeof (hda_codec_t));
2992 ASSERT(codec->wid_afg == wid);
2996 if (audiohd_codecs[j].devid == codec->vid) {
2997 codec->codec_info = &(audiohd_codecs[j]);
3002 if (codec->codec_info == NULL) {
3003 codec->codec_info = &(audiohd_codecs[len-1]);
3005 "Unknown HD codec: 0x%x", codec->vid);
3007 (void) snprintf(buf, sizeof (buf), "HD codec: %s",
3008 codec->codec_info->buf);
3012 /* work around for Sony VAIO laptop with specific codec */
3013 if ((codec->codec_info->flags & NO_GPIO) == 0) {
3039 codec->outamp_cap = audioha_codec_verb_get(statep, i, wid,
3041 codec->inamp_cap = audioha_codec_verb_get(statep, i, wid,
3043 codec->stream_format = audioha_codec_verb_get(statep, i, wid,
3045 codec->pcm_format = audioha_codec_verb_get(statep, i, wid,
3052 (codec->pcm_format & AUDIOHD_SAMP_RATE192)) {
3055 (codec->pcm_format & AUDIOHD_SAMP_RATE96)) {
3065 (codec->pcm_format & AUDIOHD_BIT_DEPTH24)) {
3076 codec->first_wid = wid;
3077 codec->last_wid = wid + nums;
3078 codec->nnodes = nums;
3081 * We output the codec information to syslog
3083 statep->codec[i] = codec;
3084 codec->statep = statep;
3085 (void) audiohd_create_widgets(codec);
3096 * destroy codec structure, and release its memory
3105 if (statep->codec[i]) {
3106 audiohd_destroy_widgets(statep->codec[i]);
3110 pin = statep->codec[i]->first_pin;
3117 kmem_free(statep->codec[i], sizeof (hda_codec_t));
3118 statep->codec[i] = NULL;
3130 * hda_codec_t *codec where the dac widget exists
3144 audiohd_find_dac(hda_codec_t *codec, wid_t wid,
3148 audiohd_widget_t *widget = codec->widget[wid];
3185 retval = audiohd_find_dac(codec,
3213 * Search an output path for each pin in the codec.
3215 * hda_codec_t *codec where the output path exists
3222 audiohd_do_build_output_path(hda_codec_t *codec, int mixer, int *mnum,
3232 statep = codec->statep;
3234 for (pin = codec->first_pin; pin; pin = pin->next) {
3247 widget = codec->widget[pin->wid];
3256 wid = audiohd_find_dac(codec,
3274 path->codec = codec;
3276 wdac = codec->widget[wid];
3294 * Build the output path in the codec for every pin.
3301 audiohd_build_output_path(hda_codec_t *codec)
3312 if (codec->codec_info->flags & NO_MIXER)
3316 audiohd_do_build_output_path(codec, mixer_allow, &mnum, 1, 0);
3319 audiohd_do_build_output_path(codec, mixer_allow, &mnum, 0, 0);
3322 audiohd_do_build_output_path(codec, 0, &mnum, 1, 0);
3325 audiohd_do_build_output_path(codec, 0, &mnum, 0, 0);
3336 audiohd_build_output_amp(hda_codec_t *codec)
3346 for (i = 0; i < codec->statep->pathnum; i++) {
3347 path = codec->statep->path[i];
3349 path->codec != codec)
3353 wpin = codec->widget[wid];
3380 widget = codec->widget[wid];
3412 widget = codec->widget[wid];
3432 wdac = codec->widget[path->adda_wid];
3435 w = codec->widget[wid];
3438 w = codec->widget[wid];
3462 widget = codec->widget[wid];
3490 widget = codec->widget[wid];
3506 audiohd_finish_output_path(hda_codec_t *codec)
3508 audiohd_state_t *statep = codec->statep;
3512 uint_t caddr = codec->index;
3516 for (i = 0; i < codec->statep->pathnum; i++) {
3517 path = codec->statep->path[i];
3518 if (!path || path->path_type != PLAY || path->codec != codec)
3522 widget = codec->widget[wid];
3554 widget = codec->widget[wid];
3593 widget = codec->widget[wid];
3611 audiohd_find_input_pins(hda_codec_t *codec, wid_t wid, int allowmixer,
3614 audiohd_widget_t *widget = codec->widget[wid];
3616 audiohd_state_t *statep = codec->statep;
3617 uint_t caddr = codec->index;
3668 retval = audiohd_find_input_pins(codec,
3685 retval = audiohd_find_input_pins(codec,
3708 retval = audiohd_find_input_pins(codec,
3731 * Find input path for the codec
3734 audiohd_build_input_path(hda_codec_t *codec)
3742 audiohd_state_t *statep = codec->statep;
3744 for (wid = codec->first_wid; wid <= codec->last_wid; wid++) {
3746 widget = codec->widget[wid];
3771 retval = audiohd_find_input_pins(codec,
3774 path->codec = codec;
3778 codec->nistream++;
3798 audiohd_build_input_amp(hda_codec_t *codec)
3808 for (i = 0; i < codec->statep->pathnum; i++) {
3809 path = codec->statep->path[i];
3811 path->codec != codec)
3815 wadc = path->codec->widget[wid];
3840 w = path->codec->widget[wid];
3870 w = path->codec->widget[wid];
3880 w = path->codec->widget[wid];
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];
3972 audiohd_finish_input_path(hda_codec_t *codec)
3974 audiohd_state_t *statep = codec->statep;
3977 uint_t caddr = codec->index;
3981 for (i = 0; i < codec->statep->pathnum; i++) {
3982 path = codec->statep->path[i];
3984 path->codec != codec)
3987 w = path->codec->widget[wid];
4014 w = path->codec->widget[wid];
4030 wsum = path->codec->widget[wid];
4059 w = path->codec->widget[wid];
4090 w = path->codec->widget[wid];
4103 * hda_codec_t *codec where the monitor path exists
4108 audiohd_find_inpin_for_monitor(hda_codec_t *codec, wid_t id, int mixer)
4116 widget = codec->widget[wid];
4152 if (audiohd_find_inpin_for_monitor(codec,
4166 if (audiohd_find_inpin_for_monitor(codec,
4199 audiohd_build_monitor_path(hda_codec_t *codec)
4203 audiohd_state_t *statep = codec->statep;
4210 if (path == NULL || path->codec != codec ||
4215 widget = codec->widget[wid];
4225 widget = codec->widget[wid];
4251 codec,
4263 codec,
4289 widget = codec->widget[wid];
4309 audiohd_do_finish_monitor_path(hda_codec_t *codec, audiohd_widget_t *wgt)
4311 uint_t caddr = codec->index;
4314 audiohd_state_t *statep = codec->statep;
4347 w = codec->widget[wid];
4348 audiohd_do_finish_monitor_path(codec, w);
4360 audiohd_finish_monitor_path(hda_codec_t *codec)
4364 audiohd_state_t *statep = codec->statep;
4370 if (!path || path->codec != codec || path->path_type != PLAY)
4378 widget = codec->widget[wid];
4379 audiohd_do_finish_monitor_path(codec, widget);
4392 audiohd_do_build_monitor_amp(hda_codec_t *codec, audiohd_pin_t *pin,
4428 audiohd_do_build_monitor_amp(codec, pin, codec->widget[wid]);
4441 audiohd_build_monitor_amp(hda_codec_t *codec)
4445 audiohd_state_t *statep = codec->statep;
4452 if (!path || path->codec != codec || path->path_type != PLAY)
4456 w = codec->widget[id];
4462 widget = codec->widget[wid];
4463 audiohd_do_build_monitor_amp(codec, pin,
4477 * hda_codec_t *codec where the beep widget exists
4486 audiohd_find_beep(hda_codec_t *codec, wid_t wid, int depth)
4488 audiohd_widget_t *widget = codec->widget[wid];
4506 retval = audiohd_find_beep(codec,
4530 * Search an beep path for each pin in the codec.
4532 * hda_codec_t *codec where the beep path exists
4535 audiohd_build_beep_path(hda_codec_t *codec)
4545 statep = codec->statep;
4547 for (pin = codec->first_pin; pin; pin = pin->next) {
4558 widget = codec->widget[pin->wid];
4567 wid = audiohd_find_beep(codec,
4584 path->codec = codec;
4595 codec = statep->codec[i];
4596 if (codec == NULL)
4598 for (wid = codec->first_wid; wid <= codec->last_wid;
4600 widget = codec->widget[wid];
4610 path->codec = codec;
4628 audiohd_build_beep_amp(hda_codec_t *codec)
4636 for (i = 0; i < codec->statep->pathnum; i++) {
4637 path = codec->statep->path[i];
4639 path->codec != codec)
4644 wbeep = codec->widget[path->beep_wid];
4657 wpin = codec->widget[wid];
4658 wbeep = codec->widget[path->beep_wid];
4674 widget = codec->widget[wid];
4697 widget = codec->widget[wid];
4711 audiohd_finish_beep_path(hda_codec_t *codec)
4713 audiohd_state_t *statep = codec->statep;
4716 uint_t caddr = codec->index;
4720 for (i = 0; i < codec->statep->pathnum; i++) {
4721 path = codec->statep->path[i];
4722 if (!path || path->path_type != BEEP || path->codec != codec)
4725 widget = codec->widget[path->beep_wid];
4747 widget = codec->widget[wid];
4753 widget = codec->widget[wid];
4794 widget = codec->widget[wid];
4801 audiohd_find_output_pins(hda_codec_t *codec, wid_t wid, int depth,
4804 audiohd_widget_t *widget = codec->widget[wid];
4845 retval = audiohd_find_output_pins(codec,
4855 retval = audiohd_find_output_pins(codec,
4876 audiohd_build_loopback_path(hda_codec_t *codec)
4878 audiohd_state_t *statep = codec->statep;
4885 for (wid = codec->first_wid; wid <= codec->last_wid; wid++) {
4886 widget = codec->widget[wid];
4899 retval = audiohd_find_output_pins(codec,
4902 path->codec = codec;
4906 codec->nistream++;
4936 if (statep->codec[i]) {
4937 audiohd_build_output_path(statep->codec[i]);
4938 audiohd_build_output_amp(statep->codec[i]);
4939 audiohd_finish_output_path(statep->codec[i]);
4941 audiohd_build_input_path(statep->codec[i]);
4942 audiohd_build_input_amp(statep->codec[i]);
4943 audiohd_finish_input_path(statep->codec[i]);
4945 audiohd_build_monitor_path(statep->codec[i]);
4946 audiohd_build_monitor_amp(statep->codec[i]);
4947 audiohd_finish_monitor_path(statep->codec[i]);
4949 audiohd_build_beep_path(statep->codec[i]);
4950 audiohd_build_beep_amp(statep->codec[i]);
4951 audiohd_finish_beep_path(statep->codec[i]);
4953 audiohd_build_loopback_path(statep->codec[i]);
5220 hda_codec_t *codec;
5224 codec = statep->codec[i];
5225 if (codec == NULL)
5227 for (wid = codec->first_wid; wid <= codec->last_wid;
5229 widget = codec->widget[wid];
5233 codec->index, wid,
5243 * This routine is used to restore the path on the codec.
5249 hda_codec_t *codec;
5252 codec = statep->codec[i];
5253 if (codec == NULL)
5255 audiohd_finish_output_path(statep->codec[i]);
5256 audiohd_finish_input_path(statep->codec[i]);
5257 audiohd_finish_monitor_path(statep->codec[i]);
5258 audiohd_finish_beep_path(statep->codec[i]);
5271 hda_codec_t *codec;
5278 codec = statep->codec[i];
5279 if (codec == NULL)
5281 pin = codec->first_pin;
5284 widget = codec->widget[pin->wid];
5296 codec->index,
5309 hda_codec_t *codec;
5312 codec = statep->codec[i];
5313 if (codec == NULL)
5315 wid = codec->wid_afg;
5321 /* work around for Sony VAIO laptop with specific codec */
5322 if ((codec->codec_info->flags & NO_GPIO) == 0) {
5450 widget = path->codec->widget[wid];
5454 path->codec->index,
5462 widget = path->codec->widget[wid];
5466 path->codec->index,
5485 hda_codec_t *codec;
5492 codec = statep->codec[index];
5493 if (codec == NULL)
5498 if (path->codec != codec || path->path_type != RECORD)
5500 sumwgt = codec->widget[path->sum_wid];
5504 widget = codec->widget[wid];
5557 statep, path->codec->index,
5569 statep, path->codec->index,
5586 if (codec->nistream > 1) {
5593 widget = codec->widget[wid];
5638 hda_codec_t *codec;
5643 codec = statep->codec[index];
5644 if (codec == NULL)
5646 widget = codec->widget[id];
5860 "response from codec: wid=%d, verb=0x%04x, param=0x%04x",
5902 "response from codec: wid=%d, verb=0x%04x, param=0x%04x",