aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/ste_dma40_ll.c
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-01-25 05:18:27 -0500
committerDan Williams <dan.j.williams@intel.com>2011-01-31 01:27:20 -0500
commitcc31b6f7949efd46c5f13d0758cf7b0bcb71fae2 (patch)
treebaa26092f94a3240ed12f4fc43b994618a1202b1 /drivers/dma/ste_dma40_ll.c
parent5ed04b8575cb22920b1333aeb55121339449048f (diff)
dma40: pass the info pointer all the way to reduce argument count
Acked-by: Per Forlin <per.forlin@stericsson.com> 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>
Diffstat (limited to 'drivers/dma/ste_dma40_ll.c')
-rw-r--r--drivers/dma/ste_dma40_ll.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/drivers/dma/ste_dma40_ll.c b/drivers/dma/ste_dma40_ll.c
index 9935c6dbcfe0..509a13049d7e 100644
--- a/drivers/dma/ste_dma40_ll.c
+++ b/drivers/dma/ste_dma40_ll.c
@@ -125,13 +125,14 @@ void d40_phy_cfg(struct stedma40_chan_cfg *cfg,
125static int d40_phy_fill_lli(struct d40_phy_lli *lli, 125static int d40_phy_fill_lli(struct d40_phy_lli *lli,
126 dma_addr_t data, 126 dma_addr_t data,
127 u32 data_size, 127 u32 data_size,
128 int psize,
129 dma_addr_t next_lli, 128 dma_addr_t next_lli,
130 u32 reg_cfg, 129 u32 reg_cfg,
131 bool term_int, 130 bool term_int,
132 u32 data_width, 131 bool is_device,
133 bool is_device) 132 struct stedma40_half_channel_info *info)
134{ 133{
134 unsigned int data_width = info->data_width;
135 int psize = info->psize;
135 int num_elems; 136 int num_elems;
136 137
137 if (psize == STEDMA40_PSIZE_PHY_1) 138 if (psize == STEDMA40_PSIZE_PHY_1)
@@ -198,16 +199,11 @@ static int d40_seg_size(int size, int data_width1, int data_width2)
198 return seg_max; 199 return seg_max;
199} 200}
200 201
201static struct d40_phy_lli *d40_phy_buf_to_lli(struct d40_phy_lli *lli, 202static struct d40_phy_lli *
202 dma_addr_t addr, 203d40_phy_buf_to_lli(struct d40_phy_lli *lli, dma_addr_t addr, u32 size,
203 u32 size, 204 dma_addr_t lli_phys, u32 reg_cfg, bool term_int,
204 int psize, 205 bool is_device, struct stedma40_half_channel_info *info,
205 dma_addr_t lli_phys, 206 struct stedma40_half_channel_info *otherinfo)
206 u32 reg_cfg,
207 bool term_int,
208 u32 data_width1,
209 u32 data_width2,
210 bool is_device)
211{ 207{
212 int err; 208 int err;
213 dma_addr_t next = lli_phys; 209 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 int size_seg = 0; 211 int size_seg = 0;
216 212
217 do { 213 do {
218 size_seg = d40_seg_size(size_rest, data_width1, data_width2); 214 size_seg = d40_seg_size(size_rest, info->data_width,
215 otherinfo->data_width);
219 size_rest -= size_seg; 216 size_rest -= size_seg;
220 217
221 if (term_int && size_rest == 0) 218 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 err = d40_phy_fill_lli(lli, 224 err = d40_phy_fill_lli(lli,
228 addr, 225 addr,
229 size_seg, 226 size_seg,
230 psize,
231 next, 227 next,
232 reg_cfg, 228 reg_cfg,
233 !next, 229 !next,
234 data_width1, 230 is_device,
235 is_device); 231 info);
236 232
237 if (err) 233 if (err)
238 goto err; 234 goto err;
@@ -254,9 +250,8 @@ int d40_phy_sg_to_lli(struct scatterlist *sg,
254 struct d40_phy_lli *lli_sg, 250 struct d40_phy_lli *lli_sg,
255 dma_addr_t lli_phys, 251 dma_addr_t lli_phys,
256 u32 reg_cfg, 252 u32 reg_cfg,
257 u32 data_width1, 253 struct stedma40_half_channel_info *info,
258 u32 data_width2, 254 struct stedma40_half_channel_info *otherinfo)
259 int psize)
260{ 255{
261 int total_size = 0; 256 int total_size = 0;
262 int i; 257 int i;
@@ -280,13 +275,12 @@ int d40_phy_sg_to_lli(struct scatterlist *sg,
280 lli = d40_phy_buf_to_lli(lli, 275 lli = d40_phy_buf_to_lli(lli,
281 dst, 276 dst,
282 sg_dma_len(current_sg), 277 sg_dma_len(current_sg),
283 psize,
284 l_phys, 278 l_phys,
285 reg_cfg, 279 reg_cfg,
286 sg_len - 1 == i, 280 sg_len - 1 == i,
287 data_width1, 281 target == dst,
288 data_width2, 282 info,
289 target == dst); 283 otherinfo);
290 if (lli == NULL) 284 if (lli == NULL)
291 return -EINVAL; 285 return -EINVAL;
292 } 286 }