Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332126
b: refs/heads/master
c: 2dcdf57
h: refs/heads/master
v: v3
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Sep 22, 2012
1 parent 33adfa2 commit 152c65a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 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: ccffa3870a7ec2b59cf051b745220c56f423d182
refs/heads/master: 2dcdf570936168d488acf90be9b04a3d32dafce7
30 changes: 25 additions & 5 deletions trunk/drivers/dma/omap-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct omap_chan {
struct dma_slave_config cfg;
unsigned dma_sig;
bool cyclic;
bool paused;

int dma_ch;
struct omap_desc *desc;
Expand Down Expand Up @@ -470,11 +471,14 @@ static int omap_dma_terminate_all(struct omap_chan *c)
*/
if (c->desc) {
c->desc = NULL;
omap_stop_dma(c->dma_ch);
/* Avoid stopping the dma twice */
if (!c->paused)
omap_stop_dma(c->dma_ch);
}

if (c->cyclic) {
c->cyclic = false;
c->paused = false;
omap_dma_unlink_lch(c->dma_ch, c->dma_ch);
}

Expand All @@ -487,14 +491,30 @@ static int omap_dma_terminate_all(struct omap_chan *c)

static int omap_dma_pause(struct omap_chan *c)
{
/* FIXME: not supported by platform private API */
return -EINVAL;
/* Pause/Resume only allowed with cyclic mode */
if (!c->cyclic)
return -EINVAL;

if (!c->paused) {
omap_stop_dma(c->dma_ch);
c->paused = true;
}

return 0;
}

static int omap_dma_resume(struct omap_chan *c)
{
/* FIXME: not supported by platform private API */
return -EINVAL;
/* Pause/Resume only allowed with cyclic mode */
if (!c->cyclic)
return -EINVAL;

if (c->paused) {
omap_start_dma(c->dma_ch);
c->paused = false;
}

return 0;
}

static int omap_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
Expand Down

0 comments on commit 152c65a

Please sign in to comment.