diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/Kconfig | 1 | ||||
-rw-r--r-- | drivers/iio/adc/Kconfig | 1 | ||||
-rw-r--r-- | drivers/iio/adc/max1363.c | 16 | ||||
-rw-r--r-- | drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 19 | ||||
-rw-r--r-- | drivers/staging/iio/Documentation/iio_utils.h | 4 |
5 files changed, 28 insertions, 13 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 | ||
5 | menuconfig IIO | 5 | menuconfig 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 | |||
110 | config AT91_ADC | 110 | config 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 | } |
344 | EXPORT_SYMBOL(hid_sensor_format_scale); | 344 | EXPORT_SYMBOL(hid_sensor_format_scale); |
345 | 345 | ||
346 | int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev, | 346 | int 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 | |||
361 | int 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, |
diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h index 2064839ef2cd..a9cfc06edb01 100644 --- a/drivers/staging/iio/Documentation/iio_utils.h +++ b/drivers/staging/iio/Documentation/iio_utils.h | |||
@@ -318,7 +318,7 @@ inline int build_channel_array(const char *device_dir, | |||
318 | free(filename); | 318 | free(filename); |
319 | goto error_close_dir; | 319 | goto error_close_dir; |
320 | } | 320 | } |
321 | fscanf(sysfsfp, "%u", &ret); | 321 | fscanf(sysfsfp, "%i", &ret); |
322 | if (ret == 1) | 322 | if (ret == 1) |
323 | (*counter)++; | 323 | (*counter)++; |
324 | fclose(sysfsfp); | 324 | fclose(sysfsfp); |
@@ -350,7 +350,7 @@ inline int build_channel_array(const char *device_dir, | |||
350 | ret = -errno; | 350 | ret = -errno; |
351 | goto error_cleanup_array; | 351 | goto error_cleanup_array; |
352 | } | 352 | } |
353 | fscanf(sysfsfp, "%u", ¤t_enabled); | 353 | fscanf(sysfsfp, "%i", ¤t_enabled); |
354 | fclose(sysfsfp); | 354 | fclose(sysfsfp); |
355 | 355 | ||
356 | if (!current_enabled) { | 356 | if (!current_enabled) { |