Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251363
b: refs/heads/master
c: 26fc02a
h: refs/heads/master
i:
  251361: 2802c68
  251359: 88286cd
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed May 25, 2011
1 parent 56d1562 commit 92bdf36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: 66ad12931d523e833516659eafcc29af9a08fff3
refs/heads/master: 26fc02ab5551349b2e593829a76cb44328ee7f61
11 changes: 8 additions & 3 deletions trunk/drivers/dma/shdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,17 @@ static int dmae_set_dmars(struct sh_dmae_chan *sh_chan, u16 val)
struct sh_dmae_device, common);
struct sh_dmae_pdata *pdata = shdev->pdata;
const struct sh_dmae_channel *chan_pdata = &pdata->channel[sh_chan->id];
u16 __iomem *addr = shdev->dmars + chan_pdata->dmars / sizeof(u16);
u16 __iomem *addr = shdev->dmars;
int shift = chan_pdata->dmars_bit;

if (dmae_is_busy(sh_chan))
return -EBUSY;

/* in the case of a missing DMARS resource use first memory window */
if (!addr)
addr = (u16 __iomem *)shdev->chan_reg;
addr += chan_pdata->dmars / sizeof(u16);

__raw_writew((__raw_readw(addr) & (0xff00 >> shift)) | (val << shift),
addr);

Expand Down Expand Up @@ -1087,7 +1092,7 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
return -ENODEV;

chan = platform_get_resource(pdev, IORESOURCE_MEM, 0);
/* DMARS area is optional, if absent, this controller cannot do slave DMA */
/* DMARS area is optional */
dmars = platform_get_resource(pdev, IORESOURCE_MEM, 1);
/*
* IRQ resources:
Expand Down Expand Up @@ -1154,7 +1159,7 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&shdev->common.channels);

dma_cap_set(DMA_MEMCPY, shdev->common.cap_mask);
if (dmars)
if (pdata->slave && pdata->slave_num)
dma_cap_set(DMA_SLAVE, shdev->common.cap_mask);

shdev->common.device_alloc_chan_resources
Expand Down

0 comments on commit 92bdf36

Please sign in to comment.