dmaengine: k3dma: remove dma_slave_config direction usage
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Tested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
ad7756e777
commit
2ae1a237e5
|
@ -87,10 +87,10 @@ struct k3_dma_chan {
|
||||||
struct virt_dma_chan vc;
|
struct virt_dma_chan vc;
|
||||||
struct k3_dma_phy *phy;
|
struct k3_dma_phy *phy;
|
||||||
struct list_head node;
|
struct list_head node;
|
||||||
enum dma_transfer_direction dir;
|
|
||||||
dma_addr_t dev_addr;
|
dma_addr_t dev_addr;
|
||||||
enum dma_status status;
|
enum dma_status status;
|
||||||
bool cyclic;
|
bool cyclic;
|
||||||
|
struct dma_slave_config slave_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct k3_dma_phy {
|
struct k3_dma_phy {
|
||||||
|
@ -118,6 +118,10 @@ struct k3_dma_dev {
|
||||||
|
|
||||||
#define to_k3_dma(dmadev) container_of(dmadev, struct k3_dma_dev, slave)
|
#define to_k3_dma(dmadev) container_of(dmadev, struct k3_dma_dev, slave)
|
||||||
|
|
||||||
|
static int k3_dma_config_write(struct dma_chan *chan,
|
||||||
|
enum dma_transfer_direction dir,
|
||||||
|
struct dma_slave_config *cfg);
|
||||||
|
|
||||||
static struct k3_dma_chan *to_k3_chan(struct dma_chan *chan)
|
static struct k3_dma_chan *to_k3_chan(struct dma_chan *chan)
|
||||||
{
|
{
|
||||||
return container_of(chan, struct k3_dma_chan, vc.chan);
|
return container_of(chan, struct k3_dma_chan, vc.chan);
|
||||||
|
@ -536,6 +540,7 @@ static struct dma_async_tx_descriptor *k3_dma_prep_slave_sg(
|
||||||
if (!ds)
|
if (!ds)
|
||||||
return NULL;
|
return NULL;
|
||||||
num = 0;
|
num = 0;
|
||||||
|
k3_dma_config_write(chan, dir, &c->slave_config);
|
||||||
|
|
||||||
for_each_sg(sgl, sg, sglen, i) {
|
for_each_sg(sgl, sg, sglen, i) {
|
||||||
addr = sg_dma_address(sg);
|
addr = sg_dma_address(sg);
|
||||||
|
@ -596,6 +601,7 @@ k3_dma_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr,
|
||||||
avail = buf_len;
|
avail = buf_len;
|
||||||
total = avail;
|
total = avail;
|
||||||
num = 0;
|
num = 0;
|
||||||
|
k3_dma_config_write(chan, dir, &c->slave_config);
|
||||||
|
|
||||||
if (period_len < modulo)
|
if (period_len < modulo)
|
||||||
modulo = period_len;
|
modulo = period_len;
|
||||||
|
@ -636,18 +642,26 @@ static int k3_dma_config(struct dma_chan *chan,
|
||||||
struct dma_slave_config *cfg)
|
struct dma_slave_config *cfg)
|
||||||
{
|
{
|
||||||
struct k3_dma_chan *c = to_k3_chan(chan);
|
struct k3_dma_chan *c = to_k3_chan(chan);
|
||||||
|
|
||||||
|
memcpy(&c->slave_config, cfg, sizeof(*cfg));
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int k3_dma_config_write(struct dma_chan *chan,
|
||||||
|
enum dma_transfer_direction dir,
|
||||||
|
struct dma_slave_config *cfg)
|
||||||
|
{
|
||||||
|
struct k3_dma_chan *c = to_k3_chan(chan);
|
||||||
u32 maxburst = 0, val = 0;
|
u32 maxburst = 0, val = 0;
|
||||||
enum dma_slave_buswidth width = DMA_SLAVE_BUSWIDTH_UNDEFINED;
|
enum dma_slave_buswidth width = DMA_SLAVE_BUSWIDTH_UNDEFINED;
|
||||||
|
|
||||||
if (cfg == NULL)
|
if (dir == DMA_DEV_TO_MEM) {
|
||||||
return -EINVAL;
|
|
||||||
c->dir = cfg->direction;
|
|
||||||
if (c->dir == DMA_DEV_TO_MEM) {
|
|
||||||
c->ccfg = CX_CFG_DSTINCR;
|
c->ccfg = CX_CFG_DSTINCR;
|
||||||
c->dev_addr = cfg->src_addr;
|
c->dev_addr = cfg->src_addr;
|
||||||
maxburst = cfg->src_maxburst;
|
maxburst = cfg->src_maxburst;
|
||||||
width = cfg->src_addr_width;
|
width = cfg->src_addr_width;
|
||||||
} else if (c->dir == DMA_MEM_TO_DEV) {
|
} else if (dir == DMA_MEM_TO_DEV) {
|
||||||
c->ccfg = CX_CFG_SRCINCR;
|
c->ccfg = CX_CFG_SRCINCR;
|
||||||
c->dev_addr = cfg->dst_addr;
|
c->dev_addr = cfg->dst_addr;
|
||||||
maxburst = cfg->dst_maxburst;
|
maxburst = cfg->dst_maxburst;
|
||||||
|
|
Loading…
Reference in New Issue