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

Commit bf9cf46a authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Documentation: DT: Add IAM20680 & SMI130 IMU DT Bindings"

parents 55bef082 5112941b
Loading
Loading
Loading
Loading
+83 −0
Original line number Diff line number Diff line
The IAM20680 sensor is 6-axis gyroscope+accelerometer combo
device which is made by InvenSense Inc.

Required properties:

 - compatible   : Should be "invn,iam20680".
 - reg          : the I2C address which depends on the AD0 pin.
 - gpios        : INVENSENSE GPIO in the format described by ../gpio/gpio.txt

Optional properties:
 - inven,vdd_ana-supply :
 - inven,vcc_i2c-supply :
 - inven,gpio_int1 :
 - axis_map_x :
 - axis_map_y :
 - axis_map_z :
 - negate_x   :
 - negate_y   :
 - negate_z   :
 - fs_range :
 - poll_interval :
 - min_interval :
 - inven,secondary_reg :
 - inven,secondary_type :
 - inven,secondary_name :
 - inven,secondary_axis_map_x :
 - inven,secondary_axis_map_y :
 - inven,secondary_axis_map_z :
 - inven,secondary_negate_x :
 - inven,secondary_negate_y :
 - inven,secondary_negate_z :
 - inven,aux_type :
 - inven,aux_name :
 - inven,aux_reg :
 - inven,read_only_slave_type :
 - inven,read_only_slave_name :
 - inven,read_only_slave_reg :

Example:
	iam20680@69 {
		compatible = "inven,iam20680";
		reg = <0x69>;
		pinctrl-names = "default";
		pinctrl-0 = <&int1_default>;
		interrupt-parent = <&tlmm_pinmux>;
		interrupts = <78 IRQ_TYPE_EDGE_RISING>;
		inven,vdd_ana-supply = <&pm8941_l17>;
		inven,vcc_i2c-supply = <&pm8941_lvs1>;
		inven,gpio_int1 = <&msmgpio 73 0x00>;
		axis_map_x = <1>;
		axis_map_y = <0>;
		axis_map_z = <2>;
		negate_x = <1>;
		negate_y = <0>;
		negate_z = <0>;
		fs_range = <0x00>;
		poll_interval = <200>;
		min_interval = <5>;
		inven,secondary_reg = <0x0c>;
		/* If no compass sensor,
		 * replace "compass" with "none"
		 */
		inven,secondary_type = "compass";
		inven,secondary_name = "ak09911";
		inven,secondary_axis_map_x = <1>;
		inven,secondary_axis_map_y = <0>;
		inven,secondary_axis_map_z = <2>;
		inven,secondary_negate_x = <1>;
		inven,secondary_negate_y = <1>;
		inven,secondary_negate_z = <1>;
		/* If no pressure sensor,
		 * replace "pressure" with "none"
		 */
		inven,aux_type = "pressure";
		inven,aux_name = "bmp280";
		inven,aux_reg = <0x76>;
		/* If no ALS sensor
		 * replace "als" with "none"
		 */
		inven,read_only_slave_type = "als";
		inven,read_only_slave_name = "apds9930";
		inven,read_only_slave_reg = <0x39>;
	};
+56 −0
Original line number Diff line number Diff line
The SMI130 is a highly integrated, low power inertial measurement unit (IMU)
that provides precise acceleration and angular rate (gyroscopic) measurement.

To enable driver probing, add the smi130_gyro and smi130_acc node to the platform
device tree as described below.

Required properties:

- compatible: "smi130_gyro", "smi130_acc"
- reg: the I2C address or SPI chip select the device will respond to
- interrupt-parent: phandle to the parent interrupt controller as documented in [interrupts][4]
- interrupts: interrupt mapping for IRQ as documented in [interrupts][4]

Recommended properties for SPI bus usage:
- spi-max-frequency: maximum SPI bus frequency as documented in [SPI][3]

Optional properties:
- smi130_gyro,gpio_irq: MEMS sensor interrupt line to use (default 1)

