mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
staging: comedi: amplc_pci263: define the register map
For completeness, define the registers used by this driver and remove the magic numbers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1ee79c8ee8
commit
623211de9a
@ -36,14 +36,18 @@
|
|||||||
|
|
||||||
#include "../comedi_pci.h"
|
#include "../comedi_pci.h"
|
||||||
|
|
||||||
|
/* PCI263 registers */
|
||||||
|
#define PCI263_DO_0_7_REG 0x00
|
||||||
|
#define PCI263_DO_8_15_REG 0x01
|
||||||
|
|
||||||
static int pci263_do_insn_bits(struct comedi_device *dev,
|
static int pci263_do_insn_bits(struct comedi_device *dev,
|
||||||
struct comedi_subdevice *s,
|
struct comedi_subdevice *s,
|
||||||
struct comedi_insn *insn,
|
struct comedi_insn *insn,
|
||||||
unsigned int *data)
|
unsigned int *data)
|
||||||
{
|
{
|
||||||
if (comedi_dio_update_state(s, data)) {
|
if (comedi_dio_update_state(s, data)) {
|
||||||
outb(s->state & 0xff, dev->iobase);
|
outb(s->state & 0xff, dev->iobase + PCI263_DO_0_7_REG);
|
||||||
outb((s->state >> 8) & 0xff, dev->iobase + 1);
|
outb((s->state >> 8) & 0xff, dev->iobase + PCI263_DO_8_15_REG);
|
||||||
}
|
}
|
||||||
|
|
||||||
data[1] = s->state;
|
data[1] = s->state;
|
||||||
@ -77,7 +81,8 @@ static int pci263_auto_attach(struct comedi_device *dev,
|
|||||||
s->insn_bits = pci263_do_insn_bits;
|
s->insn_bits = pci263_do_insn_bits;
|
||||||
|
|
||||||
/* read initial relay state */
|
/* read initial relay state */
|
||||||
s->state = inb(dev->iobase) | (inb(dev->iobase + 1) << 8);
|
s->state = inb(dev->iobase + PCI263_DO_0_7_REG) |
|
||||||
|
(inb(dev->iobase + PCI263_DO_8_15_REG) << 8);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user