On 2013-12-19 23:31, H Hartley Sweeten wrote:
The ni_tio module is used by the ni_atmio, ni_660x, ni_pcimio and ni_mio_cs
drivers to provide support functions for the NI General Purpose Counters.
The ni_tiocmd module is used by the ni_660x and ni_pcimio to support async
commands with the counters.
These boards that have different register maps, and varying numbers of
actual counters (2 or 4). Due to this the ni_tio registers are referenced
by the drivers using an enum. The drivers then use this enum to map the
ni_tio registers to the real registers on the board.
Currently a number of static inline helper functions are used to get the
ni_tio register for a given counter. Since the counter registers are all
sequential in the enum we can replace all of these inline helpers with
simple macros. This also gets rid of a bunch of unnecessary BUG() checks.
This series does this initial cleanup in addition to tidying up some
of the easy pieces.
H Hartley Sweeten (36):
staging: comedi: ni_tio.h: rename the CamelCase enum ni_gpct_register labels
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Autoincrement_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Command_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_SW_Save_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Mode_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_LoadA_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_LoadB_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Input_Select_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Counting_Mode_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Second_Gate_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gxx_Status_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gxx_Joint_Reset_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gxx_Joint_Status1_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gxx_Joint_Status2_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_DMA_Config_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_DMA_Status_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_ABZ_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Interrupt_Acknowledge_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Status_Reg()
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Interrupt_Enable_Reg()
staging: comedi: ni_tio_internal.h: add missing NITIO_*_REG macro
staging: comedi: ni_tiocmd: use a local var for the 'counter_index'
staging: comedi: ni_tio: use a local var for the 'counter_index'
staging: comedi: ni_tiocmd: move the MODULE_* stuff to the end of file
staging: comedi: ni_tio: move the MODULE_* stuff to the end of file
staging: comedi: ni_tio.h: remove 'extern' from exported function prototypes
staging: comedi: ni_tio.h: remove subdev_to_counter()
staging: comedi: ni_tio: make ni_tio_rinsn() a proper comedi (*insn_read)
staging: comedi: ni_tio: make ni_tio_winsn() a proper comedi (*insn_write)
staging: comedi: ni_tio: make ni_tio_insn_config() a proper comedi (*insn_config)
staging: comedi: ni_tiocmd: make ni_tio_cmdtest() a proper comedi (*do_cmdtest)
staging: comedi: ni_tiocmd: make ni_tio_cmd() a proper comedi (*do_cmd)
staging: comedi: ni_660x: rename the CamelCase enum NI_660x_Register and labels
staging: comedi: ni_660x: use a local var for the 'chip_index'
staging: comedi: ni_660x: remove dma_selection_counter()
staging: comedi: ni_660x: tidy up set_tio_counterswap()
drivers/staging/comedi/drivers/ni_660x.c | 706 ++++++++++-------------
drivers/staging/comedi/drivers/ni_mio_common.c | 156 ++---
drivers/staging/comedi/drivers/ni_tio.c | 314 +++++-----
drivers/staging/comedi/drivers/ni_tio.h | 209 ++++---
drivers/staging/comedi/drivers/ni_tio_internal.h | 431 +-------------
drivers/staging/comedi/drivers/ni_tiocmd.c | 88 ++-
6 files changed, 657 insertions(+), 1247 deletions(-)
Looks good!
Reviewed-by: Ian Abbott <abbotti@xxxxxxxxx>
(I'm going to be offline pretty much most of the time from 23rd December
to the New Year.)
--
-=( 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/driverdev-devel