Changes in uspace/drv/audio/hdaudio/codec.c [0e4c5f0:fff4f21] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/codec.c
r0e4c5f0 rfff4f21 437 437 } 438 438 439 if ((pcaps & BIT_V(uint32_t, pwc_input)) != 0) {440 ddf_msg(LVL_NOTE, "PIN %d will enable input", aw);441 pctl = pctl | BIT_V(uint8_t, pctl_in_enable);442 }443 444 439 if ((pcaps & BIT_V(uint32_t, pwc_hpd)) != 0) { 445 440 ddf_msg(LVL_NOTE, "PIN %d will enable headphone drive", aw); … … 508 503 codec->hda = hda; 509 504 codec->address = address; 510 codec->in_aw = -1;511 505 512 506 rc = hda_get_subnc(codec, 0, &sfg, &nfg); … … 593 587 ddf_msg(LVL_NOTE, "Output widget %d: rates=0x%x formats=0x%x", 594 588 aw, rates, formats); 595 } else if (awtype == awt_audio_input) {596 if (codec->in_aw < 0) {597 ddf_msg(LVL_NOTE, "Selected input "598 "widget %d\n", aw);599 codec->in_aw = aw;600 } else {601 ddf_msg(LVL_NOTE, "Ignoring input "602 "widget %d\n", aw);603 }604 605 rc = hda_get_supp_rates(codec, aw, &rates);606 if (rc != EOK)607 goto error;608 609 rc = hda_get_supp_formats(codec, aw, &formats);610 if (rc != EOK)611 goto error;612 613 ddf_msg(LVL_NOTE, "Input widget %d: rates=0x%x formats=0x%x",614 aw, rates, formats);615 589 } 616 590 … … 649 623 /* Configure converter */ 650 624 651 ddf_msg(LVL_NOTE, "Configure outputconverter format");625 ddf_msg(LVL_NOTE, "Configure converter format"); 652 626 rc = hda_set_converter_fmt(codec, out_aw, stream->fmt); 653 627 if (rc != EOK) 654 628 goto error; 655 629 656 ddf_msg(LVL_NOTE, "Configure outputconverter stream, channel");630 ddf_msg(LVL_NOTE, "Configure converter stream, channel"); 657 631 rc = hda_set_converter_ctl(codec, out_aw, stream->sid, 0); 658 632 if (rc != EOK) 659 633 goto error; 660 634 } 661 662 return EOK;663 error:664 return rc;665 }666 667 int hda_in_converter_setup(hda_codec_t *codec, hda_stream_t *stream)668 {669 int rc;670 671 /* Configure converter */672 673 ddf_msg(LVL_NOTE, "Configure input converter format");674 rc = hda_set_converter_fmt(codec, codec->in_aw, stream->fmt);675 if (rc != EOK)676 goto error;677 678 ddf_msg(LVL_NOTE, "Configure input converter stream, channel");679 rc = hda_set_converter_ctl(codec, codec->in_aw, stream->sid, 0);680 if (rc != EOK)681 goto error;682 635 683 636 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.