[PATCH v2 08/23] staging: comedi: adv_pci1710: remove 'has_large_fifo' and 'has_diff_ai' boardinfo

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

 



The pci1711/31 boards are the only ones that have a smaller FIFO (1K vs 4K) and
single-ended analog inputs (no differential).

Replace the 'has_large_fifo' and 'has_diff_ai' members of the boardinfo with
'is_pci1711' and use that to determine how to initialize the analog input
subdev_flags as well as the private data 'max_samples'.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/adv_pci1710.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c
index 76f3793..7088b76 100644
--- a/drivers/staging/comedi/drivers/adv_pci1710.c
+++ b/drivers/staging/comedi/drivers/adv_pci1710.c
@@ -128,9 +128,8 @@ enum pci1710_boardid {
 struct boardtype {
 	const char *name;	/*  board name */
 	const struct comedi_lrange *rangelist_ai;	/*  rangelist for A/D */
+	unsigned int is_pci1711:1;
 	unsigned int is_pci1713:1;
-	unsigned int has_large_fifo:1;	/* 4K or 1K FIFO */
-	unsigned int has_diff_ai:1;
 	unsigned int has_ao:1;
 };
 
@@ -138,32 +137,28 @@ static const struct boardtype boardtypes[] = {
 	[BOARD_PCI1710] = {
 		.name		= "pci1710",
 		.rangelist_ai	= &pci1710_ai_range,
-		.has_large_fifo	= 1,
-		.has_diff_ai	= 1,
 		.has_ao		= 1,
 	},
 	[BOARD_PCI1710HG] = {
 		.name		= "pci1710hg",
 		.rangelist_ai	= &pci1710hg_ai_range,
-		.has_large_fifo	= 1,
-		.has_diff_ai	= 1,
 		.has_ao		= 1,
 	},
 	[BOARD_PCI1711] = {
 		.name		= "pci1711",
 		.rangelist_ai	= &pci1711_ai_range,
+		.is_pci1711	= 1,
 		.has_ao		= 1,
 	},
 	[BOARD_PCI1713] = {
 		.name		= "pci1713",
 		.rangelist_ai	= &pci1710_ai_range,
 		.is_pci1713	= 1,
-		.has_large_fifo	= 1,
-		.has_diff_ai	= 1,
 	},
 	[BOARD_PCI1731] = {
 		.name		= "pci1731",
 		.rangelist_ai	= &pci1711_ai_range,
+		.is_pci1711	= 1,
 	},
 };
 
@@ -796,7 +791,7 @@ static int pci1710_auto_attach(struct comedi_device *dev,
 	s = &dev->subdevices[subdev];
 	s->type		= COMEDI_SUBD_AI;
 	s->subdev_flags	= SDF_READABLE | SDF_COMMON | SDF_GROUND;
-	if (board->has_diff_ai)
+	if (!board->is_pci1711)
 		s->subdev_flags	|= SDF_DIFF;
 	s->n_chan	= board->is_pci1713 ? 32 : 16;
 	s->maxdata	= 0x0fff;
@@ -872,7 +867,7 @@ static int pci1710_auto_attach(struct comedi_device *dev,
 	}
 
 	/* max_samples is half the FIFO size (2 bytes/sample) */
-	devpriv->max_samples = (board->has_large_fifo) ? 2048 : 512;
+	devpriv->max_samples = (board->is_pci1711) ? 512 : 2048;
 
 	return 0;
 }
-- 
2.5.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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