Lines Matching refs:prtd
100 struct q6apm_dai_rtd *prtd = priv; in event_handler() local
101 struct snd_pcm_substream *substream = prtd->substream; in event_handler()
105 prtd->state = Q6APM_STREAM_STOPPED; in event_handler()
108 prtd->pos += prtd->pcm_count; in event_handler()
110 if (prtd->state == Q6APM_STREAM_RUNNING) in event_handler()
111 q6apm_write_async(prtd->graph, prtd->pcm_count, 0, 0, 0); in event_handler()
115 prtd->pos += prtd->pcm_count; in event_handler()
117 if (prtd->state == Q6APM_STREAM_RUNNING) in event_handler()
118 q6apm_read(prtd->graph); in event_handler()
130 struct q6apm_dai_rtd *prtd = runtime->private_data; in q6apm_dai_prepare() local
140 if (!prtd || !prtd->graph) { in q6apm_dai_prepare()
148 cfg.bit_width = prtd->bits_per_sample; in q6apm_dai_prepare()
150 if (prtd->state) { in q6apm_dai_prepare()
152 q6apm_graph_stop(prtd->graph); in q6apm_dai_prepare()
153 q6apm_unmap_memory_regions(prtd->graph, substream->stream); in q6apm_dai_prepare()
156 prtd->pcm_count = snd_pcm_lib_period_bytes(substream); in q6apm_dai_prepare()
157 prtd->pos = 0; in q6apm_dai_prepare()
159 ret = q6apm_graph_media_format_shmem(prtd->graph, &cfg); in q6apm_dai_prepare()
165 ret = q6apm_graph_media_format_pcm(prtd->graph, &cfg); in q6apm_dai_prepare()
169 ret = q6apm_map_memory_regions(prtd->graph, substream->stream, prtd->phys, in q6apm_dai_prepare()
170 (prtd->pcm_size / prtd->periods), prtd->periods); in q6apm_dai_prepare()
177 ret = q6apm_graph_prepare(prtd->graph); in q6apm_dai_prepare()
183 ret = q6apm_graph_start(prtd->graph); in q6apm_dai_prepare()
193 q6apm_read(prtd->graph); in q6apm_dai_prepare()
198 prtd->state = Q6APM_STREAM_RUNNING; in q6apm_dai_prepare()
207 struct q6apm_dai_rtd *prtd = runtime->private_data; in q6apm_dai_trigger() local
216 ret = q6apm_write_async(prtd->graph, prtd->pcm_count, 0, 0, 0); in q6apm_dai_trigger()
220 prtd->state = Q6APM_STREAM_STOPPED; in q6apm_dai_trigger()
241 struct q6apm_dai_rtd *prtd; in q6apm_dai_open() local
252 prtd = kzalloc(sizeof(*prtd), GFP_KERNEL); in q6apm_dai_open()
253 if (prtd == NULL) in q6apm_dai_open()
256 prtd->substream = substream; in q6apm_dai_open()
257 prtd->graph = q6apm_graph_open(dev, (q6apm_cb)event_handler, prtd, graph_id); in q6apm_dai_open()
258 if (IS_ERR(prtd->graph)) { in q6apm_dai_open()
260 ret = PTR_ERR(prtd->graph); in q6apm_dai_open()
297 runtime->private_data = prtd; in q6apm_dai_open()
300 prtd->phys = substream->dma_buffer.addr; in q6apm_dai_open()
302 prtd->phys = substream->dma_buffer.addr | (pdata->sid << 32); in q6apm_dai_open()
306 kfree(prtd); in q6apm_dai_open()
315 struct q6apm_dai_rtd *prtd = runtime->private_data; in q6apm_dai_close() local
317 if (prtd->state) { /* only stop graph that is started */ in q6apm_dai_close()
318 q6apm_graph_stop(prtd->graph); in q6apm_dai_close()
319 q6apm_unmap_memory_regions(prtd->graph, substream->stream); in q6apm_dai_close()
322 q6apm_graph_close(prtd->graph); in q6apm_dai_close()
323 prtd->graph = NULL; in q6apm_dai_close()
324 kfree(prtd); in q6apm_dai_close()
334 struct q6apm_dai_rtd *prtd = runtime->private_data; in q6apm_dai_pointer() local
336 if (prtd->pos == prtd->pcm_size) in q6apm_dai_pointer()
337 prtd->pos = 0; in q6apm_dai_pointer()
339 return bytes_to_frames(runtime, prtd->pos); in q6apm_dai_pointer()
347 struct q6apm_dai_rtd *prtd = runtime->private_data; in q6apm_dai_hw_params() local
349 prtd->pcm_size = params_buffer_bytes(params); in q6apm_dai_hw_params()
350 prtd->periods = params_periods(params); in q6apm_dai_hw_params()
354 prtd->bits_per_sample = 16; in q6apm_dai_hw_params()
357 prtd->bits_per_sample = 24; in q6apm_dai_hw_params()