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

staging: comedi: ni_stc.h: refactor 'adbits' boardinfo

For aesthetics, change the 'adbits' in the boardinfo to 'ai_maxdata'
to remove the need for the calculation of the subdevice 'maxdata'.
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 817144ae
...@@ -108,7 +108,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -108,7 +108,7 @@ static const struct ni_board_struct ni_boards[] = {
.device_id = 44, .device_id = 44,
.isapnp_id = 0x0000, /* XXX unknown */ .isapnp_id = 0x0000, /* XXX unknown */
.n_adchan = 16, .n_adchan = 16,
.adbits = 12, .ai_maxdata = 0x0fff,
.ai_fifo_depth = 8192, .ai_fifo_depth = 8192,
.gainlkup = ai_gain_16, .gainlkup = ai_gain_16,
.ai_speed = 800, .ai_speed = 800,
...@@ -124,7 +124,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -124,7 +124,7 @@ static const struct ni_board_struct ni_boards[] = {
.device_id = 25, .device_id = 25,
.isapnp_id = 0x1900, .isapnp_id = 0x1900,
.n_adchan = 16, .n_adchan = 16,
.adbits = 12, .ai_maxdata = 0x0fff,
.ai_fifo_depth = 2048, .ai_fifo_depth = 2048,
.gainlkup = ai_gain_16, .gainlkup = ai_gain_16,
.ai_speed = 2000, .ai_speed = 2000,
...@@ -140,7 +140,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -140,7 +140,7 @@ static const struct ni_board_struct ni_boards[] = {
.device_id = 36, .device_id = 36,
.isapnp_id = 0x2400, .isapnp_id = 0x2400,
.n_adchan = 16, .n_adchan = 16,
.adbits = 12, .ai_maxdata = 0x0fff,
.ai_fifo_depth = 512, .ai_fifo_depth = 512,
.gainlkup = ai_gain_16, .gainlkup = ai_gain_16,
.ai_speed = 10000, .ai_speed = 10000,
...@@ -155,7 +155,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -155,7 +155,7 @@ static const struct ni_board_struct ni_boards[] = {
.device_id = 37, .device_id = 37,
.isapnp_id = 0x2500, .isapnp_id = 0x2500,
.n_adchan = 16, .n_adchan = 16,
.adbits = 12, .ai_maxdata = 0x0fff,
.ai_fifo_depth = 512, .ai_fifo_depth = 512,
.gainlkup = ai_gain_16, .gainlkup = ai_gain_16,
.ai_speed = 10000, .ai_speed = 10000,
...@@ -171,7 +171,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -171,7 +171,7 @@ static const struct ni_board_struct ni_boards[] = {
.device_id = 38, .device_id = 38,
.isapnp_id = 0x2600, .isapnp_id = 0x2600,
.n_adchan = 64, .n_adchan = 64,
.adbits = 12, .ai_maxdata = 0x0fff,
.ai_fifo_depth = 2048, .ai_fifo_depth = 2048,
.gainlkup = ai_gain_16, .gainlkup = ai_gain_16,
.ai_speed = 2000, .ai_speed = 2000,
...@@ -187,7 +187,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -187,7 +187,7 @@ static const struct ni_board_struct ni_boards[] = {
.device_id = 39, .device_id = 39,
.isapnp_id = 0x2700, .isapnp_id = 0x2700,
.n_adchan = 16, .n_adchan = 16,
.adbits = 16, .ai_maxdata = 0xffff,
.ai_fifo_depth = 512, .ai_fifo_depth = 512,
.alwaysdither = 1, .alwaysdither = 1,
.gainlkup = ai_gain_8, .gainlkup = ai_gain_8,
...@@ -203,7 +203,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -203,7 +203,7 @@ static const struct ni_board_struct ni_boards[] = {
.device_id = 50, .device_id = 50,
.isapnp_id = 0x0000, /* XXX unknown */ .isapnp_id = 0x0000, /* XXX unknown */
.n_adchan = 16, .n_adchan = 16,
.adbits = 16, .ai_maxdata = 0xffff,
.ai_fifo_depth = 512, .ai_fifo_depth = 512,
.alwaysdither = 1, .alwaysdither = 1,
.gainlkup = ai_gain_14, .gainlkup = ai_gain_14,
...@@ -220,7 +220,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -220,7 +220,7 @@ static const struct ni_board_struct ni_boards[] = {
.device_id = 51, .device_id = 51,
.isapnp_id = 0x0000, /* XXX unknown */ .isapnp_id = 0x0000, /* XXX unknown */
.n_adchan = 16, .n_adchan = 16,
.adbits = 16, .ai_maxdata = 0xffff,
.ai_fifo_depth = 512, .ai_fifo_depth = 512,
.alwaysdither = 1, /* unknown */ .alwaysdither = 1, /* unknown */
.gainlkup = ai_gain_14, .gainlkup = ai_gain_14,
......
...@@ -5513,13 +5513,13 @@ static int ni_E_init(struct comedi_device *dev, ...@@ -5513,13 +5513,13 @@ static int ni_E_init(struct comedi_device *dev,
SDF_READABLE | SDF_DIFF | SDF_DITHER | SDF_CMD_READ; SDF_READABLE | SDF_DIFF | SDF_DITHER | SDF_CMD_READ;
if (!devpriv->is_611x) if (!devpriv->is_611x)
s->subdev_flags |= SDF_GROUND | SDF_COMMON | SDF_OTHER; s->subdev_flags |= SDF_GROUND | SDF_COMMON | SDF_OTHER;
if (board->adbits > 16) if (board->ai_maxdata > 0xffff)
s->subdev_flags |= SDF_LSAMPL; s->subdev_flags |= SDF_LSAMPL;
if (devpriv->is_m_series) if (devpriv->is_m_series)
s->subdev_flags |= SDF_SOFT_CALIBRATED; s->subdev_flags |= SDF_SOFT_CALIBRATED;
s->n_chan = board->n_adchan; s->n_chan = board->n_adchan;
s->len_chanlist = 512; s->len_chanlist = 512;
s->maxdata = (1 << board->adbits) - 1; s->maxdata = board->ai_maxdata;
s->range_table = ni_range_lkup[board->gainlkup]; s->range_table = ni_range_lkup[board->gainlkup];
s->insn_read = &ni_ai_insn_read; s->insn_read = &ni_ai_insn_read;
s->insn_config = &ni_ai_insn_config; s->insn_config = &ni_ai_insn_config;
......
...@@ -56,7 +56,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -56,7 +56,7 @@ static const struct ni_board_struct ni_boards[] = {
.name = "DAQCard-ai-16xe-50", .name = "DAQCard-ai-16xe-50",
.device_id = 0x010d, .device_id = 0x010d,
.n_adchan = 16, .n_adchan = 16,
.adbits = 16, .ai_maxdata = 0xffff,
.ai_fifo_depth = 1024, .ai_fifo_depth = 1024,
.gainlkup = ai_gain_8, .gainlkup = ai_gain_8,
.ai_speed = 5000, .ai_speed = 5000,
...@@ -66,7 +66,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -66,7 +66,7 @@ static const struct ni_board_struct ni_boards[] = {
.name = "DAQCard-ai-16e-4", .name = "DAQCard-ai-16e-4",
.device_id = 0x010c, .device_id = 0x010c,
.n_adchan = 16, .n_adchan = 16,
.adbits = 12, .ai_maxdata = 0x0fff,
.ai_fifo_depth = 1024, .ai_fifo_depth = 1024,
.gainlkup = ai_gain_16, .gainlkup = ai_gain_16,
.ai_speed = 4000, .ai_speed = 4000,
...@@ -76,7 +76,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -76,7 +76,7 @@ static const struct ni_board_struct ni_boards[] = {
.name = "DAQCard-6062E", .name = "DAQCard-6062E",
.device_id = 0x02c4, .device_id = 0x02c4,
.n_adchan = 16, .n_adchan = 16,
.adbits = 12, .ai_maxdata = 0x0fff,
.ai_fifo_depth = 8192, .ai_fifo_depth = 8192,
.gainlkup = ai_gain_16, .gainlkup = ai_gain_16,
.ai_speed = 2000, .ai_speed = 2000,
...@@ -92,7 +92,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -92,7 +92,7 @@ static const struct ni_board_struct ni_boards[] = {
.name = "DAQCard-6024E", .name = "DAQCard-6024E",
.device_id = 0x075e, .device_id = 0x075e,
.n_adchan = 16, .n_adchan = 16,
.adbits = 12, .ai_maxdata = 0x0fff,
.ai_fifo_depth = 1024, .ai_fifo_depth = 1024,
.gainlkup = ai_gain_4, .gainlkup = ai_gain_4,
.ai_speed = 5000, .ai_speed = 5000,
...@@ -107,7 +107,7 @@ static const struct ni_board_struct ni_boards[] = { ...@@ -107,7 +107,7 @@ static const struct ni_board_struct ni_boards[] = {
.name = "DAQCard-6036E", .name = "DAQCard-6036E",
.device_id = 0x0245, .device_id = 0x0245,
.n_adchan = 16, .n_adchan = 16,
.adbits = 16, .ai_maxdata = 0xffff,
.ai_fifo_depth = 1024, .ai_fifo_depth = 1024,
.alwaysdither = 1, .alwaysdither = 1,
.gainlkup = ai_gain_4, .gainlkup = ai_gain_4,
......
This diff is collapsed.
...@@ -1393,7 +1393,7 @@ struct ni_board_struct { ...@@ -1393,7 +1393,7 @@ struct ni_board_struct {
int isapnp_id; int isapnp_id;
int n_adchan; int n_adchan;
int adbits; unsigned int ai_maxdata;
int ai_fifo_depth; int ai_fifo_depth;
unsigned int alwaysdither:1; unsigned int alwaysdither:1;
......
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