The shared "Status" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.
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>
{
unsigned int status = 0;
const unsigned bits = read_register(counter,
- NITIO_Gxx_Status_Reg(counter->
+ NITIO_STATUS_REG(counter->
counter_index));
if (bits & Gi_Armed_Bit(counter->counter_index)) {
status |= COMEDI_COUNTER_ARMED;
static unsigned ni_tio_next_load_register(struct ni_gpct *counter)
{
const unsigned bits = read_register(counter,
- NITIO_Gxx_Status_Reg(counter->
+ NITIO_STATUS_REG(counter->
counter_index));
if (bits & Gi_Next_Load_Source_Bit(counter->counter_index))
#define NITIO_INPUT_SEL_REG(x) (NITIO_G0_INPUT_SEL + (x))
#define NITIO_CNT_MODE_REG(x) (NITIO_G0_CNT_MODE + (x))
#define NITIO_GATE2_REG(x) (NITIO_G0_GATE2 + (x))
+#define NITIO_STATUS_REG(x) (NITIO_G01_STATUS + ((x) / 2))
static inline enum ni_gpct_register NITIO_Gxx_Joint_Reset_Reg(unsigned idx)
{
return 0;
}
-static inline enum ni_gpct_register NITIO_Gxx_Status_Reg(unsigned idx)
-{
- switch (idx) {
- case 0:
- case 1:
- return NITIO_G01_STATUS;
- case 2:
- case 3:
- return NITIO_G23_STATUS;
- }
- return 0;
-}
-
static inline enum ni_gpct_register NITIO_Gi_DMA_Config_Reg(unsigned idx)
{
switch (idx) {
int *stale_data)
{
const unsigned short gxx_status = read_register(counter,
- NITIO_Gxx_Status_Reg
+ NITIO_STATUS_REG
(counter->
counter_index));
const unsigned short gi_status = read_register(counter,