Changeset de16f89 in mainline for uspace/drv/audio/hdaudio/hdactl.c
- Timestamp:
- 2014-09-05T08:52:51Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 089901e
- Parents:
- 3fec817
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/hdactl.c
r3fec817 rde16f89 217 217 return EOK; 218 218 error: 219 if (hda->ctl->corb_virt != NULL) 220 dmamem_unmap_anonymous(&hda->ctl->corb_virt); 219 221 return EIO; 222 } 223 224 /** Tear down the CORB */ 225 static void hda_corb_fini(hda_t *hda) 226 { 227 uint8_t ctl; 228 229 /* Stop CORB */ 230 ctl = hda_reg8_read(&hda->regs->corbctl); 231 hda_reg8_write(&hda->regs->corbctl, ctl & ~BIT_V(uint8_t, corbctl_run)); 232 233 if (hda->ctl->corb_virt != NULL) 234 dmamem_unmap_anonymous(&hda->ctl->corb_virt); 220 235 } 221 236 … … 290 305 return EOK; 291 306 error: 307 if (hda->ctl->rirb_virt != NULL) 308 dmamem_unmap_anonymous(&hda->ctl->rirb_virt); 292 309 return EIO; 310 } 311 312 /** Tear down the RIRB */ 313 static void hda_rirb_fini(hda_t *hda) 314 { 315 uint8_t ctl; 316 317 /* Stop RIRB and disable RIRB interrupt */ 318 ctl = hda_reg8_read(&hda->regs->rirbctl); 319 hda_reg8_write(&hda->regs->rirbctl, ctl & 320 ~(BIT_V(uint8_t, rirbctl_run) | BIT_V(uint8_t, rirbctl_int))); 321 322 if (hda->ctl->rirb_virt != NULL) 323 dmamem_unmap_anonymous(&hda->ctl->rirb_virt); 293 324 } 294 325 … … 571 602 return ctl; 572 603 error: 604 hda_rirb_fini(hda); 605 hda_corb_fini(hda); 573 606 free(ctl); 574 607 hda->ctl = NULL; 575 608 return NULL; 609 } 610 611 void hda_ctl_fini(hda_ctl_t *ctl) 612 { 613 ddf_msg(LVL_NOTE, "hda_ctl_fini()"); 614 hda_rirb_fini(ctl->hda); 615 hda_corb_fini(ctl->hda); 616 free(ctl); 576 617 } 577 618 … … 595 636 596 637 return EOK; 597 }598 599 void hda_ctl_fini(hda_ctl_t *ctl)600 {601 ddf_msg(LVL_NOTE, "hda_ctl_fini()");602 free(ctl);603 638 } 604 639
Note:
See TracChangeset
for help on using the changeset viewer.