From 3f1f219ce1f814976a3e435b4e6fa963252d7581 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Tue, 8 Oct 2013 19:06:34 +0100 Subject: [PATCH] staging: comedi: s626: move s626_enc_chan_info[] Move `s626_enc_chan_info[]` and remove its forward declaration. Signed-off-by: Ian Abbott Reviewed-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/s626.c | 190 +++++++++++++------------- 1 file changed, 94 insertions(+), 96 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 05c856c725c9..9216e9a02b25 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -139,8 +139,6 @@ struct s626_enc_info { uint16_t my_event_bits[4]; /* bit translations for IntSrc -->RDMISC2 */ }; -static const struct s626_enc_info s626_enc_chan_info[]; - /* Counter overflow/index event flag masks for RDMISC2. */ #define INDXMASK(C) (1 << (((C) > 2) ? ((C) * 2 - 1) : ((C) * 2 + 4))) #define OVERMASK(C) (1 << (((C) > 2) ? ((C) * 2 + 5) : ((C) * 2 + 10))) @@ -1199,6 +1197,100 @@ static void pulse_index_b(struct comedi_device *dev, debi_write(dev, k->my_crb, crb); } +static const struct s626_enc_info s626_enc_chan_info[] = { + { + .get_enable = get_enable_a, + .get_int_src = get_int_src_a, + .get_load_trig = get_load_trig_a, + .get_mode = get_mode_a, + .pulse_index = pulse_index_a, + .set_enable = set_enable_a, + .set_int_src = set_int_src_a, + .set_load_trig = set_load_trig_a, + .set_mode = set_mode_a, + .reset_cap_flags = reset_cap_flags_a, + .my_cra = LP_CR0A, + .my_crb = LP_CR0B, + .my_latch_lsw = LP_CNTR0ALSW, + .my_event_bits = EVBITS(0), + }, { + .get_enable = get_enable_a, + .get_int_src = get_int_src_a, + .get_load_trig = get_load_trig_a, + .get_mode = get_mode_a, + .pulse_index = pulse_index_a, + .set_enable = set_enable_a, + .set_int_src = set_int_src_a, + .set_load_trig = set_load_trig_a, + .set_mode = set_mode_a, + .reset_cap_flags = reset_cap_flags_a, + .my_cra = LP_CR1A, + .my_crb = LP_CR1B, + .my_latch_lsw = LP_CNTR1ALSW, + .my_event_bits = EVBITS(1), + }, { + .get_enable = get_enable_a, + .get_int_src = get_int_src_a, + .get_load_trig = get_load_trig_a, + .get_mode = get_mode_a, + .pulse_index = pulse_index_a, + .set_enable = set_enable_a, + .set_int_src = set_int_src_a, + .set_load_trig = set_load_trig_a, + .set_mode = set_mode_a, + .reset_cap_flags = reset_cap_flags_a, + .my_cra = LP_CR2A, + .my_crb = LP_CR2B, + .my_latch_lsw = LP_CNTR2ALSW, + .my_event_bits = EVBITS(2), + }, { + .get_enable = get_enable_b, + .get_int_src = get_int_src_b, + .get_load_trig = get_load_trig_b, + .get_mode = get_mode_b, + .pulse_index = pulse_index_b, + .set_enable = set_enable_b, + .set_int_src = set_int_src_b, + .set_load_trig = set_load_trig_b, + .set_mode = set_mode_b, + .reset_cap_flags = reset_cap_flags_b, + .my_cra = LP_CR0A, + .my_crb = LP_CR0B, + .my_latch_lsw = LP_CNTR0BLSW, + .my_event_bits = EVBITS(3), + }, { + .get_enable = get_enable_b, + .get_int_src = get_int_src_b, + .get_load_trig = get_load_trig_b, + .get_mode = get_mode_b, + .pulse_index = pulse_index_b, + .set_enable = set_enable_b, + .set_int_src = set_int_src_b, + .set_load_trig = set_load_trig_b, + .set_mode = set_mode_b, + .reset_cap_flags = reset_cap_flags_b, + .my_cra = LP_CR1A, + .my_crb = LP_CR1B, + .my_latch_lsw = LP_CNTR1BLSW, + .my_event_bits = EVBITS(4), + }, { + .get_enable = get_enable_b, + .get_int_src = get_int_src_b, + .get_load_trig = get_load_trig_b, + .get_mode = get_mode_b, + .pulse_index = pulse_index_b, + .set_enable = set_enable_b, + .set_int_src = set_int_src_b, + .set_load_trig = set_load_trig_b, + .set_mode = set_mode_b, + .reset_cap_flags = reset_cap_flags_b, + .my_cra = LP_CR2A, + .my_crb = LP_CR2B, + .my_latch_lsw = LP_CNTR2BLSW, + .my_event_bits = EVBITS(5), + }, +}; + static unsigned int s626_ai_reg_to_uint(int data) { unsigned int tempdata; @@ -2370,100 +2462,6 @@ static void close_dma_b(struct comedi_device *dev, struct buffer_dma *pdma, } } -static const struct s626_enc_info s626_enc_chan_info[] = { - { - .get_enable = get_enable_a, - .get_int_src = get_int_src_a, - .get_load_trig = get_load_trig_a, - .get_mode = get_mode_a, - .pulse_index = pulse_index_a, - .set_enable = set_enable_a, - .set_int_src = set_int_src_a, - .set_load_trig = set_load_trig_a, - .set_mode = set_mode_a, - .reset_cap_flags = reset_cap_flags_a, - .my_cra = LP_CR0A, - .my_crb = LP_CR0B, - .my_latch_lsw = LP_CNTR0ALSW, - .my_event_bits = EVBITS(0), - }, { - .get_enable = get_enable_a, - .get_int_src = get_int_src_a, - .get_load_trig = get_load_trig_a, - .get_mode = get_mode_a, - .pulse_index = pulse_index_a, - .set_enable = set_enable_a, - .set_int_src = set_int_src_a, - .set_load_trig = set_load_trig_a, - .set_mode = set_mode_a, - .reset_cap_flags = reset_cap_flags_a, - .my_cra = LP_CR1A, - .my_crb = LP_CR1B, - .my_latch_lsw = LP_CNTR1ALSW, - .my_event_bits = EVBITS(1), - }, { - .get_enable = get_enable_a, - .get_int_src = get_int_src_a, - .get_load_trig = get_load_trig_a, - .get_mode = get_mode_a, - .pulse_index = pulse_index_a, - .set_enable = set_enable_a, - .set_int_src = set_int_src_a, - .set_load_trig = set_load_trig_a, - .set_mode = set_mode_a, - .reset_cap_flags = reset_cap_flags_a, - .my_cra = LP_CR2A, - .my_crb = LP_CR2B, - .my_latch_lsw = LP_CNTR2ALSW, - .my_event_bits = EVBITS(2), - }, { - .get_enable = get_enable_b, - .get_int_src = get_int_src_b, - .get_load_trig = get_load_trig_b, - .get_mode = get_mode_b, - .pulse_index = pulse_index_b, - .set_enable = set_enable_b, - .set_int_src = set_int_src_b, - .set_load_trig = set_load_trig_b, - .set_mode = set_mode_b, - .reset_cap_flags = reset_cap_flags_b, - .my_cra = LP_CR0A, - .my_crb = LP_CR0B, - .my_latch_lsw = LP_CNTR0BLSW, - .my_event_bits = EVBITS(3), - }, { - .get_enable = get_enable_b, - .get_int_src = get_int_src_b, - .get_load_trig = get_load_trig_b, - .get_mode = get_mode_b, - .pulse_index = pulse_index_b, - .set_enable = set_enable_b, - .set_int_src = set_int_src_b, - .set_load_trig = set_load_trig_b, - .set_mode = set_mode_b, - .reset_cap_flags = reset_cap_flags_b, - .my_cra = LP_CR1A, - .my_crb = LP_CR1B, - .my_latch_lsw = LP_CNTR1BLSW, - .my_event_bits = EVBITS(4), - }, { - .get_enable = get_enable_b, - .get_int_src = get_int_src_b, - .get_load_trig = get_load_trig_b, - .get_mode = get_mode_b, - .pulse_index = pulse_index_b, - .set_enable = set_enable_b, - .set_int_src = set_int_src_b, - .set_load_trig = set_load_trig_b, - .set_mode = set_mode_b, - .reset_cap_flags = reset_cap_flags_b, - .my_cra = LP_CR2A, - .my_crb = LP_CR2B, - .my_latch_lsw = LP_CNTR2BLSW, - .my_event_bits = EVBITS(5), - }, -}; - static void counters_init(struct comedi_device *dev) { int chan; -- 2.39.5