]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: qcom: msm8916-samsung-fortuna: Add LSM303C accelerometer/magnetometer
authorSiddharth Manthan <siddharth.manthan@gmail.com>
Sat, 6 Apr 2024 11:14:45 +0000 (11:14 +0000)
committerBjorn Andersson <andersson@kernel.org>
Tue, 28 May 2024 15:15:07 +0000 (10:15 -0500)
Some Grand Prime use a ST LSM303C accelerometer/magnetometer combo.
Add support for it.

Signed-off-by: Siddharth Manthan <siddharth.manthan@gmail.com>
[Stephan: Move sensors to common dtsi (disabled by default)]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
[Raymond: Use interrupts-extended]
Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Link: https://lore.kernel.org/r/20240406111348.14358-3-raymondhackley@protonmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts
arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi

index 366914be7d5333f96a302993e72f40b27062eea2..e7f6df229f9abf2bb1e9f94c0211db82424262cf 100644 (file)
@@ -9,3 +9,11 @@
        compatible = "samsung,fortuna3g", "qcom,msm8916";
        chassis-type = "handset";
 };
+
+&st_accel {
+       status = "okay";
+};
+
+&st_magn {
+       status = "okay";
+};
index fa6bfce6d1833ad9abe7a0474aba70c20b308011..4f05cae68b37e03f07379658d6135d4ad955a836 100644 (file)
 
                status = "disabled";
        };
+
+       st_accel: accelerometer@1d {
+               compatible = "st,lsm303c-accel";
+               reg = <0x1d>;
+               interrupts-extended = <&tlmm 115 IRQ_TYPE_LEVEL_HIGH>;
+
+               vdd-supply = <&pm8916_l17>;
+               vddio-supply = <&pm8916_l5>;
+
+               pinctrl-0 = <&accel_int_default>;
+               pinctrl-names = "default";
+
+               st,drdy-int-pin = <1>;
+               mount-matrix = "0", "-1",  "0",
+                              "1",  "0",  "0",
+                              "0",  "0", "-1";
+
+               status = "disabled";
+       };
+
+       st_magn: magnetometer@1e {
+               compatible = "st,lsm303c-magn";
+               reg = <0x1e>;
+
+               vdd-supply = <&pm8916_l17>;
+               vddio-supply = <&pm8916_l5>;
+
+               mount-matrix = "0", "-1",  "0",
+                              "1",  "0",  "0",
+                              "0",  "0", "-1";
+
+               status = "disabled";
+       };
 };
 
 &blsp_i2c4 {