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

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

Merge tag 'iio-for-3.16b' of...

Merge tag 'iio-for-3.16b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Second set of IIO new drivers, cleanups and functionality for the 3.16 cycle.

This set contains a change to the ABI for the hid-sensors drivers to bring them
in line with the long published documentation.  Unfortunately, rather than
reporting true scale and offset values via sysfs they were reporting
some magic numbers that could only be converted to anything useful using
the HID sensors specification. I missed this entirely through the introduction
of a number of drivers, only picking up on it recently.  Srinivas has had
user feedback about this as well. The patch set is too large to go as a fix
at this stage in the cycle and is not a regression fix as this was never
right and so will have to wait for the next merge window. Srinivas assures
me that there are relatively few pieces of hardware out there and he has
had a number of people contact him to point out that the drivers did not
obey the ABI.  Hence hopefully the fallout of this, if any will be minor.
If we don't fix it now, it will only get worse going forward. There is no
sensible way of maintaining the incorrect ABI as it is simply returning
the wrong values through the standard interfaces.

Non IIO elements
* Introduce devm_kmemdup.  Does what it says on the tin.

New drivers:
* hid-sensors rotation devices (output as quaternion)
* Freescale MPL115A2 presure and temperature sensor.
* Melexis mlx90614 contactless infrared sensor.
* Freescale MMA8452Q 3-axis accelerometer.

New functionality:
* Addition of multiple element callback to allow for sysfs interfaces to access
  elements such as quaternions which have no useful meaning if all 4 elements
  are not presented together.  Other future usecases for this include
  rotation matrices.
* Support for multiple element buffer entries for exactly the same uses as
  the sysfs related elements described above.
* Quaternion support via the quaternion IIO modifier.
* TEMP_AMBIENT and TEMP_OBJECT modifiers to distinguish cases with thermopile
  devices.
* hid-sensors gain sysfs access to the sensor readings. Previously these
  drivers used the buffered interface only.  This change involves some
  additional hid-sensors core support to read poll values back from the devices
  to allow the drivers to know roughly how long to wait for a result when
  polling the sensor.  There is also an associated hid-sensors abi to allow
  the devices to be turned off between reads and powered up on demand.

Cleanups and fixes
* Hid sensors fix as described above. Result is to make the _scale and _offset
  attributes applicable in the same way as for all other IIO drivers.
* Some additional documentation - mostly covering stuff that graduated from
  staging without managing to take it's ABI docs with it.
* A series of little tidy ups to the exynos_adc driver that make the code
  nicer to read and improve handling of some corner cases.
* A tidy up to mag3110 (logical fix rather than a real one ;). Also enable
  user offset calibration for this device.
* Drop some left over IS_ERR() checks from ad799x that snuck through during
  the cleanup in the last IIO patch set.
* Fix a naming issue from clashing patches in ak8975 - note the clash only
  occured in the last IIO patch set, hence the fix needs to go through this
  tree.
* A format string missmatch fix in ad7280.c. Unlikely to have ever had an
  impact so not worth rushing through.
parents 09c3fbba cd5b700f
Loading
Loading
Loading
Loading
+36 −2
Original line number Diff line number Diff line
@@ -114,14 +114,17 @@ What: /sys/bus/iio/devices/iio:deviceX/in_temp_raw
What:		/sys/bus/iio/devices/iio:deviceX/in_tempX_raw
What:		/sys/bus/iio/devices/iio:deviceX/in_temp_x_raw
What:		/sys/bus/iio/devices/iio:deviceX/in_temp_y_raw
What:		/sys/bus/iio/devices/iio:deviceX/in_temp_z_raw
What:		/sys/bus/iio/devices/iio:deviceX/in_temp_ambient_raw
What:		/sys/bus/iio/devices/iio:deviceX/in_temp_object_raw
KernelVersion:	2.6.35
Contact:	linux-iio@vger.kernel.org
Description:
		Raw (unscaled no bias removal etc.) temperature measurement.
		If an axis is specified it generally means that the temperature
		sensor is associated with one part of a compound device (e.g.
		a gyroscope axis). Units after application of scale and offset
		a gyroscope axis). The ambient and object modifiers distinguish
		between ambient (reference) and distant temperature for contact-
		less measurements. Units after application of scale and offset
		are milli degrees Celsius.

