RE: [PATCH 06/14] staging: comedi: daqboard2000: rename register offset macros
From: Hartley Sweeten
Date: Tue May 17 2016 - 13:42:42 EST
On Tuesday, May 17, 2016 2:53 AM, Ian Abbott wrote:
> Rename the macros defining register offsets to avoid CamelCase, and to
> use namespace associated with the driver.
>
> Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
> ---
> Other CamelCase issues in this patch will be dealt with by later
> patches in the series.
> ---
> drivers/staging/comedi/drivers/daqboard2000.c | 112 ++++++++++++++------------
> 1 file changed, 61 insertions(+), 51 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/daqboard2000.c b/drivers/staging/comedi/drivers/daqboard2000.c
> index b3b68e8..92ff8f4 100644
> --- a/drivers/staging/comedi/drivers/daqboard2000.c
> +++ b/drivers/staging/comedi/drivers/daqboard2000.c
> @@ -151,35 +151,35 @@ static const struct comedi_lrange range_daqboard2000_ai = {
> /*
> * Register Memory Map
> */
> -#define acqControl 0x00 /* u16 */
> -#define acqScanListFIFO 0x02 /* u16 */
> -#define acqPacerClockDivLow 0x04 /* u32 */
> -#define acqScanCounter 0x08 /* u16 */
> -#define acqPacerClockDivHigh 0x0a /* u16 */
> -#define acqTriggerCount 0x0c /* u16 */
> -#define acqResultsFIFO 0x10 /* u16 */
> -#define acqResultsShadow 0x14 /* u16 */
> -#define acqAdcResult 0x18 /* u16 */
> -#define dacScanCounter 0x1c /* u16 */
> -#define dacControl 0x20 /* u16 */
> -#define dacFIFO 0x24 /* s16 */
> -#define dacPacerClockDiv 0x2a /* u16 */
> -#define refDacs 0x2c /* u16 */
> -#define dioControl 0x30 /* u16 */
> -#define dioP3hsioData 0x32 /* s16 */
> -#define dioP3Control 0x34 /* u16 */
> -#define calEepromControl 0x36 /* u16 */
> -#define dacSetting(x) (0x38 + (x) * 2) /* s16 */
> -#define dioP2ExpansionIO8Bit 0x40 /* s16 */
> -#define ctrTmrControl 0x80 /* u16 */
> -#define ctrInput(x) (0x88 + (x) * 2) /* s16 */
> -#define timerDivisor(x) (0xa0 + (x) * 2) /* u16 */
> -#define dmaControl 0xb0 /* u16 */
> -#define trigControl 0xb2 /* u16 */
> -#define calEeprom 0xb8 /* u16 */
> -#define acqDigitalMark 0xba /* u16 */
> -#define trigDacs 0xbc /* u16 */
> -#define dioP2ExpansionIO16Bit(x) (0xc0 + (x) * 2) /* s16 */
> +#define DAQBOARD2000_REG_ACQ_CONTROL 0x00 /* u16 */
> +#define DAQBOARD2000_REG_ACQ_SCAN_LIST_FIFO 0x02 /* u16 */
> +#define DAQBOARD2000_REG_ACQ_PACER_CLOCK_DIV_LOW 0x04 /* u32 */
> +#define DAQBOARD2000_REG_ACQ_SCAN_COUNTER 0x08 /* u16 */
> +#define DAQBOARD2000_REG_ACQ_PACER_CLOCK_DIV_HIGH 0x0a /* u16 */
> +#define DAQBOARD2000_REG_ACQ_TRIGGER_COUNT 0x0c /* u16 */
> +#define DAQBOARD2000_REG_ACQ_RESULTS_FIFO 0x10 /* u16 */
> +#define DAQBOARD2000_REG_ACQ_RESULTS_SHADOW 0x14 /* u16 */
> +#define DAQBOARD2000_REG_ACQ_ADC_RESULT 0x18 /* u16 */
> +#define DAQBOARD2000_REG_DAC_SCAN_COUNTER 0x1c /* u16 */
> +#define DAQBOARD2000_REG_DAC_CONTROL 0x20 /* u16 */
> +#define DAQBOARD2000_REG_DAC_FIFO 0x24 /* s16 */
> +#define DAQBOARD2000_REG_DAC_PACER_CLOCK_DIV 0x2a /* u16 */
> +#define DAQBOARD2000_REG_REF_DACS 0x2c /* u16 */
> +#define DAQBOARD2000_REG_DIO_CONTROL 0x30 /* u16 */
> +#define DAQBOARD2000_REG_P3_HSIO_DATA 0x32 /* s16 */
> +#define DAQBOARD2000_REG_P3_CONTROL 0x34 /* u16 */
> +#define DAQBOARD2000_REG_CAL_EEPROM_CONTROL 0x36 /* u16 */
> +#define DAQBOARD2000_REG_DAC_SETTING(x) (0x38 + (x) * 2) /* s16 */
> +#define DAQBOARD2000_REG_DIO_P2_EXP_IO_8_BIT 0x40 /* s16 */
> +#define DAQBOARD2000_REG_COUNTER_TIMER_CONTROL 0x80 /* u16 */
> +#define DAQBOARD2000_REG_COUNTER_INPUT(x) (0x88 + (x) * 2) /* s16 */
> +#define DAQBOARD2000_REG_TIMER_DIV(x) (0xa0 + (x) * 2) /* u16 */
> +#define DAQBOARD2000_REG_DMA_CONTROL 0xb0 /* u16 */
> +#define DAQBOARD2000_REG_TRIG_CONTROL 0xb2 /* u16 */
> +#define DAQBOARD2000_REG_CAL_EEPROM 0xb8 /* u16 */
> +#define DAQBOARD2000_REG_ACQ_DIGITAL_MARK 0xba /* u16 */
> +#define DAQBOARD2000_REG_TRIG_DACS 0xbc /* u16 */
> +#define DAQBOARD2000_REG_DIO_P2_EXP_IO_16_BIT(x) (0xc0 + (x) * 2) /* s16 */
Any chance we can shorten the namespace prefix? It's not a big deal but
the DAQBOARD2000_ is pretty long. How about DB2K_ or even D2K_?
Regards,
Hartley