summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/drivers/ni_labpc_cs.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-02-23 14:58:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-01 18:53:52 -0800
commitc0cfeca1a80efbb7691961d4ac31af30c559f976 (patch)
tree4b95ce59d1a0da900bd98e4124cd25717f855de3 /drivers/staging/comedi/drivers/ni_labpc_cs.c
parent5a213fa6f7c33219300bdd826d77172bfd5a54e6 (diff)
downloadtalos-op-linux-c0cfeca1a80efbb7691961d4ac31af30c559f976.tar.gz
talos-op-linux-c0cfeca1a80efbb7691961d4ac31af30c559f976.zip
staging: comedi: ni_labpc_common: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog input data conversion. Convert it to use the comedi_8254 module to provide support for the 8254 timer. The hardware actually has two 8254 devices. Timer B0 is the master for timed conversions, timer B1 sets the scan pacing, and tmer A0 sets the conversion pacing. For the conversion, dev->pacer is used for the "B" timers and a new private data member, dev->counter, is used for the "A" timers. All the divisor values are stored in the dev->pacer. 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/drivers/ni_labpc_cs.c')
-rw-r--r--drivers/staging/comedi/drivers/ni_labpc_cs.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c
index 746c4cd9978d..a1c69ac075d5 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_cs.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c
@@ -68,8 +68,8 @@ static const struct labpc_boardinfo labpc_cs_boards[] = {
},
};
-static int labpc_auto_attach(struct comedi_device *dev,
- unsigned long context)
+static int labpc_cs_auto_attach(struct comedi_device *dev,
+ unsigned long context)
{
struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
int ret;
@@ -90,11 +90,17 @@ static int labpc_auto_attach(struct comedi_device *dev,
return labpc_common_attach(dev, link->irq, IRQF_SHARED);
}
+static void labpc_cs_detach(struct comedi_device *dev)
+{
+ labpc_common_detach(dev);
+ comedi_pcmcia_disable(dev);
+}
+
static struct comedi_driver driver_labpc_cs = {
.driver_name = "ni_labpc_cs",
.module = THIS_MODULE,
- .auto_attach = labpc_auto_attach,
- .detach = comedi_pcmcia_disable,
+ .auto_attach = labpc_cs_auto_attach,
+ .detach = labpc_cs_detach,
};
static int labpc_cs_attach(struct pcmcia_device *link)
OpenPOWER on IntegriCloud