Commit ebc2dc5f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'iio-fixes-4.18a' of...

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.
parents 0a2bc003 2a221c04
...@@ -1053,7 +1053,7 @@ static irqreturn_t mma8452_interrupt(int irq, void *p) ...@@ -1053,7 +1053,7 @@ static irqreturn_t mma8452_interrupt(int irq, void *p)
if (src < 0) if (src < 0)
return IRQ_NONE; return IRQ_NONE;
if (!(src & data->chip_info->enabled_events)) if (!(src & (data->chip_info->enabled_events | MMA8452_INT_DRDY)))
return IRQ_NONE; return IRQ_NONE;
if (src & MMA8452_INT_DRDY) { if (src & MMA8452_INT_DRDY) {
......
...@@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, ...@@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
} }
irq_type = irqd_get_trigger_type(desc); irq_type = irqd_get_trigger_type(desc);
if (!irq_type)
irq_type = IRQF_TRIGGER_RISING;
if (irq_type == IRQF_TRIGGER_RISING) if (irq_type == IRQF_TRIGGER_RISING)
st->irq_mask = INV_MPU6050_ACTIVE_HIGH; st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
else if (irq_type == IRQF_TRIGGER_FALLING) else if (irq_type == IRQF_TRIGGER_FALLING)
......
...@@ -582,6 +582,8 @@ static int tsl2772_als_calibrate(struct iio_dev *indio_dev) ...@@ -582,6 +582,8 @@ static int tsl2772_als_calibrate(struct iio_dev *indio_dev)
"%s: failed to get lux\n", __func__); "%s: failed to get lux\n", __func__);
return lux_val; return lux_val;
} }
if (lux_val == 0)
return -ERANGE;
ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) / ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) /
lux_val; lux_val;
......
...@@ -415,10 +415,9 @@ static int bmp280_read_humid(struct bmp280_data *data, int *val, int *val2) ...@@ -415,10 +415,9 @@ static int bmp280_read_humid(struct bmp280_data *data, int *val, int *val2)
} }
comp_humidity = bmp280_compensate_humidity(data, adc_humidity); comp_humidity = bmp280_compensate_humidity(data, adc_humidity);
*val = comp_humidity; *val = comp_humidity * 1000 / 1024;
*val2 = 1024;
return IIO_VAL_FRACTIONAL; return IIO_VAL_INT;
} }
static int bmp280_read_raw(struct iio_dev *indio_dev, static int bmp280_read_raw(struct iio_dev *indio_dev,
......
...@@ -141,7 +141,7 @@ int iio_dma_buffer_read(struct iio_buffer *buffer, size_t n, ...@@ -141,7 +141,7 @@ int iio_dma_buffer_read(struct iio_buffer *buffer, size_t n,
char __user *user_buffer); char __user *user_buffer);
size_t iio_dma_buffer_data_available(struct iio_buffer *buffer); size_t iio_dma_buffer_data_available(struct iio_buffer *buffer);
int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd); int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd);
int iio_dma_buffer_set_length(struct iio_buffer *buffer, int length); int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length);
int iio_dma_buffer_request_update(struct iio_buffer *buffer); int iio_dma_buffer_request_update(struct iio_buffer *buffer);
int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment