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

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

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

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

Jonathan writes:

2nd set of new device support, features and cleanup for IIO in the 4.7 cycle.

Bit of a bumper set for new drivers but plenty of other stuff here as well!

New device support
* ad5592R ADC/DAC
  - new driver supporting ad5592r and ad5593r combined ADC/DAC and gpio chips.
* Aosong am2315 relative humidity
  - new driver with triggered buffer support in follow up patch.
* bmi160 imu
  - new driver
* bmp280
  - bmp180 support - note there is support in the misc/bmp085 driver. Intent
    is to remove that driver long term.
* invensense mpu6050
  - cleanup leading to explicit support of mpu9150 with a good few cleanups
    along the way.
* Hope RF hp03 pressure and temperature sensor.
  - new driver
* maxim DS1803 potentiometer
  - new driver
* maxim max44000 light and proximity sensor
  - new driver built in a series of steps to support pretty much everything.
* ROHM BH1780 light sensor
  - new driver. There is an existing driver in misc that this is pretty much
    intended to replace.  The discussion on whether to support the non standard
    interface of that driver is some way is continuing.
* st-gyro
  - lsm9ds0-gyro.  The accel/magn side of this will take a while longer as
    extensions to the st library are needed for cases where two types of sensor
    share a single i2c address.
* ti-adc081c
  - support the adc101c and adc121c
* Vishay VEML6070 UV sensor
  - new driver.

New features
* core
  - devm_ APIs for channel_get and channel_get_all.  The first user of these
    is the generic ADC based thermal driver.  As it is going through the
    thermal tree these will be picked up as a patch to that next cycle as that
    is how the author preferred to do it.
  - mounting matrix support.  This new core support allows devices to provide
    to userspace (typically from the device tree) allowing compensation for how
    the sensor is mounted on the device.  First examples are on UAVs but it
    has a more mundane use on typical phone where the chip may be on the front
    or the back of the circuit board and soldered at any angle. Includes
    support for this ABI in ak8975 (which has an older interface, now
    deprecated) and mpu6050.
* tools
  - add a -a option to enable all available channels in generic_buffer sample.
    Makes it somewhat easier to use.
* adis library and drivers
  - support manual self test flag clearing.  This has technically been broken
    for a very long time - result is an offset on readings as the applied field
    is on all the time.
* ak8975
  - triggered buffer support
* bmc150
  - spi support (including splitting the driver into core and i2c parts)
* bmp280
  - oversampling support.
* dht11
  - improved logging - useful to debug timing issues on this quirky device.
* st-sensors
  - read each channel invidivually as not all support the optimization of
  reading in bulk.  This is technically a fix, but will need to be backported
  if desired.
  - support open drain and shared interrupts.
* ti-adc081c
  - triggered buffer support.

Cleanups
* inkern
  - white space fix.
* ad7606
  - use the iio_device_claim_direct_mode call rather than open coding equiv.
* ad799x
  - white space fix.
* ad9523
  - unsigned -> unsigned int
* apds9660
  - brace location tidying up.
  - silence an uninitialized variable warning.
* ak8975
  - else and brace on same line fix.
* at91_adc
  - white space fixes.
* bmc150
  - use regmap stored copy of the device pointer rather than having an
    additional copy.
* bmg160
  - use regmap stored copy of the device pointer rather than having an
    additional copy.
* hid-sensors
  - white space fixes.
* mcp3422
  - white space fix.
* mma7455
  - use regmap to retrieve the device struct rather than carrying another copy
    in the private data.
* ms_sensors
  - white space fix.
* mxs-lradc
  - move current bindings out of staging - some will be shortly deprecated but
    the reality is that we have device trees out there using them so they will
    need to be supported for some time.  They accidentally got left behind
    when the driver graduated from staging.
  - white space cleanup.
  - set INPUT_PROP_DIRECT.
  - move ts config into a better function.
  - move the STMP reset out of the ADC init.
* vf610_adc
  - case label indenting fix.
parents 4145ba76 fbced0e9
Loading
Loading
Loading
Loading
+53 −0
Original line number Diff line number Diff line
@@ -1512,3 +1512,56 @@ Contact: linux-iio@vger.kernel.org
Description:
		Raw (unscaled no offset etc.) pH reading of a substance as a negative
		base-10 logarithm of hydrodium ions in a litre of water.

