forked from luck/tmp_suning_uos_patched
staging: comedi: das08: rename DAS08JR_AO_LSB() and DAS08JR_AO_MSB()
The `DAS08JR_AO_LSB(x)` macro returns the offset to the analog output low byte register for channel x (0 or 1) for "JR" boards with analog output support. The `DAS08JR_AO_MSB(x)` macro returns the offset to the corresponding high byte register. Rename the macros to `DAS08JR_AO_LSB_REG(x)` and `DAS08JR_AO_MSB_REG(x)` respectively, and add some comments. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c47c0ed2d5
commit
7b2098f626
|
@ -97,8 +97,10 @@
|
|||
|
||||
#define DAS08JR_DI_REG 0x03 /* (R) digital inputs ("JR" boards) */
|
||||
#define DAS08JR_DO_REG 0x03 /* (W) digital outputs ("JR" boards) */
|
||||
#define DAS08JR_AO_LSB(x) ((x) ? 6 : 4)
|
||||
#define DAS08JR_AO_MSB(x) ((x) ? 7 : 5)
|
||||
/* (W) analog output l.s.b. registers for 2 channels ("JR" boards) */
|
||||
#define DAS08JR_AO_LSB_REG(x) ((x) ? 0x06 : 0x04)
|
||||
/* (W) analog output m.s.b. registers for 2 channels ("JR" boards) */
|
||||
#define DAS08JR_AO_MSB_REG(x) ((x) ? 0x07 : 0x05)
|
||||
|
||||
/*
|
||||
cio-das08_aox.pdf
|
||||
|
@ -353,8 +355,8 @@ static void das08_ao_set_data(struct comedi_device *dev,
|
|||
lsb = data & 0xff;
|
||||
msb = (data >> 8) & 0xff;
|
||||
if (thisboard->is_jr) {
|
||||
outb(lsb, dev->iobase + DAS08JR_AO_LSB(chan));
|
||||
outb(msb, dev->iobase + DAS08JR_AO_MSB(chan));
|
||||
outb(lsb, dev->iobase + DAS08JR_AO_LSB_REG(chan));
|
||||
outb(msb, dev->iobase + DAS08JR_AO_MSB_REG(chan));
|
||||
/* load DACs */
|
||||
inb(dev->iobase + DAS08JR_DI_REG);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user