OSDN Git Service

staging: comedi: s526: refactor gpct registers
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 17 Aug 2015 23:58:11 +0000 (16:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:24:19 +0000 (18:24 -0700)
commit1d0d1c00daff961b130691a64ad2cde6d856d24e
treeb52b17883b0c72cbdf5cc5e6cd32c8acc7439c53
parentde332b11946f1e5f9d8513828e18701d6cb903d4
staging: comedi: s526: refactor gpct registers

The S526 board has 4 general purpose counter/timers. The current
defines used for the registers of these devices do not provide much
clarity in what they are.

Refactor the code to add some clarity.

Replace the current register defines with macros that return the
correct offset based on the counter 'channel'. Introduce a some helper
functions to handle reading/writing the LSB/MSB registers so that
they are always accessed in the correct oreder.

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/s526.c