From: H Hartley Sweeten Date: Tue, 4 Mar 2014 18:30:08 +0000 (-0700) Subject: staging: comedi: pcl812: introduce pcl812_ai_soft_trig() X-Git-Tag: firefly_0821_release~176^2~4193^2~635 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1e66bb255e42e4d16d345dae5b5e5d1b2d0bea41;p=firefly-linux-kernel-4.4.55.git staging: comedi: pcl812: introduce pcl812_ai_soft_trig() Introduce a helper function to start a software triggered analog input conversion. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/pcl812.c b/drivers/staging/comedi/drivers/pcl812.c index b41dbbc5e38e..9fb3e848ac7e 100644 --- a/drivers/staging/comedi/drivers/pcl812.c +++ b/drivers/staging/comedi/drivers/pcl812.c @@ -643,6 +643,12 @@ static void pcl812_ai_clear_eoc(struct comedi_device *dev) outb(0, dev->iobase + PCL812_CLRINT); } +static void pcl812_ai_soft_trig(struct comedi_device *dev) +{ + /* writing any value triggers a software conversion */ + outb(255, dev->iobase + PCL812_SOFTTRIG); +} + static unsigned int pcl812_ai_get_sample(struct comedi_device *dev, struct comedi_subdevice *s) { @@ -1028,8 +1034,7 @@ static int pcl812_ai_insn_read(struct comedi_device *dev, for (i = 0; i < insn->n; i++) { pcl812_ai_clear_eoc(dev); - /* start conversion */ - outb(255, dev->iobase + PCL812_SOFTTRIG); + pcl812_ai_soft_trig(dev); ret = comedi_timeout(dev, s, insn, pcl812_ai_eoc, 0); if (ret)