Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77490
b: refs/heads/master
c: c58f7a1
h: refs/heads/master
v: v3
  • Loading branch information
Ben Dooks authored and Russell King committed Jan 28, 2008
1 parent bf5c95d commit d73b740
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 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: c6709e8ef5752314c22c75bc7575f9be390e215b
refs/heads/master: c58f7a1d36709e50398c05df9419386befef2c59
26 changes: 25 additions & 1 deletion trunk/arch/arm/plat-s3c24xx/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ int s3c2410_dma_devconfig(int channel,

chan->source = source;
chan->dev_addr = devaddr;
chan->hw_cfg = hwcfg;

switch (source) {
case S3C2410_DMASRC_HW:
Expand Down Expand Up @@ -1235,14 +1236,18 @@ int s3c2410_dma_getposition(dmach_t channel, dma_addr_t *src, dma_addr_t *dst)

EXPORT_SYMBOL(s3c2410_dma_getposition);

static struct s3c2410_dma_chan *to_dma_chan(struct sys_device *dev)
{
return container_of(dev, struct s3c2410_dma_chan, dev);
}

/* system device class */

#ifdef CONFIG_PM

static int s3c2410_dma_suspend(struct sys_device *dev, pm_message_t state)
{
struct s3c2410_dma_chan *cp = container_of(dev, struct s3c2410_dma_chan, dev);
struct s3c2410_dma_chan *cp = to_dma_chan(dev);

printk(KERN_DEBUG "suspending dma channel %d\n", cp->number);

Expand All @@ -1264,6 +1269,24 @@ static int s3c2410_dma_suspend(struct sys_device *dev, pm_message_t state)

static int s3c2410_dma_resume(struct sys_device *dev)
{
struct s3c2410_dma_chan *cp = to_dma_chan(dev);
unsigned int no = cp->number | DMACH_LOW_LEVEL;

/* restore channel's hardware configuration */

if (!cp->in_use)
return 0;

printk(KERN_INFO "dma%d: restoring configuration\n", cp->number);

s3c2410_dma_config(no, cp->xfer_unit, cp->dcon);
s3c2410_dma_devconfig(no, cp->source, cp->hw_cfg, cp->dev_addr);

/* re-select the dma source for this channel */

if (cp->map != NULL)
dma_sel.select(cp, cp->map);

return 0;
}

Expand Down Expand Up @@ -1453,6 +1476,7 @@ static struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel)

found:
dmach = &s3c2410_chans[ch];
dmach->map = ch_map;
dma_chan_map[channel] = dmach;

/* select the channel */
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-arm/arch-s3c2410/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ struct s3c2410_dma_chan {
unsigned long dev_addr;
unsigned long load_timeout;
unsigned int flags; /* channel flags */
unsigned int hw_cfg; /* last hw config */

struct s3c24xx_dma_map *map; /* channel hw maps */

Expand Down

0 comments on commit d73b740

Please sign in to comment.