aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-09-20 09:10:20 +0200
committerLinus Walleij <linus.walleij@linaro.org>2018-02-20 14:42:57 +0100
commit44796a0f54a06bf8508415a96085d3c890eef7df (patch)
treed61c53dc236b8ed279351bbd66bd955727c9da7a /drivers
parent47f093caebf0678a277f814b2c2ac8bf00e8ce0d (diff)
downloadlinux-stericsson-ux500-audio-rewrite.tar.gz
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dma/ste_dma40.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index b630323fc905..cdbde5582e81 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1840,6 +1840,8 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user)
bool is_src;
bool is_log = d40c->dma_cfg.mode == STEDMA40_MODE_LOGICAL;
+ dev_info(chan2dev(d40c), "ENTER %s\n", __func__);
+
phys = d40c->base->phy_res;
num_phy_chans = d40c->base->num_phy_chans;
@@ -1950,6 +1952,8 @@ out:
else
d40c->base->lookup_phy_chans[d40c->phy_chan->num] = d40c;
+ dev_info(chan2dev(d40c), "EXIT OK %s\n", __func__);
+
return 0;
}
@@ -1958,6 +1962,8 @@ static int d40_config_memcpy(struct d40_chan *d40c)
{
dma_cap_mask_t cap = d40c->chan.device->cap_mask;
+ dev_info(chan2dev(d40c), "ENTER %s\n", __func__);
+
if (dma_has_cap(DMA_MEMCPY, cap) && !dma_has_cap(DMA_SLAVE, cap)) {
d40c->dma_cfg = dma40_memcpy_conf_log;
d40c->dma_cfg.dev_type = dma40_memcpy_channels[d40c->chan.chan_id];
@@ -1977,10 +1983,12 @@ static int d40_config_memcpy(struct d40_chan *d40c)
d40c->dst_def_cfg |= BIT(D40_SREG_CFG_EIM_POS);
} else {
- chan_err(d40c, "No memcpy\n");
+ chan_err(d40c, "EXIT No memcpy\n");
return -EINVAL;
}
+ dev_info(chan2dev(d40c), "EXIT OK %s\n", __func__);
+
return 0;
}
@@ -2273,6 +2281,7 @@ bool stedma40_filter(struct dma_chan *chan, void *data)
int err;
if (data) {
+ dev_info(chan2dev(d40c), "VALIDATE CONF %s\n", __func__);
err = d40_validate_conf(d40c, info);
if (!err)
d40c->dma_cfg = *info;
@@ -2355,17 +2364,25 @@ static struct dma_chan *d40_xlate(struct of_phandle_args *dma_spec,
flags = dma_spec->args[2];
switch (D40_DT_FLAGS_MODE(flags)) {
- case 0: cfg.mode = STEDMA40_MODE_LOGICAL; break;
- case 1: cfg.mode = STEDMA40_MODE_PHYSICAL; break;
+ case 0:
+ cfg.mode = STEDMA40_MODE_LOGICAL;
+ pr_info("d40_xlate: logical channel device %d\n", cfg.dev_type);
+ break;
+ case 1:
+ cfg.mode = STEDMA40_MODE_PHYSICAL;
+ pr_info("d40_xlate: physical channel device %d\n", cfg.dev_type);
+ break;
}
switch (D40_DT_FLAGS_DIR(flags)) {
case 0:
cfg.dir = DMA_MEM_TO_DEV;
+ pr_info("d40_xlate: memory to device\n");
cfg.dst_info.big_endian = D40_DT_FLAGS_BIG_ENDIAN(flags);
break;
case 1:
cfg.dir = DMA_DEV_TO_MEM;
+ pr_info("d40_xlate: device to memory\n");
cfg.src_info.big_endian = D40_DT_FLAGS_BIG_ENDIAN(flags);
break;
}
@@ -2373,10 +2390,15 @@ static struct dma_chan *d40_xlate(struct of_phandle_args *dma_spec,
if (D40_DT_FLAGS_FIXED_CHAN(flags)) {
cfg.phy_channel = dma_spec->args[1];
cfg.use_fixed_channel = true;
+ pr_info("d40_xlate: use fixed physical channel %d\n", cfg.phy_channel);
+ } else {
+ pr_info("d40_xlate: use any channel, ignore arg %d\n", dma_spec->args[1]);
}
- if (D40_DT_FLAGS_HIGH_PRIO(flags))
+ if (D40_DT_FLAGS_HIGH_PRIO(flags)) {
+ pr_info("d40_xlate: high prio channel\n");
cfg.high_priority = true;
+ }
return dma_request_channel(cap, stedma40_filter, &cfg);
}
@@ -2389,6 +2411,9 @@ static int d40_alloc_chan_resources(struct dma_chan *chan)
struct d40_chan *d40c =
container_of(chan, struct d40_chan, chan);
bool is_free_phy;
+
+ dev_info(chan2dev(d40c), "ENTER %s\n", __func__);
+
spin_lock_irqsave(&d40c->lock, flags);
dma_cookie_init(chan);
@@ -2444,6 +2469,7 @@ static int d40_alloc_chan_resources(struct dma_chan *chan)
pm_runtime_mark_last_busy(d40c->base->dev);
pm_runtime_put_autosuspend(d40c->base->dev);
spin_unlock_irqrestore(&d40c->lock, flags);
+ dev_info(chan2dev(d40c), "EXIT %s %d\n", __func__, err);
return err;
}