From patchwork Mon Sep 4 12:35:03 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: 720019 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 DD8FEC71153 for ; Mon, 4 Sep 2023 12:35:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236236AbjIDMfc (ORCPT ); Mon, 4 Sep 2023 08:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232080AbjIDMfc (ORCPT ); Mon, 4 Sep 2023 08:35:32 -0400 Received: from mail-0201.mail-europe.com (mail-0201.mail-europe.com [51.77.79.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D5D6EC; Mon, 4 Sep 2023 05:35:29 -0700 (PDT) Date: Mon, 04 Sep 2023 12:35:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1693830923; x=1694090123; bh=at8BjoFpddRw4d0u09ct+6YIxedFb1vgOg5Bk99QBFA=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=KaiugxjdVi2200gYrnmj2bVQJrdiArkOcEyPW21B82Y9TrR8aeUnbUteeHTzHpdF0 z1GksSHP2z6D44HVmZpnUj7L3Fxju6y+P+n2K5fhN0tnxRg/XHUJhCCK6yKiF2QagI 1Dmyp80rrygdKB8Jq5CHkW9+2lPzRKC5VCTv/qU4WquINryvn3Fk1CGFb6hcNI9SHT 53Wj+ysqy1y+JYLlkeTEmcJ5WprMf9taeL7SV9CB9x786DTpkgsM2a2K6pxQ6kCzJl MjFQL7vLcu6TXlpANqF0TIgFKEY11+XyoiGYPs3nrlmPGEJRG+4L4lpbp092q3K8f3 Ffrtno2HR8OMw== To: linux-kernel@vger.kernel.org From: "Lin, Meng-Bo" Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephan Gerhold , Nikita Travkin , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Markuss Broks Subject: [PATCH] arm64: dts: qcom: msm8916-samsung-j5-common: Add accelerometer Message-ID: <20230904123123.2593-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: Markuss Broks J5 and J5X have ST LIS2HH12 accelerometer. Add support for it. Signed-off-by: Markuss Broks Co-developed-by: Stephan Gerhold Signed-off-by: Stephan Gerhold Co-developed-by: Lin, Meng-Bo Signed-off-by: Lin, Meng-Bo Reviewed-by: Konrad Dybcio --- .../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"; };