From patchwork Thu Jun 22 02:05:12 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: 695001 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 D0608EB64D7 for ; Thu, 22 Jun 2023 02:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbjFVCFd (ORCPT ); Wed, 21 Jun 2023 22:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbjFVCFa (ORCPT ); Wed, 21 Jun 2023 22:05:30 -0400 Received: from mail-4324.protonmail.ch (mail-4324.protonmail.ch [185.70.43.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2A0D1BFF for ; Wed, 21 Jun 2023 19:05:25 -0700 (PDT) Date: Thu, 22 Jun 2023 02:05:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1687399524; x=1687658724; bh=lk0OOcZZqXjPubb5cVQElXeFQG9G1YLjPnDEfHulQPo=; 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=NBwraWtlAcl8HCfMSnJN779/bad9wq4IRTd3gSC+wQi/T1LFJiRLPV2ZZwE7VDPOa 5YkeZ1VbFU/zW2Qbm/1GLvODJvl3/c70VDPhhErr5RX5DV5r8TUmLm3O4bCiyRVeye +dnlrD9+b5+MMkVrFUKXv24uYDrWvlU8wvjF3ZIasvYZhT9H9xXErA70FaUpX5xlOd c2UYgfxoiIgGDd8e3DgvPS7sPxYv8xx0GTNAhCE59XI89ePGrp8nNAlkoWSLbPUlk4 zcvJ2+H/i0m8183jFkcLEEFYrkHW+TtnbuNKZPWCQVDJLJCTliS9xNDoacK0955MBj YDeJB4NeQMf3Q== 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 Subject: [PATCH 4/8] arm64: dts: qcom: msm8939-samsung-a7: Add accelerometer/magnetometer Message-ID: <20230622020500.65806-1-linmengbo0689@protonmail.com> In-Reply-To: <20230622020344.65745-1-linmengbo0689@protonmail.com> References: <20230622020344.65745-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 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 --- .../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";