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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-4.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging/IIO driver rfixes from Greg KH:
"Here are a number of small IIO and staging driver fixes for 4.11-rc6.
Nothing big here, just iio fixes for reported issues, and an ashmem
fix for a very old bug that has been reported by a number of Android
vendors"

* tag 'staging-4.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
iio: hid-sensor-attributes: Fix sensor property setting failure.
iio: accel: hid-sensor-accel-3d: Fix duplicate scan index error
iio: core: Fix IIO_VAL_FRACTIONAL_LOG2 for negative values
iio: st_pressure: initialize lps22hb bootime
iio: bmg160: reset chip when probing
iio: cros_ec_sensors: Fix return value to get raw and calibbias data.

+31 -7
+2 -1
drivers/iio/accel/hid-sensor-accel-3d.c
··· 370 370 name = "accel_3d"; 371 371 channel_spec = accel_3d_channels; 372 372 channel_size = sizeof(accel_3d_channels); 373 + indio_dev->num_channels = ARRAY_SIZE(accel_3d_channels); 373 374 } else { 374 375 name = "gravity"; 375 376 channel_spec = gravity_channels; 376 377 channel_size = sizeof(gravity_channels); 378 + indio_dev->num_channels = ARRAY_SIZE(gravity_channels); 377 379 } 378 380 ret = hid_sensor_parse_common_attributes(hsdev, hsdev->usage, 379 381 &accel_state->common_attributes); ··· 397 395 goto error_free_dev_mem; 398 396 } 399 397 400 - indio_dev->num_channels = ARRAY_SIZE(accel_3d_channels); 401 398 indio_dev->dev.parent = &pdev->dev; 402 399 indio_dev->info = &accel_3d_info; 403 400 indio_dev->name = name;
+2 -2
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
··· 61 61 ret = st->core.read_ec_sensors_data(indio_dev, 1 << idx, &data); 62 62 if (ret < 0) 63 63 break; 64 - 64 + ret = IIO_VAL_INT; 65 65 *val = data; 66 66 break; 67 67 case IIO_CHAN_INFO_CALIBBIAS: ··· 76 76 for (i = CROS_EC_SENSOR_X; i < CROS_EC_SENSOR_MAX_AXIS; i++) 77 77 st->core.calib[i] = 78 78 st->core.resp->sensor_offset.offset[i]; 79 - 79 + ret = IIO_VAL_INT; 80 80 *val = st->core.calib[idx]; 81 81 break; 82 82 case IIO_CHAN_INFO_SCALE:
+10
drivers/iio/common/hid-sensors/hid-sensor-attributes.c
··· 379 379 { 380 380 381 381 struct hid_sensor_hub_attribute_info timestamp; 382 + s32 value; 383 + int ret; 382 384 383 385 hid_sensor_get_reporting_interval(hsdev, usage_id, st); 384 386 ··· 418 416 st->power_state.index, st->power_state.report_id, 419 417 st->sensitivity.index, st->sensitivity.report_id, 420 418 timestamp.index, timestamp.report_id); 419 + 420 + ret = sensor_hub_get_feature(hsdev, 421 + st->power_state.report_id, 422 + st->power_state.index, sizeof(value), &value); 423 + if (ret < 0) 424 + return ret; 425 + if (value < 0) 426 + return -EINVAL; 421 427 422 428 return 0; 423 429 }
+12
drivers/iio/gyro/bmg160_core.c
··· 27 27 #include <linux/iio/trigger_consumer.h> 28 28 #include <linux/iio/triggered_buffer.h> 29 29 #include <linux/regmap.h> 30 + #include <linux/delay.h> 30 31 #include "bmg160.h" 31 32 32 33 #define BMG160_IRQ_NAME "bmg160_event" ··· 52 51 #define BMG160_NO_FILTER 0 53 52 #define BMG160_DEF_BW 100 54 53 #define BMG160_REG_PMU_BW_RES BIT(7) 54 + 55 + #define BMG160_GYRO_REG_RESET 0x14 56 + #define BMG160_GYRO_RESET_VAL 0xb6 55 57 56 58 #define BMG160_REG_INT_MAP_0 0x17 57 59 #define BMG160_INT_MAP_0_BIT_ANY BIT(1) ··· 239 235 struct device *dev = regmap_get_device(data->regmap); 240 236 int ret; 241 237 unsigned int val; 238 + 239 + /* 240 + * Reset chip to get it in a known good state. A delay of 30ms after 241 + * reset is required according to the datasheet. 242 + */ 243 + regmap_write(data->regmap, BMG160_GYRO_REG_RESET, 244 + BMG160_GYRO_RESET_VAL); 245 + usleep_range(30000, 30700); 242 246 243 247 ret = regmap_read(data->regmap, BMG160_REG_CHIP_ID, &val); 244 248 if (ret < 0) {
+3 -4
drivers/iio/industrialio-core.c
··· 610 610 tmp0 = (int)div_s64_rem(tmp, 1000000000, &tmp1); 611 611 return snprintf(buf, len, "%d.%09u", tmp0, abs(tmp1)); 612 612 case IIO_VAL_FRACTIONAL_LOG2: 613 - tmp = (s64)vals[0] * 1000000000LL >> vals[1]; 614 - tmp1 = do_div(tmp, 1000000000LL); 615 - tmp0 = tmp; 616 - return snprintf(buf, len, "%d.%09u", tmp0, tmp1); 613 + tmp = shift_right((s64)vals[0] * 1000000000LL, vals[1]); 614 + tmp0 = (int)div_s64_rem(tmp, 1000000000LL, &tmp1); 615 + return snprintf(buf, len, "%d.%09u", tmp0, abs(tmp1)); 617 616 case IIO_VAL_INT_MULTIPLE: 618 617 { 619 618 int i;
+1
drivers/iio/pressure/st_pressure_core.c
··· 457 457 .addr_stat_drdy = ST_SENSORS_DEFAULT_STAT_ADDR, 458 458 }, 459 459 .multi_read_bit = true, 460 + .bootime = 2, 460 461 }, 461 462 }; 462 463
+1
drivers/staging/android/ashmem.c
··· 409 409 ret = PTR_ERR(vmfile); 410 410 goto out; 411 411 } 412 + vmfile->f_mode |= FMODE_LSEEK; 412 413 asma->file = vmfile; 413 414 } 414 415 get_file(asma->file);