Skip to content

Commit ebc2dc5

Browse files
committed
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.
2 parents 0a2bc00 + 2a221c0 commit ebc2dc5

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

drivers/iio/accel/mma8452.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ static irqreturn_t mma8452_interrupt(int irq, void *p)
10531053
if (src < 0)
10541054
return IRQ_NONE;
10551055

1056-
if (!(src & data->chip_info->enabled_events))
1056+
if (!(src & (data->chip_info->enabled_events | MMA8452_INT_DRDY)))
10571057
return IRQ_NONE;
10581058

10591059
if (src & MMA8452_INT_DRDY) {

drivers/iio/imu/inv_mpu6050/inv_mpu_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
959959
}
960960

961961
irq_type = irqd_get_trigger_type(desc);
962+
if (!irq_type)
963+
irq_type = IRQF_TRIGGER_RISING;
962964
if (irq_type == IRQF_TRIGGER_RISING)
963965
st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
964966
else if (irq_type == IRQF_TRIGGER_FALLING)

drivers/iio/light/tsl2772.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,8 @@ static int tsl2772_als_calibrate(struct iio_dev *indio_dev)
582582
"%s: failed to get lux\n", __func__);
583583
return lux_val;
584584
}
585+
if (lux_val == 0)
586+
return -ERANGE;
585587

586588
ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) /
587589
lux_val;

drivers/iio/pressure/bmp280-core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,9 @@ static int bmp280_read_humid(struct bmp280_data *data, int *val, int *val2)
415415
}
416416
comp_humidity = bmp280_compensate_humidity(data, adc_humidity);
417417

418-
*val = comp_humidity;
419-
*val2 = 1024;
418+
*val = comp_humidity * 1000 / 1024;
420419

421-
return IIO_VAL_FRACTIONAL;
420+
return IIO_VAL_INT;
422421
}
423422

424423
static int bmp280_read_raw(struct iio_dev *indio_dev,

include/linux/iio/buffer-dma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ int iio_dma_buffer_read(struct iio_buffer *buffer, size_t n,
141141
char __user *user_buffer);
142142
size_t iio_dma_buffer_data_available(struct iio_buffer *buffer);
143143
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);
145145
int iio_dma_buffer_request_update(struct iio_buffer *buffer);
146146

147147
int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue,

0 commit comments

Comments
 (0)