summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-01-13 17:16:23 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-17 22:31:29 (GMT)
commit65fdfedbc06169bc49fbbdab205659237a06568c (patch)
tree58c334b222c6d6fbdfce046ca1605abcf2224ada
parentd77bf9736b11671f803e830c5bead436a415d040 (diff)
downloadlinux-65fdfedbc06169bc49fbbdab205659237a06568c.tar.xz
staging: comedi: pcl816: introduce pcl816_isadma_disable()
According to Documentation/DMA-ISA-LPC.txt, the DMA lock needs to be claimed before using any of the ISA DMA routines. Introduce a helper function to disable the ISA DMA controller and add the necessary locking calls. 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>
-rw-r--r--drivers/staging/comedi/drivers/pcl816.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers/pcl816.c b/drivers/staging/comedi/drivers/pcl816.c
index e0d91a1..d2ce775 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -147,6 +147,15 @@ static void pcl816_isadma_program(unsigned int dma_chan,
release_dma_lock(flags);
}
+static void pcl816_isadma_disable(unsigned int dma_chan)
+{
+ unsigned long flags;
+
+ flags = claim_dma_lock();
+ disable_dma(dma_chan);
+ release_dma_lock(flags);
+}
+
static void pcl816_start_pacer(struct comedi_device *dev, bool load_counters)
{
struct pcl816_private *devpriv = dev->private;
@@ -202,7 +211,7 @@ static void pcl816_ai_setup_next_dma(struct comedi_device *dev,
struct comedi_cmd *cmd = &s->async->cmd;
struct pcl816_dma_desc *dma;
- disable_dma(devpriv->dma);
+ pcl816_isadma_disable(devpriv->dma);
if (devpriv->dma_runs_to_end > -1 || cmd->stop_src == TRIG_NONE) {
/* switch dma bufs */
devpriv->cur_dma = 1 - devpriv->cur_dma;