Lines Matching refs:prtd
75 loongson_dma_desc *dma_desc_save(struct loongson_runtime_data *prtd) in dma_desc_save() argument
77 void __iomem *order_reg = prtd->dma_data->order_addr; in dma_desc_save()
80 val = (u64)prtd->dma_pos_desc_phy & DMA_ORDER_ASK_MASK; in dma_desc_save()
88 return prtd->dma_pos_desc; in dma_desc_save()
94 struct loongson_runtime_data *prtd = substream->runtime->private_data; in loongson_pcm_trigger() local
96 void __iomem *order_reg = prtd->dma_data->order_addr; in loongson_pcm_trigger()
103 val = prtd->dma_pos_desc_phy & DMA_ORDER_ASK_MASK; in loongson_pcm_trigger()
118 dma_desc_save(prtd); in loongson_pcm_trigger()
140 struct loongson_runtime_data *prtd = runtime->private_data; in loongson_pcm_hw_params() local
154 if (!num_periods || num_periods > prtd->dma_desc_arr_size) { in loongson_pcm_hw_params()
164 order_addr = prtd->dma_desc_arr_phy; in loongson_pcm_hw_params()
166 desc = &prtd->dma_desc_arr[i]; in loongson_pcm_hw_params()
175 desc->daddr = prtd->dma_data->dev_addr; in loongson_pcm_hw_params()
187 desc = &prtd->dma_desc_arr[num_periods - 1]; in loongson_pcm_hw_params()
188 desc->order = lower_32_bits(prtd->dma_desc_arr_phy | BIT(0)); in loongson_pcm_hw_params()
189 desc->order_hi = upper_32_bits(prtd->dma_desc_arr_phy); in loongson_pcm_hw_params()
192 *prtd->dma_pos_desc = *prtd->dma_desc_arr; in loongson_pcm_hw_params()
202 struct loongson_runtime_data *prtd = runtime->private_data; in loongson_pcm_pointer() local
207 desc = dma_desc_save(prtd); in loongson_pcm_pointer()
230 struct loongson_runtime_data *prtd; in loongson_pcm_open() local
246 prtd = kzalloc(sizeof(*prtd), GFP_KERNEL); in loongson_pcm_open()
247 if (!prtd) in loongson_pcm_open()
250 prtd->dma_desc_arr = dma_alloc_coherent(card->dev, PAGE_SIZE, in loongson_pcm_open()
251 &prtd->dma_desc_arr_phy, in loongson_pcm_open()
253 if (!prtd->dma_desc_arr) in loongson_pcm_open()
256 prtd->dma_desc_arr_size = PAGE_SIZE / sizeof(*prtd->dma_desc_arr); in loongson_pcm_open()
258 prtd->dma_pos_desc = dma_alloc_coherent(card->dev, in loongson_pcm_open()
259 sizeof(*prtd->dma_pos_desc), in loongson_pcm_open()
260 &prtd->dma_pos_desc_phy, in loongson_pcm_open()
262 if (!prtd->dma_pos_desc) in loongson_pcm_open()
266 prtd->dma_data = dma_data; in loongson_pcm_open()
268 substream->runtime->private_data = prtd; in loongson_pcm_open()
272 dma_free_coherent(card->dev, PAGE_SIZE, prtd->dma_desc_arr, in loongson_pcm_open()
273 prtd->dma_desc_arr_phy); in loongson_pcm_open()
275 kfree(prtd); in loongson_pcm_open()
284 struct loongson_runtime_data *prtd = substream->runtime->private_data; in loongson_pcm_close() local
286 dma_free_coherent(card->dev, PAGE_SIZE, prtd->dma_desc_arr, in loongson_pcm_close()
287 prtd->dma_desc_arr_phy); in loongson_pcm_close()
289 dma_free_coherent(card->dev, sizeof(*prtd->dma_pos_desc), in loongson_pcm_close()
290 prtd->dma_pos_desc, prtd->dma_pos_desc_phy); in loongson_pcm_close()
292 kfree(prtd); in loongson_pcm_close()