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.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAlsxUysRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0Fog8aQ/+KuASbsNozi8/cKi6mFVYTbYZlXzgetNJ
 0vGoVRKy/RxczDF4frOjGo99rYjpjw3sO4qzZLxkeCB0eHIfVr5XeK8GPzzTpwJI
 iES/zv18jwY2roeAE6KYkGBs70wo/dEKqk2ZUvTOU+HxV7bllhkgyEtmGxWfB1Jy
 s2eHfGT+e6h5hwr8vX8lOnXFgbIzmysY+OgRZEg3P8cOX3ZG5m+3g8IkKEtB2Kyq
 4zovAKLiJMJIDyjcoqIuzk2ldzcn+S2ofcXS5FBEsjbDhueLUwXLZIRaqxrErAJp
 oO48psPn716pMXF4gSVymHRLwxewXCgeH2iQ8uj5Vr0V3I5wfNqVC6qdTr2qqKSY
 4n3wG8K9txwVfPxmBfY90LRs9HTsulMoQ3VcFWulqgHhfBG9v0HmK5AEk8SYlIJn
 Y7Zk1Psi9zX1yEBsMOW43XVjoKX6CApqvX8FZpyVpQomolVZlOZEEjuDswx7NyA5
 RD35ReXPkEmZJm47XVPwMPDNFZCdFDKCD3pkXLlTeKzF3WB5DVrogk5s0G3SuhMB
 B+NajXTfp0aqbErtAxVmRZVF3pJOUTRyl8dTGSaloAA7AH6mnhRTxi8Ne979EWhK
 UEQbp1ijn/6GuVdq+YA1CkdaP7AhGWQLkI3xK5cGOzWibWiO4Q2xmOXjox42tCg1
 yuOG+r35RkA=
 =luzu
 -----END PGP SIGNATURE-----

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.
This commit is contained in:
Greg Kroah-Hartman 2018-06-26 07:45:52 +08:00
commit ebc2dc5f9b
5 changed files with 8 additions and 5 deletions

View File

@ -1053,7 +1053,7 @@ static irqreturn_t mma8452_interrupt(int irq, void *p)
if (src < 0)
return IRQ_NONE;
if (!(src & data->chip_info->enabled_events))
if (!(src & (data->chip_info->enabled_events | MMA8452_INT_DRDY)))
return IRQ_NONE;
if (src & MMA8452_INT_DRDY) {

View File

@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
}
irq_type = irqd_get_trigger_type(desc);
if (!irq_type)
irq_type = IRQF_TRIGGER_RISING;
if (irq_type == IRQF_TRIGGER_RISING)
st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
else if (irq_type == IRQF_TRIGGER_FALLING)

View File

@ -582,6 +582,8 @@ static int tsl2772_als_calibrate(struct iio_dev *indio_dev)
"%s: failed to get lux\n", __func__);
return lux_val;
}
if (lux_val == 0)
return -ERANGE;
ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) /
lux_val;

View File

@ -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);
*val = comp_humidity;
*val2 = 1024;
*val = comp_humidity * 1000 / 1024;
return IIO_VAL_FRACTIONAL;
return IIO_VAL_INT;
}
static int bmp280_read_raw(struct iio_dev *indio_dev,

View File

@ -141,7 +141,7 @@ int iio_dma_buffer_read(struct iio_buffer *buffer, size_t n,
char __user *user_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_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_init(struct iio_dma_buffer_queue *queue,