Changes in uspace/drv/audio/hdaudio/codec.c [cf78637:0d59ea7e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/codec.c
rcf78637 r0d59ea7e 1 1 /* 2 * Copyright (c) 20 14Jiri Svoboda2 * Copyright (c) 2022 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 512 512 codec->address = address; 513 513 codec->in_aw = -1; 514 codec->out_aw = -1; 514 515 515 516 rc = hda_get_subnc(codec, 0, &sfg, &nfg); … … 584 585 goto error; 585 586 } else if (awtype == awt_audio_output) { 586 codec->out_aw_list[codec->out_aw_num++] = aw;587 588 587 rc = hda_get_supp_rates(codec, aw, &rates); 589 588 if (rc != EOK) … … 594 593 goto error; 595 594 596 ddf_msg(LVL_DEBUG, "Output widget %d: rates=0x%x formats=0x%x", 595 if (rates != 0 && formats != 0 && 596 codec->out_aw < 0) { 597 ddf_msg(LVL_DEBUG, "Selected output " 598 "widget %d\n", aw); 599 codec->out_aw = aw; 600 } else { 601 ddf_msg(LVL_DEBUG, "Ignoring output " 602 "widget %d\n", aw); 603 } 604 605 ddf_msg(LVL_NOTE, "Output widget %d: rates=0x%x formats=0x%x", 597 606 aw, rates, formats); 607 codec->out_aw_rates = rates; 608 codec->out_aw_formats = formats; 598 609 } else if (awtype == awt_audio_input) { 599 610 if (codec->in_aw < 0) { … … 616 627 ddf_msg(LVL_DEBUG, "Input widget %d: rates=0x%x formats=0x%x", 617 628 aw, rates, formats); 629 codec->in_aw_rates = rates; 630 codec->in_aw_formats = formats; 618 631 } 619 632 … … 644 657 { 645 658 errno_t rc; 646 int out_aw; 647 int i; 648 649 for (i = 0; i < codec->out_aw_num; i++) { 650 out_aw = codec->out_aw_list[i]; 651 652 /* Configure converter */ 653 654 ddf_msg(LVL_DEBUG, "Configure output converter format"); 655 rc = hda_set_converter_fmt(codec, out_aw, stream->fmt); 656 if (rc != EOK) 657 goto error; 658 659 ddf_msg(LVL_DEBUG, "Configure output converter stream, channel"); 660 rc = hda_set_converter_ctl(codec, out_aw, stream->sid, 0); 661 if (rc != EOK) 662 goto error; 663 } 659 660 /* Configure converter */ 661 ddf_msg(LVL_DEBUG, "Configure output converter format / %d", 662 codec->out_aw); 663 rc = hda_set_converter_fmt(codec, codec->out_aw, stream->fmt); 664 if (rc != EOK) 665 goto error; 666 667 ddf_msg(LVL_DEBUG, "Configure output converter stream, channel"); 668 rc = hda_set_converter_ctl(codec, codec->out_aw, stream->sid, 0); 669 if (rc != EOK) 670 goto error; 664 671 665 672 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.