Skip to content

Commit f823ae2

Browse files
author
Codrin Ciubotariu
committed
ASoC: atmel: mchp-asrc: add several debug prints
Several debug prints are added to print the DMA transfer to users-space parameters Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
1 parent 154b896 commit f823ae2

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

sound/soc/atmel/mchp-asrc-dma.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ static void mchp_asrc_start_handle(unsigned long data)
258258
dma_async_issue_pending(dma_be_priv->desc->chan);
259259
}
260260

261-
static int mchp_asrc_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream,
261+
static int mchp_asrc_dmaengine_pcm_prepare_slave_config(struct device *dev,
262+
struct snd_pcm_substream *substream,
262263
struct snd_pcm_hw_params *params,
263264
struct snd_dmaengine_dai_dma_data *dma_data,
264265
struct dma_slave_config *slave_config)
@@ -270,6 +271,14 @@ static int mchp_asrc_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream
270271
return ret;
271272

272273
snd_dmaengine_pcm_set_config_from_dai_data(substream, dma_data, slave_config);
274+
dev_dbg(dev,
275+
"%s() FE AIF dir %s, src addr %#x, dst addr: %#x, src_addr_width %d, dst_addr_width %d, src maxburst %u, dst maxburst %u\n",
276+
__func__,
277+
slave_config->direction == DMA_MEM_TO_DEV ? "DMA_MEM_TO_DEV" :
278+
"DMA_DEV_TO_MEM",
279+
slave_config->src_addr, slave_config->dst_addr,
280+
slave_config->src_addr_width, slave_config->dst_addr_width,
281+
slave_config->src_maxburst, slave_config->dst_maxburst);
273282

274283
return 0;
275284
}
@@ -476,8 +485,8 @@ static int mchp_asrc_dma_hw_params(struct snd_soc_component *component,
476485
goto __cleanup_free_fe;
477486
}
478487

479-
ret = mchp_asrc_dmaengine_pcm_prepare_slave_config(substream, params, dma_data_fe,
480-
&config_fe);
488+
ret = mchp_asrc_dmaengine_pcm_prepare_slave_config(dev, substream, params,
489+
dma_data_fe, &config_fe);
481490
if (ret) {
482491
dev_err(dev, "failed to prepare DMA config for FE %s\n", cpu_dai->name);
483492
goto __cleanup_dma_fe;
@@ -759,8 +768,11 @@ static int mchp_asrc_dma_prepare(struct snd_soc_component *component,
759768
}
760769
dma_fe_priv->desc = desc;
761770

762-
dev_dbg(dev, "%s() FE buffer_size %ld, period_size %ld\n", __func__,
763-
subs->runtime->buffer_size, subs->runtime->period_size);
771+
dev_dbg(dev,
772+
"%s() FE buffer_size(periods) %ld, buffer_size(bytes) %u period_size(frames) %ld period_size(bytes) %u\n",
773+
__func__,
774+
subs->runtime->buffer_size, snd_pcm_lib_buffer_bytes(subs),
775+
subs->runtime->period_size, snd_pcm_lib_period_bytes(subs));
764776
dma_fe_priv->desc->callback = mchp_asrc_pcm_dma_complete;
765777
dma_fe_priv->desc->callback_param = subs;
766778
} else {

0 commit comments

Comments
 (0)