Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

+30 -15
+1
drivers/iio/Kconfig
··· 4 4 5 5 menuconfig IIO 6 6 tristate "Industrial I/O support" 7 + select ANON_INODES 7 8 help 8 9 The industrial I/O subsystem provides a unified framework for 9 10 drivers for many different types of embedded sensors using a
+1
drivers/iio/adc/Kconfig
··· 110 110 config AT91_ADC 111 111 tristate "Atmel AT91 ADC" 112 112 depends on ARCH_AT91 113 + depends on INPUT 113 114 select IIO_BUFFER 114 115 select IIO_TRIGGERED_BUFFER 115 116 select SYSFS
+8 -8
drivers/iio/adc/max1363.c
··· 1252 1252 .num_modes = ARRAY_SIZE(max1238_mode_list), 1253 1253 .default_mode = s0to11, 1254 1254 .info = &max1238_info, 1255 - .channels = max1238_channels, 1256 - .num_channels = ARRAY_SIZE(max1238_channels), 1255 + .channels = max1038_channels, 1256 + .num_channels = ARRAY_SIZE(max1038_channels), 1257 1257 }, 1258 1258 [max11605] = { 1259 1259 .bits = 8, ··· 1262 1262 .num_modes = ARRAY_SIZE(max1238_mode_list), 1263 1263 .default_mode = s0to11, 1264 1264 .info = &max1238_info, 1265 - .channels = max1238_channels, 1266 - .num_channels = ARRAY_SIZE(max1238_channels), 1265 + .channels = max1038_channels, 1266 + .num_channels = ARRAY_SIZE(max1038_channels), 1267 1267 }, 1268 1268 [max11606] = { 1269 1269 .bits = 10, ··· 1312 1312 .num_modes = ARRAY_SIZE(max1238_mode_list), 1313 1313 .default_mode = s0to11, 1314 1314 .info = &max1238_info, 1315 - .channels = max1238_channels, 1316 - .num_channels = ARRAY_SIZE(max1238_channels), 1315 + .channels = max1138_channels, 1316 + .num_channels = ARRAY_SIZE(max1138_channels), 1317 1317 }, 1318 1318 [max11611] = { 1319 1319 .bits = 10, ··· 1322 1322 .num_modes = ARRAY_SIZE(max1238_mode_list), 1323 1323 .default_mode = s0to11, 1324 1324 .info = &max1238_info, 1325 - .channels = max1238_channels, 1326 - .num_channels = ARRAY_SIZE(max1238_channels), 1325 + .channels = max1138_channels, 1326 + .num_channels = ARRAY_SIZE(max1138_channels), 1327 1327 }, 1328 1328 [max11612] = { 1329 1329 .bits = 12,
+18 -5
drivers/iio/common/hid-sensors/hid-sensor-attributes.c
··· 327 327 *val0 = 1; 328 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 331 if (unit_conversion[i].usage_id == usage_id && 332 332 unit_conversion[i].unit == attr_info->units) { 333 333 exp = hid_sensor_convert_exponent( ··· 343 343 } 344 344 EXPORT_SYMBOL(hid_sensor_format_scale); 345 345 346 + int hid_sensor_get_reporting_interval(struct hid_sensor_hub_device *hsdev, 347 + u32 usage_id, 348 + struct hid_sensor_common *st) 349 + { 350 + sensor_hub_input_get_attribute_info(hsdev, 351 + HID_FEATURE_REPORT, usage_id, 352 + HID_USAGE_SENSOR_PROP_REPORT_INTERVAL, 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 + 346 361 int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev, 347 362 u32 usage_id, 348 363 struct hid_sensor_common *st) 349 364 { 350 365 351 - sensor_hub_input_get_attribute_info(hsdev, 352 - HID_FEATURE_REPORT, usage_id, 353 - HID_USAGE_SENSOR_PROP_REPORT_INTERVAL, 354 - &st->poll); 366 + 367 + hid_sensor_get_reporting_interval(hsdev, usage_id, st); 355 368 356 369 sensor_hub_input_get_attribute_info(hsdev, 357 370 HID_FEATURE_REPORT, usage_id,
+2 -2
drivers/staging/iio/Documentation/iio_utils.h
··· 318 318 free(filename); 319 319 goto error_close_dir; 320 320 } 321 - fscanf(sysfsfp, "%u", &ret); 321 + fscanf(sysfsfp, "%i", &ret); 322 322 if (ret == 1) 323 323 (*counter)++; 324 324 fclose(sysfsfp); ··· 350 350 ret = -errno; 351 351 goto error_cleanup_array; 352 352 } 353 - fscanf(sysfsfp, "%u", &current_enabled); 353 + fscanf(sysfsfp, "%i", &current_enabled); 354 354 fclose(sysfsfp); 355 355 356 356 if (!current_enabled) {