[PATCH 53/66] staging: comedi: pcl812: define the status register bits

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

 



Define the bits in the status register.

Writing any value to the status register clears any pending interrupt.
For aesthetics, rename the status register and remove the "clrint"
register.

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

diff --git a/drivers/staging/comedi/drivers/pcl812.c b/drivers/staging/comedi/drivers/pcl812.c
index 7d13a99..7e105c8 100644
--- a/drivers/staging/comedi/drivers/pcl812.c
+++ b/drivers/staging/comedi/drivers/pcl812.c
@@ -139,7 +139,8 @@
 #define PCL812_AO_MSB_REG(x)			(0x05 + ((x) * 2))
 #define PCL812_DI_LSB_REG			0x06
 #define PCL812_DI_MSB_REG			0x07
-#define PCL812_CLRINT	      8
+#define PCL812_STATUS_REG			0x08
+#define PCL812_STATUS_DRDY			(1 << 5)
 #define PCL812_GAIN	      9
 #define PCL812_MUX	     10
 #define PCL812_MODE	     11
@@ -148,10 +149,6 @@
 #define PCL812_DO_LSB_REG			0x0d
 #define PCL812_DO_MSB_REG			0x0e
 
-#define ACL8216_STATUS	      8	/* 5. bit signalize data ready */
-
-#define ACL8216_DRDY	   0x20	/* =0 data ready */
-
 #define MAX_CHANLIST_LEN    256	/* length of scan list */
 
 static const struct comedi_lrange range_pcl812pg_ai = {
@@ -639,7 +636,7 @@ static void pcl812_ai_setup_next_dma(struct comedi_device *dev,
 static void pcl812_ai_clear_eoc(struct comedi_device *dev)
 {
 	/* writing any value clears the interrupt request */
-	outb(0, dev->iobase + PCL812_CLRINT);
+	outb(0, dev->iobase + PCL812_STATUS_REG);
 }
 
 static void pcl812_ai_soft_trig(struct comedi_device *dev)
@@ -667,8 +664,8 @@ static int pcl812_ai_eoc(struct comedi_device *dev,
 	unsigned int status;
 
 	if (s->maxdata > 0x0fff) {
-		status = inb(dev->iobase + ACL8216_STATUS);
-		if ((status & ACL8216_DRDY) == 0)
+		status = inb(dev->iobase + PCL812_STATUS_REG);
+		if ((status & PCL812_STATUS_DRDY) == 0)
 			return 0;
 	} else {
 		status = inb(dev->iobase + PCL812_AI_MSB_REG);
-- 
1.8.5.2

_______________________________________________
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