diff options
author | H Hartley Sweeten | 2014-09-09 22:05:51 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2014-09-11 23:34:25 +0200 |
commit | d900197e9e0ee372a6eabce6a8a98ec8c4174c2b (patch) | |
tree | 3e3cc65c864f7d0e9e30e6a3c5408c51067d5ba5 /drivers/staging/comedi | |
parent | staging: comedi: adl_pci9118: tidy up 'ai_cfg' in pci9118_ai_docmd_dma() (diff) | |
download | kernel-qcow2-linux-d900197e9e0ee372a6eabce6a8a98ec8c4174c2b.tar.gz kernel-qcow2-linux-d900197e9e0ee372a6eabce6a8a98ec8c4174c2b.tar.xz kernel-qcow2-linux-d900197e9e0ee372a6eabce6a8a98ec8c4174c2b.zip |
staging: comedi: adl_pci9118: enable DMA in common code path
The pci9118_ai_docmd_dma() function enables the DMA bit in the ai control
register for all acquisition modes. For aesthetics, move the enable of
this bit into the (*do_cmd).
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/adl_pci9118.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index 48064c20103d..558863133dd6 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -1139,12 +1139,10 @@ static int pci9118_ai_docmd_dma(struct comedi_device *dev, switch (devpriv->ai_do) { case 1: - devpriv->ai_ctrl |= PCI9118_AI_CTRL_TMRTR | - PCI9118_AI_CTRL_DMA; + devpriv->ai_ctrl |= PCI9118_AI_CTRL_TMRTR; break; case 2: - devpriv->ai_ctrl |= PCI9118_AI_CTRL_TMRTR | - PCI9118_AI_CTRL_DMA; + devpriv->ai_ctrl |= PCI9118_AI_CTRL_TMRTR; devpriv->ai_cfg |= PCI9118_AI_CFG_BM | PCI9118_AI_CFG_BS; if (cmd->convert_src == TRIG_NOW && !devpriv->softsshdelay) @@ -1153,12 +1151,10 @@ static int pci9118_ai_docmd_dma(struct comedi_device *dev, dev->iobase + PCI9118_AI_BURST_NUM_REG); break; case 3: - devpriv->ai_ctrl |= PCI9118_AI_CTRL_EXTM | - PCI9118_AI_CTRL_DMA; + devpriv->ai_ctrl |= PCI9118_AI_CTRL_EXTM; break; case 4: - devpriv->ai_ctrl |= PCI9118_AI_CTRL_TMRTR | - PCI9118_AI_CTRL_DMA; + devpriv->ai_ctrl |= PCI9118_AI_CTRL_TMRTR; devpriv->ai_cfg |= PCI9118_AI_CFG_AM; outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG); pci9118_timer_set_mode(dev, 0, I8254_MODE0); @@ -1346,6 +1342,9 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) devpriv->ai_do = 3; } + if (devpriv->usedma) + devpriv->ai_ctrl |= PCI9118_AI_CTRL_DMA; + pci9118_start_pacer(dev, -1); /* stop pacer */ /* set default config (disable burst and triggers) */ |