Commit 36a70608 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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

Merge tag 'iio-fixes-for-6.19a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus

Jonathan writes:

IIO: 1st set of fixes for the 6.19 cycle

The usual mixed bag of fixes for ancient problems plus some more
recent ones.

adi,ad7280a
- Check for errors from spi_setup().
adi,ad3552r
- Fix potential buffer overflow when setting to use the internal ramp.
adi,ax5695r
- Fill in the data for this device in the chip info table.
adi,ad7606
- Don't store a negative error in an unsigned int.
adi,ad9467
- Fix incorrect register mask value.
adi,adxl380
- Fix inverted condition for whether INT1 interrupt present in dt.
atmel,at91-sama5d2
- Cancel work on remove to avoid a potential use-after-free
invensense,icm45600
- Fix temperature scaling.
samsung,eynos_adc
- Use of_platform_depolulate() to correctly clear up such that child
  devices are created correctly if the driver is rebound.
sensiron,scd4x
- Fix incorrect endianness reported to user-space.
st,accel
- Fix gain reported for the iis329dq.
st,lsm6dsx
- Hide event related interfaces on parts that don't support events.
ti,pac1934
- Ensure output of clamp() is used rather than unclamped value.

* tag 'iio-fixes-for-6.19a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
  iio: dac: ad3552r-hs: fix out-of-bound write in ad3552r_hs_write_data_source
  iio: accel: iis328dq: fix gain values
  iio: core: add separate lockdep class for info_exist_lock
  iio: chemical: scd4x: fix reported channel endianness
  iio: imu: inv_icm45600: fix temperature offset reporting
  iio: adc: exynos_adc: fix OF populate on driver rebind
  iio: dac: ad5686: add AD5695R to ad5686_chip_info_tbl
  iio: accel: adxl380: fix handling of unavailable "INT1" interrupt
  iio: imu: st_lsm6dsx: fix iio_chan_spec for sensors without event detection
  iio: adc: pac1934: Fix clamped value in pac1934_reg_snapshot
  iio: adc: ad9467: fix ad9434 vref mask
  iio: adc: ad7606: Fix incorrect type for error return variable
  iio: adc: ad7280a: handle spi_setup() errors in probe()
  iio: adc: at91-sama5d2_adc: Fix potential use-after-free in sama5d2_adc driver
parents 0f61b186 978d2813
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1784,9 +1784,9 @@ static int adxl380_config_irq(struct iio_dev *indio_dev)
		st->int_map[1] = ADXL380_INT0_MAP1_REG;
	} else {
		st->irq = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT1");
		if (st->irq > 0)
			return dev_err_probe(st->dev, -ENODEV,
					     "no interrupt name specified");
		if (st->irq < 0)
			return dev_err_probe(st->dev, st->irq,
					     "no interrupt name specified\n");
		st->int_map[0] = ADXL380_INT1_MAP0_REG;
		st->int_map[1] = ADXL380_INT1_MAP1_REG;
	}
+71 −1
Original line number Diff line number Diff line
@@ -517,7 +517,6 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
		.wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
		.sensors_supported = {
			[0] = H3LIS331DL_ACCEL_DEV_NAME,
			[1] = IIS328DQ_ACCEL_DEV_NAME,
		},
		.ch = (struct iio_chan_spec *)st_accel_12bit_channels,
		.odr = {
@@ -584,6 +583,77 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
		.multi_read_bit = true,
		.bootime = 2,
	},
	{
		.wai = 0x32,
		.wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
		.sensors_supported = {
			[0] = IIS328DQ_ACCEL_DEV_NAME,
		},
		.ch = (struct iio_chan_spec *)st_accel_12bit_channels,
		.odr = {
			.addr = 0x20,
			.mask = 0x18,
			.odr_avl = {
				{ .hz = 50, .value = 0x00, },
				{ .hz = 100, .value = 0x01, },
				{ .hz = 400, .value = 0x02, },
				{ .hz = 1000, .value = 0x03, },
			},
		},
		.pw = {
			.addr = 0x20,
			.mask = 0x20,
			.value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE,
			.value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
		},
		.enable_axis = {
			.addr = ST_SENSORS_DEFAULT_AXIS_ADDR,
			.mask = ST_SENSORS_DEFAULT_AXIS_MASK,
		},
		.fs = {
			.addr = 0x23,
			.mask = 0x30,
			.fs_avl = {
				[0] = {
					.num = ST_ACCEL_FS_AVL_100G,
					.value = 0x00,
					.gain = IIO_G_TO_M_S_2(980),
				},
				[1] = {
					.num = ST_ACCEL_FS_AVL_200G,
					.value = 0x01,
					.gain = IIO_G_TO_M_S_2(1950),
				},
				[2] = {
					.num = ST_ACCEL_FS_AVL_400G,
					.value = 0x03,
					.gain = IIO_G_TO_M_S_2(3910),
				},
			},
		},
		.bdu = {
			.addr = 0x23,
			.mask = 0x80,
		},
		.drdy_irq = {
			.int1 = {
				.addr = 0x22,
				.mask = 0x02,
			},
			.int2 = {
				.addr = 0x22,
				.mask = 0x10,
			},
			.addr_ihl = 0x22,
			.mask_ihl = 0x80,
		},
		.sim = {
			.addr = 0x23,
			.value = BIT(0),
		},
		.multi_read_bit = true,
		.bootime = 2,
	},
	{
		/* No WAI register present */
		.sensors_supported = {
+3 −1
Original line number Diff line number Diff line
@@ -1024,7 +1024,9 @@ static int ad7280_probe(struct spi_device *spi)

	st->spi->max_speed_hz = AD7280A_MAX_SPI_CLK_HZ;
	st->spi->mode = SPI_MODE_1;
	spi_setup(st->spi);
	ret = spi_setup(st->spi);
	if (ret < 0)
		return ret;

	st->ctrl_lb = FIELD_PREP(AD7280A_CTRL_LB_ACQ_TIME_MSK, st->acquisition_time) |
		FIELD_PREP(AD7280A_CTRL_LB_THERMISTOR_MSK, st->thermistor_term_en);
+2 −1
Original line number Diff line number Diff line
@@ -43,7 +43,8 @@ static int ad7606_par_bus_setup_iio_backend(struct device *dev,
					    struct iio_dev *indio_dev)
{
	struct ad7606_state *st = iio_priv(indio_dev);
	unsigned int ret, c;
	unsigned int c;
	int ret;
	struct iio_backend_data_fmt data = {
		.sign_extend = true,
		.enable = true,
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@

#define CHIPID_AD9434			0x6A
#define AD9434_DEF_OUTPUT_MODE		0x00
#define AD9434_REG_VREF_MASK		0xC0
#define AD9434_REG_VREF_MASK		GENMASK(4, 0)

/*
 * Analog Devices AD9467 16-Bit, 200/250 MSPS ADC
Loading