Skip to content

Commit ddea1b2

Browse files
morimotobroonie
authored andcommitted
ASoC: rsnd: dma: add DMA name on .ops
Current rsnd driver is using Audio DMAC (via DMAEngine) and Audio DMAC peri peri (via original method), and usage of these DMAC are different. Indicates its naming is useful for debugging. Signed-off-by: Kuninori Morimoto <[email protected]> Tested-by: Keita Kobayashi <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 9469b8b commit ddea1b2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

sound/soc/sh/rcar/dma.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct rsnd_dma_ctrl {
2828
};
2929

3030
struct rsnd_dma_ops {
31+
char *name;
3132
void (*start)(struct rsnd_dai_stream *io, struct rsnd_dma *dma);
3233
void (*stop)(struct rsnd_dai_stream *io, struct rsnd_dma *dma);
3334
int (*init)(struct rsnd_dai_stream *io, struct rsnd_dma *dma, int id,
@@ -190,7 +191,8 @@ static int rsnd_dmaen_init(struct rsnd_dai_stream *io,
190191
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
191192
cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
192193

193-
dev_dbg(dev, "dma : %pad -> %pad\n",
194+
dev_dbg(dev, "%s %pad -> %pad\n",
195+
dma->ops->name,
194196
&cfg.src_addr, &cfg.dst_addr);
195197

196198
ret = dmaengine_slave_config(dmaen->chan, &cfg);
@@ -223,6 +225,7 @@ static void rsnd_dmaen_quit(struct rsnd_dai_stream *io, struct rsnd_dma *dma)
223225
}
224226

225227
static struct rsnd_dma_ops rsnd_dmaen_ops = {
228+
.name = "audmac",
226229
.start = rsnd_dmaen_start,
227230
.stop = rsnd_dmaen_stop,
228231
.init = rsnd_dmaen_init,
@@ -368,6 +371,7 @@ static int rsnd_dmapp_init(struct rsnd_dai_stream *io,
368371
}
369372

370373
static struct rsnd_dma_ops rsnd_dmapp_ops = {
374+
.name = "audmac-pp",
371375
.start = rsnd_dmapp_start,
372376
.stop = rsnd_dmapp_stop,
373377
.init = rsnd_dmapp_init,
@@ -580,6 +584,7 @@ int rsnd_dma_init(struct rsnd_dai_stream *io, struct rsnd_dma *dma, int id)
580584
struct rsnd_mod *mod_to;
581585
struct rsnd_priv *priv = rsnd_io_to_priv(io);
582586
struct rsnd_dma_ctrl *dmac = rsnd_priv_to_dmac(priv);
587+
struct device *dev = rsnd_priv_to_dev(priv);
583588
int is_play = rsnd_io_is_play(io);
584589

585590
/*
@@ -606,6 +611,11 @@ int rsnd_dma_init(struct rsnd_dai_stream *io, struct rsnd_dma *dma, int id)
606611
if (rsnd_is_gen1(priv))
607612
dma->ops = &rsnd_dmaen_ops;
608613

614+
dev_dbg(dev, "%s %s[%d] -> %s[%d]\n",
615+
dma->ops->name,
616+
rsnd_mod_name(mod_from), rsnd_mod_id(mod_from),
617+
rsnd_mod_name(mod_to), rsnd_mod_id(mod_to));
618+
609619
return dma->ops->init(io, dma, id, mod_from, mod_to);
610620
}
611621

0 commit comments

Comments
 (0)