summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorH Hartley Sweeten2015-02-23 22:57:39 +0100
committerGreg Kroah-Hartman2015-03-02 03:51:50 +0100
commita90feb7fd095863780fe550da71afaa7f03adc65 (patch)
tree6481cb8c654f8b6223c560ad727595147925b04c /drivers/staging/comedi
parentstaging: comedi: das16m1: convert driver to use the comedi_8254 module (diff)
downloadkernel-qcow2-linux-a90feb7fd095863780fe550da71afaa7f03adc65.tar.gz
kernel-qcow2-linux-a90feb7fd095863780fe550da71afaa7f03adc65.tar.xz
kernel-qcow2-linux-a90feb7fd095863780fe550da71afaa7f03adc65.zip
staging: comedi: cb_das16_cs: convert driver to use the comedi_8254 module
The hardware supported by this drive has an 8254 timer. Currently this driver does not use the timer functions. For aesthetics, use the comedi_8254 module to provide support for the 8254 timer. This will ensure that the counters are all reset and make it easier to add functionality later. 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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/Kconfig1
-rw-r--r--drivers/staging/comedi/drivers/cb_das16_cs.c12
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
index 9b7a0d7b6bd7..85c5c876e65d 100644
--- a/drivers/staging/comedi/Kconfig
+++ b/drivers/staging/comedi/Kconfig
@@ -1100,6 +1100,7 @@ if COMEDI_PCMCIA_DRIVERS
config COMEDI_CB_DAS16_CS
tristate "CB DAS16 series PCMCIA support"
+ select COMEDI_8254
---help---
Enable support for the ComputerBoards/MeasurementComputing PCMCIA
cards DAS16/16, PCM-DAS16D/12 and PCM-DAS16s/16
diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c
index 1079b6c72b15..9c7242d81963 100644
--- a/drivers/staging/comedi/drivers/cb_das16_cs.c
+++ b/drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -41,16 +41,13 @@ Status: experimental
#include "../comedi_pcmcia.h"
#include "comedi_fc.h"
-#include "8253.h"
+#include "comedi_8254.h"
#define DAS16CS_ADC_DATA 0
#define DAS16CS_DIO_MUX 2
#define DAS16CS_MISC1 4
#define DAS16CS_MISC2 6
-#define DAS16CS_CTR0 8
-#define DAS16CS_CTR1 10
-#define DAS16CS_CTR2 12
-#define DAS16CS_CTR_CONTROL 14
+#define DAS16CS_TIMER_BASE 8
#define DAS16CS_DIO 16
struct das16cs_board {
@@ -279,6 +276,11 @@ static int das16cs_auto_attach(struct comedi_device *dev,
if (!devpriv)
return -ENOMEM;
+ dev->pacer = comedi_8254_init(dev->iobase + DAS16CS_TIMER_BASE,
+ I8254_OSC_BASE_10MHZ, I8254_IO16, 0);
+ if (!dev->pacer)
+ return -ENOMEM;
+
ret = comedi_alloc_subdevices(dev, 3);
if (ret)
return ret;