Commit 832bceef authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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()
parents 4da81fa2 a1bfb0cc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@ description:
properties:
  compatible:
    enum:
      - bosch,bmc150
      - bosch,bmi055
      - bosch,bmc150_accel
      - bosch,bmi055_accel
      - bosch,bma255
      - bosch,bma250e
      - bosch,bma222
+0 −35
Original line number Diff line number Diff line
@@ -235,36 +235,6 @@ static ssize_t ti_eqep_position_ceiling_write(struct counter_device *counter,
	return len;
}

static ssize_t ti_eqep_position_floor_read(struct counter_device *counter,
					   struct counter_count *count,
					   void *ext_priv, char *buf)
{
	struct ti_eqep_cnt *priv = counter->priv;
	u32 qposinit;

	regmap_read(priv->regmap32, QPOSINIT, &qposinit);

	return sprintf(buf, "%u\n", qposinit);
}

static ssize_t ti_eqep_position_floor_write(struct counter_device *counter,
					    struct counter_count *count,
					    void *ext_priv, const char *buf,
					    size_t len)
{
	struct ti_eqep_cnt *priv = counter->priv;
	int err;
	u32 res;

	err = kstrtouint(buf, 0, &res);
	if (err < 0)
		return err;

	regmap_write(priv->regmap32, QPOSINIT, res);

	return len;
}

static ssize_t ti_eqep_position_enable_read(struct counter_device *counter,
					    struct counter_count *count,
					    void *ext_priv, char *buf)
@@ -301,11 +271,6 @@ static struct counter_count_ext ti_eqep_position_ext[] = {
		.read	= ti_eqep_position_ceiling_read,
		.write	= ti_eqep_position_ceiling_write,
	},
	{
		.name	= "floor",
		.read	= ti_eqep_position_floor_read,
		.write	= ti_eqep_position_floor_write,
	},
	{
		.name	= "enable",
		.read	= ti_eqep_position_enable_read,
+1 −5
Original line number Diff line number Diff line
@@ -397,16 +397,12 @@ static int tiadc_iio_buffered_hardware_setup(struct device *dev,
	ret = devm_request_threaded_irq(dev, irq, pollfunc_th, pollfunc_bh,
				flags, indio_dev->name, indio_dev);
	if (ret)
		goto error_kfifo_free;
		return ret;

	indio_dev->setup_ops = setup_ops;
	indio_dev->modes |= INDIO_BUFFER_SOFTWARE;

	return 0;

error_kfifo_free:
	iio_kfifo_free(indio_dev->buffer);
	return ret;
}

static const char * const chan_name_ain[] = {
+17 −14
Original line number Diff line number Diff line
@@ -23,35 +23,31 @@
 * @sdata: Sensor data.
 *
 * returns:
 * 0 - no new samples available
 * 1 - new samples available
 * negative - error or unknown
 * false - no new samples available or read error
 * true - new samples available
 */
static int st_sensors_new_samples_available(struct iio_dev *indio_dev,
static bool st_sensors_new_samples_available(struct iio_dev *indio_dev,
					     struct st_sensor_data *sdata)
{
	int ret, status;

	/* How would I know if I can't check it? */
	if (!sdata->sensor_settings->drdy_irq.stat_drdy.addr)
		return -EINVAL;
		return true;

	/* No scan mask, no interrupt */
	if (!indio_dev->active_scan_mask)
		return 0;
		return false;

	ret = regmap_read(sdata->regmap,
			  sdata->sensor_settings->drdy_irq.stat_drdy.addr,
			  &status);
	if (ret < 0) {
		dev_err(sdata->dev, "error checking samples available\n");
		return ret;
		return false;
	}

	if (status & sdata->sensor_settings->drdy_irq.stat_drdy.mask)
		return 1;

	return 0;
	return !!(status & sdata->sensor_settings->drdy_irq.stat_drdy.mask);
}

/**
@@ -180,9 +176,15 @@ int st_sensors_allocate_trigger(struct iio_dev *indio_dev,

	/* Tell the interrupt handler that we're dealing with edges */
	if (irq_trig == IRQF_TRIGGER_FALLING ||
	    irq_trig == IRQF_TRIGGER_RISING)
	    irq_trig == IRQF_TRIGGER_RISING) {
		if (!sdata->sensor_settings->drdy_irq.stat_drdy.addr) {
			dev_err(&indio_dev->dev,
				"edge IRQ not supported w/o stat register.\n");
			err = -EOPNOTSUPP;
			goto iio_trigger_free;
		}
		sdata->edge_irq = true;
	else
	} else {
		/*
		 * If we're not using edges (i.e. level interrupts) we
		 * just mask off the IRQ, handle one interrupt, then
@@ -190,6 +192,7 @@ int st_sensors_allocate_trigger(struct iio_dev *indio_dev,
		 * interrupt handler top half again and start over.
		 */
		irq_trig |= IRQF_ONESHOT;
	}

	/*
	 * If the interrupt pin is Open Drain, by definition this
+2 −2
Original line number Diff line number Diff line
@@ -187,9 +187,9 @@ static ssize_t ad5504_write_dac_powerdown(struct iio_dev *indio_dev,
		return ret;

	if (pwr_down)
		st->pwr_down_mask |= (1 << chan->channel);
	else
		st->pwr_down_mask &= ~(1 << chan->channel);
	else
		st->pwr_down_mask |= (1 << chan->channel);

	ret = ad5504_spi_write(st, AD5504_ADDR_CTRL,
				AD5504_DAC_PWRDWN_MODE(st->pwr_down_mode) |
Loading