[PATCH v2 13/37] staging: comedi: das1800: remove 'ao_n_chan' boardinfo
H Hartley Sweeten
hsweeten at visionengravers.com
Fri Apr 8 19:41:42 UTC 2016
The "st-da" board types have 4 analog output channels. All other
board types, with analog outputs, only have 2 channels.
Remove the 'ao_n_chan' member of the boardinfo and use the
'id' member to determine the subdevice 'n_chan'.
Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
drivers/staging/comedi/drivers/das1800.c | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c
index 962a414..1a9565e 100644
--- a/drivers/staging/comedi/drivers/das1800.c
+++ b/drivers/staging/comedi/drivers/das1800.c
@@ -229,7 +229,6 @@ struct das1800_board {
int ai_speed; /* max conversion period in nanoseconds */
int qram_len; /* length of card's channel / gain queue */
int ao_ability; /* 0 == no analog out, 1 == basic analog out, 2 == waveform analog out */
- int ao_n_chan; /* number of analog out channels */
const struct comedi_lrange *range_ai; /* available input ranges */
};
@@ -244,7 +243,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250,
.qram_len = 256,
.ao_ability = 0,
- .ao_n_chan = 0,
.range_ai = &range_ai_das1801,
},
[BOARD_DAS1701ST_DA] = {
@@ -253,7 +251,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250,
.qram_len = 256,
.ao_ability = 1,
- .ao_n_chan = 4,
.range_ai = &range_ai_das1801,
},
[BOARD_DAS1702ST] = {
@@ -262,7 +259,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250,
.qram_len = 256,
.ao_ability = 0,
- .ao_n_chan = 0,
.range_ai = &range_ai_das1802,
},
[BOARD_DAS1702ST_DA] = {
@@ -271,7 +267,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250,
.qram_len = 256,
.ao_ability = 1,
- .ao_n_chan = 4,
.range_ai = &range_ai_das1802,
},
[BOARD_DAS1702HR] = {
@@ -280,7 +275,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 20000,
.qram_len = 256,
.ao_ability = 0,
- .ao_n_chan = 0,
.range_ai = &range_ai_das1802,
},
[BOARD_DAS1702HR_DA] = {
@@ -289,7 +283,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 20000,
.qram_len = 256,
.ao_ability = 1,
- .ao_n_chan = 2,
.range_ai = &range_ai_das1802,
},
[BOARD_DAS1701AO] = {
@@ -298,7 +291,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250,
.qram_len = 256,
.ao_ability = 2,
- .ao_n_chan = 2,
.range_ai = &range_ai_das1801,
},
[BOARD_DAS1702AO] = {
@@ -307,7 +299,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250,
.qram_len = 256,
.ao_ability = 2,
- .ao_n_chan = 2,
.range_ai = &range_ai_das1802,
},
[BOARD_DAS1801ST] = {
@@ -316,7 +307,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000,
.qram_len = 256,
.ao_ability = 0,
- .ao_n_chan = 0,
.range_ai = &range_ai_das1801,
},
[BOARD_DAS1801ST_DA] = {
@@ -325,7 +315,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000,
.qram_len = 256,
.ao_ability = 1,
- .ao_n_chan = 4,
.range_ai = &range_ai_das1801,
},
[BOARD_DAS1802ST] = {
@@ -334,7 +323,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000,
.qram_len = 256,
.ao_ability = 0,
- .ao_n_chan = 0,
.range_ai = &range_ai_das1802,
},
[BOARD_DAS1802ST_DA] = {
@@ -343,7 +331,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000,
.qram_len = 256,
.ao_ability = 1,
- .ao_n_chan = 4,
.range_ai = &range_ai_das1802,
},
[BOARD_DAS1802HR] = {
@@ -352,7 +339,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 10000,
.qram_len = 256,
.ao_ability = 0,
- .ao_n_chan = 0,
.range_ai = &range_ai_das1802,
},
[BOARD_DAS1802HR_DA] = {
@@ -361,7 +347,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 10000,
.qram_len = 256,
.ao_ability = 1,
- .ao_n_chan = 2,
.range_ai = &range_ai_das1802,
},
[BOARD_DAS1801HC] = {
@@ -370,7 +355,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000,
.qram_len = 64,
.ao_ability = 1,
- .ao_n_chan = 2,
.range_ai = &range_ai_das1801,
},
[BOARD_DAS1802HC] = {
@@ -379,7 +363,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000,
.qram_len = 64,
.ao_ability = 1,
- .ao_n_chan = 2,
.range_ai = &range_ai_das1802,
},
[BOARD_DAS1801AO] = {
@@ -388,7 +371,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000,
.qram_len = 256,
.ao_ability = 2,
- .ao_n_chan = 2,
.range_ai = &range_ai_das1801,
},
[BOARD_DAS1802AO] = {
@@ -397,7 +379,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000,
.qram_len = 256,
.ao_ability = 2,
- .ao_n_chan = 2,
.range_ai = &range_ai_das1802,
},
};
@@ -1368,7 +1349,7 @@ static int das1800_attach(struct comedi_device *dev,
if (board->ao_ability == 1) {
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE;
- s->n_chan = board->ao_n_chan;
+ s->n_chan = (board->id == DAS1800_ID_ST_DA) ? 4 : 2;
s->maxdata = is_16bit ? 0xffff : 0x0fff;
s->range_table = &range_bipolar10;
s->insn_write = das1800_ao_insn_write;
--
2.6.3
More information about the devel
mailing list