Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/sound/pci/hda/hdac.c
Show First 20 Lines • Show All 969 Lines • ▼ Show 20 Lines | |||||
* Wrapper function that sends only one command to a given codec | * Wrapper function that sends only one command to a given codec | ||||
****************************************************************************/ | ****************************************************************************/ | ||||
static uint32_t | static uint32_t | ||||
hdac_send_command(struct hdac_softc *sc, nid_t cad, uint32_t verb) | hdac_send_command(struct hdac_softc *sc, nid_t cad, uint32_t verb) | ||||
{ | { | ||||
int timeout; | int timeout; | ||||
uint32_t *corb; | uint32_t *corb; | ||||
if (!hdac_lockowned(sc)) | hdac_lockassert(sc); | ||||
device_printf(sc->dev, "WARNING!!!! mtx not owned!!!!\n"); | |||||
verb &= ~HDA_CMD_CAD_MASK; | verb &= ~HDA_CMD_CAD_MASK; | ||||
verb |= ((uint32_t)cad) << HDA_CMD_CAD_SHIFT; | verb |= ((uint32_t)cad) << HDA_CMD_CAD_SHIFT; | ||||
sc->codecs[cad].response = HDA_INVALID; | sc->codecs[cad].response = HDA_INVALID; | ||||
sc->codecs[cad].pending++; | sc->codecs[cad].pending++; | ||||
sc->corb_wp++; | sc->corb_wp++; | ||||
sc->corb_wp %= sc->corb_size; | sc->corb_wp %= sc->corb_size; | ||||
corb = (uint32_t *)sc->corb_dma.dma_vaddr; | corb = (uint32_t *)sc->corb_dma.dma_vaddr; | ||||
▲ Show 20 Lines • Show All 1,115 Lines • Show Last 20 Lines |