I2C example (based on Raspberry PI 3):

        &i2c0 {
                status = "ok";
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                smi130_gyro@68 {
                        compatible = "smi130_gyro";
                        reg = <0x68>;
                        interrupt-parent = <&gpio>;
                        interrupts = <26 IRQ_TYPE_EDGE_RISING>;
                };
                smi130_acc@18 {
                        compatible = "smi130_acc";
                        reg = <0x18>;
                        interrupt-parent = <&gpio>;
                        interrupts = <25 IRQ_TYPE_EDGE_RISING>;
                };

SPI example (based on Raspberry PI 3):

        &spi0 {
                status = "ok";
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                smi130_gyro@68 {
                        compatible = "smi130_gyro";
                        reg = <0x68>;
                        interrupt-parent = <&gpio>;
                        interrupts = <26 IRQ_TYPE_EDGE_RISING>;
                };
                smi130_acc@18 {
                        compatible = "smi130_acc";
                        reg = <0x18>;
                        interrupt-parent = <&gpio>;
                        interrupts = <25 IRQ_TYPE_EDGE_RISING>;
                };
+1 −0
Original line number Diff line number Diff line
@@ -390,3 +390,4 @@ zidoo Shenzhen Zidoo Technology Co., Ltd.
zii	Zodiac Inflight Innovations
zte	ZTE Corp.
zyxel	ZyXEL Communications Corp.
inven   InvenSense, Inc.
+13 −0
Original line number Diff line number Diff line
@@ -230,6 +230,13 @@ CONFIG_INPUT_MISC=y
CONFIG_INPUT_QPNP_POWER_ON=y
CONFIG_INPUT_UINPUT=y
CONFIG_INPUT_GPIO=m
CONFIG_SMI130=y
CONFIG_BOSCH_DRIVER_LOG_FUNC=y
CONFIG_SENSORS_SMI_ACC2X2=y
CONFIG_SENSORS_SMI_ACC2X2_ENABLE_INT2=y
CONFIG_SENSORS_SMI_GYRO=y
CONFIG_SENSORS_SMI_GYRO_FIFO=y
CONFIG_ENABLE_SMI_ACC_GYRO_BUFFERING=y
CONFIG_SERIO_LIBPS2=y
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_MSM=y
@@ -423,6 +430,12 @@ CONFIG_QCOM_DEVFREQ_DEVBW=y
CONFIG_EXTCON_QCOM_SPMI_MISC=y
CONFIG_IIO=y
CONFIG_QCOM_SPMI_ADC5=y
CONFIG_INV_MPU_IIO_IAM20680=y
CONFIG_INV_MPU_IIO_I2C=y
CONFIG_INV_MPU_IIO_SPI=y
CONFIG_ENABLE_IAM_ACC_GYRO_BUFFERING=y
CONFIG_IIO_ST_ASM330LHH=y
CONFIG_ENABLE_ASM_ACC_GYRO_BUFFERING=y
CONFIG_PWM=y
CONFIG_QCOM_SHOW_RESUME_IRQ=y
CONFIG_ANDROID=y
+13 −0
Original line number Diff line number Diff line
@@ -229,6 +229,13 @@ CONFIG_INPUT_MISC=y
CONFIG_INPUT_QPNP_POWER_ON=y
CONFIG_INPUT_UINPUT=y
CONFIG_INPUT_GPIO=m
CONFIG_SMI130=y
CONFIG_BOSCH_DRIVER_LOG_FUNC=y
CONFIG_SENSORS_SMI_ACC2X2=y
CONFIG_SENSORS_SMI_ACC2X2_ENABLE_INT2=y
CONFIG_SENSORS_SMI_GYRO=y
CONFIG_SENSORS_SMI_GYRO_FIFO=y
CONFIG_ENABLE_SMI_ACC_GYRO_BUFFERING=y
CONFIG_SERIO_LIBPS2=y
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_MSM=y
@@ -428,6 +435,12 @@ CONFIG_QCOM_DEVFREQ_DEVBW=y
CONFIG_EXTCON_QCOM_SPMI_MISC=y
CONFIG_IIO=y
CONFIG_QCOM_SPMI_ADC5=y
CONFIG_INV_MPU_IIO_IAM20680=y
CONFIG_INV_MPU_IIO_I2C=y
CONFIG_INV_MPU_IIO_SPI=y
CONFIG_ENABLE_IAM_ACC_GYRO_BUFFERING=y
CONFIG_IIO_ST_ASM330LHH=y
CONFIG_ENABLE_ASM_ACC_GYRO_BUFFERING=y
CONFIG_PWM=y
CONFIG_QCOM_SHOW_RESUME_IRQ=y
CONFIG_ANDROID=y
Loading