staging: comedi: adv_pci1710: fix counter 0 internal clock source
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 13 Nov 2015 18:11:23 +0000 (11:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Dec 2015 22:56:30 +0000 (14:56 -0800)
There are a number of descrepencies in the various manuals for the boards
that this driver supports. Some show a 10 MHz clock for counters 1 and 2
others show a 1 MHz clock. Counter 0 can use either a div 10 of that clock
or an external clock (up to 10 MHz).

Currently this driver initializes counters 1 and 2 with a 10 MHz clock.
For consistency, return 1 MHz (10 MHz/10) for counter 0 when the user
queries the internal clock source with INSN_CONFIG_GET_CLOCK_SRC.

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>
drivers/staging/comedi/drivers/adv_pci1710.c

index 8bd9edfca2f2c2e4b6afe5caadac5bb5ac2da516..5f1e86e767c80886795127395f10b744484af8a8 100644 (file)
@@ -701,7 +701,7 @@ static int pci1710_counter_insn_config(struct comedi_device *dev,
                        data[2] = 0;
                } else {
                        data[1] = 0;
-                       data[2] = I8254_OSC_BASE_10MHZ;
+                       data[2] = I8254_OSC_BASE_1MHZ;
                }
                break;
        default: