summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-09-20 23:41:39 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-25 22:59:59 (GMT)
commit1c4babb2464d0af65ebc0165d2a93ac9f7b9554b (patch)
treee211bc3864378e74ab6f8639a64a65eccda76017
parent075eaef87ee880dbfed2bd3a8ff0ece1b05cdacf (diff)
downloadlinux-fsl-qoriq-1c4babb2464d0af65ebc0165d2a93ac9f7b9554b.tar.xz
staging: comedi: pcl711: fix software trigger for board->is_8112
The acl-8112 boards also need to write a value to the software trigger register in order to start an A/D conversion. Remove the if (!board->is_8112) test so that the write is always done. Also, the analog input mode does not need to be set each time for multiple samples. Move the pcl711_ai_set_mode() out of the for loop. 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/pcl711.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/staging/comedi/drivers/pcl711.c b/drivers/staging/comedi/drivers/pcl711.c
index 945e0bc..f8401b7 100644
--- a/drivers/staging/comedi/drivers/pcl711.c
+++ b/drivers/staging/comedi/drivers/pcl711.c
@@ -91,7 +91,8 @@ supported.
#define PCL711_MODE_PACER (4 << 0)
#define PCL711_MODE_PACER_IRQ (6 << 0)
#define PCL711_MODE_IRQ(x) (((x) & 0x7) << 4)
-#define PCL711_SOFTTRIG 0x0c
+#define PCL711_SOFTTRIG_REG 0x0c
+#define PCL711_SOFTTRIG (0 << 0) /* any value will work */
#define PCL711_DO_LO 0x0d
#define PCL711_DO_HI 0x0e
@@ -280,17 +281,15 @@ static int pcl711_ai_wait_for_eoc(struct comedi_device *dev,
static int pcl711_ai_insn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
- const struct pcl711_board *board = comedi_board(dev);
int ret;
int n;
pcl711_set_changain(dev, insn->chanspec);
- for (n = 0; n < insn->n; n++) {
- pcl711_ai_set_mode(dev, PCL711_MODE_SOFTTRIG);
+ pcl711_ai_set_mode(dev, PCL711_MODE_SOFTTRIG);
- if (!board->is_8112)
- outb(0, dev->iobase + PCL711_SOFTTRIG);
+ for (n = 0; n < insn->n; n++) {
+ outb(PCL711_SOFTTRIG, dev->iobase + PCL711_SOFTTRIG_REG);
ret = pcl711_ai_wait_for_eoc(dev, 100);
if (ret)