Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286126
b: refs/heads/master
c: 8f0d30f
h: refs/heads/master
v: v3
  • Loading branch information
Viresh Kumar authored and Vinod Koul committed Dec 5, 2011
1 parent 781a786 commit 3ecc2b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 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: c94e910535be72f0c6ac0c69e6acd8d44414e80d
refs/heads/master: 8f0d30f9ee333f4fb3458a9a33f7ead5269ea8f3
21 changes: 12 additions & 9 deletions trunk/drivers/dma/amba-pl08x.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,10 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan,
int ret;

/* Check if we already have a channel */
if (plchan->phychan)
return 0;
if (plchan->phychan) {
ch = plchan->phychan;
goto got_channel;
}

ch = pl08x_get_phy_channel(pl08x, plchan);
if (!ch) {
Expand All @@ -880,21 +882,22 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan,
return -EBUSY;
}
ch->signal = ret;

/* Assign the flow control signal to this channel */
if (txd->direction == DMA_MEM_TO_DEV)
txd->ccfg |= ch->signal << PL080_CONFIG_DST_SEL_SHIFT;
else if (txd->direction == DMA_DEV_TO_MEM)
txd->ccfg |= ch->signal << PL080_CONFIG_SRC_SEL_SHIFT;
}

plchan->phychan = ch;
dev_dbg(&pl08x->adev->dev, "allocated physical channel %d and signal %d for xfer on %s\n",
ch->id,
ch->signal,
plchan->name);

got_channel:
/* Assign the flow control signal to this channel */
if (txd->direction == DMA_MEM_TO_DEV)
txd->ccfg |= ch->signal << PL080_CONFIG_DST_SEL_SHIFT;
else if (txd->direction == DMA_DEV_TO_MEM)
txd->ccfg |= ch->signal << PL080_CONFIG_SRC_SEL_SHIFT;

plchan->phychan_hold++;
plchan->phychan = ch;

return 0;
}
Expand Down

0 comments on commit 3ecc2b9

Please sign in to comment.