Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289033
b: refs/heads/master
c: e3794b5
h: refs/heads/master
i:
  289031: bd91670
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Feb 9, 2012
1 parent a48da6c commit 3a1af23
Show file tree
Hide file tree
Showing 2 changed files with 11 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: 41add2e84bff0c887949698e01dab28105f11a6b
refs/heads/master: e3794b52f56ac20947a2dbdd505e9ad29013c555
15 changes: 10 additions & 5 deletions trunk/drivers/staging/comedi/drivers/ni_pcidio.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ static int ni_pcidio_request_di_mite_channel(struct comedi_device *dev)
comedi_error(dev, "failed to reserve mite dma channel.");
return -EBUSY;
}
devpriv->di_mite_chan->dir = COMEDI_INPUT;
writeb(primary_DMAChannel_bits(devpriv->di_mite_chan->channel) |
secondary_DMAChannel_bits(devpriv->di_mite_chan->channel),
devpriv->mite->daq_io_addr + DMA_Line_Control_Group1);
Expand Down Expand Up @@ -1005,20 +1006,24 @@ static int ni_pcidio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
static int setup_mite_dma(struct comedi_device *dev, struct comedi_subdevice *s)
{
int retval;
unsigned long flags;

retval = ni_pcidio_request_di_mite_channel(dev);
if (retval)
return retval;

devpriv->di_mite_chan->dir = COMEDI_INPUT;

/* write alloc the entire buffer */
comedi_buf_write_alloc(s->async, s->async->prealloc_bufsz);

mite_prep_dma(devpriv->di_mite_chan, 32, 32);
spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
if (devpriv->di_mite_chan) {
mite_prep_dma(devpriv->di_mite_chan, 32, 32);
mite_dma_arm(devpriv->di_mite_chan);
} else
retval = -EIO;
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);

mite_dma_arm(devpriv->di_mite_chan);
return 0;
return retval;
}

static int ni_pcidio_inttrig(struct comedi_device *dev,
Expand Down

0 comments on commit 3a1af23

Please sign in to comment.