What:           /sys/bus/iio/devices/iio:deviceX/mount_matrix
What:           /sys/bus/iio/devices/iio:deviceX/in_mount_matrix
What:           /sys/bus/iio/devices/iio:deviceX/out_mount_matrix
What:           /sys/bus/iio/devices/iio:deviceX/in_anglvel_mount_matrix
What:           /sys/bus/iio/devices/iio:deviceX/in_accel_mount_matrix
KernelVersion:  4.6
Contact:        linux-iio@vger.kernel.org
Description:
		Mounting matrix for IIO sensors. This is a rotation matrix which
		informs userspace about sensor chip's placement relative to the
		main hardware it is mounted on.
		Main hardware placement is defined according to the local
		reference frame related to the physical quantity the sensor
		measures.
		Given that the rotation matrix is defined in a board specific
		way (platform data and / or device-tree), the main hardware
		reference frame definition is left to the implementor's choice
		(see below for a magnetometer example).
		Applications should apply this rotation matrix to samples so
		that when main hardware reference frame is aligned onto local
		reference frame, then sensor chip reference frame is also
		perfectly aligned with it.
		Matrix is a 3x3 unitary matrix and typically looks like
		[0, 1, 0; 1, 0, 0; 0, 0, -1]. Identity matrix
		[1, 0, 0; 0, 1, 0; 0, 0, 1] means sensor chip and main hardware
		are perfectly aligned with each other.

		For example, a mounting matrix for a magnetometer sensor informs
		userspace about sensor chip's ORIENTATION relative to the main
		hardware.
		More specifically, main hardware orientation is defined with
		respect to the LOCAL EARTH GEOMAGNETIC REFERENCE FRAME where :
		* Y is in the ground plane and positive towards magnetic North ;
		* X is in the ground plane, perpendicular to the North axis and
		  positive towards the East ;
		* Z is perpendicular to the ground plane and positive upwards.

		An implementor might consider that for a hand-held device, a
		'natural' orientation would be 'front facing camera at the top'.
		The main hardware reference frame could then be described as :
		* Y is in the plane of the screen and is positive towards the
		  top of the screen ;
		* X is in the plane of the screen, perpendicular to Y axis, and
		  positive towards the right hand side of the screen ;
		* Z is perpendicular to the screen plane and positive out of the
		  screen.
		Another example for a quadrotor UAV might be :
		* Y is in the plane of the propellers and positive towards the
		  front-view camera;
		* X is in the plane of the propellers, perpendicular to Y axis,
		  and positive towards the starboard side of the UAV ;
		* Z is perpendicular to propellers plane and positive upwards.
+155 −0
Original line number Diff line number Diff line
Analog Devices AD5592R/AD5593R DAC/ADC device driver

Required properties for the AD5592R:
	- compatible: Must be "adi,ad5592r"
	- reg: SPI chip select number for the device
	- spi-max-frequency: Max SPI frequency to use (< 30000000)
	- spi-cpol: The AD5592R requires inverse clock polarity (CPOL) mode

Required properties for the AD5593R:
	- compatible: Must be "adi,ad5593r"
	- reg: I2C address of the device

Required properties for all supported chips:
	- #address-cells: Should be 1.
	- #size-cells: Should be 0.
	- channel nodes:
	  Each child node represents one channel and has the following
	  Required properties:
		* reg: Pin on which this channel is connected to.
		* adi,mode: Mode or function of this channel.
			    Macros specifying the valid values
			    can be found in <dt-bindings/iio/adi,ad5592r.h>.

			    The following values are currently supported:
				* CH_MODE_UNUSED (the pin is unused)
				* CH_MODE_ADC (the pin is ADC input)
				* CH_MODE_DAC (the pin is DAC output)
				* CH_MODE_DAC_AND_ADC (the pin is DAC output
					but can be monitored by an ADC, since
					there is no disadvantage this
					this should be considered as the
					preferred DAC mode)
				* CH_MODE_GPIO (the pin is registered
					with GPIOLIB)
	 Optional properties:
		* adi,off-state: State of this channel when unused or the
				 device gets removed. Macros specifying the
				 valid values can be found in
				 <dt-bindings/iio/adi,ad5592r.h>.

				* CH_OFFSTATE_PULLDOWN (the pin is pulled down)
				* CH_OFFSTATE_OUT_LOW  (the pin is output low)
				* CH_OFFSTATE_OUT_HIGH (the pin is output high)
				* CH_OFFSTATE_OUT_TRISTATE (the pin is
					tristated output)


