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

Merge tag 'iio-fixes-5.13a' of...

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

Jonathan writes:

First set of IIO fixes for the 5.13 cycle

A couple of high priority core fixes and the usual bits scattered
across individual drivers.

core:
* Fix ioctl handler double free.
* Fix an accidental ABI change wrt to error codes when an IOCTL is not
  supported.

gp2ap002:
* Runtime pm imbalance on error.
hid-sensors:
* Fix a Kconfig dependency issue in a particularly crazy config.
mpu3050:
* Fix wrong temperature calculation due to a type needing to be signed.
pulsedlight:
* Runtime pm imbalance on error.
tsl2583
* Fix a potential division by zero.

* tag 'iio-fixes-5.13a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
  iio: tsl2583: Fix division by a zero lux_val
  iio: core: return ENODEV if ioctl is unknown
  iio: core: fix ioctl handlers removal
  iio: gyro: mpu3050: Fix reported temperature value
  iio: hid-sensors: select IIO_TRIGGERED_BUFFER under HID_SENSOR_IIO_TRIGGER
  iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
  iio: light: gp2ap002: Fix rumtime PM imbalance on error
parents 14b6cff5 af0e1871
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -229,7 +229,6 @@ config DMARD10
config HID_SENSOR_ACCEL_3D
config HID_SENSOR_ACCEL_3D
	depends on HID_SENSOR_HUB
	depends on HID_SENSOR_HUB
	select IIO_BUFFER
	select IIO_BUFFER
	select IIO_TRIGGERED_BUFFER
	select HID_SENSOR_IIO_COMMON
	select HID_SENSOR_IIO_COMMON
	select HID_SENSOR_IIO_TRIGGER
	select HID_SENSOR_IIO_TRIGGER
	tristate "HID Accelerometers 3D"
	tristate "HID Accelerometers 3D"
+1 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ config HID_SENSOR_IIO_TRIGGER
	tristate "Common module (trigger) for all HID Sensor IIO drivers"
	tristate "Common module (trigger) for all HID Sensor IIO drivers"
	depends on HID_SENSOR_HUB && HID_SENSOR_IIO_COMMON && IIO_BUFFER
	depends on HID_SENSOR_HUB && HID_SENSOR_IIO_COMMON && IIO_BUFFER
	select IIO_TRIGGER
	select IIO_TRIGGER
	select IIO_TRIGGERED_BUFFER
	help
	help
	  Say yes here to build trigger support for HID sensors.
	  Say yes here to build trigger support for HID sensors.
	  Triggers will be send if all requested attributes were read.
	  Triggers will be send if all requested attributes were read.
+0 −1
Original line number Original line Diff line number Diff line
@@ -111,7 +111,6 @@ config FXAS21002C_SPI
config HID_SENSOR_GYRO_3D
config HID_SENSOR_GYRO_3D
	depends on HID_SENSOR_HUB
	depends on HID_SENSOR_HUB
	select IIO_BUFFER
	select IIO_BUFFER
	select IIO_TRIGGERED_BUFFER
	select HID_SENSOR_IIO_COMMON
	select HID_SENSOR_IIO_COMMON
	select HID_SENSOR_IIO_TRIGGER
	select HID_SENSOR_IIO_TRIGGER
	tristate "HID Gyroscope 3D"
	tristate "HID Gyroscope 3D"
+11 −2
Original line number Original line Diff line number Diff line
@@ -272,7 +272,16 @@ static int mpu3050_read_raw(struct iio_dev *indio_dev,
	case IIO_CHAN_INFO_OFFSET:
	case IIO_CHAN_INFO_OFFSET:
		switch (chan->type) {
		switch (chan->type) {
		case IIO_TEMP:
		case IIO_TEMP:
			/* The temperature scaling is (x+23000)/280 Celsius */
			/*
			 * The temperature scaling is (x+23000)/280 Celsius
			 * for the "best fit straight line" temperature range
			 * of -30C..85C.  The 23000 includes room temperature
			 * offset of +35C, 280 is the precision scale and x is
			 * the 16-bit signed integer reported by hardware.
			 *
			 * Temperature value itself represents temperature of
			 * the sensor die.
			 */
			*val = 23000;
			*val = 23000;
			return IIO_VAL_INT;
			return IIO_VAL_INT;
		default:
		default:
@@ -329,7 +338,7 @@ static int mpu3050_read_raw(struct iio_dev *indio_dev,
				goto out_read_raw_unlock;
				goto out_read_raw_unlock;
			}
			}


			*val = be16_to_cpu(raw_val);
			*val = (s16)be16_to_cpu(raw_val);
			ret = IIO_VAL_INT;
			ret = IIO_VAL_INT;


			goto out_read_raw_unlock;
			goto out_read_raw_unlock;
+0 −1
Original line number Original line Diff line number Diff line
@@ -52,7 +52,6 @@ config HID_SENSOR_HUMIDITY
	tristate "HID Environmental humidity sensor"
	tristate "HID Environmental humidity sensor"
	depends on HID_SENSOR_HUB
	depends on HID_SENSOR_HUB
	select IIO_BUFFER
	select IIO_BUFFER
	select IIO_TRIGGERED_BUFFER
	select HID_SENSOR_IIO_COMMON
	select HID_SENSOR_IIO_COMMON
	select HID_SENSOR_IIO_TRIGGER
	select HID_SENSOR_IIO_TRIGGER
	help
	help
Loading