summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/amplc_pc236.h
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2014-07-28 13:09:34 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-30 16:48:42 -0700
commit4cb60db2eabd275649b3305cc488a9794de8e463 (patch)
treea50d154dcaca3dffe25f27208f04f34c3f5ef506 /drivers/staging/comedi/drivers/amplc_pc236.h
parent55901d15b6f816af5bff9efd55b6400121dbc04a (diff)
staging: comedi: amplc_pc236: split into ISA, PCI and common module
The "amplc_pc236" driver currently handles both ISA and PCI devices and uses a small amount of conditional compilation depending which are enabled. Move most of the functionality into a new module, "amplc_pc236_common", and split off support for PCI devices into a new module, "amplc_pci236". Retain support for ISA devices in the existing module, "amplc_pc236". Since the `detach` handler (`pc236_detach()`) in the existing module "amplc_pc236" now only needs to handle ISA devices and only calls `comedi_legacy_detach()`, just use `comedi_legacy_detach()` directly as the `detach` handler in `struct comedi_driver amplc_pc236_driver`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/amplc_pc236.h')
-rw-r--r--drivers/staging/comedi/drivers/amplc_pc236.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pc236.h b/drivers/staging/comedi/drivers/amplc_pc236.h
new file mode 100644
index 000000000000..37348f1d986f
--- /dev/null
+++ b/drivers/staging/comedi/drivers/amplc_pc236.h
@@ -0,0 +1,45 @@
+/*
+ * comedi/drivers/amplc_pc236.h
+ * Header for "amplc_pc236", "amplc_pci236" and "amplc_pc236_common".
+ *
+ * Copyright (C) 2002-2014 MEV Ltd. <http://www.mev.co.uk/>
+ *
+ * COMEDI - Linux Control and Measurement Device Interface
+ * Copyright (C) 2000 David A. Schleef <ds@schleef.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef AMPLC_PC236_H_INCLUDED
+#define AMPLC_PC236_H_INCLUDED
+
+#include <linux/types.h>
+
+struct comedi_device;
+
+enum pc236_bustype { isa_bustype, pci_bustype };
+
+struct pc236_board {
+ const char *name;
+ enum pc236_bustype bustype;
+ void (*intr_update_cb)(struct comedi_device *dev, bool enable);
+ bool (*intr_chk_clr_cb)(struct comedi_device *dev);
+};
+
+struct pc236_private {
+ unsigned long lcr_iobase; /* PLX PCI9052 config registers in PCIBAR1 */
+ bool enable_irq;
+};
+
+int amplc_pc236_common_attach(struct comedi_device *dev, unsigned long iobase,
+ unsigned int irq, unsigned long req_irq_flags);
+
+#endif