From: Ian Abbott Date: Thu, 10 Apr 2008 11:01:40 +0000 (+0000) Subject: Moved labpc_cs_boards[] from ni_labpc.c to ni_labpc_cs.c and exported X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a62cc5ec6ef9605deb7a69b3b1cbc794dea9f50e;p=comedi.git Moved labpc_cs_boards[] from ni_labpc.c to ni_labpc_cs.c and exported range_labpc_1200_ai, labpc_1200_ai_gain_bits[] and labpc_1200_is_unipolar[] from ni_labpc.c for use by ni_labpc_cs.c. --- diff --git a/comedi/drivers/ni_labpc.c b/comedi/drivers/ni_labpc.c index d5baf94e..5dc4373e 100644 --- a/comedi/drivers/ni_labpc.c +++ b/comedi/drivers/ni_labpc.c @@ -273,7 +273,7 @@ static const comedi_lrange range_labpc_plus_ai = { #define NUM_LABPC_1200_AI_RANGES 14 // indicates unipolar ranges -static const int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] = { +const int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] = { 0, 0, 0, @@ -291,7 +291,7 @@ static const int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] = { }; // map range index to gain bits -static const int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] = { +const int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] = { 0x00, 0x20, 0x30, @@ -307,7 +307,7 @@ static const int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] = { 0x60, 0x70, }; -static const comedi_lrange range_labpc_1200_ai = { +const comedi_lrange range_labpc_1200_ai = { NUM_LABPC_1200_AI_RANGES, { BIP_RANGE(5), @@ -408,36 +408,6 @@ static const labpc_board labpc_boards[] = { }, }; -const labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS] = { - { - name: "daqcard-1200", - device_id:0x103, // 0x10b is manufacturer id, 0x103 is device id - ai_speed:10000, - bustype: pcmcia_bustype, - register_layout:labpc_1200_layout, - has_ao: 1, - ai_range_table:&range_labpc_1200_ai, - ai_range_code:labpc_1200_ai_gain_bits, - ai_range_is_unipolar:labpc_1200_is_unipolar, - ai_scan_up:0, - memory_mapped_io:0, - }, - /* duplicate entry, to support using alternate name */ - { - name: "ni_labpc_cs", - device_id:0x103, - ai_speed:10000, - bustype: pcmcia_bustype, - register_layout:labpc_1200_layout, - has_ao: 1, - ai_range_table:&range_labpc_1200_ai, - ai_range_code:labpc_1200_ai_gain_bits, - ai_range_is_unipolar:labpc_1200_is_unipolar, - ai_scan_up:0, - memory_mapped_io:0, - }, -}; - /* * Useful for shorthand access to the particular board structure */ @@ -2004,4 +1974,6 @@ COMEDI_INITCLEANUP(driver_labpc); EXPORT_SYMBOL_GPL(labpc_common_attach); EXPORT_SYMBOL_GPL(labpc_common_detach); -EXPORT_SYMBOL_GPL(labpc_cs_boards); +EXPORT_SYMBOL_GPL(range_labpc_1200_ai); +EXPORT_SYMBOL_GPL(labpc_1200_ai_gain_bits); +EXPORT_SYMBOL_GPL(labpc_1200_is_unipolar); diff --git a/comedi/drivers/ni_labpc.h b/comedi/drivers/ni_labpc.h index 6eabe5cb..8264fb19 100644 --- a/comedi/drivers/ni_labpc.h +++ b/comedi/drivers/ni_labpc.h @@ -74,11 +74,12 @@ typedef struct { void (*write_byte) (unsigned int byte, unsigned long address); } labpc_private; -#define NUM_LABPC_CS_BOARDS 2 -extern const labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS]; - int labpc_common_attach(comedi_device * dev, unsigned long iobase, unsigned int irq, unsigned int dma); int labpc_common_detach(comedi_device * dev); +extern const int labpc_1200_is_unipolar[]; +extern const int labpc_1200_ai_gain_bits[]; +extern const comedi_lrange range_labpc_1200_ai; + #endif /* _NI_LABPC_H */ diff --git a/comedi/drivers/ni_labpc_cs.c b/comedi/drivers/ni_labpc_cs.c index e75e916f..19f900d1 100644 --- a/comedi/drivers/ni_labpc_cs.c +++ b/comedi/drivers/ni_labpc_cs.c @@ -82,6 +82,36 @@ static struct pcmcia_device *pcmcia_cur_dev = NULL; static int labpc_attach(comedi_device * dev, comedi_devconfig * it); +static const labpc_board labpc_cs_boards[] = { + { + name: "daqcard-1200", + device_id:0x103, // 0x10b is manufacturer id, 0x103 is device id + ai_speed:10000, + bustype: pcmcia_bustype, + register_layout:labpc_1200_layout, + has_ao: 1, + ai_range_table:&range_labpc_1200_ai, + ai_range_code:labpc_1200_ai_gain_bits, + ai_range_is_unipolar:labpc_1200_is_unipolar, + ai_scan_up:0, + memory_mapped_io:0, + }, + /* duplicate entry, to support using alternate name */ + { + name: "ni_labpc_cs", + device_id:0x103, + ai_speed:10000, + bustype: pcmcia_bustype, + register_layout:labpc_1200_layout, + has_ao: 1, + ai_range_table:&range_labpc_1200_ai, + ai_range_code:labpc_1200_ai_gain_bits, + ai_range_is_unipolar:labpc_1200_is_unipolar, + ai_scan_up:0, + memory_mapped_io:0, + }, +}; + /* * Useful for shorthand access to the particular board structure */