Changeset cf78637 in mainline for uspace/drv/audio/hdaudio/codec.c
- Timestamp:
- 2019-12-15T11:57:25Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9e45a41
- Parents:
- 894afff
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/codec.c
r894afff rcf78637 70 70 #if 0 71 71 if (resp != NULL) { 72 ddf_msg(LVL_ NOTE, "verb 0x%" PRIx32 " -> 0x%" PRIx32, verb,72 ddf_msg(LVL_DEBUG, "verb 0x%" PRIx32 " -> 0x%" PRIx32, verb, 73 73 *resp); 74 74 } else { 75 ddf_msg(LVL_ NOTE, "verb 0x%" PRIx32, verb);75 ddf_msg(LVL_DEBUG, "verb 0x%" PRIx32, verb); 76 76 } 77 77 #endif … … 273 273 274 274 offset = ampcaps & 0x7f; 275 ddf_msg(LVL_ NOTE, "out amp caps 0x%x (offset=0x%x)",275 ddf_msg(LVL_DEBUG, "out amp caps 0x%x (offset=0x%x)", 276 276 ampcaps, offset); 277 277 … … 288 288 goto error; 289 289 290 ddf_msg(LVL_ NOTE, "gain/mute: L:0x%x R:0x%x", gmleft, gmright);290 ddf_msg(LVL_DEBUG, "gain/mute: L:0x%x R:0x%x", gmleft, gmright); 291 291 292 292 return EOK; … … 309 309 310 310 offset = ampcaps & 0x7f; 311 ddf_msg(LVL_ NOTE, "in amp caps 0x%x (offset=0x%x)", ampcaps, offset);311 ddf_msg(LVL_DEBUG, "in amp caps 0x%x (offset=0x%x)", ampcaps, offset); 312 312 313 313 for (i = 0; i < 15; i++) { … … 324 324 goto error; 325 325 326 ddf_msg(LVL_ NOTE, "in:%d gain/mute: L:0x%x R:0x%x",326 ddf_msg(LVL_DEBUG, "in:%d gain/mute: L:0x%x R:0x%x", 327 327 i, gmleft, gmright); 328 328 } … … 345 345 int i, j; 346 346 347 ddf_msg(LVL_ NOTE, "Connections for widget %d:", aw);347 ddf_msg(LVL_DEBUG, "Connections for widget %d:", aw); 348 348 349 349 rc = hda_get_clist_len(codec, aw, &longform, &len); … … 384 384 385 385 for (j = 0; j < epresp && i < len; j++) { 386 ddf_msg(LVL_ NOTE, "<- %d%s", resp & mask,386 ddf_msg(LVL_DEBUG, "<- %d%s", resp & mask, 387 387 (int)cidx == i ? " *** current *** " : ""); 388 388 resp = resp >> shift; … … 406 406 if (rc != EOK) 407 407 goto error; 408 ddf_msg(LVL_ NOTE, "aw %d: PIN cdfgef=0x%x",408 ddf_msg(LVL_DEBUG, "aw %d: PIN cdfgef=0x%x", 409 409 aw, cfgdef); 410 410 … … 412 412 if (rc != EOK) 413 413 goto error; 414 ddf_msg(LVL_ NOTE, "aw %d : PIN caps=0x%x",414 ddf_msg(LVL_DEBUG, "aw %d : PIN caps=0x%x", 415 415 aw, pcaps); 416 416 … … 420 420 goto error; 421 421 422 ddf_msg(LVL_ NOTE, "PIN %d had EAPD value=0x%x", aw, eapd);422 ddf_msg(LVL_DEBUG, "PIN %d had EAPD value=0x%x", aw, eapd); 423 423 424 424 rc = hda_set_eapd_btl_enable(codec, aw, eapd | 2); … … 430 430 goto error; 431 431 432 ddf_msg(LVL_ NOTE, "PIN %d now has EAPD value=0x%x", aw, eapd);432 ddf_msg(LVL_DEBUG, "PIN %d now has EAPD value=0x%x", aw, eapd); 433 433 } 434 434 435 435 pctl = 0; 436 436 if ((pcaps & BIT_V(uint32_t, pwc_output)) != 0) { 437 ddf_msg(LVL_ NOTE, "PIN %d will enable output", aw);437 ddf_msg(LVL_DEBUG, "PIN %d will enable output", aw); 438 438 pctl = pctl | BIT_V(uint8_t, pctl_out_enable); 439 439 } 440 440 441 441 if ((pcaps & BIT_V(uint32_t, pwc_input)) != 0) { 442 ddf_msg(LVL_ NOTE, "PIN %d will enable input", aw);442 ddf_msg(LVL_DEBUG, "PIN %d will enable input", aw); 443 443 pctl = pctl | BIT_V(uint8_t, pctl_in_enable); 444 444 } 445 445 446 446 if ((pcaps & BIT_V(uint32_t, pwc_hpd)) != 0) { 447 ddf_msg(LVL_ NOTE, "PIN %d will enable headphone drive", aw);447 ddf_msg(LVL_DEBUG, "PIN %d will enable headphone drive", aw); 448 448 pctl = pctl | BIT_V(uint8_t, pctl_hpd_enable); 449 449 } … … 451 451 #if 0 452 452 if ((pcaps & BIT_V(uint32_t, pwc_input)) != 0) { 453 ddf_msg(LVL_ NOTE, "PIN %d will enable input");453 ddf_msg(LVL_DEBUG, "PIN %d will enable input"); 454 454 pctl = pctl | BIT_V(uint8_t, pctl_input_enable); 455 455 } 456 456 #endif 457 ddf_msg(LVL_ NOTE, "Setting PIN %d ctl to 0x%x", aw, pctl);457 ddf_msg(LVL_DEBUG, "Setting PIN %d ctl to 0x%x", aw, pctl); 458 458 rc = hda_set_pin_ctl(codec, aw, pctl); 459 459 if (rc != EOK) … … 465 465 goto error; 466 466 467 ddf_msg(LVL_ NOTE, "PIN %d ctl reads as 0x%x", aw, pctl);467 ddf_msg(LVL_DEBUG, "PIN %d ctl reads as 0x%x", aw, pctl); 468 468 469 469 return EOK; … … 478 478 uint32_t pwrstate; 479 479 480 ddf_msg(LVL_ NOTE, "aw %d is power control-capable", aw);480 ddf_msg(LVL_DEBUG, "aw %d is power control-capable", aw); 481 481 482 482 rc = hda_get_power_state(codec, aw, &pwrstate); 483 483 if (rc != EOK) 484 484 goto error; 485 ddf_msg(LVL_ NOTE, "aw %d: power state = 0x%x", aw, pwrstate);485 ddf_msg(LVL_DEBUG, "aw %d: power state = 0x%x", aw, pwrstate); 486 486 487 487 return EOK; … … 517 517 goto error; 518 518 519 ddf_msg(LVL_ NOTE, "hda_get_subnc -> %s", str_error_name(rc));520 ddf_msg(LVL_ NOTE, "sfg=%d nfg=%d", sfg, nfg);519 ddf_msg(LVL_DEBUG, "hda_get_subnc -> %s", str_error_name(rc)); 520 ddf_msg(LVL_DEBUG, "sfg=%d nfg=%d", sfg, nfg); 521 521 522 522 for (fg = sfg; fg < sfg + nfg; fg++) { 523 ddf_msg(LVL_ NOTE, "Enumerate FG %d", fg);523 ddf_msg(LVL_DEBUG, "Enumerate FG %d", fg); 524 524 525 525 rc = hda_get_fgrp_type(codec, fg, &unsol, &grptype); … … 527 527 goto error; 528 528 529 ddf_msg(LVL_ NOTE, "hda_get_fgrp_type -> %s", str_error_name(rc));530 ddf_msg(LVL_ NOTE, "unsol: %d, grptype: %d", unsol, grptype);529 ddf_msg(LVL_DEBUG, "hda_get_fgrp_type -> %s", str_error_name(rc)); 530 ddf_msg(LVL_DEBUG, "unsol: %d, grptype: %d", unsol, grptype); 531 531 532 532 rc = hda_get_gpio_cnt(codec, fg, &gpio); … … 534 534 goto error; 535 535 536 ddf_msg(LVL_ NOTE, "GPIO: wake=%d unsol=%d gpis=%d gpos=%d gpios=%d",536 ddf_msg(LVL_DEBUG, "GPIO: wake=%d unsol=%d gpis=%d gpos=%d gpios=%d", 537 537 (gpio & BIT_V(uint32_t, 31)) != 0, 538 538 (gpio & BIT_V(uint32_t, 30)) != 0, … … 549 549 goto error; 550 550 551 ddf_msg(LVL_ NOTE, "hda_get_subnc -> %s", str_error_name(rc));552 ddf_msg(LVL_ NOTE, "saw=%d baw=%d", saw, naw);551 ddf_msg(LVL_DEBUG, "hda_get_subnc -> %s", str_error_name(rc)); 552 ddf_msg(LVL_DEBUG, "saw=%d baw=%d", saw, naw); 553 553 554 554 for (aw = saw; aw < saw + naw; aw++) { … … 556 556 if (rc != EOK) 557 557 goto error; 558 ddf_msg(LVL_ NOTE, "aw %d: type=0x%x caps=0x%x",558 ddf_msg(LVL_DEBUG, "aw %d: type=0x%x caps=0x%x", 559 559 aw, awtype, awcaps); 560 560 … … 594 594 goto error; 595 595 596 ddf_msg(LVL_ NOTE, "Output widget %d: rates=0x%x formats=0x%x",596 ddf_msg(LVL_DEBUG, "Output widget %d: rates=0x%x formats=0x%x", 597 597 aw, rates, formats); 598 598 } else if (awtype == awt_audio_input) { 599 599 if (codec->in_aw < 0) { 600 ddf_msg(LVL_ NOTE, "Selected input "600 ddf_msg(LVL_DEBUG, "Selected input " 601 601 "widget %d\n", aw); 602 602 codec->in_aw = aw; 603 603 } else { 604 ddf_msg(LVL_ NOTE, "Ignoring input "604 ddf_msg(LVL_DEBUG, "Ignoring input " 605 605 "widget %d\n", aw); 606 606 } … … 614 614 goto error; 615 615 616 ddf_msg(LVL_ NOTE, "Input widget %d: rates=0x%x formats=0x%x",616 ddf_msg(LVL_DEBUG, "Input widget %d: rates=0x%x formats=0x%x", 617 617 aw, rates, formats); 618 618 } … … 628 628 hda_ctl_dump_info(hda->ctl); 629 629 630 ddf_msg(LVL_ NOTE, "Codec OK");630 ddf_msg(LVL_DEBUG, "Codec OK"); 631 631 return codec; 632 632 error: … … 637 637 void hda_codec_fini(hda_codec_t *codec) 638 638 { 639 ddf_msg(LVL_ NOTE, "hda_codec_fini()");639 ddf_msg(LVL_DEBUG, "hda_codec_fini()"); 640 640 free(codec); 641 641 } … … 652 652 /* Configure converter */ 653 653 654 ddf_msg(LVL_ NOTE, "Configure output converter format");654 ddf_msg(LVL_DEBUG, "Configure output converter format"); 655 655 rc = hda_set_converter_fmt(codec, out_aw, stream->fmt); 656 656 if (rc != EOK) 657 657 goto error; 658 658 659 ddf_msg(LVL_ NOTE, "Configure output converter stream, channel");659 ddf_msg(LVL_DEBUG, "Configure output converter stream, channel"); 660 660 rc = hda_set_converter_ctl(codec, out_aw, stream->sid, 0); 661 661 if (rc != EOK) … … 674 674 /* Configure converter */ 675 675 676 ddf_msg(LVL_ NOTE, "Configure input converter format");676 ddf_msg(LVL_DEBUG, "Configure input converter format"); 677 677 rc = hda_set_converter_fmt(codec, codec->in_aw, stream->fmt); 678 678 if (rc != EOK) 679 679 goto error; 680 680 681 ddf_msg(LVL_ NOTE, "Configure input converter stream, channel");681 ddf_msg(LVL_DEBUG, "Configure input converter stream, channel"); 682 682 rc = hda_set_converter_ctl(codec, codec->in_aw, stream->sid, 0); 683 683 if (rc != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.