Merge tag 'iio-fixes-4.18a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

First set of IIO fixes for the 4.18 cycle.

* bmp280
- Fix wrong relative humidity unit.
* buffer
- Fix a function signature to match the function.
* inv_mpu6050
- Fix a regression in which older ACPI devices won't have working
interrupts due to lack of information on the interrupt type.
* mma8452
- Don't ignore data ready interrupt when handling interrupts as will
look like an unhandled interrupt.
* tsl2x7x/tsl2772
- Avoid a potential division by zero.

Changed files
+8 -5
drivers
iio
accel
imu
inv_mpu6050
light
pressure
include
linux
+1 -1
drivers/iio/accel/mma8452.c
··· 1053 1053 if (src < 0) 1054 1054 return IRQ_NONE; 1055 1055 1056 - if (!(src & data->chip_info->enabled_events)) 1056 + if (!(src & (data->chip_info->enabled_events | MMA8452_INT_DRDY))) 1057 1057 return IRQ_NONE; 1058 1058 1059 1059 if (src & MMA8452_INT_DRDY) {
+2
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
··· 959 959 } 960 960 961 961 irq_type = irqd_get_trigger_type(desc); 962 + if (!irq_type) 963 + irq_type = IRQF_TRIGGER_RISING; 962 964 if (irq_type == IRQF_TRIGGER_RISING) 963 965 st->irq_mask = INV_MPU6050_ACTIVE_HIGH; 964 966 else if (irq_type == IRQF_TRIGGER_FALLING)
+2
drivers/iio/light/tsl2772.c
··· 582 582 "%s: failed to get lux\n", __func__); 583 583 return lux_val; 584 584 } 585 + if (lux_val == 0) 586 + return -ERANGE; 585 587 586 588 ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) / 587 589 lux_val;
+2 -3
drivers/iio/pressure/bmp280-core.c
··· 415 415 } 416 416 comp_humidity = bmp280_compensate_humidity(data, adc_humidity); 417 417 418 - *val = comp_humidity; 419 - *val2 = 1024; 418 + *val = comp_humidity * 1000 / 1024; 420 419 421 - return IIO_VAL_FRACTIONAL; 420 + return IIO_VAL_INT; 422 421 } 423 422 424 423 static int bmp280_read_raw(struct iio_dev *indio_dev,
+1 -1
include/linux/iio/buffer-dma.h
··· 141 141 char __user *user_buffer); 142 142 size_t iio_dma_buffer_data_available(struct iio_buffer *buffer); 143 143 int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd); 144 - int iio_dma_buffer_set_length(struct iio_buffer *buffer, int length); 144 + int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length); 145 145 int iio_dma_buffer_request_update(struct iio_buffer *buffer); 146 146 147 147 int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue,