mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-03-01 17:11:59 +00:00
ste_dma40: add variable to indicate valid dma_cfg
Since we want to reduce the amount of required channel configuration and remove channel_type, don't depend on it to indicate whether the configuration is valid. Acked-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
9646b7985e
commit
ce2ca1252b
@ -175,6 +175,7 @@ struct d40_base;
|
|||||||
* @active: Active descriptor.
|
* @active: Active descriptor.
|
||||||
* @queue: Queued jobs.
|
* @queue: Queued jobs.
|
||||||
* @dma_cfg: The client configuration of this dma channel.
|
* @dma_cfg: The client configuration of this dma channel.
|
||||||
|
* @configured: whether the dma_cfg configuration is valid
|
||||||
* @base: Pointer to the device instance struct.
|
* @base: Pointer to the device instance struct.
|
||||||
* @src_def_cfg: Default cfg register setting for src.
|
* @src_def_cfg: Default cfg register setting for src.
|
||||||
* @dst_def_cfg: Default cfg register setting for dst.
|
* @dst_def_cfg: Default cfg register setting for dst.
|
||||||
@ -198,6 +199,7 @@ struct d40_chan {
|
|||||||
struct list_head active;
|
struct list_head active;
|
||||||
struct list_head queue;
|
struct list_head queue;
|
||||||
struct stedma40_chan_cfg dma_cfg;
|
struct stedma40_chan_cfg dma_cfg;
|
||||||
|
bool configured;
|
||||||
struct d40_base *base;
|
struct d40_base *base;
|
||||||
/* Default register configurations */
|
/* Default register configurations */
|
||||||
u32 src_def_cfg;
|
u32 src_def_cfg;
|
||||||
@ -1518,8 +1520,7 @@ static int d40_free_dma(struct d40_chan *d40c)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
d40c->phy_chan = NULL;
|
d40c->phy_chan = NULL;
|
||||||
/* Invalidate channel type */
|
d40c->configured = false;
|
||||||
d40c->dma_cfg.channel_type = 0;
|
|
||||||
d40c->base->lookup_phy_chans[phy->num] = NULL;
|
d40c->base->lookup_phy_chans[phy->num] = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1704,6 +1705,9 @@ bool stedma40_filter(struct dma_chan *chan, void *data)
|
|||||||
} else
|
} else
|
||||||
err = d40_config_memcpy(d40c);
|
err = d40_config_memcpy(d40c);
|
||||||
|
|
||||||
|
if (!err)
|
||||||
|
d40c->configured = true;
|
||||||
|
|
||||||
return err == 0;
|
return err == 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(stedma40_filter);
|
EXPORT_SYMBOL(stedma40_filter);
|
||||||
@ -1720,12 +1724,8 @@ static int d40_alloc_chan_resources(struct dma_chan *chan)
|
|||||||
|
|
||||||
d40c->completed = chan->cookie = 1;
|
d40c->completed = chan->cookie = 1;
|
||||||
|
|
||||||
/*
|
/* If no dma configuration is set use default configuration (memcpy) */
|
||||||
* If no dma configuration is set (channel_type == 0)
|
if (!d40c->configured) {
|
||||||
* use default configuration (memcpy)
|
|
||||||
*/
|
|
||||||
if (d40c->dma_cfg.channel_type == 0) {
|
|
||||||
|
|
||||||
err = d40_config_memcpy(d40c);
|
err = d40_config_memcpy(d40c);
|
||||||
if (err) {
|
if (err) {
|
||||||
dev_err(&d40c->chan.dev->device,
|
dev_err(&d40c->chan.dev->device,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user