Commit 721869e8 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: c6xdigio: define the register map

The register map was already defined but it was not being used. Rename
to defines and use them in the code.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6d758307
......@@ -44,11 +44,12 @@ This driver will not work with a 2.4 kernel.
#include "../comedidev.h"
/*
* port offsets
* Register I/O map
*/
#define C6XDIGIO_PARALLEL_DATA 0
#define C6XDIGIO_PARALLEL_STATUS 1
#define C6XDIGIO_PARALLEL_CONTROL 2
#define C6XDIGIO_DATA_REG 0x00
#define C6XDIGIO_STATUS_REG 0x01
#define C6XDIGIO_CTRL_REG 0x02
struct pwmbitstype {
unsigned sb0:2;
unsigned sb1:2;
......@@ -83,7 +84,7 @@ static int c6xdigio_chk_status(struct comedi_device *dev, unsigned long context)
int timeout = 0;
do {
status = inb(dev->iobase + 1);
status = inb(dev->iobase + C6XDIGIO_STATUS_REG);
if ((status & 0x80) != context)
return 0;
timeout++;
......@@ -95,7 +96,7 @@ static int c6xdigio_chk_status(struct comedi_device *dev, unsigned long context)
static int c6xdigio_write_data(struct comedi_device *dev,
unsigned int val, unsigned int status)
{
outb_p(val, dev->iobase);
outb_p(val, dev->iobase + C6XDIGIO_DATA_REG);
return c6xdigio_chk_status(dev, status);
}
......@@ -146,28 +147,28 @@ static int c6xdigio_encoder_read(struct comedi_device *dev,
c6xdigio_write_data(dev, ppcmd, 0x00);
enc.bits.sb0 = ((inb(dev->iobase + 1) >> 3) & 0x7);
enc.bits.sb0 = ((inb(dev->iobase + C6XDIGIO_STATUS_REG) >> 3) & 0x7);
c6xdigio_write_data(dev, ppcmd + 0x4, 0x80);
enc.bits.sb1 = ((inb(dev->iobase + 1) >> 3) & 0x7);
enc.bits.sb1 = ((inb(dev->iobase + C6XDIGIO_STATUS_REG) >> 3) & 0x7);
c6xdigio_write_data(dev, ppcmd, 0x00);
enc.bits.sb2 = ((inb(dev->iobase + 1) >> 3) & 0x7);
enc.bits.sb2 = ((inb(dev->iobase + C6XDIGIO_STATUS_REG) >> 3) & 0x7);
c6xdigio_write_data(dev, ppcmd + 0x4, 0x80);
enc.bits.sb3 = ((inb(dev->iobase + 1) >> 3) & 0x7);
enc.bits.sb3 = ((inb(dev->iobase + C6XDIGIO_STATUS_REG) >> 3) & 0x7);
c6xdigio_write_data(dev, ppcmd, 0x00);
enc.bits.sb4 = ((inb(dev->iobase + 1) >> 3) & 0x7);
enc.bits.sb4 = ((inb(dev->iobase + C6XDIGIO_STATUS_REG) >> 3) & 0x7);
c6xdigio_write_data(dev, ppcmd + 0x4, 0x80);
enc.bits.sb5 = ((inb(dev->iobase + 1) >> 3) & 0x7);
enc.bits.sb5 = ((inb(dev->iobase + C6XDIGIO_STATUS_REG) >> 3) & 0x7);
c6xdigio_write_data(dev, ppcmd, 0x00);
enc.bits.sb6 = ((inb(dev->iobase + 1) >> 3) & 0x7);
enc.bits.sb6 = ((inb(dev->iobase + C6XDIGIO_STATUS_REG) >> 3) & 0x7);
c6xdigio_write_data(dev, ppcmd + 0x4, 0x80);
enc.bits.sb7 = ((inb(dev->iobase + 1) >> 3) & 0x7);
enc.bits.sb7 = ((inb(dev->iobase + C6XDIGIO_STATUS_REG) >> 3) & 0x7);
c6xdigio_write_data(dev, ppcmd, 0x00);
c6xdigio_write_data(dev, 0x00, 0x80);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment