Changeset 1e92bc3 in mainline for uspace/drv/audio/hdaudio/hdactl.c
- Timestamp:
- 2014-08-26T15:32:19Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9bae8b8
- Parents:
- c67195c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/hdactl.c
rc67195c r1e92bc3 55 55 }; 56 56 57 static void hda_ctl_process_rirb(hda_ctl_t *); 58 57 59 /** Perform set-reset handshake on a 16-bit register. 58 60 * … … 407 409 int wcnt; 408 410 409 ddf_msg(LVL_NOTE, "hda_solrb_read()"); 410 wcnt = 100; 411 412 ddf_msg(LVL_NOTE, "hda_solrb_read() - lock mutex"); 411 ddf_msg(LVL_DEBUG, "hda_solrb_read()"); 412 413 413 fibril_mutex_lock(&hda->ctl->solrb_lock); 414 414 415 415 while (count > 0) { 416 ddf_msg(LVL_NOTE, "hda_solrb_read() - while(1)");417 416 while (count > 0 && hda->ctl->solrb_rp != hda->ctl->solrb_wp) { 418 ddf_msg(LVL_NOTE, "hda_solrb_read() - while(2)");419 417 ++hda->ctl->solrb_rp; 420 418 resp = hda->ctl->solrb[hda->ctl->solrb_rp]; 421 419 422 ddf_msg(LVL_ NOTE, "solrb RESPONSE resp=0x%x respex=0x%x",420 ddf_msg(LVL_DEBUG2, "solrb RESPONSE resp=0x%x respex=0x%x", 423 421 resp.resp, resp.respex); 424 422 if ((resp.respex & BIT_V(uint32_t, respex_unsol)) == 0) { … … 430 428 431 429 if (count > 0) { 432 ddf_msg(LVL_NOTE, "hda_solrb_read() - count > 0");430 wcnt = 100; 433 431 while (wcnt > 0 && hda->ctl->solrb_wp == hda->ctl->solrb_rp) { 434 ddf_msg(LVL_NOTE, "hda_solrb_read() - while(3), wcnt=%d", wcnt);435 432 fibril_mutex_unlock(&hda->ctl->solrb_lock); 436 ddf_msg(LVL_NOTE, "hda_solrb_read() - sleep");437 433 async_usleep(10000); 438 ddf_msg(LVL_NOTE, "hda_solrb_read() - re-lock");439 434 fibril_mutex_lock(&hda->ctl->solrb_lock); 440 435 --wcnt; … … 442 437 443 438 if (hda->ctl->solrb_wp == hda->ctl->solrb_rp) { 439 ddf_msg(LVL_NOTE, "hda_solrb_read() - last ditch effort process RIRB"); 440 fibril_mutex_unlock(&hda->ctl->solrb_lock); 441 hda_ctl_process_rirb(hda->ctl); 442 fibril_mutex_lock(&hda->ctl->solrb_lock); 443 } 444 445 if (hda->ctl->solrb_wp == hda->ctl->solrb_rp) { 444 446 ddf_msg(LVL_NOTE, "hda_solrb_read() time out"); 445 ddf_msg(LVL_NOTE, "corbwp=%d corbrp=%d",446 hda_reg16_read(&hda->regs->corbwp),447 hda_reg16_read(&hda->regs->corbrp));448 ddf_msg(LVL_NOTE, "corbctl=0x%x, corbsts=0x%x",449 hda_reg8_read(&hda->regs->corbctl),450 hda_reg8_read(&hda->regs->corbsts));451 ddf_msg(LVL_NOTE, "rirbwp=%d",452 hda_reg16_read(&hda->regs->rirbwp));453 ddf_msg(LVL_NOTE, "rirbctl=0x%x, rirbsts=0x%x",454 hda_reg8_read(&hda->regs->rirbctl),455 hda_reg8_read(&hda->regs->rirbsts));456 447 fibril_mutex_unlock(&hda->ctl->solrb_lock); 457 448 return ETIMEOUT; … … 461 452 462 453 fibril_mutex_unlock(&hda->ctl->solrb_lock); 463 ddf_msg(LVL_NOTE, "hda_solrb_read() success");464 454 return EOK; 465 455 } … … 613 603 } 614 604 615 void hda_ctl_interrupt(hda_ctl_t *ctl)605 static void hda_ctl_process_rirb(hda_ctl_t *ctl) 616 606 { 617 607 hda_rirb_entry_t resp; … … 625 615 } 626 616 627 ddf_msg(LVL_ NOTE, "writing to solrb");617 ddf_msg(LVL_DEBUG2, "writing to solrb"); 628 618 fibril_mutex_lock(&ctl->solrb_lock); 629 619 ctl->solrb_wp = (ctl->solrb_wp + 1) % softrb_entries; … … 634 624 } 635 625 626 void hda_ctl_interrupt(hda_ctl_t *ctl) 627 { 628 hda_ctl_process_rirb(ctl); 629 } 630 636 631 /** @} 637 632 */
Note:
See TracChangeset
for help on using the changeset viewer.