• Home
  • Raw
  • Download

Lines Matching refs:s

1040 static int snd_m3_pcm_start(struct snd_m3 *chip, struct m3_dma *s,  in snd_m3_pcm_start()  argument
1043 if (! s || ! subs) in snd_m3_pcm_start()
1051 s->inst.data + CDATA_INSTANCE_READY, 1); in snd_m3_pcm_start()
1060 s->inst.data + CDATA_INSTANCE_READY, 1); in snd_m3_pcm_start()
1067 static int snd_m3_pcm_stop(struct snd_m3 *chip, struct m3_dma *s, in snd_m3_pcm_stop() argument
1070 if (! s || ! subs) in snd_m3_pcm_stop()
1074 s->inst.data + CDATA_INSTANCE_READY, 0); in snd_m3_pcm_stop()
1095 struct m3_dma *s = subs->runtime->private_data; in snd_m3_pcm_trigger() local
1098 if (snd_BUG_ON(!s)) in snd_m3_pcm_trigger()
1105 if (s->running) in snd_m3_pcm_trigger()
1108 s->running = 1; in snd_m3_pcm_trigger()
1109 err = snd_m3_pcm_start(chip, s, subs); in snd_m3_pcm_trigger()
1114 if (! s->running) in snd_m3_pcm_trigger()
1117 s->running = 0; in snd_m3_pcm_trigger()
1118 err = snd_m3_pcm_stop(chip, s, subs); in snd_m3_pcm_trigger()
1130 snd_m3_pcm_setup1(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substream *subs) in snd_m3_pcm_setup1() argument
1142 dsp_in_buffer = s->inst.data + (MINISRC_TMP_BUFFER_SIZE / 2); in snd_m3_pcm_setup1()
1145 s->dma_size = frames_to_bytes(runtime, runtime->buffer_size); in snd_m3_pcm_setup1()
1146 s->period_size = frames_to_bytes(runtime, runtime->period_size); in snd_m3_pcm_setup1()
1147 s->hwptr = 0; in snd_m3_pcm_setup1()
1148 s->count = 0; in snd_m3_pcm_setup1()
1155 s->inst.data + CDATA_HOST_SRC_ADDRL, in snd_m3_pcm_setup1()
1156 LO(s->buffer_addr)); in snd_m3_pcm_setup1()
1159 s->inst.data + CDATA_HOST_SRC_ADDRH, in snd_m3_pcm_setup1()
1160 HI(s->buffer_addr)); in snd_m3_pcm_setup1()
1163 s->inst.data + CDATA_HOST_SRC_END_PLUS_1L, in snd_m3_pcm_setup1()
1164 LO(s->buffer_addr + s->dma_size)); in snd_m3_pcm_setup1()
1167 s->inst.data + CDATA_HOST_SRC_END_PLUS_1H, in snd_m3_pcm_setup1()
1168 HI(s->buffer_addr + s->dma_size)); in snd_m3_pcm_setup1()
1171 s->inst.data + CDATA_HOST_SRC_CURRENTL, in snd_m3_pcm_setup1()
1172 LO(s->buffer_addr)); in snd_m3_pcm_setup1()
1175 s->inst.data + CDATA_HOST_SRC_CURRENTH, in snd_m3_pcm_setup1()
1176 HI(s->buffer_addr)); in snd_m3_pcm_setup1()
1183 s->inst.data + CDATA_IN_BUF_BEGIN, in snd_m3_pcm_setup1()
1187 s->inst.data + CDATA_IN_BUF_END_PLUS_1, in snd_m3_pcm_setup1()
1191 s->inst.data + CDATA_IN_BUF_HEAD, in snd_m3_pcm_setup1()
1195 s->inst.data + CDATA_IN_BUF_TAIL, in snd_m3_pcm_setup1()
1199 s->inst.data + CDATA_OUT_BUF_BEGIN, in snd_m3_pcm_setup1()
1203 s->inst.data + CDATA_OUT_BUF_END_PLUS_1, in snd_m3_pcm_setup1()
1207 s->inst.data + CDATA_OUT_BUF_HEAD, in snd_m3_pcm_setup1()
1211 s->inst.data + CDATA_OUT_BUF_TAIL, in snd_m3_pcm_setup1()
1215 static void snd_m3_pcm_setup2(struct snd_m3 *chip, struct m3_dma *s, in snd_m3_pcm_setup2() argument
1223 if (! s->in_lists) { in snd_m3_pcm_setup2()
1224 s->index[0] = snd_m3_add_list(chip, s->index_list[0], in snd_m3_pcm_setup2()
1225 s->inst.data >> DP_SHIFT_COUNT); in snd_m3_pcm_setup2()
1226 s->index[1] = snd_m3_add_list(chip, s->index_list[1], in snd_m3_pcm_setup2()
1227 s->inst.data >> DP_SHIFT_COUNT); in snd_m3_pcm_setup2()
1228 s->index[2] = snd_m3_add_list(chip, s->index_list[2], in snd_m3_pcm_setup2()
1229 s->inst.data >> DP_SHIFT_COUNT); in snd_m3_pcm_setup2()
1230 s->in_lists = 1; in snd_m3_pcm_setup2()
1235 s->inst.data + SRC3_DIRECTION_OFFSET + 1, in snd_m3_pcm_setup2()
1239 s->inst.data + SRC3_DIRECTION_OFFSET + 2, in snd_m3_pcm_setup2()
1248 s->inst.data + CDATA_FREQUENCY, in snd_m3_pcm_setup2()
1282 snd_m3_playback_setup(struct snd_m3 *chip, struct m3_dma *s, in snd_m3_playback_setup() argument
1292 s->inst.data + SRC3_DIRECTION_OFFSET + 12, in snd_m3_playback_setup()
1293 s->inst.data + 40 + 8); in snd_m3_playback_setup()
1296 s->inst.data + SRC3_DIRECTION_OFFSET + 19, in snd_m3_playback_setup()
1297 s->inst.code + MINISRC_COEF_LOC); in snd_m3_playback_setup()
1301 s->inst.data + SRC3_DIRECTION_OFFSET + 22, in snd_m3_playback_setup()
1306 s->inst.data + CDATA_DMA_CONTROL, in snd_m3_playback_setup()
1314 s->inst.data + pv[i].addr, pv[i].val); in snd_m3_playback_setup()
1349 snd_m3_capture_setup(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substream *subs) in snd_m3_capture_setup() argument
1358 s->inst.data + SRC3_DIRECTION_OFFSET + 12, in snd_m3_capture_setup()
1359 s->inst.data + 40 + 8); in snd_m3_capture_setup()
1363 s->inst.data + CDATA_DMA_CONTROL, in snd_m3_capture_setup()
1372 s->inst.data + rv[i].addr, rv[i].val); in snd_m3_capture_setup()
1378 struct m3_dma *s = substream->runtime->private_data; in snd_m3_pcm_hw_params() local
1381 s->buffer_addr = substream->runtime->dma_addr; in snd_m3_pcm_hw_params()
1382 if (s->buffer_addr & 0x3) { in snd_m3_pcm_hw_params()
1384 s->buffer_addr = s->buffer_addr & ~0x3; in snd_m3_pcm_hw_params()
1391 struct m3_dma *s; in snd_m3_pcm_hw_free() local
1395 s = substream->runtime->private_data; in snd_m3_pcm_hw_free()
1396 s->buffer_addr = 0; in snd_m3_pcm_hw_free()
1405 struct m3_dma *s = runtime->private_data; in snd_m3_pcm_prepare() local
1407 if (snd_BUG_ON(!s)) in snd_m3_pcm_prepare()
1419 snd_m3_pcm_setup1(chip, s, subs); in snd_m3_pcm_prepare()
1422 snd_m3_playback_setup(chip, s, subs); in snd_m3_pcm_prepare()
1424 snd_m3_capture_setup(chip, s, subs); in snd_m3_pcm_prepare()
1426 snd_m3_pcm_setup2(chip, s, runtime); in snd_m3_pcm_prepare()
1437 snd_m3_get_pointer(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substream *subs) in snd_m3_get_pointer() argument
1448 s->inst.data + CDATA_HOST_SRC_CURRENTH); in snd_m3_get_pointer()
1451 s->inst.data + CDATA_HOST_SRC_CURRENTL); in snd_m3_get_pointer()
1454 s->inst.data + CDATA_HOST_SRC_CURRENTH)) in snd_m3_get_pointer()
1458 return (unsigned int)(addr - s->buffer_addr); in snd_m3_get_pointer()
1466 struct m3_dma *s = subs->runtime->private_data; in snd_m3_pcm_pointer() local
1468 if (snd_BUG_ON(!s)) in snd_m3_pcm_pointer()
1472 ptr = snd_m3_get_pointer(chip, s, subs); in snd_m3_pcm_pointer()
1480 static void snd_m3_update_ptr(struct snd_m3 *chip, struct m3_dma *s) in snd_m3_update_ptr() argument
1482 struct snd_pcm_substream *subs = s->substream; in snd_m3_update_ptr()
1486 if (! s->running) in snd_m3_update_ptr()
1489 hwptr = snd_m3_get_pointer(chip, s, subs); in snd_m3_update_ptr()
1492 if (hwptr >= s->dma_size) in snd_m3_update_ptr()
1493 hwptr %= s->dma_size; in snd_m3_update_ptr()
1495 diff = s->dma_size + hwptr - s->hwptr; in snd_m3_update_ptr()
1496 if (diff >= s->dma_size) in snd_m3_update_ptr()
1497 diff %= s->dma_size; in snd_m3_update_ptr()
1499 s->hwptr = hwptr; in snd_m3_update_ptr()
1500 s->count += diff; in snd_m3_update_ptr()
1502 if (s->count >= (signed)s->period_size) { in snd_m3_update_ptr()
1504 if (s->count < 2 * (signed)s->period_size) in snd_m3_update_ptr()
1505 s->count -= (signed)s->period_size; in snd_m3_update_ptr()
1507 s->count %= s->period_size; in snd_m3_update_ptr()
1636 struct m3_dma *s = &chip->substreams[i]; in snd_m3_interrupt() local
1637 if (s->running) in snd_m3_interrupt()
1638 snd_m3_update_ptr(chip, s); in snd_m3_interrupt()
1710 struct m3_dma *s; in snd_m3_substream_open() local
1714 s = &chip->substreams[i]; in snd_m3_substream_open()
1715 if (! s->opened) in snd_m3_substream_open()
1721 s->opened = 1; in snd_m3_substream_open()
1722 s->running = 0; in snd_m3_substream_open()
1725 subs->runtime->private_data = s; in snd_m3_substream_open()
1726 s->substream = subs; in snd_m3_substream_open()
1730 s->index_list[0] = &chip->mixer_list; in snd_m3_substream_open()
1732 s->index_list[0] = &chip->adc1_list; in snd_m3_substream_open()
1733 s->index_list[1] = &chip->msrc_list; in snd_m3_substream_open()
1734 s->index_list[2] = &chip->dma_list; in snd_m3_substream_open()
1742 struct m3_dma *s = subs->runtime->private_data; in snd_m3_substream_close() local
1744 if (s == NULL) in snd_m3_substream_close()
1748 if (s->substream && s->running) in snd_m3_substream_close()
1749 snd_m3_pcm_stop(chip, s, s->substream); /* does this happen? */ in snd_m3_substream_close()
1750 if (s->in_lists) { in snd_m3_substream_close()
1751 snd_m3_remove_list(chip, s->index_list[0], s->index[0]); in snd_m3_substream_close()
1752 snd_m3_remove_list(chip, s->index_list[1], s->index[1]); in snd_m3_substream_close()
1753 snd_m3_remove_list(chip, s->index_list[2], s->index[2]); in snd_m3_substream_close()
1754 s->in_lists = 0; in snd_m3_substream_close()
1756 s->running = 0; in snd_m3_substream_close()
1757 s->opened = 0; in snd_m3_substream_close()
2172 static int snd_m3_assp_client_init(struct snd_m3 *chip, struct m3_dma *s, int index) in snd_m3_assp_client_init() argument
2199 s->number = index; in snd_m3_assp_client_init()
2200 s->inst.code = 0x400; in snd_m3_assp_client_init()
2201 s->inst.data = address; in snd_m3_assp_client_init()
2345 struct m3_dma *s; in snd_m3_free() local
2353 s = &chip->substreams[i]; in snd_m3_free()
2355 if (s->substream && s->running) in snd_m3_free()
2356 snd_m3_pcm_stop(chip, s, s->substream); in snd_m3_free()
2611 struct m3_dma *s = &chip->substreams[i]; in snd_m3_create() local
2612 err = snd_m3_assp_client_init(chip, s, i); in snd_m3_create()