Commit cc31b6f7 authored by Rabin Vincent's avatar Rabin Vincent Committed by Dan Williams

dma40: pass the info pointer all the way to reduce argument count

Acked-by: default avatarPer Forlin <per.forlin@stericsson.com>
Acked-by: default avatarJonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: default avatarRabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@stericsson.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 5ed04b85
...@@ -1679,17 +1679,13 @@ d40_prep_sg_phy(struct d40_chan *chan, struct d40_desc *desc, ...@@ -1679,17 +1679,13 @@ d40_prep_sg_phy(struct d40_chan *chan, struct d40_desc *desc,
desc->lli_phy.src, desc->lli_phy.src,
virt_to_phys(desc->lli_phy.src), virt_to_phys(desc->lli_phy.src),
chan->src_def_cfg, chan->src_def_cfg,
src_info->data_width, src_info, dst_info);
dst_info->data_width,
src_info->psize);
ret = d40_phy_sg_to_lli(sg_dst, sg_len, dst_dev_addr, ret = d40_phy_sg_to_lli(sg_dst, sg_len, dst_dev_addr,
desc->lli_phy.dst, desc->lli_phy.dst,
virt_to_phys(desc->lli_phy.dst), virt_to_phys(desc->lli_phy.dst),
chan->dst_def_cfg, chan->dst_def_cfg,
dst_info->data_width, dst_info, src_info);
src_info->data_width,
dst_info->psize);
dma_sync_single_for_device(chan->base->dev, desc->lli_pool.dma_addr, dma_sync_single_for_device(chan->base->dev, desc->lli_pool.dma_addr,
desc->lli_pool.size, DMA_TO_DEVICE); desc->lli_pool.size, DMA_TO_DEVICE);
......
...@@ -125,13 +125,14 @@ void d40_phy_cfg(struct stedma40_chan_cfg *cfg, ...@@ -125,13 +125,14 @@ void d40_phy_cfg(struct stedma40_chan_cfg *cfg,
static int d40_phy_fill_lli(struct d40_phy_lli *lli, static int d40_phy_fill_lli(struct d40_phy_lli *lli,
dma_addr_t data, dma_addr_t data,
u32 data_size, u32 data_size,
int psize,
dma_addr_t next_lli, dma_addr_t next_lli,
u32 reg_cfg, u32 reg_cfg,
bool term_int, bool term_int,
u32 data_width, bool is_device,
bool is_device) struct stedma40_half_channel_info *info)
{ {
unsigned int data_width = info->data_width;
int psize = info->psize;
int num_elems; int num_elems;
if (psize == STEDMA40_PSIZE_PHY_1) if (psize == STEDMA40_PSIZE_PHY_1)
...@@ -198,16 +199,11 @@ static int d40_seg_size(int size, int data_width1, int data_width2) ...@@ -198,16 +199,11 @@ static int d40_seg_size(int size, int data_width1, int data_width2)
return seg_max; return seg_max;
} }
static struct d40_phy_lli *d40_phy_buf_to_lli(struct d40_phy_lli *lli, static struct d40_phy_lli *
dma_addr_t addr, d40_phy_buf_to_lli(struct d40_phy_lli *lli, dma_addr_t addr, u32 size,
u32 size, dma_addr_t lli_phys, u32 reg_cfg, bool term_int,
int psize, bool is_device, struct stedma40_half_channel_info *info,
dma_addr_t lli_phys, struct stedma40_half_channel_info *otherinfo)
u32 reg_cfg,
bool term_int,
u32 data_width1,
u32 data_width2,
bool is_device)
{ {
int err; int err;
dma_addr_t next = lli_phys; dma_addr_t next = lli_phys;
...@@ -215,7 +211,8 @@ static struct d40_phy_lli *d40_phy_buf_to_lli(struct d40_phy_lli *lli, ...@@ -215,7 +211,8 @@ static struct d40_phy_lli *d40_phy_buf_to_lli(struct d40_phy_lli *lli,
int size_seg = 0; int size_seg = 0;
do { do {
size_seg = d40_seg_size(size_rest, data_width1, data_width2); size_seg = d40_seg_size(size_rest, info->data_width,
otherinfo->data_width);
size_rest -= size_seg; size_rest -= size_seg;
if (term_int && size_rest == 0) if (term_int && size_rest == 0)
...@@ -227,12 +224,11 @@ static struct d40_phy_lli *d40_phy_buf_to_lli(struct d40_phy_lli *lli, ...@@ -227,12 +224,11 @@ static struct d40_phy_lli *d40_phy_buf_to_lli(struct d40_phy_lli *lli,
err = d40_phy_fill_lli(lli, err = d40_phy_fill_lli(lli,
addr, addr,
size_seg, size_seg,
psize,
next, next,
reg_cfg, reg_cfg,
!next, !next,
data_width1, is_device,
is_device); info);
if (err) if (err)
goto err; goto err;
...@@ -254,9 +250,8 @@ int d40_phy_sg_to_lli(struct scatterlist *sg, ...@@ -254,9 +250,8 @@ int d40_phy_sg_to_lli(struct scatterlist *sg,
struct d40_phy_lli *lli_sg, struct d40_phy_lli *lli_sg,
dma_addr_t lli_phys, dma_addr_t lli_phys,
u32 reg_cfg, u32 reg_cfg,
u32 data_width1, struct stedma40_half_channel_info *info,
u32 data_width2, struct stedma40_half_channel_info *otherinfo)
int psize)
{ {
int total_size = 0; int total_size = 0;
int i; int i;
...@@ -280,13 +275,12 @@ int d40_phy_sg_to_lli(struct scatterlist *sg, ...@@ -280,13 +275,12 @@ int d40_phy_sg_to_lli(struct scatterlist *sg,
lli = d40_phy_buf_to_lli(lli, lli = d40_phy_buf_to_lli(lli,
dst, dst,
sg_dma_len(current_sg), sg_dma_len(current_sg),
psize,
l_phys, l_phys,
reg_cfg, reg_cfg,
sg_len - 1 == i, sg_len - 1 == i,
data_width1, target == dst,
data_width2, info,
target == dst); otherinfo);
if (lli == NULL) if (lli == NULL)
return -EINVAL; return -EINVAL;
} }
......
...@@ -308,9 +308,8 @@ int d40_phy_sg_to_lli(struct scatterlist *sg, ...@@ -308,9 +308,8 @@ int d40_phy_sg_to_lli(struct scatterlist *sg,
struct d40_phy_lli *lli, struct d40_phy_lli *lli,
dma_addr_t lli_phys, dma_addr_t lli_phys,
u32 reg_cfg, u32 reg_cfg,
u32 data_width1, struct stedma40_half_channel_info *info,
u32 data_width2, struct stedma40_half_channel_info *otherinfo);
int psize);
/* Logical channels */ /* Logical channels */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment