devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
To: linux-kernel@vger.kernel.org
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Stephan Gerhold <stephan@gerhold.net>,
	Nikita Travkin <nikita@trvn.ru>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht
Subject: [PATCH 4/8] arm64: dts: qcom: msm8939-samsung-a7: Add accelerometer/magnetometer
Date: Thu, 22 Jun 2023 02:05:12 +0000	[thread overview]
Message-ID: <20230622020500.65806-1-linmengbo0689@protonmail.com> (raw)
In-Reply-To: <20230622020344.65745-1-linmengbo0689@protonmail.com>

A7 uses a Bosch BMC150 accelerometer/magnetometer combo.
The chip provides two separate I2C devices for the accelerometer
and magnetometer that are already supported by the bmc150-accel
and bmc150-magn driver.

Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
---
 .../boot/dts/qcom/msm8939-samsung-a7.dts      | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
index 98a2738eb8ea..6a817038a3b9 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
@@ -69,6 +69,43 @@ button-home {
 		};
 	};
 
+	i2c-sensor {
+		compatible = "i2c-gpio";
+		sda-gpios = <&tlmm 84 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&tlmm 85 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+		pinctrl-0 = <&sensor_i2c_default>;
+		pinctrl-names = "default";
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		accelerometer: accelerometer@10 {
+			compatible = "bosch,bmc150_accel";
+			reg = <0x10>;
+			interrupt-parent = <&tlmm>;
+			interrupts = <115 IRQ_TYPE_EDGE_RISING>;
+
+			vdd-supply = <&pm8916_l17>;
+			vddio-supply = <&pm8916_l5>;
+
+			pinctrl-0 = <&accel_int_default>;
+			pinctrl-names = "default";
+
+			mount-matrix = "-1", "0", "0",
+					"0", "-1", "0",
+					"0", "0", "1";
+		};
+
+		magnetometer@12 {
+			compatible = "bosch,bmc150_magn";
+			reg = <0x12>;
+
+			vdd-supply = <&pm8916_l17>;
+			vddio-supply = <&pm8916_l5>;
+		};
+	};
+
 	i2c-tkey {
 		compatible = "i2c-gpio";
 		sda-gpios = <&tlmm 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
@@ -190,6 +227,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";
@@ -218,6 +262,13 @@ sdc2_cd_default: sdc2-cd-default-state {
 		bias-pull-up;
 	};
 
+	sensor_i2c_default: sensor-i2c-default-state {
+		pins = "gpio84", "gpio85";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	tkey_default: tkey-default-state {
 		pins = "gpio20";
 		function = "gpio";
-- 
2.39.2



  parent reply	other threads:[~2023-06-22  2:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22  2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
2023-06-22  2:04 ` [PATCH 1/8] dt-bindings: qcom: Document msm8939,a7 Lin, Meng-Bo
2023-06-22 14:41   ` Rob Herring
2023-06-22  2:04 ` [PATCH 2/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
2023-06-22  2:04 ` [PATCH 3/8] arm64: dts: qcom: msm8939-samsung-a7: Add touch key Lin, Meng-Bo
2023-06-22 15:11   ` Krzysztof Kozlowski
2023-06-22  2:05 ` Lin, Meng-Bo [this message]
2023-06-22  2:05 ` [PATCH 5/8] arm64: dts: qcom: msm8939-samsung-a7: Add rt5033 battery Lin, Meng-Bo
2023-06-22  2:05 ` [PATCH 6/8] arm64: dts: qcom: msm8939-samsung-a7: Add NFC Lin, Meng-Bo
2023-06-22  2:05 ` [PATCH 7/8] arm64: dts: qcom: msm8939-samsung-a7: Add vibrator Lin, Meng-Bo
2023-06-22  2:06 ` [PATCH 8/8] arm64: dts: qcom: msm8939-samsung-a7: Add touchscreen Lin, Meng-Bo
2023-06-23 10:01 ` [PATCH v2 0/2] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230622020500.65806-1-linmengbo0689@protonmail.com \
    --to=linmengbo0689@protonmail.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikita@trvn.ru \
    --cc=robh+dt@kernel.org \
    --cc=stephan@gerhold.net \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).