aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-25 13:56:30 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-25 13:56:30 -0400
commit588079342e2cf29fd1c33b567366519b11d83ab8 (patch)
tree035d118d3ca1b65babf7d2343f80e6bb9d4d12c4 /drivers/iio
parentc4a6ca97439a40164cd65e7f695a9f380776817f (diff)
parent34683a5c6e0ffaa61528ff71c283efe3063cc53f (diff)
Merge tag 'iio-for-3.16c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes: Third round of new stuff for IIO in the 3.16 cycle. This (rather late) set consists only of fixes to patches earlier in the cycle or minor fixes for other problems (such as randconfig build issues picked up by Arnd). I've included the general minor fixes here as it is very late in the current cycle and they can all wait for the merge window. * Recent change to hid-sensors introduced a possible infinite loop due to a typo. In the same series, a report interval unit read was added but in the case where the hardware doesn't support it a value of 0 would lead to some nasty issues. The patch sets it to the specified default of msecs. * Anon inodes were used by IIO without being explicitly selected. This has been true for a long time so it clearly only effects rather unusual configurations (rand configs) * at91 requires the input subsytem but this wasn't explicity in the Kconfig. * A couple of parts supported by the max1363 driver were using the wrong iio_chan_spec arrays and hence would missreport their bit depths. This has been there a long time and was never right so isn't a regression.
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/Kconfig1
-rw-r--r--drivers/iio/adc/Kconfig1
-rw-r--r--drivers/iio/adc/max1363.c16
-rw-r--r--drivers/iio/common/hid-sensors/hid-sensor-attributes.c19
4 files changed, 26 insertions, 11 deletions
diff --git a/drivers/iio/Kconfig b/drivers/iio/Kconfig
index 743485e4d6f8..345395e9dc6e 100644
--- a/drivers/iio/Kconfig
+++ b/drivers/iio/Kconfig
@@ -4,6 +4,7 @@
4 4
5menuconfig IIO 5menuconfig IIO
6 tristate "Industrial I/O support" 6 tristate "Industrial I/O support"
7 select ANON_INODES
7 help 8 help
8 The industrial I/O subsystem provides a unified framework for 9 The industrial I/O subsystem provides a unified framework for
9 drivers for many different types of embedded sensors using a 10 drivers for many different types of embedded sensors using a
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 90f596db940d..a80d23628f14 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -110,6 +110,7 @@ config AD799X
110config AT91_ADC 110config AT91_ADC
111 tristate "Atmel AT91 ADC" 111 tristate "Atmel AT91 ADC"
112 depends on ARCH_AT91 112 depends on ARCH_AT91
113 depends on INPUT
113 select IIO_BUFFER 114 select IIO_BUFFER
114 select IIO_TRIGGERED_BUFFER 115 select IIO_TRIGGERED_BUFFER
115 select SYSFS 116 select SYSFS
diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c
index 9cf3229a7272..1b3b74be5c20 100644
--- a/drivers/iio/adc/max1363.c
+++ b/drivers/iio/adc/max1363.c
@@ -1252,8 +1252,8 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = {
1252 .num_modes = ARRAY_SIZE(max1238_mode_list), 1252 .num_modes = ARRAY_SIZE(max1238_mode_list),
1253 .default_mode = s0to11, 1253 .default_mode = s0to11,
1254 .info = &max1238_info, 1254 .info = &max1238_info,
1255 .channels = max1238_channels, 1255 .channels = max1038_channels,
1256 .num_channels = ARRAY_SIZE(max1238_channels), 1256 .num_channels = ARRAY_SIZE(max1038_channels),
1257 }, 1257 },
1258 [max11605] = { 1258 [max11605] = {
1259 .bits = 8, 1259 .bits = 8,
@@ -1262,8 +1262,8 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = {
1262 .num_modes = ARRAY_SIZE(max1238_mode_list), 1262 .num_modes = ARRAY_SIZE(max1238_mode_list),
1263 .default_mode = s0to11, 1263 .default_mode = s0to11,
1264 .info = &max1238_info, 1264 .info = &max1238_info,
1265 .channels = max1238_channels, 1265 .channels = max1038_channels,
1266 .num_channels = ARRAY_SIZE(max1238_channels), 1266 .num_channels = ARRAY_SIZE(max1038_channels),
1267 }, 1267 },
1268 [max11606] = { 1268 [max11606] = {
1269 .bits = 10, 1269 .bits = 10,
@@ -1312,8 +1312,8 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = {
1312 .num_modes = ARRAY_SIZE(max1238_mode_list), 1312 .num_modes = ARRAY_SIZE(max1238_mode_list),
1313 .default_mode = s0to11, 1313 .default_mode = s0to11,
1314 .info = &max1238_info, 1314 .info = &max1238_info,
1315 .channels = max1238_channels, 1315 .channels = max1138_channels,
1316 .num_channels = ARRAY_SIZE(max1238_channels), 1316 .num_channels = ARRAY_SIZE(max1138_channels),
1317 }, 1317 },
1318 [max11611] = { 1318 [max11611] = {
1319 .bits = 10, 1319 .bits = 10,
@@ -1322,8 +1322,8 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = {
1322 .num_modes = ARRAY_SIZE(max1238_mode_list), 1322 .num_modes = ARRAY_SIZE(max1238_mode_list),
1323 .default_mode = s0to11, 1323 .default_mode = s0to11,
1324 .info = &max1238_info, 1324 .info = &max1238_info,
1325 .channels = max1238_channels, 1325 .channels = max1138_channels,
1326 .num_channels = ARRAY_SIZE(max1238_channels), 1326 .num_channels = ARRAY_SIZE(max1138_channels),
1327 }, 1327 },
1328 [max11612] = { 1328 [max11612] = {
1329 .bits = 12, 1329 .bits = 12,
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
index 372964635ccf..403dd3d8986e 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -327,7 +327,7 @@ int hid_sensor_format_scale(u32 usage_id,
327 *val0 = 1; 327 *val0 = 1;
328 *val1 = 0; 328 *val1 = 0;
329 329
330 for (i = 0; ARRAY_SIZE(unit_conversion); ++i) { 330 for (i = 0; i < ARRAY_SIZE(unit_conversion); ++i) {
331 if (unit_conversion[i].usage_id == usage_id && 331 if (unit_conversion[i].usage_id == usage_id &&
332 unit_conversion[i].unit == attr_info->units) { 332 unit_conversion[i].unit == attr_info->units) {
333 exp = hid_sensor_convert_exponent( 333 exp = hid_sensor_convert_exponent(
@@ -343,15 +343,28 @@ int hid_sensor_format_scale(u32 usage_id,
343} 343}
344EXPORT_SYMBOL(hid_sensor_format_scale); 344EXPORT_SYMBOL(hid_sensor_format_scale);
345 345
346int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev, 346int hid_sensor_get_reporting_interval(struct hid_sensor_hub_device *hsdev,
347 u32 usage_id, 347 u32 usage_id,
348 struct hid_sensor_common *st) 348 struct hid_sensor_common *st)
349{ 349{
350
351 sensor_hub_input_get_attribute_info(hsdev, 350 sensor_hub_input_get_attribute_info(hsdev,
352 HID_FEATURE_REPORT, usage_id, 351 HID_FEATURE_REPORT, usage_id,
353 HID_USAGE_SENSOR_PROP_REPORT_INTERVAL, 352 HID_USAGE_SENSOR_PROP_REPORT_INTERVAL,
354 &st->poll); 353 &st->poll);
354 /* Default unit of measure is milliseconds */
355 if (st->poll.units == 0)
356 st->poll.units = HID_USAGE_SENSOR_UNITS_MILLISECOND;
357 return 0;
358
359}
360
361int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev,
362 u32 usage_id,
363 struct hid_sensor_common *st)
364{
365
366
367 hid_sensor_get_reporting_interval(hsdev, usage_id, st);
355 368
356 sensor_hub_input_get_attribute_info(hsdev, 369 sensor_hub_input_get_attribute_info(hsdev,
357 HID_FEATURE_REPORT, usage_id, 370 HID_FEATURE_REPORT, usage_id,