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

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

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

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

Jonathan writes:

Second round of IIO new drivers, functionality and cleanups for the 3.20 cycle.

New drivers and device support:
* Capella cm3232 ambient light sensor driver.
* Freescale MMA9553 pedometer and activity monitor. Note this involved a
  refactor of the mma9551 driver to pull out shared elements.
* Samsung sensor hub (as used in the galaxy gear 2 watch) Core support
  and initial drivers (gyro and accelerometer) more to follow.
  An additional fix was applied on top of this for a build issue
  thrown up by the autobuilders on some platforms.
* Cosmic Circuits 10001 ADC driver
* Qualcomm SPMI PMIC voltage ADC driver (current adc merged a while back).
* Add binding for AK8963 (in capitals) as unfortunately there are bios'
  out there not using lower case.

New functionality
* Add newe operating mode to the core to allow for non triggered software
  buffers.  This is mostly semantics as previously drivers just claimed they
  had a hardware buffer (when they didn't).
* Add distance channel type.
* Add energy channel type.
* Add velocity channel type and IIO_MOD_ROOT_SUM_SQUARED (i.e. speed when
  our channel type is velocity).
* Add _debounce_count and _debounce_time filter attributes.  Only really
  make sense for counting types of measurements.  First use is for avoiding
  miss detection of steps prior to walking.
* Add change event type.   This replaces the briefly present INSTANCE type
  (which hadn't gained any users).  It is more generic as it allows for
  events say every 10 steps rather than every step.
* Add _calibweight attributes to the ABI (and core support).  Used by
  activity monitors to estimate energy use.  Can imagine there will be
  other uses for this one.

Driver new functionality
* mma9551 gains runtime pm support.
* hid-sensors gain PM support.

Cleanup
* Change calibheight unit to m from cm.  As there are no prior users
  and this was inconsistent with other distance units, it makes sense
  to fix it before hte mma9553 driver which uses it.
* mpu6050 cleanups and devm_ use.
* as3935 switch over to PM ops.
* Fix a few format strings for signed vs unsigned.
* Fix tcs3414 missindentation
* Typo in industrialio-event
* Stop requiring IIO_TRIGGER for IIO_KFIFO_BUF as we have drivers that don't
  need it. No one is quite sure why that dependency was there and it
  seems to not matter.
parents 71e365ed 67460e8c
Loading
Loading
Loading
Loading
+114 −9
Original line number Diff line number Diff line
@@ -282,6 +282,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_current_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_accel_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_accel_peak_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_energy_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_distance_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_magn_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_magn_x_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_magn_y_scale
@@ -293,6 +295,7 @@ What: /sys/bus/iio/devices/iio:deviceX/in_rot_from_north_true_tilt_comp_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_pressureY_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_pressure_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_humidityrelative_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_velocity_sqrt(x^2+y^2+z^2)_scale
KernelVersion:	2.6.35
Contact:	linux-iio@vger.kernel.org
Description:
@@ -340,14 +343,44 @@ Description:
		production inaccuracies).  If shared across all channels,
		<type>_calibscale is used.

What:		/sys/bus/iio/devices/iio:deviceX/in_steps_calibheight
What:		/sys/bus/iio/devices/iio:deviceX/in_activity_calibgender
What:		/sys/bus/iio/devices/iio:deviceX/in_energy_calibgender
What:		/sys/bus/iio/devices/iio:deviceX/in_distance_calibgender
What:		/sys/bus/iio/devices/iio:deviceX/in_velocity_calibgender
KernelVersion:	3.20
Contact:	linux-iio@vger.kernel.org
Description:
		Gender of the user (e.g.: male, female) used by some pedometers
		to compute the stride length, distance, speed and activity
		type.

What:		/sys/bus/iio/devices/iio:deviceX/in_activity_calibgender_available
What:		/sys/bus/iio/devices/iio:deviceX/in_energy_calibgender_available
What:		/sys/bus/iio/devices/iio:deviceX/in_distance_calibgender_available
What:		/sys/bus/iio/devices/iio:deviceX/in_velocity_calibgender_available
KernelVersion:	3.20
Contact:	linux-iio@vger.kernel.org
Description:
		Lists all available gender values (e.g.: male, female).

What:		/sys/bus/iio/devices/iio:deviceX/in_activity_calibheight
What:		/sys/bus/iio/devices/iio:deviceX/in_energy_calibheight
What:		/sys/bus/iio/devices/iio:deviceX/in_distance_calibheight
What:		/sys/bus/iio/devices/iio:deviceX/in_velocity_calibheight
KernelVersion:	3.19
Contact:	linux-iio@vger.kernel.org
Description:
		Height of the user (in centimeters) used by some pedometers
		Height of the user (in meters) used by some pedometers
		to compute the stride length, distance, speed and activity
		type.

What:		/sys/bus/iio/devices/iio:deviceX/in_energy_calibweight
KernelVersion:	3.20
Contact:	linux-iio@vger.kernel.org
Description:
		Weight of the user (in kg). It is needed by some pedometers
		to compute the calories burnt by the user.

What:		/sys/bus/iio/devices/iio:deviceX/in_accel_scale_available
What:		/sys/.../iio:deviceX/in_voltageX_scale_available
What:		/sys/.../iio:deviceX/in_voltage-voltage_scale_available
@@ -808,6 +841,14 @@ What: /sys/.../events/in_tempY_roc_falling_period
What:		/sys/.../events/in_accel_x&y&z_mag_falling_period
What:		/sys/.../events/in_intensity0_thresh_period
What:		/sys/.../events/in_proximity0_thresh_period
What:		/sys/.../events/in_activity_still_thresh_rising_period
What:		/sys/.../events/in_activity_still_thresh_falling_period
What:		/sys/.../events/in_activity_walking_thresh_rising_period
What:		/sys/.../events/in_activity_walking_thresh_falling_period
What:		/sys/.../events/in_activity_jogging_thresh_rising_period
What:		/sys/.../events/in_activity_jogging_thresh_falling_period
What:		/sys/.../events/in_activity_running_thresh_rising_period
What:		/sys/.../events/in_activity_running_thresh_falling_period
KernelVersion:	2.6.37
Contact:	linux-iio@vger.kernel.org
Description:
@@ -881,12 +922,24 @@ Description:
		number or direction is not specified, applies to all channels of
		this type.

What:		/sys/.../events/in_steps_instance_en
KernelVersion:	3.19
What:		/sys/.../events/in_steps_change_en
KernelVersion:	3.20
Contact:	linux-iio@vger.kernel.org
Description:
		Enables or disables step detection. Each time the user takes a step an
		event of this type will be generated.
		Event generated when channel passes a threshold on the absolute
		change in value. E.g. for steps: a step change event is
		generated each time the user takes N steps, where N is set using
		in_steps_change_value.

What:		/sys/.../events/in_steps_change_value
KernelVersion:	3.20
Contact:	linux-iio@vger.kernel.org
Description:
		Specifies the value of change threshold that the
		device is comparing against for the events enabled by
		<type>[Y][_name]_roc[_rising|falling|]_en. E.g. for steps:
		if set to 3, a step change event will be generated every 3
		steps.

What:		/sys/bus/iio/devices/iio:deviceX/trigger/current_trigger
KernelVersion:	2.6.35
@@ -1049,6 +1102,24 @@ Description:
		For a list of available output power modes read
		in_accel_power_mode_available.

What:		/sys/.../iio:deviceX/in_energy_input
What:		/sys/.../iio:deviceX/in_energy_raw
KernelVersion:	3.20
Contact:	linux-iio@vger.kernel.org
Description:
		This attribute is used to read the energy value reported by the
		device (e.g.: human activity sensors report energy burnt by the
		user). Units after application of scale are Joules.

What:		/sys/.../iio:deviceX/in_distance_input
What:		/sys/.../iio:deviceX/in_distance_raw
KernelVersion:	3.20
Contact:	linux-iio@vger.kernel.org
Description:
		This attribute is used to read the distance covered by the user
		since the last reboot while activated. Units after application
		of scale are meters.

What:		/sys/bus/iio/devices/iio:deviceX/store_eeprom
KernelVersion:	3.4.0
Contact:	linux-iio@vger.kernel.org
@@ -1102,6 +1173,12 @@ Description:
		This attribute is used to get/set the integration time in
		seconds.

What:		/sys/.../iio:deviceX/in_velocity_sqrt(x^2+y^2+z^2)_integration_time
KernelVersion:	3.20
Contact:	linux-iio@vger.kernel.org
Description:
		Number of seconds in which to compute speed.

What:		/sys/bus/iio/devices/iio:deviceX/in_rot_quaternion_raw
KernelVersion:	3.15
Contact:	linux-iio@vger.kernel.org
@@ -1130,13 +1207,17 @@ Description:
		present, output should be considered as processed with the
		unit in milliamps.

What:		/sys/.../iio:deviceX/in_energy_en
What:		/sys/.../iio:deviceX/in_distance_en
What:		/sys/.../iio:deviceX/in_velocity_sqrt(x^2+y^2+z^2)_en
What:		/sys/.../iio:deviceX/in_steps_en
KernelVersion:	3.19
Contact:	linux-iio@vger.kernel.org
Description:
		Activates the step counter. After activation, the number of steps
		taken by the user will be counted in hardware and exported through
		in_steps_input.
		Activates a device feature that runs in firmware/hardware.
		E.g. for steps: the pedometer saves power while not used;
		when activated, it will count the steps taken by the user in
		firmware and export them through in_steps_input.

What:		/sys/.../iio:deviceX/in_steps_input
KernelVersion:	3.19
@@ -1144,3 +1225,27 @@ Contact: linux-iio@vger.kernel.org
Description:
		This attribute is used to read the number of steps taken by the user
		since the last reboot while activated.

What:		/sys/.../iio:deviceX/in_velocity_sqrt(x^2+y^2+z^2)_input
What:		/sys/.../iio:deviceX/in_velocity_sqrt(x^2+y^2+z^2)_raw
KernelVersion:	3.19
Contact:	linux-iio@vger.kernel.org
Description:
		This attribute is used to read the current speed value of the
		user (which is the norm or magnitude of the velocity vector).
		Units after application of scale are m/s.

What:		/sys/.../iio:deviceX/in_steps_debounce_count
KernelVersion:	3.20
Contact:	linux-iio@vger.kernel.org
Description:
		Specifies the number of steps that must occur within
		in_steps_filter_debounce_time for the pedometer to decide the
		consumer is making steps.

What:		/sys/.../iio:deviceX/in_steps_debounce_time
KernelVersion:	3.20
Contact:	linux-iio@vger.kernel.org
Description:
		Specifies number of seconds in which we compute the steps
		that occur in order to decide if the consumer is making steps.
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ atmel,24c512 i2c serial eeprom (24cxx)
atmel,24c1024		i2c serial eeprom  (24cxx)
atmel,at97sc3204t	i2c trusted platform module (TPM)
capella,cm32181		CM32181: Ambient Light Sensor
capella,cm3232		CM3232: Ambient Light Sensor
catalyst,24c32		i2c serial eeprom
cirrus,cs42l51		Cirrus Logic CS42L51 audio codec
dallas,ds1307		64 x 8, Serial, I2C Real-Time Clock
+22 −0
Original line number Diff line number Diff line
* Cosmic Circuits - Analog to Digital Converter (CC-10001-ADC)

Required properties:
  - compatible: Should be "cosmic,10001-adc"
  - reg: Should contain adc registers location and length.
  - clock-names: Should contain "adc".
  - clocks: Should contain a clock specifier for each entry in clock-names
  - vref-supply: The regulator supply ADC reference voltage.

Optional properties:
  - adc-reserved-channels: Bitmask of reserved channels,
    i.e. channels that cannot be used by the OS.

Example:
adc: adc@18101600 {
	compatible = "cosmic,10001-adc";
	reg = <0x18101600 0x24>;
	adc-reserved-channels = <0x2>;
	clocks = <&adc_clk>;
	clock-names = "adc";
	vref-supply = <&reg_1v8>;
};
+129 −0
Original line number Diff line number Diff line
Qualcomm's SPMI PMIC voltage ADC

SPMI PMIC voltage ADC (VADC) provides interface to clients to read
voltage. The VADC is a 15-bit sigma-delta ADC.

VADC node:

- compatible:
    Usage: required
    Value type: <string>
    Definition: Should contain "qcom,spmi-vadc".

- reg:
    Usage: required
    Value type: <prop-encoded-array>
    Definition: VADC base address and length in the SPMI PMIC register map.

- #address-cells:
    Usage: required
    Value type: <u32>
    Definition: Must be one. Child node 'reg' property should define ADC
            channel number.

- #size-cells:
    Usage: required
    Value type: <u32>
    Definition: Must be zero.

- #io-channel-cells:
    Usage: required
    Value type: <u32>
    Definition: Must be one. For details about IIO bindings see:
            Documentation/devicetree/bindings/iio/iio-bindings.txt

- interrupts:
    Usage: optional
    Value type: <prop-encoded-array>
    Definition: End of conversion interrupt.

Channel node properties:

- reg:
    Usage: required
    Value type: <u32>
    Definition: ADC channel number.
            See include/dt-bindings/iio/qcom,spmi-vadc.h

- qcom,decimation:
    Usage: optional
    Value type: <u32>
    Definition: This parameter is used to decrease ADC sampling rate.
            Quicker measurements can be made by reducing decimation ratio.
            Valid values are 512, 1024, 2048, 4096.
            If property is not found, default value of 512 will be used.

- qcom,pre-scaling:
    Usage: optional
    Value type: <u32 array>
    Definition: Used for scaling the channel input signal before the signal is
            fed to VADC. The configuration for this node is to know the
            pre-determined ratio and use it for post scaling. Select one from
            the following options.
            <1 1>, <1 3>, <1 4>, <1 6>, <1 20>, <1 8>, <10 81>, <1 10>
            If property is not found default value depending on chip will be used.

- qcom,ratiometric:
    Usage: optional
    Value type: <empty>
    Definition: Channel calibration type. If this property is specified
            VADC will use the VDD reference (1.8V) and GND for channel
            calibration. If property is not found, channel will be
            calibrated with 0.625V and 1.25V reference channels, also
            known as absolute calibration.

- qcom,hw-settle-time:
    Usage: optional
    Value type: <u32>
    Definition: Time between AMUX getting configured and the ADC starting
            conversion. Delay = 100us * (value) for value < 11, and
            2ms * (value - 10) otherwise.
            Valid values are: 0, 100, 200, 300, 400, 500, 600, 700, 800,
            900 us and 1, 2, 4, 6, 8, 10 ms
            If property is not found, channel will use 0us.

- qcom,avg-samples:
    Usage: optional
    Value type: <u32>
    Definition: Number of samples to be used for measurement.
            Averaging provides the option to obtain a single measurement
            from the ADC that is an average of multiple samples. The value
            selected is 2^(value).
            Valid values are: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512
            If property is not found, 1 sample will be used.

NOTE:

Following channels, also known as reference point channels, are used for
result calibration and their channel configuration nodes should be defined:
VADC_REF_625MV and/or VADC_SPARE1(based on PMIC version) VADC_REF_1250MV,
VADC_GND_REF and VADC_VDD_VADC.

Example:

	/* VADC node */
	pmic_vadc: vadc@3100 {
		compatible = "qcom,spmi-vadc";
		reg = <0x3100 0x100>;
		interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
		#address-cells = <1>;
		#size-cells = <0>;
		#io-channel-cells = <1>;
		io-channel-ranges;

		/* Channel node */
		usb_id_nopull {
			reg = <VADC_LR_MUX10_USB_ID>;
			qcom,decimation = <512>;
			qcom,ratiometric;
			qcom,hw-settle-time = <200>;
			qcom,avg-samples = <1>;
			qcom,pre-scaling = <1 3>;
		};
	};

	/* IIO client node */
	usb {
		io-channels = <&pmic_vadc VADC_LR_MUX10_USB_ID>;
		io-channel-names = "vadc";
	};
+25 −0
Original line number Diff line number Diff line
Samsung Sensorhub driver

Sensorhub is a MCU which manages several sensors and also plays the role
of a virtual sensor device.

Required properties:
- compatible: "samsung,sensorhub-rinato" or "samsung,sensorhub-thermostat"
- spi-max-frequency: max SPI clock frequency
- interrupt-parent: interrupt parent
- interrupts: communication interrupt
- ap-mcu-gpios: [out] ap to sensorhub line - used during communication
- mcu-ap-gpios: [in] sensorhub to ap - used during communication
- mcu-reset-gpios: [out] sensorhub reset

Example:

	shub_spi: shub {
		compatible = "samsung,sensorhub-rinato";
		spi-max-frequency = <5000000>;
		interrupt-parent = <&gpx0>;
		interrupts = <2 0>;
		ap-mcu-gpios = <&gpx0 0 0>;
		mcu-ap-gpios = <&gpx0 4 0>;
		mcu-reset-gpios = <&gpx0 5 0>;
	};
Loading