diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2012-10-24 16:48:10 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-24 15:25:22 -0700 |
commit | 87276012ead9f96f249fedf715b1052106f2e0d0 (patch) | |
tree | aaa2eaa70848c372cc819a1e341d90617f40c483 /drivers/staging/comedi/drivers/amplc_dio200.c | |
parent | 025d1f675c401da7c1efa0e37d5eada1abebdc5a (diff) |
staging: comedi: amplc_dio200: add 32-bit register access functions
These are currently unused but will be used to support extra features of
the PCIe boards.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/amplc_dio200.c')
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_dio200.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_dio200.c b/drivers/staging/comedi/drivers/amplc_dio200.c index 34bbf9bddccc..768a269d48f8 100644 --- a/drivers/staging/comedi/drivers/amplc_dio200.c +++ b/drivers/staging/comedi/drivers/amplc_dio200.c @@ -680,6 +680,38 @@ static void dio200_write8(struct comedi_device *dev, unsigned int offset, } /* + * Read 32-bit register. + */ +static unsigned int dio200_read32(struct comedi_device *dev, + unsigned int offset) +{ + const struct dio200_board *thisboard = comedi_board(dev); + struct dio200_private *devpriv = dev->private; + + offset <<= thisboard->mainshift; + if (devpriv->io.regtype == io_regtype) + return inl(devpriv->io.u.iobase + offset); + else + return readl(devpriv->io.u.membase + offset); +} + +/* + * Write 32-bit register. + */ +static void dio200_write32(struct comedi_device *dev, unsigned int offset, + unsigned int val) +{ + const struct dio200_board *thisboard = comedi_board(dev); + struct dio200_private *devpriv = dev->private; + + offset <<= thisboard->mainshift; + if (devpriv->io.regtype == io_regtype) + outl(val, devpriv->io.u.iobase + offset); + else + writel(val, devpriv->io.u.membase + offset); +} + +/* * This function looks for a board matching the supplied PCI device. */ static const struct dio200_board * |