Re: [PATCH 3/4] staging: comedi: remove cb_pcidio driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2012-09-12 23:37, H Hartley Sweeten wrote:
Move the support for the boards in the cb_pcidio driver to
the generic 8255_pci driver and remove the cb_pcidio driver.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
  drivers/staging/comedi/Kconfig             |  11 +-
  drivers/staging/comedi/drivers/8255_pci.c  |  36 +++++-
  drivers/staging/comedi/drivers/Makefile    |   1 -
  drivers/staging/comedi/drivers/cb_pcidio.c | 189 -----------------------------
  4 files changed, 36 insertions(+), 201 deletions(-)
  delete mode 100644 drivers/staging/comedi/drivers/cb_pcidio.c

diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
index 1ecf213..1bd7e93 100644
--- a/drivers/staging/comedi/Kconfig
+++ b/drivers/staging/comedi/Kconfig
@@ -558,6 +558,7 @@ config COMEDI_8255_PCI

  	  Supported boards:
  	    ADlink - PCI-7224, PCI-7248, and PCI-7296
+	    Measurement Computing - PCI-DIO24, PCI-DIO24H and PCI-DIO48H

  	  To compile this driver as a module, choose M here: the module will
  	  be called 8255_pci.
@@ -934,16 +935,6 @@ config COMEDI_CB_PCIDDA
  	  To compile this driver as a module, choose M here: the module will be
  	  called cb_pcidda.

-config COMEDI_CB_PCIDIO
-	tristate "MeasurementComputing PCI-DIO series support"
-	select COMEDI_8255
-	---help---
-	  Enable support for ComputerBoards/MeasurementComputing PCI-DIO series
-	  PCI-DIO24, PCI-DIO24H and PCI-DIO48H
-
-	  To compile this driver as a module, choose M here: the module will be
-	  called cb_pcidio.
-
  config COMEDI_CB_PCIMDAS
  	tristate "MeasurementComputing PCIM-DAS1602/16 support"
  	select COMEDI_8255
diff --git a/drivers/staging/comedi/drivers/8255_pci.c b/drivers/staging/comedi/drivers/8255_pci.c
index cc8b1e0..e011b0a 100644
--- a/drivers/staging/comedi/drivers/8255_pci.c
+++ b/drivers/staging/comedi/drivers/8255_pci.c
@@ -4,6 +4,8 @@
   *
   * Based on the tested adl_pci7296 driver written by:
   *	Jon Grierson <jd@xxxxxxxxxxx>
+ * and the experimental cb_pcidio driver written by:
+ *	Yoshiya Matsuzaka
   *
   * COMEDI - Linux Control and Measurement Device Interface
   * Copyright (C) 2000 David A. Schleef <ds@xxxxxxxxxxx>
@@ -29,6 +31,9 @@ Description: Generic PCI based 8255 Digital I/O boards
  Devices: (ADLink) PCI-7224 [adl_pci-7224] - 24 channels
  	 (ADLink) PCI-7248 [adl_pci-7248] - 48 channels
  	 (ADLink) PCI-7296 [adl_pci-7296] - 96 channels
+	 (Measurement Computing) PCI-DIO24 [cb_pci-dio24] - 24 channels
+	 (Measurement Computing) PCI-DIO24H [cb_pci-dio24h] - 24 channels
+	 (Measurement Computing) PCI-DIO48H [cb_pci-dio48h] - 48 channels
  Author: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
  Updated: Wed, 12 Sep 2012 11:52:01 -0700
  Status: untested
@@ -52,9 +57,17 @@ Configuration Options: not applicable, uses PCI auto config
  #define PCI_DEVICE_ID_ADLINK_PCI7248	0x7248
  #define PCI_DEVICE_ID_ADLINK_PCI7296	0x7296

+/* ComputerBoards is now known as Measurement Computing */
+#define PCI_VENDOR_ID_CB		0x1307
+
+#define PCI_DEVICE_ID_CB_PCIDIO48H	0x000b
+#define PCI_DEVICE_ID_CB_PCIDIO24H	0x0014
+#define PCI_DEVICE_ID_CB_PCIDIO24	0x0028
+
  struct pci_8255_boardinfo {
  	const char *name;
  	unsigned short device;
+	int dio_badr;
  	int n_8255;
  };

@@ -62,15 +75,33 @@ static const struct pci_8255_boardinfo pci_8255_boards[] = {
  	{
  		.name		= "adl_pci-7224",
  		.device		= PCI_DEVICE_ID_ADLINK_PCI7224,
+		.dio_badr	= 2,
  		.n_8255		= 1,
  	}, {
  		.name		= "adl_pci-7248",
  		.device		= PCI_DEVICE_ID_ADLINK_PCI7248,
+		.dio_badr	= 2,
  		.n_8255		= 2,
  	}, {
  		.name		= "adl_pci-7296",
  		.device		= PCI_DEVICE_ID_ADLINK_PCI7296,
+		.dio_badr	= 2,
  		.n_8255		= 4,
+	}, {
+		.name		= "cb_pci-dio24",
+		.device		= PCI_DEVICE_ID_CB_PCIDIO24,
+		.dio_badr	= 2,
+		.n_8255		= 1,
+	}, {
+		.name		= "cb_pci-dio24h",
+		.device		= PCI_DEVICE_ID_CB_PCIDIO24H,
+		.dio_badr	= 2,
+		.n_8255		= 1,
+	}, {
+		.name		= "cb_pci-dio48h",
+		.device		= PCI_DEVICE_ID_CB_PCIDIO48H,
+		.dio_badr	= 1,
+		.n_8255		= 2,
  	},
  };

Since this handles multiple vendor IDs, the boardinfo ought to include the vendor ID now and pci_8255_find_boardinfo() ought to match it. I know the device IDs are _unlikely_ to clash, but new ones could, in theory!

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux