Changeset 94e46c9 in mainline for uspace/drv/audio/hdaudio/codec.c
- Timestamp:
- 2015-05-23T04:09:11Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b5143bd
- Parents:
- a25d893 (diff), 0683992 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/codec.c
ra25d893 r94e46c9 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 439 444 if ((pcaps & BIT_V(uint32_t, pwc_hpd)) != 0) { 440 445 ddf_msg(LVL_NOTE, "PIN %d will enable headphone drive", aw); … … 503 508 codec->hda = hda; 504 509 codec->address = address; 510 codec->in_aw = -1; 505 511 506 512 rc = hda_get_subnc(codec, 0, &sfg, &nfg); … … 587 593 ddf_msg(LVL_NOTE, "Output widget %d: rates=0x%x formats=0x%x", 588 594 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); 589 615 } 590 616 … … 623 649 /* Configure converter */ 624 650 625 ddf_msg(LVL_NOTE, "Configure converter format");651 ddf_msg(LVL_NOTE, "Configure output converter format"); 626 652 rc = hda_set_converter_fmt(codec, out_aw, stream->fmt); 627 653 if (rc != EOK) 628 654 goto error; 629 655 630 ddf_msg(LVL_NOTE, "Configure converter stream, channel");656 ddf_msg(LVL_NOTE, "Configure output converter stream, channel"); 631 657 rc = hda_set_converter_ctl(codec, out_aw, stream->sid, 0); 632 658 if (rc != EOK) 633 659 goto error; 634 660 } 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; 635 682 636 683 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.