Changeset cf78637 in mainline
- Timestamp:
- 2019-12-15T11:57:25Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9e45a41
- Parents:
- 894afff
- Location:
- uspace/drv/audio/hdaudio
- Files:
-
- 5 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) -
uspace/drv/audio/hdaudio/hdactl.c
r894afff rcf78637 154 154 errno_t rc; 155 155 156 ddf_msg(LVL_ NOTE, "hda_corb_init()");156 ddf_msg(LVL_DEBUG, "hda_corb_init()"); 157 157 158 158 /* Stop CORB if not stopped */ 159 159 ctl = hda_reg8_read(&hda->regs->corbctl); 160 160 if ((ctl & BIT_V(uint8_t, corbctl_run)) != 0) { 161 ddf_msg(LVL_ NOTE, "CORB is enabled, disabling first.");161 ddf_msg(LVL_DEBUG, "CORB is enabled, disabling first."); 162 162 hda_reg8_write(&hda->regs->corbctl, ctl & ~BIT_V(uint8_t, 163 163 corbctl_run)); … … 176 176 corbsz = corbsz | selsz; 177 177 178 ddf_msg(LVL_ NOTE, "Setting CORB Size register to 0x%x", corbsz);178 ddf_msg(LVL_DEBUG, "Setting CORB Size register to 0x%x", corbsz); 179 179 hda_reg8_write(&hda->regs->corbsize, corbsz); 180 180 hda->ctl->corb_entries = hda_rb_entries(selsz); … … 190 190 if (rc != EOK) { 191 191 hda->ctl->corb_virt = NULL; 192 ddf_msg(LVL_ NOTE, "Failed allocating DMA memory for CORB");193 goto error; 194 } 195 196 ddf_msg(LVL_ NOTE, "Set CORB base registers");192 ddf_msg(LVL_ERROR, "Failed allocating DMA memory for CORB"); 193 goto error; 194 } 195 196 ddf_msg(LVL_DEBUG, "Set CORB base registers"); 197 197 198 198 /* Update CORB base registers */ … … 200 200 hda_reg32_write(&hda->regs->corbubase, UPPER32(hda->ctl->corb_phys)); 201 201 202 ddf_msg(LVL_ NOTE, "Reset CORB Read/Write pointers");202 ddf_msg(LVL_DEBUG, "Reset CORB Read/Write pointers"); 203 203 204 204 /* Reset CORB Read Pointer */ … … 206 206 BIT_V(uint16_t, corbrp_rst)); 207 207 if (rc != EOK) { 208 ddf_msg(LVL_ NOTE, "Failed resetting CORBRP");208 ddf_msg(LVL_ERROR, "Failed resetting CORBRP"); 209 209 goto error; 210 210 } … … 215 215 /* Start CORB */ 216 216 ctl = hda_reg8_read(&hda->regs->corbctl); 217 ddf_msg(LVL_ NOTE, "CORBctl (0x%x) = 0x%x",217 ddf_msg(LVL_DEBUG, "CORBctl (0x%x) = 0x%x", 218 218 (unsigned)((void *)&hda->regs->corbctl - (void *)hda->regs), ctl | BIT_V(uint8_t, corbctl_run)); 219 219 hda_reg8_write(&hda->regs->corbctl, ctl | BIT_V(uint8_t, corbctl_run)); 220 220 221 ddf_msg(LVL_ NOTE, "CORB initialized");221 ddf_msg(LVL_DEBUG, "CORB initialized"); 222 222 return EOK; 223 223 error: … … 251 251 errno_t rc; 252 252 253 ddf_msg(LVL_ NOTE, "hda_rirb_init()");253 ddf_msg(LVL_DEBUG, "hda_rirb_init()"); 254 254 255 255 /* Stop RIRB if not stopped */ 256 256 ctl = hda_reg8_read(&hda->regs->rirbctl); 257 257 if ((ctl & BIT_V(uint8_t, rirbctl_run)) != 0) { 258 ddf_msg(LVL_ NOTE, "RIRB is enabled, disabling first.");258 ddf_msg(LVL_DEBUG, "RIRB is enabled, disabling first."); 259 259 hda_reg8_write(&hda->regs->corbctl, ctl & ~BIT_V(uint8_t, 260 260 rirbctl_run)); … … 273 273 rirbsz = rirbsz | (selsz << rirbsize_size_l); 274 274 275 ddf_msg(LVL_ NOTE, "Setting RIRB Size register to 0x%x", rirbsz);275 ddf_msg(LVL_DEBUG, "Setting RIRB Size register to 0x%x", rirbsz); 276 276 hda_reg8_write(&hda->regs->rirbsize, rirbsz); 277 277 hda->ctl->rirb_entries = hda_rb_entries(selsz); … … 287 287 if (rc != EOK) { 288 288 hda->ctl->rirb_virt = NULL; 289 ddf_msg(LVL_ NOTE, "Failed allocating DMA memory for RIRB");290 goto error; 291 } 292 293 ddf_msg(LVL_ NOTE, "Set RIRB base registers");289 ddf_msg(LVL_ERROR, "Failed allocating DMA memory for RIRB"); 290 goto error; 291 } 292 293 ddf_msg(LVL_DEBUG, "Set RIRB base registers"); 294 294 295 295 /* Update RIRB base registers */ … … 297 297 hda_reg32_write(&hda->regs->rirbubase, UPPER32(hda->ctl->rirb_phys)); 298 298 299 ddf_msg(LVL_ NOTE, "Reset RIRB Write pointer");299 ddf_msg(LVL_DEBUG, "Reset RIRB Write pointer"); 300 300 301 301 /* Reset RIRB Write Pointer */ … … 309 309 /* Start RIRB and enable RIRB interrupt */ 310 310 ctl = hda_reg8_read(&hda->regs->rirbctl); 311 ddf_msg(LVL_ NOTE, "RIRBctl (0x%x) = 0x%x",311 ddf_msg(LVL_DEBUG, "RIRBctl (0x%x) = 0x%x", 312 312 (unsigned)((void *)&hda->regs->rirbctl - (void *)hda->regs), ctl | BIT_V(uint8_t, rirbctl_run)); 313 313 hda_reg8_write(&hda->regs->rirbctl, ctl | BIT_V(uint8_t, rirbctl_run) | 314 314 BIT_V(uint8_t, rirbctl_int)); 315 315 316 ddf_msg(LVL_ NOTE, "RIRB initialized");316 ddf_msg(LVL_DEBUG, "RIRB initialized"); 317 317 return EOK; 318 318 error: … … 479 479 480 480 if (hda->ctl->solrb_wp == hda->ctl->solrb_rp) { 481 ddf_msg(LVL_ NOTE, "hda_solrb_read() - last ditch effort process RIRB");481 ddf_msg(LVL_DEBUG, "hda_solrb_read() - last ditch effort process RIRB"); 482 482 fibril_mutex_unlock(&hda->ctl->solrb_lock); 483 483 hda_ctl_process_rirb(hda->ctl); … … 486 486 487 487 if (hda->ctl->solrb_wp == hda->ctl->solrb_rp) { 488 ddf_msg(LVL_ NOTE, "hda_solrb_read() time out");488 ddf_msg(LVL_DEBUG, "hda_solrb_read() time out"); 489 489 fibril_mutex_unlock(&hda->ctl->solrb_lock); 490 490 return ETIMEOUT; … … 525 525 } 526 526 527 ddf_msg(LVL_ NOTE, "reg 0x%zx STATESTS = 0x%x",527 ddf_msg(LVL_DEBUG, "reg 0x%zx STATESTS = 0x%x", 528 528 (void *)&hda->regs->statests - (void *)hda->regs, 529 529 hda_reg16_read(&hda->regs->statests)); … … 534 534 hda_reg16_write(&hda->regs->statests, 0x7f); 535 535 536 ddf_msg(LVL_ NOTE, "after clearing reg 0x%zx STATESTS = 0x%x",536 ddf_msg(LVL_DEBUG, "after clearing reg 0x%zx STATESTS = 0x%x", 537 537 (void *)&hda->regs->statests - (void *)hda->regs, 538 538 hda_reg16_read(&hda->regs->statests)); … … 540 540 gctl = hda_reg32_read(&hda->regs->gctl); 541 541 if ((gctl & BIT_V(uint32_t, gctl_crst)) != 0) { 542 ddf_msg(LVL_ NOTE, "Controller not in reset. Resetting.");542 ddf_msg(LVL_DEBUG, "Controller not in reset. Resetting."); 543 543 hda_reg32_write(&hda->regs->gctl, gctl & ~BIT_V(uint32_t, gctl_crst)); 544 544 } 545 545 546 ddf_msg(LVL_ NOTE, "Taking controller out of reset.");546 ddf_msg(LVL_DEBUG, "Taking controller out of reset."); 547 547 hda_reg32_write(&hda->regs->gctl, gctl | BIT_V(uint32_t, gctl_crst)); 548 548 … … 552 552 gctl = hda_reg32_read(&hda->regs->gctl); 553 553 if ((gctl & BIT_V(uint32_t, gctl_crst)) != 0) { 554 ddf_msg(LVL_ NOTE, "gctl=0x%x", gctl);554 ddf_msg(LVL_DEBUG, "gctl=0x%x", gctl); 555 555 break; 556 556 } 557 557 558 ddf_msg(LVL_ NOTE, "Waiting for controller to initialize.");558 ddf_msg(LVL_DEBUG, "Waiting for controller to initialize."); 559 559 fibril_usleep(100 * 1000); 560 560 --cnt; … … 566 566 } 567 567 568 ddf_msg(LVL_ NOTE, "Controller is out of reset.");569 570 ddf_msg(LVL_ NOTE, "Read GCAP");568 ddf_msg(LVL_DEBUG, "Controller is out of reset."); 569 570 ddf_msg(LVL_DEBUG, "Read GCAP"); 571 571 uint16_t gcap = hda_reg16_read(&hda->regs->gcap); 572 572 ctl->ok64bit = (gcap & BIT_V(uint16_t, gcap_64ok)) != 0; … … 574 574 ctl->iss = BIT_RANGE_EXTRACT(uint16_t, gcap_iss_h, gcap_iss_l, gcap); 575 575 ctl->bss = BIT_RANGE_EXTRACT(uint16_t, gcap_bss_h, gcap_bss_l, gcap); 576 ddf_msg(LVL_ NOTE, "GCAP: 0x%x (64OK=%d)", gcap, ctl->ok64bit);577 ddf_msg(LVL_ NOTE, "iss: %d, oss: %d, bss: %d\n",576 ddf_msg(LVL_DEBUG, "GCAP: 0x%x (64OK=%d)", gcap, ctl->ok64bit); 577 ddf_msg(LVL_DEBUG, "iss: %d, oss: %d, bss: %d\n", 578 578 ctl->iss, ctl->oss, ctl->bss); 579 579 /* Give codecs enough time to enumerate themselves */ 580 580 fibril_usleep(codec_enum_wait_us); 581 581 582 ddf_msg(LVL_ NOTE, "STATESTS = 0x%x",582 ddf_msg(LVL_DEBUG, "STATESTS = 0x%x", 583 583 hda_reg16_read(&hda->regs->statests)); 584 584 585 585 /* Enable interrupts */ 586 586 intctl = hda_reg32_read(&hda->regs->intctl); 587 ddf_msg(LVL_ NOTE, "intctl (0x%x) := 0x%x",587 ddf_msg(LVL_DEBUG, "intctl (0x%x) := 0x%x", 588 588 (unsigned)((void *)&hda->regs->intctl - (void *)hda->regs), 589 589 intctl | BIT_V(uint32_t, intctl_gie) | BIT_V(uint32_t, intctl_cie)); … … 600 600 goto error; 601 601 602 ddf_msg(LVL_ NOTE, "call hda_codec_init()");602 ddf_msg(LVL_DEBUG, "call hda_codec_init()"); 603 603 hda->ctl->codec = hda_codec_init(hda, 0); 604 604 if (hda->ctl->codec == NULL) { 605 ddf_msg(LVL_ NOTE, "hda_codec_init() failed");606 goto error; 607 } 608 609 ddf_msg(LVL_ NOTE, "intsts=0x%x", hda_reg32_read(&hda->regs->intsts));610 ddf_msg(LVL_ NOTE, "sdesc[%d].sts=0x%x",605 ddf_msg(LVL_DEBUG, "hda_codec_init() failed"); 606 goto error; 607 } 608 609 ddf_msg(LVL_DEBUG, "intsts=0x%x", hda_reg32_read(&hda->regs->intsts)); 610 ddf_msg(LVL_DEBUG, "sdesc[%d].sts=0x%x", 611 611 hda->ctl->iss, hda_reg8_read(&hda->regs->sdesc[hda->ctl->iss].sts)); 612 612 … … 622 622 void hda_ctl_fini(hda_ctl_t *ctl) 623 623 { 624 ddf_msg(LVL_ NOTE, "hda_ctl_fini()");624 ddf_msg(LVL_DEBUG, "hda_ctl_fini()"); 625 625 hda_rirb_fini(ctl->hda); 626 626 hda_corb_fini(ctl->hda); … … 677 677 void hda_ctl_dump_info(hda_ctl_t *ctl) 678 678 { 679 ddf_msg(LVL_ NOTE, "corbwp=%d, corbrp=%d",679 ddf_msg(LVL_DEBUG, "corbwp=%d, corbrp=%d", 680 680 hda_reg16_read(&ctl->hda->regs->corbwp), 681 681 hda_reg16_read(&ctl->hda->regs->corbrp)); 682 ddf_msg(LVL_ NOTE, "corbctl=0x%x, corbsts=0x%x",682 ddf_msg(LVL_DEBUG, "corbctl=0x%x, corbsts=0x%x", 683 683 hda_reg8_read(&ctl->hda->regs->corbctl), 684 684 hda_reg8_read(&ctl->hda->regs->corbsts)); 685 ddf_msg(LVL_ NOTE, "rirbwp=0x%x, soft-rirbrp=0x%zx",685 ddf_msg(LVL_DEBUG, "rirbwp=0x%x, soft-rirbrp=0x%zx", 686 686 hda_reg16_read(&ctl->hda->regs->rirbwp), 687 687 ctl->rirb_rp); 688 ddf_msg(LVL_ NOTE, "solrb_wp=0x%zx, solrb_rp=0x%zx",688 ddf_msg(LVL_DEBUG, "solrb_wp=0x%zx, solrb_rp=0x%zx", 689 689 ctl->solrb_wp, ctl->solrb_wp); 690 690 } -
uspace/drv/audio/hdaudio/hdaudio.c
r894afff rcf78637 163 163 errno_t rc; 164 164 165 ddf_msg(LVL_ NOTE, "hda_dev_add()");165 ddf_msg(LVL_DEBUG, "hda_dev_add()"); 166 166 hw_res_list_parsed_init(&res); 167 167 … … 175 175 fibril_mutex_initialize(&hda->lock); 176 176 177 ddf_msg(LVL_ NOTE, "create parent sess");177 ddf_msg(LVL_DEBUG, "create parent sess"); 178 178 hda->parent_sess = ddf_dev_parent_sess_get(dev); 179 179 if (hda->parent_sess == NULL) { … … 183 183 } 184 184 185 ddf_msg(LVL_ NOTE, "get HW res list");185 ddf_msg(LVL_DEBUG, "get HW res list"); 186 186 rc = hw_res_get_list_parsed(hda->parent_sess, &res, 0); 187 187 if (rc != EOK) { … … 199 199 hda->rwsize = RNGSZ(res.mem_ranges.ranges[0]); 200 200 201 ddf_msg(LVL_ NOTE, "hda reg base: %" PRIx64,201 ddf_msg(LVL_DEBUG, "hda reg base: %" PRIx64, 202 202 RNGABS(res.mem_ranges.ranges[0])); 203 203 … … 208 208 } 209 209 210 ddf_msg(LVL_ NOTE, "enable PIO");210 ddf_msg(LVL_DEBUG, "enable PIO"); 211 211 rc = pio_enable((void *)(uintptr_t)hda->rwbase, hda->rwsize, ®s); 212 212 if (rc != EOK) { … … 217 217 hda->regs = (hda_regs_t *)regs; 218 218 219 ddf_msg(LVL_ NOTE, "IRQs: %zu", res.irqs.count);219 ddf_msg(LVL_DEBUG, "IRQs: %zu", res.irqs.count); 220 220 if (res.irqs.count != 1) { 221 221 ddf_msg(LVL_ERROR, "Unexpected IRQ count %zu (!= 1)", … … 223 223 goto error; 224 224 } 225 ddf_msg(LVL_ NOTE, "interrupt no: %d", res.irqs.irqs[0]);225 ddf_msg(LVL_DEBUG, "interrupt no: %d", res.irqs.irqs[0]); 226 226 227 227 ncmds_base = sizeof(hdaudio_irq_commands) / sizeof(irq_cmd_t); … … 256 256 } 257 257 258 ddf_msg(LVL_ NOTE, "range0.base=%zu", hdaudio_irq_pio_ranges[0].base);258 ddf_msg(LVL_DEBUG, "range0.base=%zu", hdaudio_irq_pio_ranges[0].base); 259 259 260 260 rc = hw_res_enable_interrupt(hda->parent_sess, res.irqs.irqs[0]); … … 281 281 } 282 282 283 ddf_msg(LVL_ NOTE, "create function");283 ddf_msg(LVL_DEBUG, "create function"); 284 284 fun_pcm = ddf_fun_create(dev, fun_exposed, "pcm"); 285 285 if (fun_pcm == NULL) { … … 323 323 hw_res_list_parsed_clean(&res); 324 324 325 ddf_msg(LVL_ NOTE, "Failing hda_dev_add() -> %s", str_error_name(rc));325 ddf_msg(LVL_DEBUG, "Failing hda_dev_add() -> %s", str_error_name(rc)); 326 326 return rc; 327 327 } -
uspace/drv/audio/hdaudio/pcm_iface.c
r894afff rcf78637 92 92 static errno_t hda_get_info_str(ddf_fun_t *fun, const char **name) 93 93 { 94 ddf_msg(LVL_ NOTE, "hda_get_info_str()");94 ddf_msg(LVL_DEBUG, "hda_get_info_str()"); 95 95 if (name) 96 96 *name = "High Definition Audio"; … … 102 102 hda_t *hda = fun_to_hda(fun); 103 103 104 ddf_msg(LVL_ NOTE, "hda_query_cap(%d)", cap);104 ddf_msg(LVL_DEBUG, "hda_query_cap(%d)", cap); 105 105 switch (cap) { 106 106 case AUDIO_CAP_PLAYBACK: … … 129 129 errno_t rc = EOK; 130 130 131 ddf_msg(LVL_ NOTE, "hda_test_format(%u, %u, %d)\n",131 ddf_msg(LVL_DEBUG, "hda_test_format(%u, %u, %d)\n", 132 132 *channels, *rate, *format); 133 133 … … 157 157 hda_lock(hda); 158 158 159 ddf_msg(LVL_ NOTE, "hda_get_buffer(): hda=%p", hda);159 ddf_msg(LVL_DEBUG, "hda_get_buffer(): hda=%p", hda); 160 160 if (hda->pcm_buffers != NULL) { 161 161 hda_unlock(hda); … … 163 163 } 164 164 165 ddf_msg(LVL_ NOTE, "hda_get_buffer() - allocate stream buffers");165 ddf_msg(LVL_DEBUG, "hda_get_buffer() - allocate stream buffers"); 166 166 rc = hda_stream_buffers_alloc(hda, &hda->pcm_buffers); 167 167 if (rc != EOK) { … … 171 171 } 172 172 173 ddf_msg(LVL_ NOTE, "hda_get_buffer() - fill info");173 ddf_msg(LVL_DEBUG, "hda_get_buffer() - fill info"); 174 174 /* XXX This is only one buffer */ 175 175 *buffer = hda->pcm_buffers->buf[0]; 176 176 *size = hda->pcm_buffers->bufsize * hda->pcm_buffers->nbuffers; 177 177 178 ddf_msg(LVL_ NOTE, "hda_get_buffer() returing EOK, buffer=%p, size=%zu",178 ddf_msg(LVL_DEBUG, "hda_get_buffer() returing EOK, buffer=%p, size=%zu", 179 179 *buffer, *size); 180 180 … … 185 185 static errno_t hda_get_buffer_position(ddf_fun_t *fun, size_t *pos) 186 186 { 187 ddf_msg(LVL_ NOTE, "hda_get_buffer_position()");187 ddf_msg(LVL_DEBUG, "hda_get_buffer_position()"); 188 188 return ENOTSUP; 189 189 } … … 193 193 hda_t *hda = fun_to_hda(fun); 194 194 195 ddf_msg(LVL_ NOTE, "hda_set_event_session()");195 ddf_msg(LVL_DEBUG, "hda_set_event_session()"); 196 196 hda_lock(hda); 197 197 hda->ev_sess = sess; … … 206 206 async_sess_t *sess; 207 207 208 ddf_msg(LVL_ NOTE, "hda_get_event_session()");208 ddf_msg(LVL_DEBUG, "hda_get_event_session()"); 209 209 210 210 hda_lock(hda); … … 221 221 hda_lock(hda); 222 222 223 ddf_msg(LVL_ NOTE, "hda_release_buffer()");223 ddf_msg(LVL_DEBUG, "hda_release_buffer()"); 224 224 if (hda->pcm_buffers == NULL) { 225 225 hda_unlock(hda); … … 240 240 errno_t rc; 241 241 242 ddf_msg(LVL_ NOTE, "hda_start_playback()");242 ddf_msg(LVL_DEBUG, "hda_start_playback()"); 243 243 hda_lock(hda); 244 244 … … 279 279 hda_t *hda = fun_to_hda(fun); 280 280 281 ddf_msg(LVL_ NOTE, "hda_stop_playback()");281 ddf_msg(LVL_DEBUG, "hda_stop_playback()"); 282 282 hda_lock(hda); 283 283 hda_stream_stop(hda->pcm_stream); … … 299 299 errno_t rc; 300 300 301 ddf_msg(LVL_ NOTE, "hda_start_capture()");301 ddf_msg(LVL_DEBUG, "hda_start_capture()"); 302 302 hda_lock(hda); 303 303 … … 312 312 fmt = (fmt_base_44khz << fmt_base) | (fmt_bits_16 << fmt_bits_l) | 1; 313 313 314 ddf_msg(LVL_ NOTE, "hda_start_capture() - create input stream");314 ddf_msg(LVL_DEBUG, "hda_start_capture() - create input stream"); 315 315 hda->pcm_stream = hda_stream_create(hda, sdir_input, hda->pcm_buffers, 316 316 fmt); … … 338 338 hda_t *hda = fun_to_hda(fun); 339 339 340 ddf_msg(LVL_ NOTE, "hda_stop_capture()");340 ddf_msg(LVL_DEBUG, "hda_stop_capture()"); 341 341 hda_lock(hda); 342 342 hda_stream_stop(hda->pcm_stream); -
uspace/drv/audio/hdaudio/stream.c
r894afff rcf78637 101 101 goto error; 102 102 103 ddf_msg(LVL_ NOTE, "Stream buf phys=0x%llx virt=%p",103 ddf_msg(LVL_DEBUG, "Stream buf phys=0x%llx virt=%p", 104 104 (unsigned long long)buffer_phys, buffer); 105 105 … … 123 123 0, &buffer_phys, &buffer); 124 124 if (rc != EOK) { 125 ddf_msg(LVL_ NOTE, "dmamem_map_anon -> %s", str_error_name(rc));125 ddf_msg(LVL_DEBUG, "dmamem_map_anon -> %s", str_error_name(rc)); 126 126 goto error; 127 127 } … … 131 131 bufs->buf_phys[i] = buffer_phys + i * bufs->bufsize; 132 132 133 ddf_msg(LVL_ NOTE, "Stream buf phys=0x%llx virt=%p",133 ddf_msg(LVL_DEBUG, "Stream buf phys=0x%llx virt=%p", 134 134 (long long unsigned)(uintptr_t)bufs->buf[i], 135 135 (void *)bufs->buf_phys[i]); … … 246 246 stream->buffers = bufs; 247 247 248 ddf_msg(LVL_ NOTE, "snum=%d sdidx=%d", stream->sid, stream->sdid);249 250 ddf_msg(LVL_ NOTE, "Configure stream descriptor");248 ddf_msg(LVL_DEBUG, "snum=%d sdidx=%d", stream->sid, stream->sdid); 249 250 ddf_msg(LVL_DEBUG, "Configure stream descriptor"); 251 251 hda_stream_desc_configure(stream); 252 252 return stream; … … 255 255 void hda_stream_destroy(hda_stream_t *stream) 256 256 { 257 ddf_msg(LVL_ NOTE, "hda_stream_destroy()");257 ddf_msg(LVL_DEBUG, "hda_stream_destroy()"); 258 258 hda_stream_reset_noinit(stream); 259 259 free(stream); … … 262 262 void hda_stream_start(hda_stream_t *stream) 263 263 { 264 ddf_msg(LVL_ NOTE, "hda_stream_start()");264 ddf_msg(LVL_DEBUG, "hda_stream_start()"); 265 265 hda_stream_set_run(stream, true); 266 266 } … … 268 268 void hda_stream_stop(hda_stream_t *stream) 269 269 { 270 ddf_msg(LVL_ NOTE, "hda_stream_stop()");270 ddf_msg(LVL_DEBUG, "hda_stream_stop()"); 271 271 hda_stream_set_run(stream, false); 272 272 } … … 274 274 void hda_stream_reset(hda_stream_t *stream) 275 275 { 276 ddf_msg(LVL_ NOTE, "hda_stream_reset()");276 ddf_msg(LVL_DEBUG, "hda_stream_reset()"); 277 277 hda_stream_reset_noinit(stream); 278 278 hda_stream_desc_configure(stream);
Note:
See TracChangeset
for help on using the changeset viewer.