Commit 1322f148 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: das1800: remove 'ao_n_chan' boardinfo

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4c6f738e
...@@ -229,7 +229,6 @@ struct das1800_board { ...@@ -229,7 +229,6 @@ struct das1800_board {
int ai_speed; /* max conversion period in nanoseconds */ int ai_speed; /* max conversion period in nanoseconds */
int qram_len; /* length of card's channel / gain queue */ 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_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 */ const struct comedi_lrange *range_ai; /* available input ranges */
}; };
...@@ -244,7 +243,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -244,7 +243,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250, .ai_speed = 6250,
.qram_len = 256, .qram_len = 256,
.ao_ability = 0, .ao_ability = 0,
.ao_n_chan = 0,
.range_ai = &range_ai_das1801, .range_ai = &range_ai_das1801,
}, },
[BOARD_DAS1701ST_DA] = { [BOARD_DAS1701ST_DA] = {
...@@ -253,7 +251,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -253,7 +251,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250, .ai_speed = 6250,
.qram_len = 256, .qram_len = 256,
.ao_ability = 1, .ao_ability = 1,
.ao_n_chan = 4,
.range_ai = &range_ai_das1801, .range_ai = &range_ai_das1801,
}, },
[BOARD_DAS1702ST] = { [BOARD_DAS1702ST] = {
...@@ -262,7 +259,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -262,7 +259,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250, .ai_speed = 6250,
.qram_len = 256, .qram_len = 256,
.ao_ability = 0, .ao_ability = 0,
.ao_n_chan = 0,
.range_ai = &range_ai_das1802, .range_ai = &range_ai_das1802,
}, },
[BOARD_DAS1702ST_DA] = { [BOARD_DAS1702ST_DA] = {
...@@ -271,7 +267,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -271,7 +267,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250, .ai_speed = 6250,
.qram_len = 256, .qram_len = 256,
.ao_ability = 1, .ao_ability = 1,
.ao_n_chan = 4,
.range_ai = &range_ai_das1802, .range_ai = &range_ai_das1802,
}, },
[BOARD_DAS1702HR] = { [BOARD_DAS1702HR] = {
...@@ -280,7 +275,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -280,7 +275,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 20000, .ai_speed = 20000,
.qram_len = 256, .qram_len = 256,
.ao_ability = 0, .ao_ability = 0,
.ao_n_chan = 0,
.range_ai = &range_ai_das1802, .range_ai = &range_ai_das1802,
}, },
[BOARD_DAS1702HR_DA] = { [BOARD_DAS1702HR_DA] = {
...@@ -289,7 +283,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -289,7 +283,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 20000, .ai_speed = 20000,
.qram_len = 256, .qram_len = 256,
.ao_ability = 1, .ao_ability = 1,
.ao_n_chan = 2,
.range_ai = &range_ai_das1802, .range_ai = &range_ai_das1802,
}, },
[BOARD_DAS1701AO] = { [BOARD_DAS1701AO] = {
...@@ -298,7 +291,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -298,7 +291,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250, .ai_speed = 6250,
.qram_len = 256, .qram_len = 256,
.ao_ability = 2, .ao_ability = 2,
.ao_n_chan = 2,
.range_ai = &range_ai_das1801, .range_ai = &range_ai_das1801,
}, },
[BOARD_DAS1702AO] = { [BOARD_DAS1702AO] = {
...@@ -307,7 +299,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -307,7 +299,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 6250, .ai_speed = 6250,
.qram_len = 256, .qram_len = 256,
.ao_ability = 2, .ao_ability = 2,
.ao_n_chan = 2,
.range_ai = &range_ai_das1802, .range_ai = &range_ai_das1802,
}, },
[BOARD_DAS1801ST] = { [BOARD_DAS1801ST] = {
...@@ -316,7 +307,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -316,7 +307,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000, .ai_speed = 3000,
.qram_len = 256, .qram_len = 256,
.ao_ability = 0, .ao_ability = 0,
.ao_n_chan = 0,
.range_ai = &range_ai_das1801, .range_ai = &range_ai_das1801,
}, },
[BOARD_DAS1801ST_DA] = { [BOARD_DAS1801ST_DA] = {
...@@ -325,7 +315,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -325,7 +315,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000, .ai_speed = 3000,
.qram_len = 256, .qram_len = 256,
.ao_ability = 1, .ao_ability = 1,
.ao_n_chan = 4,
.range_ai = &range_ai_das1801, .range_ai = &range_ai_das1801,
}, },
[BOARD_DAS1802ST] = { [BOARD_DAS1802ST] = {
...@@ -334,7 +323,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -334,7 +323,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000, .ai_speed = 3000,
.qram_len = 256, .qram_len = 256,
.ao_ability = 0, .ao_ability = 0,
.ao_n_chan = 0,
.range_ai = &range_ai_das1802, .range_ai = &range_ai_das1802,
}, },
[BOARD_DAS1802ST_DA] = { [BOARD_DAS1802ST_DA] = {
...@@ -343,7 +331,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -343,7 +331,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000, .ai_speed = 3000,
.qram_len = 256, .qram_len = 256,
.ao_ability = 1, .ao_ability = 1,
.ao_n_chan = 4,
.range_ai = &range_ai_das1802, .range_ai = &range_ai_das1802,
}, },
[BOARD_DAS1802HR] = { [BOARD_DAS1802HR] = {
...@@ -352,7 +339,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -352,7 +339,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 10000, .ai_speed = 10000,
.qram_len = 256, .qram_len = 256,
.ao_ability = 0, .ao_ability = 0,
.ao_n_chan = 0,
.range_ai = &range_ai_das1802, .range_ai = &range_ai_das1802,
}, },
[BOARD_DAS1802HR_DA] = { [BOARD_DAS1802HR_DA] = {
...@@ -361,7 +347,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -361,7 +347,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 10000, .ai_speed = 10000,
.qram_len = 256, .qram_len = 256,
.ao_ability = 1, .ao_ability = 1,
.ao_n_chan = 2,
.range_ai = &range_ai_das1802, .range_ai = &range_ai_das1802,
}, },
[BOARD_DAS1801HC] = { [BOARD_DAS1801HC] = {
...@@ -370,7 +355,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -370,7 +355,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000, .ai_speed = 3000,
.qram_len = 64, .qram_len = 64,
.ao_ability = 1, .ao_ability = 1,
.ao_n_chan = 2,
.range_ai = &range_ai_das1801, .range_ai = &range_ai_das1801,
}, },
[BOARD_DAS1802HC] = { [BOARD_DAS1802HC] = {
...@@ -379,7 +363,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -379,7 +363,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000, .ai_speed = 3000,
.qram_len = 64, .qram_len = 64,
.ao_ability = 1, .ao_ability = 1,
.ao_n_chan = 2,
.range_ai = &range_ai_das1802, .range_ai = &range_ai_das1802,
}, },
[BOARD_DAS1801AO] = { [BOARD_DAS1801AO] = {
...@@ -388,7 +371,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -388,7 +371,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000, .ai_speed = 3000,
.qram_len = 256, .qram_len = 256,
.ao_ability = 2, .ao_ability = 2,
.ao_n_chan = 2,
.range_ai = &range_ai_das1801, .range_ai = &range_ai_das1801,
}, },
[BOARD_DAS1802AO] = { [BOARD_DAS1802AO] = {
...@@ -397,7 +379,6 @@ static const struct das1800_board das1800_boards[] = { ...@@ -397,7 +379,6 @@ static const struct das1800_board das1800_boards[] = {
.ai_speed = 3000, .ai_speed = 3000,
.qram_len = 256, .qram_len = 256,
.ao_ability = 2, .ao_ability = 2,
.ao_n_chan = 2,
.range_ai = &range_ai_das1802, .range_ai = &range_ai_das1802,
}, },
}; };
...@@ -1368,7 +1349,7 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1368,7 +1349,7 @@ static int das1800_attach(struct comedi_device *dev,
if (board->ao_ability == 1) { if (board->ao_ability == 1) {
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE; 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->maxdata = is_16bit ? 0xffff : 0x0fff;
s->range_table = &range_bipolar10; s->range_table = &range_bipolar10;
s->insn_write = das1800_ao_insn_write; s->insn_write = das1800_ao_insn_write;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment