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

staging: comedi: addi_apci_3xxx: analog output 'maxdata' is always 12-bit

The boards that have analog outputs always have 12-bit resolution.

Remove the 'i_AoMaxdata' data from the boardinfo and open code the
s->maxdata. Use the hex value for the resolution since that is more
common in comedi drivers.
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 0ed9f25f
...@@ -83,7 +83,6 @@ struct apci3xxx_boardinfo { ...@@ -83,7 +83,6 @@ struct apci3xxx_boardinfo {
int i_AiChannelList; int i_AiChannelList;
int i_NbrAoChannel; int i_NbrAoChannel;
int i_AiMaxdata; int i_AiMaxdata;
int i_AoMaxdata;
unsigned char b_AvailableConvertUnit; unsigned char b_AvailableConvertUnit;
unsigned int ui_MinAcquisitiontimeNs; unsigned int ui_MinAcquisitiontimeNs;
unsigned int has_dig_in:1; unsigned int has_dig_in:1;
...@@ -231,7 +230,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { ...@@ -231,7 +230,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = {
.i_AiChannelList = 16, .i_AiChannelList = 16,
.i_NbrAoChannel = 4, .i_NbrAoChannel = 4,
.i_AiMaxdata = 4095, .i_AiMaxdata = 4095,
.i_AoMaxdata = 4095,
.b_AvailableConvertUnit = 6, .b_AvailableConvertUnit = 6,
.ui_MinAcquisitiontimeNs = 10000, .ui_MinAcquisitiontimeNs = 10000,
.has_ttl_io = 1, .has_ttl_io = 1,
...@@ -243,7 +241,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { ...@@ -243,7 +241,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = {
.i_AiChannelList = 8, .i_AiChannelList = 8,
.i_NbrAoChannel = 4, .i_NbrAoChannel = 4,
.i_AiMaxdata = 4095, .i_AiMaxdata = 4095,
.i_AoMaxdata = 4095,
.b_AvailableConvertUnit = 6, .b_AvailableConvertUnit = 6,
.ui_MinAcquisitiontimeNs = 10000, .ui_MinAcquisitiontimeNs = 10000,
.has_ttl_io = 1, .has_ttl_io = 1,
...@@ -255,7 +252,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { ...@@ -255,7 +252,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = {
.i_AiChannelList = 16, .i_AiChannelList = 16,
.i_NbrAoChannel = 4, .i_NbrAoChannel = 4,
.i_AiMaxdata = 65535, .i_AiMaxdata = 65535,
.i_AoMaxdata = 4095,
.b_AvailableConvertUnit = 6, .b_AvailableConvertUnit = 6,
.ui_MinAcquisitiontimeNs = 10000, .ui_MinAcquisitiontimeNs = 10000,
.has_ttl_io = 1, .has_ttl_io = 1,
...@@ -267,7 +263,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { ...@@ -267,7 +263,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = {
.i_AiChannelList = 8, .i_AiChannelList = 8,
.i_NbrAoChannel = 4, .i_NbrAoChannel = 4,
.i_AiMaxdata = 65535, .i_AiMaxdata = 65535,
.i_AoMaxdata = 4095,
.b_AvailableConvertUnit = 6, .b_AvailableConvertUnit = 6,
.ui_MinAcquisitiontimeNs = 10000, .ui_MinAcquisitiontimeNs = 10000,
.has_ttl_io = 1, .has_ttl_io = 1,
...@@ -279,7 +274,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { ...@@ -279,7 +274,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = {
.i_AiChannelList = 16, .i_AiChannelList = 16,
.i_NbrAoChannel = 4, .i_NbrAoChannel = 4,
.i_AiMaxdata = 4095, .i_AiMaxdata = 4095,
.i_AoMaxdata = 4095,
.b_AvailableConvertUnit = 6, .b_AvailableConvertUnit = 6,
.ui_MinAcquisitiontimeNs = 5000, .ui_MinAcquisitiontimeNs = 5000,
.has_dig_in = 1, .has_dig_in = 1,
...@@ -293,7 +287,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { ...@@ -293,7 +287,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = {
.i_AiChannelList = 8, .i_AiChannelList = 8,
.i_NbrAoChannel = 4, .i_NbrAoChannel = 4,
.i_AiMaxdata = 4095, .i_AiMaxdata = 4095,
.i_AoMaxdata = 4095,
.b_AvailableConvertUnit = 6, .b_AvailableConvertUnit = 6,
.ui_MinAcquisitiontimeNs = 5000, .ui_MinAcquisitiontimeNs = 5000,
.has_dig_in = 1, .has_dig_in = 1,
...@@ -307,7 +300,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { ...@@ -307,7 +300,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = {
.i_AiChannelList = 16, .i_AiChannelList = 16,
.i_NbrAoChannel = 4, .i_NbrAoChannel = 4,
.i_AiMaxdata = 65535, .i_AiMaxdata = 65535,
.i_AoMaxdata = 4095,
.b_AvailableConvertUnit = 6, .b_AvailableConvertUnit = 6,
.ui_MinAcquisitiontimeNs = 5000, .ui_MinAcquisitiontimeNs = 5000,
.has_dig_in = 1, .has_dig_in = 1,
...@@ -321,7 +313,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { ...@@ -321,7 +313,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = {
.i_AiChannelList = 8, .i_AiChannelList = 8,
.i_NbrAoChannel = 4, .i_NbrAoChannel = 4,
.i_AiMaxdata = 65535, .i_AiMaxdata = 65535,
.i_AoMaxdata = 4095,
.b_AvailableConvertUnit = 6, .b_AvailableConvertUnit = 6,
.ui_MinAcquisitiontimeNs = 5000, .ui_MinAcquisitiontimeNs = 5000,
.has_dig_in = 1, .has_dig_in = 1,
...@@ -371,7 +362,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { ...@@ -371,7 +362,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = {
[BOARD_APCI3500] = { [BOARD_APCI3500] = {
.pc_DriverName = "apci3500", .pc_DriverName = "apci3500",
.i_NbrAoChannel = 4, .i_NbrAoChannel = 4,
.i_AoMaxdata = 4095,
.has_ttl_io = 1, .has_ttl_io = 1,
}, },
}; };
...@@ -569,7 +559,7 @@ static int apci3xxx_auto_attach(struct comedi_device *dev, ...@@ -569,7 +559,7 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON; s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
s->n_chan = board->i_NbrAoChannel; s->n_chan = board->i_NbrAoChannel;
s->maxdata = board->i_AoMaxdata; s->maxdata = 0x0fff;
s->range_table = &apci3xxx_ao_range; s->range_table = &apci3xxx_ao_range;
s->insn_write = i_APCI3XXX_InsnWriteAnalogOutput; s->insn_write = i_APCI3XXX_InsnWriteAnalogOutput;
} else { } else {
......
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