Define the bits in the status register and remove the magic values. 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/pcl818.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c index c3e8b73..a3615fd 100644 --- a/drivers/staging/comedi/drivers/pcl818.c +++ b/drivers/staging/comedi/drivers/pcl818.c @@ -119,10 +119,6 @@ A word or two about DMA. Driver support DMA operations at two ways: #define boardPCL818 4 #define boardPCL718 5 -/* W: clear INT request */ -#define PCL818_CLRINT 8 -/* R: return status byte */ -#define PCL818_STATUS 8 /* R: A/D high byte W: A/D range control */ #define PCL818_RANGE 1 /* R: next mux scan channel W: mux scan channel & range control pointer */ @@ -134,9 +130,15 @@ A word or two about DMA. Driver support DMA operations at two ways: #define PCL818_AI_LSB_REG 0x00 #define PCL818_AI_MSB_REG 0x01 +#define PCL818_DO_DI_LSB_REG 0x03 #define PCL818_AO_LSB_REG(x) (0x04 + ((x) * 2)) #define PCL818_AO_MSB_REG(x) (0x05 + ((x) * 2)) -#define PCL818_DO_DI_LSB_REG 0x03 +#define PCL818_STATUS_REG 0x08 +#define PCL818_STATUS_NEXT_CHAN_MASK (0xf << 0) +#define PCL818_STATUS_INT (1 << 4) +#define PCL818_STATUS_MUX (1 << 5) +#define PCL818_STATUS_UNI (1 << 6) +#define PCL818_STATUS_EOC (1 << 7) #define PCL818_DO_DI_MSB_REG 0x0b #define PCL818_TIMER_BASE 0x0c @@ -400,7 +402,7 @@ static void pcl818_ai_setup_next_dma(struct comedi_device *dev, static void pcl818_ai_clear_eoc(struct comedi_device *dev) { /* writing any value clears the interrupt request */ - outb(0, dev->iobase + PCL818_CLRINT); + outb(0, dev->iobase + PCL818_STATUS_REG); } static void pcl818_ai_soft_trig(struct comedi_device *dev) @@ -446,8 +448,8 @@ static int pcl818_ai_eoc(struct comedi_device *dev, { unsigned int status; - status = inb(dev->iobase + PCL818_STATUS); - if (status & 0x10) + status = inb(dev->iobase + PCL818_STATUS_REG); + if (status & PCL818_STATUS_INT) return 0; return -EBUSY; } @@ -785,7 +787,7 @@ static void setup_channel_list(struct comedi_device *dev, static int check_single_ended(unsigned int port) { - if (inb(port + PCL818_STATUS) & 0x20) + if (inb(port + PCL818_STATUS_REG) & PCL818_STATUS_MUX) return 1; return 0; } -- 1.8.5.2 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel