diff options
author | Per Forlin <per.friden@stericsson.com> | 2010-10-06 05:05:27 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-10-07 17:56:35 -0400 |
commit | a59670a40b4dd497630f9442feb259dde601e469 (patch) | |
tree | 2ed346ae4dbd94e271ffeac5badba2c1723d8775 /drivers/dma | |
parent | 819504f4861a5bc1e25c82409956388bb79fb635 (diff) |
DMAENGINE: Set burst size for phy and log chans in ste_dma40 dev_control
Set burst for physical or logical channels respectively.
Convert the values in dma_cfg to dma reg bits
for physical or logical channels.
Signed-off-by: Per Forlin <per.forlin@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')
-rw-r--r-- | drivers/dma/ste_dma40.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index c07d989f26d7..ad8d6df1b6a8 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -2246,14 +2246,25 @@ static void d40_set_runtime_config(struct dma_chan *chan, | |||
2246 | return; | 2246 | return; |
2247 | } | 2247 | } |
2248 | 2248 | ||
2249 | if (config_maxburst >= 16) | 2249 | if (d40c->log_num != D40_PHY_CHAN) { |
2250 | psize = STEDMA40_PSIZE_LOG_16; | 2250 | if (config_maxburst >= 16) |
2251 | else if (config_maxburst >= 8) | 2251 | psize = STEDMA40_PSIZE_LOG_16; |
2252 | psize = STEDMA40_PSIZE_LOG_8; | 2252 | else if (config_maxburst >= 8) |
2253 | else if (config_maxburst >= 4) | 2253 | psize = STEDMA40_PSIZE_LOG_8; |
2254 | psize = STEDMA40_PSIZE_LOG_4; | 2254 | else if (config_maxburst >= 4) |
2255 | else | 2255 | psize = STEDMA40_PSIZE_LOG_4; |
2256 | psize = STEDMA40_PSIZE_LOG_1; | 2256 | else |
2257 | psize = STEDMA40_PSIZE_LOG_1; | ||
2258 | } else { | ||
2259 | if (config_maxburst >= 16) | ||
2260 | psize = STEDMA40_PSIZE_PHY_16; | ||
2261 | else if (config_maxburst >= 8) | ||
2262 | psize = STEDMA40_PSIZE_PHY_8; | ||
2263 | else if (config_maxburst >= 4) | ||
2264 | psize = STEDMA40_PSIZE_PHY_4; | ||
2265 | else | ||
2266 | psize = STEDMA40_PSIZE_PHY_1; | ||
2267 | } | ||
2257 | 2268 | ||
2258 | /* Set up all the endpoint configs */ | 2269 | /* Set up all the endpoint configs */ |
2259 | cfg->src_info.data_width = addr_width; | 2270 | cfg->src_info.data_width = addr_width; |
@@ -2265,6 +2276,13 @@ static void d40_set_runtime_config(struct dma_chan *chan, | |||
2265 | cfg->dst_info.endianess = STEDMA40_LITTLE_ENDIAN; | 2276 | cfg->dst_info.endianess = STEDMA40_LITTLE_ENDIAN; |
2266 | cfg->dst_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL; | 2277 | cfg->dst_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL; |
2267 | 2278 | ||
2279 | /* Fill in register values */ | ||
2280 | if (d40c->log_num != D40_PHY_CHAN) | ||
2281 | d40_log_cfg(cfg, &d40c->log_def.lcsp1, &d40c->log_def.lcsp3); | ||
2282 | else | ||
2283 | d40_phy_cfg(cfg, &d40c->src_def_cfg, | ||
2284 | &d40c->dst_def_cfg, false); | ||
2285 | |||
2268 | /* These settings will take precedence later */ | 2286 | /* These settings will take precedence later */ |
2269 | d40c->runtime_addr = config_addr; | 2287 | d40c->runtime_addr = config_addr; |
2270 | d40c->runtime_direction = config->direction; | 2288 | d40c->runtime_direction = config->direction; |