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-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging/IIO driver fixes from Greg KH:
"Here are some IIO driver fixes for 5.11-rc5 to resolve some reported
problems.

Nothing major, just a few small fixes, all of these have been in
linux-next for a while and full details are in the shortlog"

* tag 'staging-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
iio: sx9310: Fix semtech,avg-pos-strength setting when > 16
iio: common: st_sensors: fix possible infinite loop in st_sensors_irq_thread
iio: ad5504: Fix setting power-down state
counter:ti-eqep: remove floor
drivers: iio: temperature: Add delay after the addressed reset command in mlx90632.c
iio: adc: ti_am335x_adc: remove omitted iio_kfifo_free()
dt-bindings: iio: accel: bma255: Fix bmc150/bmi055 compatible
iio: sx9310: Off by one in sx9310_read_thresh()

+31 -60
+2 -2
Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml
··· 16 16 properties: 17 17 compatible: 18 18 enum: 19 - - bosch,bmc150 20 - - bosch,bmi055 19 + - bosch,bmc150_accel 20 + - bosch,bmi055_accel 21 21 - bosch,bma255 22 22 - bosch,bma250e 23 23 - bosch,bma222
-35
drivers/counter/ti-eqep.c
··· 235 235 return len; 236 236 } 237 237 238 - static ssize_t ti_eqep_position_floor_read(struct counter_device *counter, 239 - struct counter_count *count, 240 - void *ext_priv, char *buf) 241 - { 242 - struct ti_eqep_cnt *priv = counter->priv; 243 - u32 qposinit; 244 - 245 - regmap_read(priv->regmap32, QPOSINIT, &qposinit); 246 - 247 - return sprintf(buf, "%u\n", qposinit); 248 - } 249 - 250 - static ssize_t ti_eqep_position_floor_write(struct counter_device *counter, 251 - struct counter_count *count, 252 - void *ext_priv, const char *buf, 253 - size_t len) 254 - { 255 - struct ti_eqep_cnt *priv = counter->priv; 256 - int err; 257 - u32 res; 258 - 259 - err = kstrtouint(buf, 0, &res); 260 - if (err < 0) 261 - return err; 262 - 263 - regmap_write(priv->regmap32, QPOSINIT, res); 264 - 265 - return len; 266 - } 267 - 268 238 static ssize_t ti_eqep_position_enable_read(struct counter_device *counter, 269 239 struct counter_count *count, 270 240 void *ext_priv, char *buf) ··· 270 300 .name = "ceiling", 271 301 .read = ti_eqep_position_ceiling_read, 272 302 .write = ti_eqep_position_ceiling_write, 273 - }, 274 - { 275 - .name = "floor", 276 - .read = ti_eqep_position_floor_read, 277 - .write = ti_eqep_position_floor_write, 278 303 }, 279 304 { 280 305 .name = "enable",
+1 -5
drivers/iio/adc/ti_am335x_adc.c
··· 397 397 ret = devm_request_threaded_irq(dev, irq, pollfunc_th, pollfunc_bh, 398 398 flags, indio_dev->name, indio_dev); 399 399 if (ret) 400 - goto error_kfifo_free; 400 + return ret; 401 401 402 402 indio_dev->setup_ops = setup_ops; 403 403 indio_dev->modes |= INDIO_BUFFER_SOFTWARE; 404 404 405 405 return 0; 406 - 407 - error_kfifo_free: 408 - iio_kfifo_free(indio_dev->buffer); 409 - return ret; 410 406 } 411 407 412 408 static const char * const chan_name_ain[] = {
+17 -14
drivers/iio/common/st_sensors/st_sensors_trigger.c
··· 23 23 * @sdata: Sensor data. 24 24 * 25 25 * returns: 26 - * 0 - no new samples available 27 - * 1 - new samples available 28 - * negative - error or unknown 26 + * false - no new samples available or read error 27 + * true - new samples available 29 28 */ 30 - static int st_sensors_new_samples_available(struct iio_dev *indio_dev, 31 - struct st_sensor_data *sdata) 29 + static bool st_sensors_new_samples_available(struct iio_dev *indio_dev, 30 + struct st_sensor_data *sdata) 32 31 { 33 32 int ret, status; 34 33 35 34 /* How would I know if I can't check it? */ 36 35 if (!sdata->sensor_settings->drdy_irq.stat_drdy.addr) 37 - return -EINVAL; 36 + return true; 38 37 39 38 /* No scan mask, no interrupt */ 40 39 if (!indio_dev->active_scan_mask) 41 - return 0; 40 + return false; 42 41 43 42 ret = regmap_read(sdata->regmap, 44 43 sdata->sensor_settings->drdy_irq.stat_drdy.addr, 45 44 &status); 46 45 if (ret < 0) { 47 46 dev_err(sdata->dev, "error checking samples available\n"); 48 - return ret; 47 + return false; 49 48 } 50 49 51 - if (status & sdata->sensor_settings->drdy_irq.stat_drdy.mask) 52 - return 1; 53 - 54 - return 0; 50 + return !!(status & sdata->sensor_settings->drdy_irq.stat_drdy.mask); 55 51 } 56 52 57 53 /** ··· 176 180 177 181 /* Tell the interrupt handler that we're dealing with edges */ 178 182 if (irq_trig == IRQF_TRIGGER_FALLING || 179 - irq_trig == IRQF_TRIGGER_RISING) 183 + irq_trig == IRQF_TRIGGER_RISING) { 184 + if (!sdata->sensor_settings->drdy_irq.stat_drdy.addr) { 185 + dev_err(&indio_dev->dev, 186 + "edge IRQ not supported w/o stat register.\n"); 187 + err = -EOPNOTSUPP; 188 + goto iio_trigger_free; 189 + } 180 190 sdata->edge_irq = true; 181 - else 191 + } else { 182 192 /* 183 193 * If we're not using edges (i.e. level interrupts) we 184 194 * just mask off the IRQ, handle one interrupt, then ··· 192 190 * interrupt handler top half again and start over. 193 191 */ 194 192 irq_trig |= IRQF_ONESHOT; 193 + } 195 194 196 195 /* 197 196 * If the interrupt pin is Open Drain, by definition this
+2 -2
drivers/iio/dac/ad5504.c
··· 187 187 return ret; 188 188 189 189 if (pwr_down) 190 - st->pwr_down_mask |= (1 << chan->channel); 191 - else 192 190 st->pwr_down_mask &= ~(1 << chan->channel); 191 + else 192 + st->pwr_down_mask |= (1 << chan->channel); 193 193 194 194 ret = ad5504_spi_write(st, AD5504_ADDR_CTRL, 195 195 AD5504_DAC_PWRDWN_MODE(st->pwr_down_mode) |
+3 -2
drivers/iio/proximity/sx9310.c
··· 601 601 return ret; 602 602 603 603 regval = FIELD_GET(SX9310_REG_PROX_CTRL8_9_PTHRESH_MASK, regval); 604 - if (regval > ARRAY_SIZE(sx9310_pthresh_codes)) 604 + if (regval >= ARRAY_SIZE(sx9310_pthresh_codes)) 605 605 return -EINVAL; 606 606 607 607 *val = sx9310_pthresh_codes[regval]; ··· 1305 1305 if (ret) 1306 1306 break; 1307 1307 1308 - pos = min(max(ilog2(pos), 3), 10) - 3; 1308 + /* Powers of 2, except for a gap between 16 and 64 */ 1309 + pos = clamp(ilog2(pos), 3, 11) - (pos >= 32 ? 4 : 3); 1309 1310 reg_def->def &= ~SX9310_REG_PROX_CTRL7_AVGPOSFILT_MASK; 1310 1311 reg_def->def |= FIELD_PREP(SX9310_REG_PROX_CTRL7_AVGPOSFILT_MASK, 1311 1312 pos);
+6
drivers/iio/temperature/mlx90632.c
··· 248 248 if (ret < 0) 249 249 return ret; 250 250 251 + /* 252 + * Give the mlx90632 some time to reset properly before sending a new I2C command 253 + * if this is not done, the following I2C command(s) will not be accepted. 254 + */ 255 + usleep_range(150, 200); 256 + 251 257 ret = regmap_write_bits(regmap, MLX90632_REG_CONTROL, 252 258 (MLX90632_CFG_MTYP_MASK | MLX90632_CFG_PWR_MASK), 253 259 (MLX90632_MTYP_STATUS(type) | MLX90632_PWR_STATUS_HALT));