Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231611
b: refs/heads/master
c: f0fd944
h: refs/heads/master
i:
  231609: 447e471
  231607: 6c7ab50
v: v3
  • Loading branch information
Russell King - ARM Linux authored and Dan Williams committed Jan 5, 2011
1 parent be67c48 commit 3db78ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c370e594efe2993620d24d41a78f325102e99d1c
refs/heads/master: f0fd944625b6e406dc273b8dffa16e0728c973e6
23 changes: 13 additions & 10 deletions trunk/drivers/dma/amba-pl08x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,31 +1117,32 @@ static const struct burst_table burst_sizes[] = {
},
};

static void dma_set_runtime_config(struct dma_chan *chan,
struct dma_slave_config *config)
static int dma_set_runtime_config(struct dma_chan *chan,
struct dma_slave_config *config)
{
struct pl08x_dma_chan *plchan = to_pl08x_chan(chan);
struct pl08x_driver_data *pl08x = plchan->host;
struct pl08x_channel_data *cd = plchan->cd;
enum dma_slave_buswidth addr_width;
dma_addr_t addr;
u32 maxburst;
u32 cctl = 0;
int i;

/* Transfer direction */
plchan->runtime_direction = config->direction;
if (config->direction == DMA_TO_DEVICE) {
plchan->runtime_addr = config->dst_addr;
addr = config->dst_addr;
addr_width = config->dst_addr_width;
maxburst = config->dst_maxburst;
} else if (config->direction == DMA_FROM_DEVICE) {
plchan->runtime_addr = config->src_addr;
addr = config->src_addr;
addr_width = config->src_addr_width;
maxburst = config->src_maxburst;
} else {
dev_err(&pl08x->adev->dev,
"bad runtime_config: alien transfer direction\n");
return;
return -EINVAL;
}

switch (addr_width) {
Expand All @@ -1160,7 +1161,7 @@ static void dma_set_runtime_config(struct dma_chan *chan,
default:
dev_err(&pl08x->adev->dev,
"bad runtime_config: alien address width\n");
return;
return -EINVAL;
}

/*
Expand All @@ -1179,6 +1180,8 @@ static void dma_set_runtime_config(struct dma_chan *chan,
cctl |= burst_sizes[i].reg;
}

plchan->runtime_addr = addr;

/* Modify the default channel data to fit PrimeCell request */
cd->cctl = cctl;

Expand All @@ -1190,6 +1193,8 @@ static void dma_set_runtime_config(struct dma_chan *chan,
addr_width,
maxburst,
cctl);

return 0;
}

/*
Expand Down Expand Up @@ -1452,10 +1457,8 @@ static int pl08x_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,

/* Controls applicable to inactive channels */
if (cmd == DMA_SLAVE_CONFIG) {
dma_set_runtime_config(chan,
(struct dma_slave_config *)
arg);
return 0;
return dma_set_runtime_config(chan,
(struct dma_slave_config *)arg);
}

/*
Expand Down

0 comments on commit 3db78ae

Please sign in to comment.