From: H Hartley Sweeten Date: Tue, 4 Mar 2014 18:30:14 +0000 (-0700) Subject: staging: comedi: pcl812: define the status register bits X-Git-Tag: v3.15-rc1~139^2~629 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=598e61e6dd42cc865ca34a1213054946a99489ff;p=karo-tx-linux.git staging: comedi: pcl812: define the status register bits 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/pcl812.c b/drivers/staging/comedi/drivers/pcl812.c index 7d13a99e3f5d..7e105c872b95 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);