arm64: dts: qcom: msm8916-longcheer-l8910: Add imu/magnetometer
authorJonathan Albrieux <jonathan.albrieux@gmail.com>
Mon, 25 Jan 2021 09:44:32 +0000 (10:44 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 2 Feb 2021 22:31:37 +0000 (16:31 -0600)
BQ Aquaris X5 (Longcheer L8910) has:
 - BMI160 accelerometer and gyroscope sensor
 - AK09911 magnetometer sensor
Add them to the device tree.

This patch depends on patch "arm64: dts: qcom: msm8916: Add blsp_i2c3".

Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Link: https://lore.kernel.org/r/20210125094435.7528-4-jonathan.albrieux@gmail.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts

index 7d5eff9..2784518 100644 (file)
        };
 };
 
+&blsp_i2c3 {
+       status = "okay";
+
+       magnetometer@d {
+               compatible = "asahi-kasei,ak09911";
+               reg = <0x0d>;
+
+               vdd-supply = <&pm8916_l17>;
+               vid-supply = <&pm8916_l6>;
+
+               reset-gpios = <&msmgpio 111 GPIO_ACTIVE_LOW>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&mag_reset_default>;
+       };
+
+       imu@68 {
+               compatible = "bosch,bmi160";
+               reg = <0x68>;
+
+               vdd-supply = <&pm8916_l17>;
+               vddio-supply = <&pm8916_l6>;
+
+               mount-matrix = "0", "1", "0",
+                             "-1", "0", "0",
+                              "0", "0", "1";
+       };
+};
+
 &blsp1_uart2 {
        status = "okay";
 };
                bias-pull-up;
        };
 
+       mag_reset_default: mag-reset-default {
+               pins = "gpio111";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-disable;
+       };
+
        usb_id_default: usb-id-default {
                pins = "gpio110";
                function = "gpio";