Lines Matching refs:port

410 	audio810_port_t	*port = arg;  in audio810_open()  local
414 port->count = 0; in audio810_open()
415 *nframes = port->samp_frames; in audio810_open()
416 *bufp = port->samp_kaddr; in audio810_open()
451 audio810_port_t *port = arg; in audio810_stop() local
452 audio810_state_t *statep = port->statep; in audio810_stop()
455 cr = I810_BM_GET8(port->regoff + I810_OFFSET_CR); in audio810_stop()
457 I810_BM_PUT8(port->regoff + I810_OFFSET_CR, cr); in audio810_stop()
475 audio810_port_t *port = arg; in audio810_start() local
476 audio810_state_t *statep = port->statep; in audio810_start()
479 regoff = port->regoff; in audio810_start()
480 port->offset = 0; in audio810_start()
483 if (port->num == I810_PCM_OUT) { in audio810_start()
501 I810_BM_PUT32(regoff + I810_OFFSET_BD_BASE, port->bdl_paddr); in audio810_start()
551 audio810_port_t *port = arg; in audio810_channels() local
553 return (port->nchan); in audio810_channels()
591 audio810_port_t *port = arg; in audio810_count() local
592 audio810_state_t *statep = port->statep; in audio810_count()
593 uint8_t regoff = port->regoff; in audio810_count()
603 offset = I810_BM_GET16(port->picboff); in audio810_count()
605 I810_BM_PUT8(port->regoff + I810_OFFSET_LVI, (civ - 1) % I810_BD_NUMS); in audio810_count()
612 offset = port->samp_size - offset; in audio810_count()
614 if (offset < port->offset) { in audio810_count()
615 val = (port->samp_size - port->offset) + offset; in audio810_count()
617 val = offset - port->offset; in audio810_count()
619 port->offset = offset; in audio810_count()
620 port->count += (val / (port->nchan * 2)); in audio810_count()
621 val = port->count; in audio810_count()
638 audio810_port_t *port = arg; in audio810_sync() local
641 (void) ddi_dma_sync(port->samp_dmah, 0, 0, port->sync_dir); in audio810_sync()
662 audio810_port_t *port = arg; in audio810_playahead() local
663 audio810_state_t *statep = port->statep; in audio810_playahead()
1046 audio810_port_t *port; in audio810_alloc_port() local
1054 port = kmem_zalloc(sizeof (*port), KM_SLEEP); in audio810_alloc_port()
1055 statep->ports[num] = port; in audio810_alloc_port()
1056 port->statep = statep; in audio810_alloc_port()
1057 port->nchan = nchan; in audio810_alloc_port()
1058 port->num = num; in audio810_alloc_port()
1064 port->sync_dir = DDI_DMA_SYNC_FORKERNEL; in audio810_alloc_port()
1065 port->regoff = I810_BASE_PCM_IN; in audio810_alloc_port()
1070 port->sync_dir = DDI_DMA_SYNC_FORDEV; in audio810_alloc_port()
1071 port->regoff = I810_BASE_PCM_OUT; in audio810_alloc_port()
1082 port->stsoff = port->regoff + I810_OFFSET_PICB; in audio810_alloc_port()
1083 port->picboff = port->regoff + I810_OFFSET_SR; in audio810_alloc_port()
1085 port->stsoff = port->regoff + I810_OFFSET_SR; in audio810_alloc_port()
1086 port->picboff = port->regoff + I810_OFFSET_PICB; in audio810_alloc_port()
1096 port->samp_frames = 4096; in audio810_alloc_port()
1097 port->samp_size = port->samp_frames * port->nchan * sizeof (int16_t); in audio810_alloc_port()
1101 NULL, &port->samp_dmah); in audio810_alloc_port()
1107 rc = ddi_dma_mem_alloc(port->samp_dmah, port->samp_size, &buf_attr, in audio810_alloc_port()
1108 DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, NULL, &port->samp_kaddr, in audio810_alloc_port()
1109 &port->samp_size, &port->samp_acch); in audio810_alloc_port()
1112 port->samp_size, rc); in audio810_alloc_port()
1117 rc = ddi_dma_addr_bind_handle(port->samp_dmah, NULL, in audio810_alloc_port()
1118 port->samp_kaddr, port->samp_size, dir|DDI_DMA_CONSISTENT, in audio810_alloc_port()
1125 port->samp_paddr = cookie.dmac_address; in audio810_alloc_port()
1132 NULL, &port->bdl_dmah); in audio810_alloc_port()
1141 port->bdl_size = sizeof (i810_bd_entry_t) * I810_BD_NUMS; in audio810_alloc_port()
1142 rc = ddi_dma_mem_alloc(port->bdl_dmah, port->bdl_size, in audio810_alloc_port()
1144 &port->bdl_kaddr, &port->bdl_size, &port->bdl_acch); in audio810_alloc_port()
1150 rc = ddi_dma_addr_bind_handle(port->bdl_dmah, NULL, port->bdl_kaddr, in audio810_alloc_port()
1151 port->bdl_size, DDI_DMA_WRITE|DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, in audio810_alloc_port()
1157 port->bdl_paddr = cookie.dmac_address; in audio810_alloc_port()
1162 bdentry = (void *)port->bdl_kaddr; in audio810_alloc_port()
1166 ddi_put32(port->bdl_acch, &bdentry->buf_base, in audio810_alloc_port()
1167 port->samp_paddr); in audio810_alloc_port()
1169 ddi_put16(port->bdl_acch, &bdentry->buf_len, in audio810_alloc_port()
1170 statep->quirk == QUIRK_SIS7012 ? port->samp_size : in audio810_alloc_port()
1171 port->samp_size / 2); in audio810_alloc_port()
1172 ddi_put16(port->bdl_acch, &bdentry->buf_cmd, BUF_CMD_BUP); in audio810_alloc_port()
1176 (void) ddi_dma_sync(port->bdl_dmah, 0, 0, DDI_DMA_SYNC_FORDEV); in audio810_alloc_port()
1178 port->engine = audio_engine_alloc(&audio810_engine_ops, caps); in audio810_alloc_port()
1179 if (port->engine == NULL) { in audio810_alloc_port()
1184 audio_engine_set_private(port->engine, port); in audio810_alloc_port()
1185 audio_dev_add_engine(adev, port->engine); in audio810_alloc_port()
1201 audio810_free_port(audio810_port_t *port) in audio810_free_port() argument
1203 if (port == NULL) in audio810_free_port()
1206 if (port->engine) { in audio810_free_port()
1207 audio_dev_remove_engine(port->statep->adev, port->engine); in audio810_free_port()
1208 audio_engine_free(port->engine); in audio810_free_port()
1210 if (port->bdl_paddr) { in audio810_free_port()
1211 (void) ddi_dma_unbind_handle(port->bdl_dmah); in audio810_free_port()
1213 if (port->bdl_acch) { in audio810_free_port()
1214 ddi_dma_mem_free(&port->bdl_acch); in audio810_free_port()
1216 if (port->bdl_dmah) { in audio810_free_port()
1217 ddi_dma_free_handle(&port->bdl_dmah); in audio810_free_port()
1219 if (port->samp_paddr) { in audio810_free_port()
1220 (void) ddi_dma_unbind_handle(port->samp_dmah); in audio810_free_port()
1222 if (port->samp_acch) { in audio810_free_port()
1223 ddi_dma_mem_free(&port->samp_acch); in audio810_free_port()
1225 if (port->samp_dmah) { in audio810_free_port()
1226 ddi_dma_free_handle(&port->samp_dmah); in audio810_free_port()
1228 kmem_free(port, sizeof (*port)); in audio810_free_port()