Changeset dda5848 in mainline
- Timestamp:
- 2014-08-26T23:07:47Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9034876
- Parents:
- 2f6b916
- Location:
- uspace/drv/audio/hdaudio
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/codec.c
r2f6b916 rdda5848 56 56 verb = (codec->address << 28) | (node << 20) | (vid << 8) | payload; 57 57 int rc = hda_cmd(codec->hda, verb, resp); 58 /* 58 59 if (resp != NULL) { 59 60 ddf_msg(LVL_NOTE, "verb 0x%" PRIx32 " -> 0x%" PRIx32, verb, … … 62 63 ddf_msg(LVL_NOTE, "verb 0x%" PRIx32, verb); 63 64 } 65 */ 64 66 return rc; 65 67 } … … 409 411 410 412 } else if (awtype == awt_audio_output) { 411 codec->out_aw = aw;412 413 codec->out_aw_list[codec->out_aw_num++] = aw; 414 415 rc = hda_get_supp_rates(codec, aw, &rates); 416 if (rc != EOK) 417 goto error; 418 419 rc = hda_get_supp_formats(codec, aw, &formats); 420 if (rc != EOK) 421 goto error; 422 423 ddf_msg(LVL_NOTE, "Output widget %d: rates=0x%x formats=0x%x", 424 aw, rates, formats); 413 425 } 414 426 415 if (0) {416 427 if ((awcaps & BIT_V(uint32_t, awc_out_amp_present)) != 0) 417 428 hda_set_out_amp_max(codec, aw); … … 419 430 if ((awcaps & BIT_V(uint32_t, awc_in_amp_present)) != 0) 420 431 hda_set_in_amp_max(codec, aw); 421 }422 432 } 423 433 } 424 434 425 rc = hda_get_supp_rates(codec, codec->out_aw, &rates); 426 if (rc != EOK) 427 goto error; 428 429 rc = hda_get_supp_formats(codec, codec->out_aw, &formats); 430 if (rc != EOK) 431 goto error; 432 433 ddf_msg(LVL_NOTE, "Output widget %d: rates=0x%x formats=0x%x", 434 codec->out_aw, rates, formats); 435 hda_ctl_dump_info(hda->ctl); 435 436 436 437 ddf_msg(LVL_NOTE, "Codec OK"); -
uspace/drv/audio/hdaudio/codec.h
r2f6b916 rdda5848 43 43 hda_t *hda; 44 44 uint8_t address; 45 uint8_t out_aw;46 45 uint8_t out_aw_list[MAX_OUT_AW]; 47 46 int out_aw_num; -
uspace/drv/audio/hdaudio/hdactl.c
r2f6b916 rdda5848 106 106 * 107 107 * We always use the largest available size. In @a sizecap each of bits 108 * 0, 1, 2 determine whether one of the supported size (0 == 2 en ries,108 * 0, 1, 2 determine whether one of the supported size (0 == 2 entries, 109 109 * 1 == 16 entries, 2 == 256 entries) is supported. @a *selsz is set to 110 110 * one of 0, 1, 2 on success. … … 249 249 } 250 250 rirbsz = rirbsz & ~BIT_RANGE(uint8_t, rirbsize_size_h, rirbsize_size_l); 251 rirbsz = rirbsz | selsz;251 rirbsz = rirbsz | (selsz << rirbsize_size_l); 252 252 253 253 ddf_msg(LVL_NOTE, "Setting RIRB Size register to 0x%x", rirbsz); … … 395 395 return ENOENT; 396 396 397 ++hda->ctl->rirb_rp;397 hda->ctl->rirb_rp = (hda->ctl->rirb_rp + 1) % hda->ctl->rirb_entries; 398 398 resp = rirb[hda->ctl->rirb_rp]; 399 399 … … 415 415 while (count > 0) { 416 416 while (count > 0 && hda->ctl->solrb_rp != hda->ctl->solrb_wp) { 417 ++hda->ctl->solrb_rp;417 hda->ctl->solrb_rp = (hda->ctl->solrb_rp + 1) % softrb_entries; 418 418 resp = hda->ctl->solrb[hda->ctl->solrb_rp]; 419 419 … … 629 629 } 630 630 631 void hda_ctl_dump_info(hda_ctl_t *ctl) 632 { 633 ddf_msg(LVL_NOTE, "corbwp=%d, corbrp=%d", 634 hda_reg16_read(&ctl->hda->regs->corbwp), 635 hda_reg16_read(&ctl->hda->regs->corbrp)); 636 ddf_msg(LVL_NOTE, "corbctl=0x%x, corbsts=0x%x", 637 hda_reg8_read(&ctl->hda->regs->corbctl), 638 hda_reg8_read(&ctl->hda->regs->corbsts)); 639 ddf_msg(LVL_NOTE, "rirbwp=0x%x, soft-rirbrp=0x%x", 640 hda_reg16_read(&ctl->hda->regs->rirbwp), 641 ctl->rirb_rp); 642 ddf_msg(LVL_NOTE, "solrb_wp=0x%x, solrb_rp=0x%x", 643 ctl->solrb_wp, ctl->solrb_wp); 644 } 645 631 646 /** @} 632 647 */ -
uspace/drv/audio/hdaudio/hdactl.h
r2f6b916 rdda5848 79 79 extern void hda_ctl_interrupt(hda_ctl_t *); 80 80 extern int hda_cmd(hda_t *, uint32_t, uint32_t *); 81 extern void hda_ctl_dump_info(hda_ctl_t *); 81 82 82 83 #endif
Note:
See TracChangeset
for help on using the changeset viewer.