From patchwork Thu Jun 22 00:05:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Meng-Bo" X-Patchwork-Id: 695004 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54513EB64DC for ; Thu, 22 Jun 2023 00:17:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbjFVARS (ORCPT ); Wed, 21 Jun 2023 20:17:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230453AbjFVAQv (ORCPT ); Wed, 21 Jun 2023 20:16:51 -0400 Received: from mail-41103.protonmail.ch (mail-41103.protonmail.ch [185.70.41.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFAFF122; Wed, 21 Jun 2023 17:16:19 -0700 (PDT) Date: Thu, 22 Jun 2023 00:05:13 +0000 Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="M2Sz3/y3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1687392324; x=1687651524; bh=IYok//eY9xuimU+KVH65Hac7c91mXkAV7BdwtpJ7YdU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=M2Sz3/y3j2LVl67KR9qTQAr9aNp308mG6JMS1PCVOREMXYL6xPhvkl7kyXl1F4DWb tMdWl7mf70lCGGK3vOpUcAmjybzx2PXK8F8zHsG1sMVRISdtWA71EKmcOk3uR1ABO6 c3CtFdQ9G/lr/mIR7KBpbclJ7BXXUbvotCqKTIDxwmmIl4Q9wGZVEGspzboH/NaHd2 Z8SMOHEzg/kS53J67lH6XNUTlEpqnnA3u20srAhFFlcu4qhfyPntQ6AX/D0TziWdf2 BoUdFuzg0np/+5EJ4i5qXqwpn2f/0mI5sd9z7+Sa8yVHvTkjwEZda+r4c57R64nUGD WBv5gQ0ZLGLUw== To: linux-kernel@vger.kernel.org From: "Lin, Meng-Bo" Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Arnd Bergmann , Olof Johansson , Stephan Gerhold , Nikita Travkin , soc@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ~postmarketos/upstreaming@lists.sr.ht, Joe Mason , Siddharth Manthan , "Lin, Meng-Bo" Subject: [PATCH 6/7] arm64: dts: qcom: msm8916-samsung-fortuna: Add accelerometer/magnetometer Message-ID: <20230622000418.48350-1-linmengbo0689@protonmail.com> In-Reply-To: <20230622000007.48219-1-linmengbo0689@protonmail.com> References: <20230622000007.48219-1-linmengbo0689@protonmail.com> Feedback-ID: 40467236:user:proton MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Joe Mason 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 [Add LSM303C] Signed-off-by: Siddharth Manthan [Move sensors to fortuna.dtsi. Disable them by default] Signed-off-by: Stephan Gerhold [Enable on grandprimelte. Add LIS2HH12] Signed-off-by: Lin, Meng-Bo --- .../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(+) 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"; +};