Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 360b921b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-fixes-for-5.1a' of...

Merge tag 'iio-fixes-for-5.1a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

First set of IIO fixes for the 5.1 cycle.

Mostly the usual mix, but the bme680 SPI fix is much larger than
I would normally like.  It never worked, but conversely we have
code there that would make people expect it to do so.  Chances
of side effects are very low.

* core
  - Fix an uninitialised bitaks that could potentially result in random
    channels being enabled on startup.
* ad7192
  - Fix a wrong channel address for ad7193.
* ade7854
  - Fix a typo that results in returning peak voltage instead of peak current.
* at91
  - Fix a potential hang due to a race on interrupt setting.
* bmg160
  - Fix scale factor of temperature
* bme680
  - Fix scale factor of temperature
  - Fix SPI read interface.  This is a bit of a large patch as it seems
    that it never worked.  It's major for this driver but is unlikely to
    have any negative side effects.
* kxcjk1013
  - restore sensor range setting after resume.
* mcp4725
  - make sure to store powerdown bits when storing to the eeprom.
* mpu3050
  - Mask the chip ID correctly as we have chips that set the bother bits of
    this register.
* sgp30
  - Fix a missing Kconfig block that means the driver doesn't actually ever
    get built.

* tag 'iio-fixes-for-5.1a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
  iio: core: fix a possible circular locking dependency
  iio: ad_sigma_delta: select channel when reading register
  iio: pms7003: select IIO_TRIGGERED_BUFFER
  iio: cros_ec: Fix the maths for gyro scale calculation
  iio: adc: xilinx: prevent touching unclocked h/w on remove
  iio: adc: xilinx: fix potential use-after-free on probe
  iio: adc: xilinx: fix potential use-after-free on remove
  iio: dac: mcp4725: add missing powerdown bits in store eeprom
  io: accel: kxcjk1013: restore the range after resume.
  iio:chemical:bme680: Fix SPI read interface
  iio:chemical:bme680: Fix, report temperature in millidegrees
  iio: chemical: fix missing Kconfig block for sgp30
  iio: adc: at91: disable adc channel interrupt in timeout case
  iio: gyro: mpu3050: fix chip ID reading
  iio: Fix scan mask selection
  staging: iio: ad7192: Fix ad7193 channel address
  iio/gyro/bmg160: Use millidegrees for temperature scale
  Staging: iio: meter: fixed typo
parents 79a3aaa7 7f75591f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1437,6 +1437,8 @@ static int kxcjk1013_resume(struct device *dev)

	mutex_lock(&data->mutex);
	ret = kxcjk1013_set_mode(data, OPERATION);
	if (ret == 0)
		ret = kxcjk1013_set_range(data, data->range);
	mutex_unlock(&data->mutex);

	return ret;
+1 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ static int ad_sd_read_reg_raw(struct ad_sigma_delta *sigma_delta,
	if (sigma_delta->info->has_registers) {
		data[0] = reg << sigma_delta->info->addr_shift;
		data[0] |= sigma_delta->info->read_mask;
		data[0] |= sigma_delta->comm;
		spi_message_add_tail(&t[0], &m);
	}
	spi_message_add_tail(&t[1], &m);
+17 −11
Original line number Diff line number Diff line
@@ -704,23 +704,29 @@ static int at91_adc_read_raw(struct iio_dev *idev,
		ret = wait_event_interruptible_timeout(st->wq_data_avail,
						       st->done,
						       msecs_to_jiffies(1000));
		if (ret == 0)
			ret = -ETIMEDOUT;
		if (ret < 0) {
			mutex_unlock(&st->lock);
			return ret;
		}

		*val = st->last_value;

		/* Disable interrupts, regardless if adc conversion was
		 * successful or not
		 */
		at91_adc_writel(st, AT91_ADC_CHDR,
				AT91_ADC_CH(chan->channel));
		at91_adc_writel(st, AT91_ADC_IDR, BIT(chan->channel));

		if (ret > 0) {
			/* a valid conversion took place */
			*val = st->last_value;
			st->last_value = 0;
			st->done = false;
			ret = IIO_VAL_INT;
		} else if (ret == 0) {
			/* conversion timeout */
			dev_err(&idev->dev, "ADC Channel %d timeout.\n",
				chan->channel);
			ret = -ETIMEDOUT;
		}

		mutex_unlock(&st->lock);
		return IIO_VAL_INT;
		return ret;

	case IIO_CHAN_INFO_SCALE:
		*val = st->vref_mv;
+2 −1
Original line number Diff line number Diff line
@@ -1292,6 +1292,7 @@ static int xadc_probe(struct platform_device *pdev)

err_free_irq:
	free_irq(xadc->irq, indio_dev);
	cancel_delayed_work_sync(&xadc->zynq_unmask_work);
err_clk_disable_unprepare:
	clk_disable_unprepare(xadc->clk);
err_free_samplerate_trigger:
@@ -1321,8 +1322,8 @@ static int xadc_remove(struct platform_device *pdev)
		iio_triggered_buffer_cleanup(indio_dev);
	}
	free_irq(xadc->irq, indio_dev);
	cancel_delayed_work_sync(&xadc->zynq_unmask_work);
	clk_disable_unprepare(xadc->clk);
	cancel_delayed_work(&xadc->zynq_unmask_work);
	kfree(xadc->data);
	kfree(indio_dev->channels);

+14 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ config IAQCORE
config PMS7003
	tristate "Plantower PMS7003 particulate matter sensor"
	depends on SERIAL_DEV_BUS
	select IIO_TRIGGERED_BUFFER
	help
	  Say Y here to build support for the Plantower PMS7003 particulate
	  matter sensor.
@@ -71,6 +72,19 @@ config PMS7003
	  To compile this driver as a module, choose M here: the module will
	  be called pms7003.

config SENSIRION_SGP30
	tristate "Sensirion SGPxx gas sensors"
	depends on I2C
	select CRC8
	help
	  Say Y here to build I2C interface support for the following
	  Sensirion SGP gas sensors:
	    * SGP30 gas sensor
	    * SGPC3 low power gas sensor

	  To compile this driver as module, choose M here: the
	  module will be called sgp30.

config SPS30
	tristate "SPS30 particulate matter sensor"
	depends on I2C
Loading