What:		/sys/bus/iio/devices/iio:deviceX/in_tempX_input
@@ -792,6 +795,7 @@ What: /sys/.../iio:deviceX/scan_elements/in_incli_x_en
What:		/sys/.../iio:deviceX/scan_elements/in_incli_y_en
What:		/sys/.../iio:deviceX/scan_elements/in_pressureY_en
What:		/sys/.../iio:deviceX/scan_elements/in_pressure_en
What:		/sys/.../iio:deviceX/scan_elements/in_rot_quaternion_en
KernelVersion:	2.6.37
Contact:	linux-iio@vger.kernel.org
Description:
@@ -807,6 +811,7 @@ What: /sys/.../iio:deviceX/scan_elements/in_voltageY_supply_type
What:		/sys/.../iio:deviceX/scan_elements/in_timestamp_type
What:		/sys/.../iio:deviceX/scan_elements/in_pressureY_type
What:		/sys/.../iio:deviceX/scan_elements/in_pressure_type
What:		/sys/.../iio:deviceX/scan_elements/in_rot_quaternion_type
KernelVersion:	2.6.37
Contact:	linux-iio@vger.kernel.org
Description:
@@ -853,6 +858,7 @@ What: /sys/.../iio:deviceX/scan_elements/in_incli_y_index
What:		/sys/.../iio:deviceX/scan_elements/in_timestamp_index
What:		/sys/.../iio:deviceX/scan_elements/in_pressureY_index
What:		/sys/.../iio:deviceX/scan_elements/in_pressure_index
What:		/sys/.../iio:deviceX/scan_elements/in_rot_quaternion_index
KernelVersion:	2.6.37
Contact:	linux-iio@vger.kernel.org
Description:
@@ -889,6 +895,25 @@ Description:
		on-chip EEPROM. After power-up or chip reset the device will
		automatically load the saved configuration.

What:		/sys/.../iio:deviceX/in_illuminanceY_input
What:		/sys/.../iio:deviceX/in_illuminanceY_raw
What:		/sys/.../iio:deviceX/in_illuminanceY_mean_raw
KernelVersion:	3.4
Contact:	linux-iio@vger.kernel.org
Description:
		Illuminance measurement, units after application of scale
		and offset are lux.

What:		/sys/.../iio:deviceX/in_intensityY_raw
What:		/sys/.../iio:deviceX/in_intensityY_ir_raw
What:		/sys/.../iio:deviceX/in_intensityY_both_raw
KernelVersion:	3.4
Contact:	linux-iio@vger.kernel.org
Description:
		Unit-less light intensity. Modifiers both and ir indicate
		that measurements contains visible and infrared light
		components or just infrared light, respectively.

What:		/sys/.../iio:deviceX/in_intensity_red_integration_time
What:		/sys/.../iio:deviceX/in_intensity_green_integration_time
What:		/sys/.../iio:deviceX/in_intensity_blue_integration_time
@@ -899,3 +924,12 @@ Contact: linux-iio@vger.kernel.org
Description:
		This attribute is used to get/set the integration time in
		seconds.

What:		/sys/bus/iio/devices/iio:deviceX/in_rot_quaternion_raw
KernelVersion:	3.15
Contact:	linux-iio@vger.kernel.org
Description:
		Raw value of quaternion components using a format
		x y z w. Here x, y, and z component represents the axis about
		which a rotation will occur and w component represents the
		amount of rotation.
+1 −0
Original line number Diff line number Diff line
@@ -236,6 +236,7 @@ certainly invest a bit more effort into libata core layer).
MEM
  devm_kzalloc()
  devm_kfree()
  devm_kmemdup()

IIO
  devm_iio_device_alloc()
+21 −0
Original line number Diff line number Diff line
@@ -831,3 +831,24 @@ void devm_kfree(struct device *dev, void *p)
	WARN_ON(rc);
}
EXPORT_SYMBOL_GPL(devm_kfree);

/**
 * devm_kmemdup - Resource-managed kmemdup
 * @dev: Device this memory belongs to
 * @src: Memory region to duplicate
 * @len: Memory region length
 * @gfp: GFP mask to use
 *
 * Duplicate region of a memory using resource managed kmalloc
 */
void *devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp)
{
	void *p;

	p = devm_kmalloc(dev, len, gfp);
	if (p)
		memcpy(p, src, len);

	return p;
}
EXPORT_SYMBOL_GPL(devm_kmemdup);
+12 −0
Original line number Diff line number Diff line
@@ -65,4 +65,16 @@ config KXSD9
	  Say yes here to build support for the Kionix KXSD9 accelerometer.
	  Currently this only supports the device via an SPI interface.

config MMA8452
	tristate "Freescale MMA8452Q Accelerometer Driver"
	depends on I2C
	select IIO_BUFFER
	select IIO_TRIGGERED_BUFFER
	help
	  Say yes here to build support for the Freescale MMA8452Q 3-axis
	  accelerometer.

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

endmenu
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
obj-$(CONFIG_BMA180) += bma180.o
obj-$(CONFIG_HID_SENSOR_ACCEL_3D) += hid-sensor-accel-3d.o
obj-$(CONFIG_KXSD9)	+= kxsd9.o
obj-$(CONFIG_MMA8452)	+= mma8452.o

obj-$(CONFIG_IIO_ST_ACCEL_3AXIS) += st_accel.o
st_accel-y := st_accel_core.o
Loading