Changeset 1412a184 in mainline for uspace/drv/audio/hdaudio/hdactl.c
- Timestamp:
- 2014-08-16T15:34:44Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a333b7f
- Parents:
- 65b09c1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/hdactl.c
r65b09c1 r1412a184 102 102 uint8_t sizecap; 103 103 uint8_t selsz; 104 bool ok64bit;105 104 int rc; 106 105 … … 131 130 hda->ctl->corb_entries = hda_rb_entries(selsz); 132 131 133 ddf_msg(LVL_NOTE, "Read GCAP");134 uint16_t gcap = hda_reg16_read(&hda->regs->gcap);135 ok64bit = (gcap & BIT_V(uint8_t, gcap_64ok)) != 0;136 ddf_msg(LVL_NOTE, "GCAP: 0x%x (64OK=%d)", gcap, ok64bit);137 132 138 133 /* … … 142 137 hda->ctl->corb_virt = AS_AREA_ANY; 143 138 rc = dmamem_map_anonymous(hda->ctl->corb_entries * sizeof(uint32_t), 144 ok64bit ? 0 : DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0,139 hda->ctl->ok64bit ? 0 : DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, 145 140 &hda->ctl->corb_phys, &hda->ctl->corb_virt); 146 141 … … 178 173 uint8_t sizecap; 179 174 uint8_t selsz; 180 bool ok64bit;181 175 int rc; 182 176 … … 207 201 hda->ctl->rirb_entries = hda_rb_entries(selsz); 208 202 209 ddf_msg(LVL_NOTE, "Read GCAP");210 uint16_t gcap = hda_reg16_read(&hda->regs->gcap);211 ok64bit = (gcap & BIT_V(uint8_t, gcap_64ok)) != 0;212 ddf_msg(LVL_NOTE, "GCAP: 0x%x (64OK=%d)", gcap, ok64bit);213 214 203 /* 215 204 * RIRB must be aligned to 128 bytes. If 64OK is not set, … … 218 207 hda->ctl->rirb_virt = AS_AREA_ANY; 219 208 rc = dmamem_map_anonymous(hda->ctl->rirb_entries * sizeof(uint64_t), 220 ok64bit ? 0 : DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0,209 hda->ctl->ok64bit ? 0 : DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, 221 210 &hda->ctl->rirb_phys, &hda->ctl->rirb_virt); 222 211 … … 434 423 ddf_msg(LVL_NOTE, "Controller is out of reset."); 435 424 425 ddf_msg(LVL_NOTE, "Read GCAP"); 426 uint16_t gcap = hda_reg16_read(&hda->regs->gcap); 427 ctl->ok64bit = (gcap & BIT_V(uint16_t, gcap_64ok)) != 0; 428 ctl->oss = BIT_RANGE_EXTRACT(uint16_t, gcap_oss_h, gcap_oss_l, gcap); 429 ctl->iss = BIT_RANGE_EXTRACT(uint16_t, gcap_iss_h, gcap_iss_l, gcap); 430 ctl->bss = BIT_RANGE_EXTRACT(uint16_t, gcap_bss_h, gcap_bss_l, gcap); 431 ddf_msg(LVL_NOTE, "GCAP: 0x%x (64OK=%d)", gcap, ctl->ok64bit); 432 436 433 /* Give codecs enough time to enumerate themselves */ 437 434 async_usleep(codec_enum_wait_us);
Note:
See TracChangeset
for help on using the changeset viewer.