From: Frank Mori Hess Date: Fri, 4 Jul 2003 18:50:04 +0000 (+0000) Subject: reduce number of symbols exported from ni_labpc.o for ni_labpc_cs.o X-Git-Tag: r0_7_69~304 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=33472723fa3248158cc3430521bb752205e7f263;p=comedi.git reduce number of symbols exported from ni_labpc.o for ni_labpc_cs.o --- diff --git a/comedi/drivers/ni_labpc.c b/comedi/drivers/ni_labpc.c index 7ea3de0c..2d70b199 100644 --- a/comedi/drivers/ni_labpc.c +++ b/comedi/drivers/ni_labpc.c @@ -252,8 +252,9 @@ static comedi_lrange range_labpc_plus_ai = { } }; +#define NUM_LABPC_1200_AI_RANGES 14 // indicates unipolar ranges -int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] = +static int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] = { 0, 0, @@ -271,7 +272,7 @@ int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] = 1, }; // map range index to gain bits -int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] = +static int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] = { 0x00, 0x20, @@ -288,7 +289,7 @@ int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] = 0x60, 0x70, }; -comedi_lrange range_labpc_1200_ai = { +static comedi_lrange range_labpc_1200_ai = { NUM_LABPC_1200_AI_RANGES, { BIP_RANGE(5), @@ -318,6 +319,25 @@ comedi_lrange range_labpc_ao = { } }; +/* functions that do inb/outb and readb/writeb so we can use + * function pointers to decide which to use */ +static inline unsigned int labpc_inb(unsigned long address) +{ + return inb(address); +} +static inline void labpc_outb(unsigned int byte, unsigned long address) +{ + outb(byte, address); +} +static inline unsigned int labpc_readb(unsigned long address) +{ + return readb(address); +} +static inline void labpc_writeb(unsigned int byte, unsigned long address) +{ + writeb(byte, address); +} + static labpc_board labpc_boards[] = { { @@ -375,6 +395,39 @@ static labpc_board labpc_boards[] = }, }; +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, + read_byte: labpc_inb, + write_byte: labpc_outb, + 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, + }, + /* 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, + read_byte: labpc_inb, + write_byte: labpc_outb, + 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, + }, +}; + /* * Useful for shorthand access to the particular board structure */ @@ -1938,8 +1991,5 @@ COMEDI_INITCLEANUP(driver_labpc); EXPORT_SYMBOL_GPL( labpc_common_attach ); EXPORT_SYMBOL_GPL( labpc_common_detach ); -EXPORT_SYMBOL_GPL( labpc_1200_is_unipolar ); -EXPORT_SYMBOL_GPL( labpc_1200_ai_gain_bits ); -EXPORT_SYMBOL_GPL( range_labpc_1200_ai ); -EXPORT_SYMBOL_GPL( range_labpc_ao ); +EXPORT_SYMBOL_GPL( labpc_cs_boards ); diff --git a/comedi/drivers/ni_labpc.h b/comedi/drivers/ni_labpc.h index b00199f2..27b51a57 100644 --- a/comedi/drivers/ni_labpc.h +++ b/comedi/drivers/ni_labpc.h @@ -70,38 +70,12 @@ typedef struct{ unsigned int caldac[16]; // stores settings of calibration dacs }labpc_private; -//analog input ranges -// indicates unipolar ranges -#define NUM_LABPC_1200_AI_RANGES 14 -int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES]; -// map range index to gain bits -int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES]; -comedi_lrange range_labpc_1200_ai; - -//analog output ranges -comedi_lrange range_labpc_ao; +#define NUM_LABPC_CS_BOARDS 2 +labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS]; int labpc_common_attach( comedi_device *dev, unsigned long iobase, int irq, int dma ); int labpc_common_detach( comedi_device *dev ); -/* functions that do inb/outb and readb/writeb so we can use - * function pointers to decide which to use */ -static inline unsigned int labpc_inb(unsigned long address) -{ - return inb(address); -} -static inline void labpc_outb(unsigned int byte, unsigned long address) -{ - outb(byte, address); -} -static inline unsigned int labpc_readb(unsigned long address) -{ - return readb(address); -} -static inline void labpc_writeb(unsigned int byte, unsigned long address) -{ - writeb(byte, address); -} #endif /* _NI_LABPC_H */ diff --git a/comedi/drivers/ni_labpc_cs.c b/comedi/drivers/ni_labpc_cs.c index cdb81b53..7e9adf50 100644 --- a/comedi/drivers/ni_labpc_cs.c +++ b/comedi/drivers/ni_labpc_cs.c @@ -93,39 +93,6 @@ static dev_link_t *pcmcia_dev_list = NULL; static int labpc_attach(comedi_device *dev,comedi_devconfig *it); -static labpc_board labpc_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, - read_byte: labpc_inb, - write_byte: labpc_outb, - 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, - }, - /* 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, - read_byte: labpc_inb, - write_byte: labpc_outb, - 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, - }, -}; - /* * Useful for shorthand access to the particular board structure */ @@ -134,16 +101,14 @@ static labpc_board labpc_boards[] = static const int dma_buffer_size = 0xff00; // size in bytes of dma buffer static const int sample_size = 2; // 2 bytes per sample -#define devpriv ((labpc_private *)dev->private) - static comedi_driver driver_labpc_cs = { driver_name: "ni_labpc_cs", module: THIS_MODULE, attach: labpc_attach, detach: labpc_common_detach, - num_names: sizeof(labpc_boards) / sizeof(labpc_board), - board_name: (char **)labpc_boards, + num_names: sizeof(labpc_cs_boards) / sizeof(labpc_board), + board_name: (char **)labpc_cs_boards, offset: sizeof(labpc_board), }; @@ -765,4 +730,5 @@ void labpc_exit_module(void) } module_init( labpc_init_module ); -module_exit( labpc_exit_module ); \ No newline at end of file +module_exit( labpc_exit_module ); +