Optional properties:
	- vref-supply: Phandle to the external reference voltage supply. This should
	  only be set if there is an external reference voltage connected to the VREF
	  pin. If the property is not set the internal 2.5V reference is used.
	- reset-gpios : GPIO spec for the RESET pin. If specified, it will be
	  asserted during driver probe.
	- gpio-controller: Marks the device node as a GPIO controller.
	- #gpio-cells: Should be 2. The first cell is the GPIO number and the second
	  cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.

AD5592R Example:

	#include <dt-bindings/iio/adi,ad5592r.h>

	vref: regulator-vref {
		compatible = "regulator-fixed";
		regulator-name = "vref-ad559x";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};

	ad5592r@0 {
		#size-cells = <0>;
		#address-cells = <1>;
		#gpio-cells = <2>;
		compatible = "adi,ad5592r";
		reg = <0>;

		spi-max-frequency = <1000000>;
		spi-cpol;

		vref-supply = <&vref>; /* optional */
		reset-gpios = <&gpio0 86 0>;  /* optional */
		gpio-controller;

		channel@0 {
			reg = <0>;
			adi,mode = <CH_MODE_DAC>;
		};
		channel@1 {
			reg = <1>;
			adi,mode = <CH_MODE_ADC>;
		};
		channel@2 {
			reg = <2>;
			adi,mode = <CH_MODE_DAC_AND_ADC>;
		};
		channel@3 {
			reg = <3>;
			adi,mode = <CH_MODE_DAC_AND_ADC>;
			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
		};
		channel@4 {
			reg = <4>;
			adi,mode = <CH_MODE_UNUSED>;
			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
		};
		channel@5 {
			reg = <5>;
			adi,mode = <CH_MODE_GPIO>;
			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
		};
		channel@6 {
			reg = <6>;
			adi,mode = <CH_MODE_GPIO>;
			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
		};
		channel@7 {
			reg = <7>;
			adi,mode = <CH_MODE_GPIO>;
			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
		};
	};

AD5593R Example:

	#include <dt-bindings/iio/adi,ad5592r.h>

	ad5593r@10 {
		#size-cells = <0>;
		#address-cells = <1>;
		#gpio-cells = <2>;
		compatible = "adi,ad5593r";
		reg = <0x10>;
		gpio-controller;

		channel@0 {
			reg = <0>;
			adi,mode = <CH_MODE_DAC>;
			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
		};
		channel@1 {
			reg = <1>;
			adi,mode = <CH_MODE_ADC>;
			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
		};
		channel@2 {
			reg = <2>;
			adi,mode = <CH_MODE_DAC_AND_ADC>;
			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
		};
		channel@6 {
			reg = <6>;
			adi,mode = <CH_MODE_GPIO>;
			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
		};
	};
+13 −0
Original line number Diff line number Diff line
@@ -8,10 +8,23 @@ Required properties:
 - interrupt-parent : should be the phandle for the interrupt controller
 - interrupts : interrupt mapping for GPIO IRQ

Optional properties:
 - mount-matrix: an optional 3x3 mounting rotation matrix


Example:
	mpu6050@68 {
		compatible = "invensense,mpu6050";
		reg = <0x68>;
		interrupt-parent = <&gpio1>;
		interrupts = <18 1>;
		mount-matrix = "-0.984807753012208",  /* x0 */
		               "0",                   /* y0 */
		               "-0.173648177666930",  /* z0 */
		               "0",                   /* x1 */
		               "-1",                  /* y1 */
		               "0",                   /* z1 */
		               "-0.173648177666930",  /* x2 */
		               "0",                   /* y2 */
		               "0.984807753012208";   /* z2 */
	};
+10 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ Optional properties:

  - gpios : should be device tree identifier of the magnetometer DRDY pin
  - vdd-supply: an optional regulator that needs to be on to provide VDD
  - mount-matrix: an optional 3x3 mounting rotation matrix

Example:

@@ -17,4 +18,13 @@ ak8975@0c {
        reg = <0x0c>;
        gpios = <&gpj0 7 0>;
        vdd-supply = <&ldo_3v3_gnss>;
        mount-matrix = "-0.984807753012208",  /* x0 */
                       "0",                   /* y0 */
                       "-0.173648177666930",  /* z0 */
                       "0",                   /* x1 */
                       "-1",                  /* y1 */
                       "0",                   /* z1 */
                       "-0.173648177666930",  /* x2 */
                       "0",                   /* y2 */
                       "0.984807753012208";   /* z2 */
};
Loading