diff mbox series

[6/7] arm64: dts: qcom: msm8916-samsung-fortuna: Add accelerometer/magnetometer

Message ID 20230622000418.48350-1-linmengbo0689@protonmail.com
State New
Headers show
Series arm64: dts: qcom: msm8916-samsung-fortuna: Add initial device trees | expand

Commit Message

Lin, Meng-Bo June 22, 2023, 12:05 a.m. UTC
From: Joe Mason <buddyjojo06@outlook.com>

gprimeltecan and grandprimelte use a Bosch BMC150, and fortuna3g has
ST LSM303C accelerometer/magnetometer combo.
fortunaltezt and rossa have only ST LIS2HH12 accelerometer.

Add support for them.

Signed-off-by: Joe Mason <buddyjojo06@outlook.com>
[Add LSM303C]
Signed-off-by: Siddharth Manthan <siddharth.manthan@gmail.com>
[Move sensors to fortuna.dtsi. Disable them by default]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
[Enable on grandprimelte. Add LIS2HH12]
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
---
 .../dts/qcom/msm8216-samsung-fortuna3g.dts    |  8 ++
 .../qcom/msm8916-samsung-fortuna-common.dtsi  | 80 +++++++++++++++++++
 .../dts/qcom/msm8916-samsung-fortunaltezt.dts |  8 ++
 .../dts/qcom/msm8916-samsung-gprimeltecan.dts |  8 ++
 .../qcom/msm8916-samsung-grandprimelte.dts    |  8 ++
 .../qcom/msm8916-samsung-rossa-common.dtsi    |  8 ++
 6 files changed, 120 insertions(+)

Comments

Krzysztof Kozlowski June 22, 2023, 3:17 p.m. UTC | #1
On 22/06/2023 02:05, Lin, Meng-Bo wrote:
> From: Joe Mason <buddyjojo06@outlook.com>
> 
> gprimeltecan and grandprimelte use a Bosch BMC150, and fortuna3g has
> ST LSM303C accelerometer/magnetometer combo.
> fortunaltezt and rossa have only ST LIS2HH12 accelerometer.
> 
> Add support for them.
> 
> Signed-off-by: Joe Mason <buddyjojo06@outlook.com>
> [Add LSM303C]
> Signed-off-by: Siddharth Manthan <siddharth.manthan@gmail.com>
> [Move sensors to fortuna.dtsi. Disable them by default]
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> [Enable on grandprimelte. Add LIS2HH12]
> Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
> ---
>  .../dts/qcom/msm8216-samsung-fortuna3g.dts    |  8 ++
>  .../qcom/msm8916-samsung-fortuna-common.dtsi  | 80 +++++++++++++++++++
>  .../dts/qcom/msm8916-samsung-fortunaltezt.dts |  8 ++
>  .../dts/qcom/msm8916-samsung-gprimeltecan.dts |  8 ++
>  .../qcom/msm8916-samsung-grandprimelte.dts    |  8 ++
>  .../qcom/msm8916-samsung-rossa-common.dtsi    |  8 ++

Your split of patches is difficult to follow and understand. You bring
now, within your first submission, few boards. Then adding one feature
to this board is not a separate commit. Commit, so a logical change, is
adding a board. Please organize your patchset so it will be easier to
review. Now with such changes touching multiple files, seems not
organized correctly. Your previous patch added multiple boards in one
commit - also not easy to review.

One commit for the binding, one commit for each board. Optionally common
file could be a separate commit.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts b/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts
index 366914be7d53..e7f6df229f9a 100644
--- a/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts
+++ b/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts
@@ -9,3 +9,11 @@  / {
 	compatible = "samsung,fortuna3g", "qcom,msm8916";
 	chassis-type = "handset";
 };
+
+&st_accel {
+	status = "okay";
+};
+
+&st_magn {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi
index 6d9f89446105..0436b8ccc3e8 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi
@@ -92,6 +92,79 @@  muic: extcon@25 {
 	};
 };
 
+&blsp_i2c2 {
+	/* Available sensors vary depending on model variant */
+	status = "okay";
+
+	bosch_accel: accelerometer@10 {
+		compatible = "bosch,bmc150_accel";
+		reg = <0x10>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <115 IRQ_TYPE_EDGE_RISING>;
+
+		vdd-supply = <&pm8916_l5>;
+		vddio-supply = <&pm8916_l5>;
+
+		pinctrl-0 = <&accel_int_default>;
+		pinctrl-names = "default";
+
+		mount-matrix = "0", "-1", "0",
+			      "-1",  "0", "0",
+			       "0",  "0", "1";
+
+		status = "disabled";
+	};
+
+	bosch_magn: magnetometer@12 {
+		compatible = "bosch,bmc150_magn";
+		reg = <0x12>;
+
+		vdd-supply = <&pm8916_l5>;
+		vddio-supply = <&pm8916_l5>;
+
+		mount-matrix = "0", "-1", "0",
+			      "-1",  "0", "0",
+			       "0",  "0", "1";
+
+		status = "disabled";
+	};
+
+	st_accel: accelerometer@1d {
+		compatible = "st,lsm303c-accel";
+		reg = <0x1d>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <115 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "INT1";
+
+		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 {
 	status = "okay";
 
@@ -178,6 +251,13 @@  &wcnss_iris {
 };
 
 &tlmm {
+	accel_int_default: accel-int-default-state {
+		pins = "gpio115";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	fg_alert_default: fg-alert-default-state {
 		pins = "gpio121";
 		function = "gpio";
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortunaltezt.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortunaltezt.dts
index f7c4dcb34bb3..0716ef577df1 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortunaltezt.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortunaltezt.dts
@@ -21,3 +21,11 @@  / {
 	compatible = "samsung,fortunaltezt", "qcom,msm8916";
 	chassis-type = "handset";
 };
+
+&st_accel {
+	compatible = "st,lis2hh12";
+	mount-matrix = "1",  "0", "0",
+		       "0", "-1", "0",
+		       "0",  "0", "1";
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts
index 883f20554dbe..b0d8ac3d6ce9 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts
@@ -20,3 +20,11 @@  tz-apps@85500000 {
 		};
 	};
 };
+
+&bosch_accel {
+	status = "okay";
+};
+
+&bosch_magn {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts
index ea8a1e698dd4..f7fc538fda04 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts
@@ -9,3 +9,11 @@  / {
 	compatible = "samsung,grandprimelte", "qcom,msm8916";
 	chassis-type = "handset";
 };
+
+&bosch_accel {
+	status = "okay";
+};
+
+&bosch_magn {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi
index 242cb61e55fd..39f99b5030e5 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi
@@ -22,3 +22,11 @@  &blsp_i2c5 {
 	/* Touchscreen varies depending on model variant */
 	/delete-node/ touchscreen@20;
 };
+
+&st_accel {
+	compatible = "st,lis2hh12";
+	mount-matrix = "1",  "0", "0",
+		       "0", "-1", "0",
+		       "0",  "0", "1";
+	status = "okay";
+};