]> git.karo-electronics.de Git - linux-beck.git/commit
staging: comedi: ni_mio_common: refactor m-series stc register handling
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 1 May 2015 21:58:26 +0000 (14:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 May 2015 17:05:03 +0000 (19:05 +0200)
commit05dd0c9fcb34f8335728a2c4ea7f5bb5829900bc
tree135b31b98a314aa973d87b382fb9f7f2473d4b1b
parent5ccca155675a5a2d491257a441306dd8547695c2
staging: comedi: ni_mio_common: refactor m-series stc register handling

For M-Series boards (devpriv->is_m_series), the STC registers need to be
remapped. This is currently handled with some big switch statements to
convert the STC register offset to the M-Series offset. Some of the
registers also need special handling due to differences in the register
size on the M-Series boards.

Create some lookup tables to handle the remapping of the read and write
registers. These are easier to maintain and can contain the register size
so that a common function can be used instead of the separate helpers.

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>
drivers/staging/comedi/drivers/ni_mio_common.c