[PATCH 07/15] staging: comedi: ni_daq_700: tidy up the remaining register defines

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

 



For aesthetics, rename these register defines to give them namespace
associated with the driver and define the bits in the registers.

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

diff --git a/drivers/staging/comedi/drivers/ni_daq_700.c b/drivers/staging/comedi/drivers/ni_daq_700.c
index 106fd51..bde5996 100644
--- a/drivers/staging/comedi/drivers/ni_daq_700.c
+++ b/drivers/staging/comedi/drivers/ni_daq_700.c
@@ -78,6 +78,9 @@
 #define DAQ700_STATUS2_REG		0x01
 #define DAQ700_STATUS2_OVERFLOW		(1 << 1)
 #define DAQ700_STATUS2_OVERRUN		(1 << 0)
+#define DAQ700_AI_CLR_REG		0x01
+#define DAQ700_AI_CLR_FIFO		(0 << 0)
+#define DAQ700_AI_FIFO_REG		0x02	/* 16-bit */
 #define DAQ700_DO_REG			0x04
 #define DAQ700_DI_REG			0x05
 #define DAQ700_CMD3_REG			0x05
@@ -85,16 +88,13 @@
 #define DAQ700_CMD3_CLK1SRC		(1 << 3)
 #define DAQ700_CMD3_DIFF		(1 << 2)
 #define DAQ700_CMD3_ARNG(x)		((x) << 0)
+#define DAQ700_TIC_REG			0x06
+#define DAQ700_TIC_CLR_INT		(0 << 0)
 #define DAQ700_CMD2_REG			0x07
 #define DAQ700_CMD2_ENADAQ		(0 << 1)
 #define DAQ700_CMD2_DISABDAQ		(1 << 1)
 #define DAQ700_TIMER_BASE		0x08
 
-/* daqcard700 registers */
-#define ADFIFO_R	0x02	/* RO 16bit */
-#define ADCLEAR_R	0x01	/* WO 8bit */
-#define TIC_R		0x06	/* WO 8bit */
-
 static const struct comedi_lrange range_daq700_ai = {
 	3,
 	{
@@ -220,7 +220,7 @@ static int daq700_ai_rinsn(struct comedi_device *dev,
 			return ret;
 
 		/* read data */
-		d = inw(dev->iobase + ADFIFO_R);
+		d = inw(dev->iobase + DAQ700_AI_FIFO_REG);
 		/* mangle the data as necessary */
 		/* Bipolar Offset Binary: 0 to 4095 for -10 to +10 */
 		d &= 0x0fff;
@@ -252,9 +252,9 @@ static void daq700_ai_config(struct comedi_device *dev,
 	outb(DAQ700_CMD3_ARNG(0), iobase + DAQ700_CMD3_REG);
 	i8254_set_mode(iobase + DAQ700_TIMER_BASE, 0,
 		       0, I8254_MODE1 | I8254_BINARY);	/* OUT0 high */
-	outb(0x00, iobase + TIC_R);	/* clear counter interrupt */
-	outb(0x00, iobase + ADCLEAR_R);	/* clear the ADC FIFO */
-	inw(iobase + ADFIFO_R);		/* read 16bit junk from FIFO to clear */
+	outb(DAQ700_TIC_CLR_INT, iobase + DAQ700_TIC_REG);
+	outb(DAQ700_AI_CLR_FIFO, iobase + DAQ700_AI_CLR_REG);
+	inw(iobase + DAQ700_AI_FIFO_REG);
 }
 
 static int daq700_auto_attach(struct comedi_device *dev,
-- 
1.9.3

_______________________________________________
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