Changeset 1412a184 in mainline for uspace/drv/audio/hdaudio/hdactl.c


Ignore:
Timestamp:
2014-08-16T15:34:44Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a333b7f
Parents:
65b09c1
Message:

Stream management. Attempt some playback.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/hdaudio/hdactl.c

    r65b09c1 r1412a184  
    102102        uint8_t sizecap;
    103103        uint8_t selsz;
    104         bool ok64bit;
    105104        int rc;
    106105
     
    131130        hda->ctl->corb_entries = hda_rb_entries(selsz);
    132131
    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);
    137132
    138133        /*
     
    142137        hda->ctl->corb_virt = AS_AREA_ANY;
    143138        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,
    145140            &hda->ctl->corb_phys, &hda->ctl->corb_virt);
    146141
     
    178173        uint8_t sizecap;
    179174        uint8_t selsz;
    180         bool ok64bit;
    181175        int rc;
    182176
     
    207201        hda->ctl->rirb_entries = hda_rb_entries(selsz);
    208202
    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 
    214203        /*
    215204         * RIRB must be aligned to 128 bytes. If 64OK is not set,
     
    218207        hda->ctl->rirb_virt = AS_AREA_ANY;
    219208        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,
    221210            &hda->ctl->rirb_phys, &hda->ctl->rirb_virt);
    222211
     
    434423        ddf_msg(LVL_NOTE, "Controller is out of reset.");
    435424
     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
    436433        /* Give codecs enough time to enumerate themselves */
    437434        async_usleep(codec_enum_wait_us);
Note: See TracChangeset for help on using the changeset viewer.