staging: comedi: adl_pci9118: fix interrupt_pci9118_ai_mode4_switch()
This function modifies the analog input acquistion programming after the first DMA cycle to continue a "mode4" acqusition. Part of this programs timer 0 based on the hardware address of the next buffer. When double buffering is not used for DMA the "next" buffer is always the first, and only, buffer. Add a parameter to this function to indicate what the "next" buffer actually is and fix the callers. 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>
This commit is contained in:
parent
e652632fc2
commit
f9d208d3ea
1 changed files with 5 additions and 6 deletions
|
@ -449,12 +449,11 @@ static int setup_channel_list(struct comedi_device *dev,
|
||||||
return 1; /* we can serve this with scan logic */
|
return 1; /* we can serve this with scan logic */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void interrupt_pci9118_ai_mode4_switch(struct comedi_device *dev)
|
static void interrupt_pci9118_ai_mode4_switch(struct comedi_device *dev,
|
||||||
|
unsigned int next_buf)
|
||||||
{
|
{
|
||||||
struct pci9118_private *devpriv = dev->private;
|
struct pci9118_private *devpriv = dev->private;
|
||||||
struct pci9118_dmabuf *dmabuf;
|
struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[next_buf];
|
||||||
|
|
||||||
dmabuf = &devpriv->dmabuf[1 - devpriv->dma_actbuf];
|
|
||||||
|
|
||||||
devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG |
|
devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG |
|
||||||
PCI9118_AI_CFG_AM;
|
PCI9118_AI_CFG_AM;
|
||||||
|
@ -700,7 +699,7 @@ static void interrupt_pci9118_ai_dma(struct comedi_device *dev,
|
||||||
next_dma_buf = 1 - devpriv->dma_actbuf;
|
next_dma_buf = 1 - devpriv->dma_actbuf;
|
||||||
pci9118_amcc_setup_dma(dev, next_dma_buf);
|
pci9118_amcc_setup_dma(dev, next_dma_buf);
|
||||||
if (devpriv->ai_do == 4)
|
if (devpriv->ai_do == 4)
|
||||||
interrupt_pci9118_ai_mode4_switch(dev);
|
interrupt_pci9118_ai_mode4_switch(dev, next_dma_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (samplesinbuf) {
|
if (samplesinbuf) {
|
||||||
|
@ -724,7 +723,7 @@ static void interrupt_pci9118_ai_dma(struct comedi_device *dev,
|
||||||
/* restart DMA if is not used double buffering */
|
/* restart DMA if is not used double buffering */
|
||||||
pci9118_amcc_setup_dma(dev, 0);
|
pci9118_amcc_setup_dma(dev, 0);
|
||||||
if (devpriv->ai_do == 4)
|
if (devpriv->ai_do == 4)
|
||||||
interrupt_pci9118_ai_mode4_switch(dev);
|
interrupt_pci9118_ai_mode4_switch(dev, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue