[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230904123123.2593-1-linmengbo0689@protonmail.com>
Date: Mon, 04 Sep 2023 12:35:03 +0000
From: "Lin, Meng-Bo" <linmengbo0689@...tonmail.com>
To: linux-kernel@...r.kernel.org
Cc: Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Stephan Gerhold <stephan@...hold.net>,
Nikita Travkin <nikita@...n.ru>, linux-arm-msm@...r.kernel.org,
devicetree@...r.kernel.org, ~postmarketos/upstreaming@...ts.sr.ht,
Markuss Broks <markuss.broks@...il.com>
Subject: [PATCH] arm64: dts: qcom: msm8916-samsung-j5-common: Add accelerometer
From: Markuss Broks <markuss.broks@...il.com>
J5 and J5X have ST LIS2HH12 accelerometer.
Add support for it.
Signed-off-by: Markuss Broks <markuss.broks@...il.com>
Co-developed-by: Stephan Gerhold <stephan@...hold.net>
Signed-off-by: Stephan Gerhold <stephan@...hold.net>
Co-developed-by: Lin, Meng-Bo <linmengbo0689@...tonmail.com>
Signed-off-by: Lin, Meng-Bo <linmengbo0689@...tonmail.com>
---
.../dts/qcom/msm8916-samsung-j5-common.dtsi | 39 +++++++++++++++++++
.../boot/dts/qcom/msm8916-samsung-j5.dts | 5 +++
.../boot/dts/qcom/msm8916-samsung-j5x.dts | 15 +++++++
3 files changed, 59 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
index cb0e4a7faf91..68e22873647f 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
@@ -84,6 +84,31 @@ muic: extcon@25 {
pinctrl-0 = <&muic_int_default>;
};
};
+
+ i2c_sensors: i2c-sensors {
+ compatible = "i2c-gpio";
+
+ sda-gpios = <&tlmm 31 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 32 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+ pinctrl-0 = <&sensors_i2c_default>;
+ pinctrl-names = "default";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ accelerometer: accelerometer@1d {
+ compatible = "st,lis2hh12";
+ reg = <0x1d>;
+
+ interrupts-extended = <&tlmm 115 IRQ_TYPE_LEVEL_HIGH>;
+
+ pinctrl-0 = <&accel_int_default>;
+ pinctrl-names = "default";
+
+ st,drdy-int-pin = <1>;
+ };
+ };
};
&blsp_i2c5 {
@@ -147,6 +172,13 @@ &wcnss_iris {
};
&tlmm {
+ accel_int_default: accel-int-default-state {
+ pins = "gpio115";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
gpio_hall_sensor_default: gpio-hall-sensor-default-state {
pins = "gpio52";
function = "gpio";
@@ -187,6 +219,13 @@ sdc2_cd_default: sdc2-cd-default-state {
bias-disable;
};
+ sensors_i2c_default: sensors-i2c-default-state {
+ pins = "gpio31", "gpio32";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
tsp_int_default: tsp-int-default-state {
pins = "gpio13";
function = "gpio";
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts
index 3e1ff5b4d2d7..58c2f5a70e78 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts
@@ -10,6 +10,11 @@ / {
chassis-type = "handset";
};
+&accelerometer {
+ vdd-supply = <&pm8916_l5>;
+ vddio-supply = <&pm8916_l5>;
+};
+
&blsp_i2c5 {
status = "disabled";
};
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5x.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5x.dts
index b2fe109723d8..8b404a9cd62d 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5x.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5x.dts
@@ -23,6 +23,17 @@ reg_vdd_tsp_a: regulator-vdd-tsp-a {
};
};
+&accelerometer {
+ interrupts-extended = <&tlmm 49 IRQ_TYPE_LEVEL_HIGH>;
+
+ vdd-supply = <&pm8916_l6>;
+ vddio-supply = <&pm8916_l6>;
+
+ mount-matrix = "0", "-1", "0",
+ "1", "0", "0",
+ "0", "0", "-1";
+};
+
&muic {
interrupts = <121 IRQ_TYPE_EDGE_FALLING>;
};
@@ -40,6 +51,10 @@ tsp_ldo_en_default: tsp-ldo-en-default-state {
};
};
+&accel_int_default {
+ pins = "gpio49";
+};
+
&muic_int_default {
pins = "gpio121";
};
--
2.39.2
Powered by blists - more mailing lists