Commit c3fa0fdd authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

staging:iio:max1363 add support for max11606-max11617

Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 758d988c
......@@ -12,7 +12,9 @@ config MAX1363
Say yes here to build support for many MAXIM i2c analog to digital
convertors (ADC). (max1361, max1362, max1363, max1364, max1136,
max1136, max1137, max1138, max1139, max1236, max1237, max11238,
max1239) Provides direct access via sysfs.
max1239, max11606, max11607, max11608, max11609, max11610,
max11611, max11612, max11613, max11614, max11615, max11616,
max11617) Provides direct access via sysfs.
config MAX1363_RING_BUFFER
bool "MAXIM max1363: use ring buffer"
......
......@@ -434,6 +434,76 @@ static struct attribute_group max1238_scan_el_group = {
.attrs = max1238_scan_el_attrs,
};
static const enum max1363_modes max11607_mode_list[] = {
_s0, _s1, _s2, _s3,
s0to1, s0to2, s0to3,
s2to3,
d0m1, d2m3, d1m0, d3m2,
d0m1to2m3, d1m0to3m2,
};
static const enum max1363_modes max11608_mode_list[] = {
_s0, _s1, _s2, _s3, _s4, _s5, _s6, _s7,
s0to1, s0to2, s0to3, s0to4, s0to5, s0to6, s0to7,
s6to7,
d0m1, d2m3, d4m5, d6m7,
d1m0, d3m2, d5m4, d7m6,
d0m1to2m3, d0m1to4m5, d0m1to6m7,
d1m0to3m2, d1m0to5m4, d1m0to7m6,
};
static struct attribute *max11608_device_attrs[] = {
&iio_dev_attr_in0_raw.dev_attr.attr,
&iio_dev_attr_in1_raw.dev_attr.attr,
&iio_dev_attr_in2_raw.dev_attr.attr,
&iio_dev_attr_in3_raw.dev_attr.attr,
&iio_dev_attr_in4_raw.dev_attr.attr,
&iio_dev_attr_in5_raw.dev_attr.attr,
&iio_dev_attr_in6_raw.dev_attr.attr,
&iio_dev_attr_in7_raw.dev_attr.attr,
&iio_dev_attr_in0min1_raw.dev_attr.attr,
&iio_dev_attr_in2min3_raw.dev_attr.attr,
&iio_dev_attr_in4min5_raw.dev_attr.attr,
&iio_dev_attr_in6min7_raw.dev_attr.attr,
&iio_dev_attr_in1min0_raw.dev_attr.attr,
&iio_dev_attr_in3min2_raw.dev_attr.attr,
&iio_dev_attr_in5min4_raw.dev_attr.attr,
&iio_dev_attr_in7min6_raw.dev_attr.attr,
&iio_dev_attr_name.dev_attr.attr,
&iio_dev_attr_in_scale.dev_attr.attr,
NULL
};
static struct attribute_group max11608_dev_attr_group = {
.attrs = max11608_device_attrs,
};
static struct attribute *max11608_scan_el_attrs[] = {
&iio_scan_el_in0.dev_attr.attr,
&iio_scan_el_in1.dev_attr.attr,
&iio_scan_el_in2.dev_attr.attr,
&iio_scan_el_in3.dev_attr.attr,
&iio_scan_el_in4.dev_attr.attr,
&iio_scan_el_in5.dev_attr.attr,
&iio_scan_el_in6.dev_attr.attr,
&iio_scan_el_in7.dev_attr.attr,
&iio_scan_el_in0min1.dev_attr.attr,
&iio_scan_el_in2min3.dev_attr.attr,
&iio_scan_el_in4min5.dev_attr.attr,
&iio_scan_el_in6min7.dev_attr.attr,
&iio_scan_el_in1min0.dev_attr.attr,
&iio_scan_el_in3min2.dev_attr.attr,
&iio_scan_el_in5min4.dev_attr.attr,
&iio_scan_el_in7min6.dev_attr.attr,
&iio_dev_attr_in_precision.dev_attr.attr,
};
static struct attribute_group max11608_scan_el_group = {
.name = "scan_elements",
.attrs = max11608_scan_el_attrs,
};
enum { max1361,
max1362,
max1363,
......@@ -446,6 +516,18 @@ enum { max1361,
max1237,
max1238,
max1239,
max11606,
max11607,
max11608,
max11609,
max11610,
max11611,
max11612,
max11613,
max11614,
max11615,
max11616,
max11617,
};
/* max1363 and max1368 tested - rest from data sheet */
......@@ -574,7 +656,127 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = {
.default_mode = s0to11,
.dev_attrs = &max1238_dev_attr_group,
.scan_attrs = &max1238_scan_el_group,
},
}, {
.name = "max11606",
.num_inputs = 4,
.bits = 10,
.int_vref_mv = 4096,
.mode_list = max11607_mode_list,
.num_modes = ARRAY_SIZE(max11607_mode_list),
.default_mode = s0to3,
.dev_attrs = &max1363_dev_attr_group,
.scan_attrs = &max1363_scan_el_group,
}, {
.name = "max11607",
.num_inputs = 4,
.bits = 10,
.int_vref_mv = 2048,
.mode_list = max11607_mode_list,
.num_modes = ARRAY_SIZE(max11607_mode_list),
.default_mode = s0to3,
.dev_attrs = &max1363_dev_attr_group,
.scan_attrs = &max1363_scan_el_group,
}, {
.name = "max11608",
.num_inputs = 8,
.bits = 10,
.int_vref_mv = 4096,
.mode_list = max11608_mode_list,
.num_modes = ARRAY_SIZE(max11608_mode_list),
.default_mode = s0to7,
.dev_attrs = &max11608_dev_attr_group,
.scan_attrs = &max11608_scan_el_group,
}, {
.name = "max11609",
.num_inputs = 8,
.bits = 10,
.int_vref_mv = 2048,
.mode_list = max11608_mode_list,
.num_modes = ARRAY_SIZE(max11608_mode_list),
.default_mode = s0to7,
.dev_attrs = &max11608_dev_attr_group,
.scan_attrs = &max11608_scan_el_group,
}, {
.name = "max11610",
.num_inputs = 12,
.bits = 10,
.int_vref_mv = 4098,
.mode_list = max1238_mode_list,
.num_modes = ARRAY_SIZE(max1238_mode_list),
.default_mode = s0to11,
.dev_attrs = &max1238_dev_attr_group,
.scan_attrs = &max1238_scan_el_group,
}, {
.name = "max11611",
.num_inputs = 12,
.bits = 10,
.int_vref_mv = 2048,
.mode_list = max1238_mode_list,
.num_modes = ARRAY_SIZE(max1238_mode_list),
.default_mode = s0to11,
.dev_attrs = &max1238_dev_attr_group,
.scan_attrs = &max1238_scan_el_group,
}, {
.name = "max11612",
.num_inputs = 4,
.bits = 12,
.int_vref_mv = 4096,
.mode_list = max11607_mode_list,
.num_modes = ARRAY_SIZE(max11607_mode_list),
.default_mode = s0to3,
.dev_attrs = &max1363_dev_attr_group,
.scan_attrs = &max1363_scan_el_group,
}, {
.name = "max11613",
.num_inputs = 4,
.bits = 12,
.int_vref_mv = 2048,
.mode_list = max11607_mode_list,
.num_modes = ARRAY_SIZE(max11607_mode_list),
.default_mode = s0to3,
.dev_attrs = &max1363_dev_attr_group,
.scan_attrs = &max1363_scan_el_group,
}, {
.name = "max11614",
.num_inputs = 8,
.bits = 12,
.int_vref_mv = 4096,
.mode_list = max11608_mode_list,
.num_modes = ARRAY_SIZE(max11608_mode_list),
.default_mode = s0to7,
.dev_attrs = &max11608_dev_attr_group,
.scan_attrs = &max11608_scan_el_group,
}, {
.name = "max11615",
.num_inputs = 8,
.bits = 12,
.int_vref_mv = 2048,
.mode_list = max11608_mode_list,
.num_modes = ARRAY_SIZE(max11608_mode_list),
.default_mode = s0to7,
.dev_attrs = &max11608_dev_attr_group,
.scan_attrs = &max11608_scan_el_group,
}, {
.name = "max11616",
.num_inputs = 12,
.bits = 12,
.int_vref_mv = 4098,
.mode_list = max1238_mode_list,
.num_modes = ARRAY_SIZE(max1238_mode_list),
.default_mode = s0to11,
.dev_attrs = &max1238_dev_attr_group,
.scan_attrs = &max1238_scan_el_group,
}, {
.name = "max11617",
.num_inputs = 12,
.bits = 12,
.int_vref_mv = 2048,
.mode_list = max1238_mode_list,
.num_modes = ARRAY_SIZE(max1238_mode_list),
.default_mode = s0to11,
.dev_attrs = &max1238_dev_attr_group,
.scan_attrs = &max1238_scan_el_group,
}
};
static int max1363_initial_setup(struct max1363_state *st)
......@@ -726,6 +928,18 @@ static const struct i2c_device_id max1363_id[] = {
{ "max1237", max1237 },
{ "max1238", max1238 },
{ "max1239", max1239 },
{ "max11606", max11606 },
{ "max11607", max11607 },
{ "max11608", max11608 },
{ "max11609", max11609 },
{ "max11610", max11610 },
{ "max11611", max11611 },
{ "max11612", max11612 },
{ "max11613", max11613 },
{ "max11614", max11614 },
{ "max11615", max11615 },
{ "max11616", max11616 },
{ "max11617", max11617 },
{}
};
......
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