From patchwork Thu Jun 22 02:04:30 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: 695870 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 4B7BFEB64D8 for ; Thu, 22 Jun 2023 02:04:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230259AbjFVCEt (ORCPT ); Wed, 21 Jun 2023 22:04:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbjFVCEp (ORCPT ); Wed, 21 Jun 2023 22:04:45 -0400 Received: from mail-0301.mail-europe.com (mail-0301.mail-europe.com [188.165.51.139]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9B9B1B2 for ; Wed, 21 Jun 2023 19:04:44 -0700 (PDT) Date: Thu, 22 Jun 2023 02:04:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1687399481; x=1687658681; bh=/vDYUh5McZs3N8YCkpc89lkm19R833ueuUBmkB8Qv9Y=; 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=jkrNLS2LURlB3pszCs7wlzZif5xGk03NmgxL8xCeZ8lJodALrSfa1XXzl2R+tvKCI ouZ1AZYK85m0al3gRliV48jUDNnxIEZm++Et5swSgRbUBycWqE5/y/MECudQXqyvjT FZx7GHOqyOrsukY8dsFkybtIgsCQQCTnLwINlDwSqW1FM7E5IAqUWeBR7YS7/4ymPs f48m8i+wh3u9Fi4ZQpRzog6Zd+crmHE8T8N032R/S+U/JS7hNZJurC0PfSMuHpJ+oe 3Wm02nnv3eAjTcPODFHga8PBuB+DNirNL3tHLZ9jilT2O0rPjZIFucPyz1lPgOMmkd SbMZOTsek8ZwQ== 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 1/8] dt-bindings: qcom: Document msm8939,a7 Message-ID: <20230622020419.65760-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 Document samsung,a7 bindings used in its device tree. Signed-off-by: Lin, Meng-Bo --- Documentation/devicetree/bindings/arm/qcom.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/qcom.yaml b/Documentation/devicetree/bindings/arm/qcom.yaml index 450f616774e0..a6f7ef4f0830 100644 --- a/Documentation/devicetree/bindings/arm/qcom.yaml +++ b/Documentation/devicetree/bindings/arm/qcom.yaml @@ -186,6 +186,7 @@ properties: - items: - enum: + - samsung,a7 - sony,kanuti-tulip - square,apq8039-t2 - const: qcom,msm8939 From patchwork Thu Jun 22 02:04:45 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: 695002 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 DD591EB64D8 for ; Thu, 22 Jun 2023 02:05:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229902AbjFVCFG (ORCPT ); Wed, 21 Jun 2023 22:05:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230051AbjFVCFF (ORCPT ); Wed, 21 Jun 2023 22:05:05 -0400 Received: from mail-4319.protonmail.ch (mail-4319.protonmail.ch [185.70.43.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40A241BE2; Wed, 21 Jun 2023 19:05:00 -0700 (PDT) Date: Thu, 22 Jun 2023 02:04:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1687399499; x=1687658699; bh=fV5B6btJ64xeyUcdf9cajjOxdbvHHUDzzFEKlZ+Zs5A=; 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=MOLZXiFCWoBV3v8s9/krVt8hVNz042OOqTfVpFhSD74S9NUer7Ag7FRQBWGsoUVtw t2Sfg39YfRV6b915aIGp8EgodgxIuhDLdKYLVEsyVl3zjdiMmxNH+tsGNdW0CFTgrQ dDqMF4xpPBBva1uz9fr7jw0gOmnts7vWykfqyj3pNSyxRN6dnq44JX+j0MRdB4cMat 7RxXba6JYOIM3n+izjumr7sRhxsfsvivZA7enmPQ1QKveRiP3UxYnQev6rZhHLK7YS 6GUbKeQ5FecGT+URVKlm3/+/CsBG1SMg/kdHNYtDyrsq7T3NB+YjPrNuqwClkHy6uW PGS4fBx7np80g== 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 2/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Message-ID: <20230622020434.65776-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 This dts adds support for Samsung Galaxy A7 smartphone released in 2015. Add a device tree for A7 with initial support for: - GPIO keys - Hall Sensor - SDHCI (internal and external storage) - USB Device Mode - UART (on USB connector via the SM5502 MUIC) - WCNSS (WiFi/BT) - Regulators Signed-off-by: Lin, Meng-Bo --- arch/arm64/boot/dts/qcom/Makefile | 1 + .../boot/dts/qcom/msm8939-samsung-a7.dts | 163 ++++++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile index 337abc4ceb17..23fd31d4bf5a 100644 --- a/arch/arm64/boot/dts/qcom/Makefile +++ b/arch/arm64/boot/dts/qcom/Makefile @@ -39,6 +39,7 @@ dtb-$(CONFIG_ARCH_QCOM) += msm8916-thwc-uf896.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-thwc-ufi001c.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-wingtech-wt88047.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-yiming-uz801v3.dtb +dtb-$(CONFIG_ARCH_QCOM) += msm8939-samsung-a7.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8939-sony-xperia-kanuti-tulip.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8953-motorola-potter.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8953-xiaomi-daisy.dtb diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts new file mode 100644 index 000000000000..cf2738bc3313 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts @@ -0,0 +1,163 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/dts-v1/; + +#include "msm8939-pm8916.dtsi" + +#include +#include +#include + +/ { + model = "Samsung Galaxy A7 (2015)"; + compatible = "samsung,a7", "qcom,msm8939"; + chassis-type = "handset"; + + aliases { + mmc0 = &sdhc_1; /* SDC1 eMMC slot */ + mmc1 = &sdhc_2; /* SDC2 SD card slot */ + serial0 = &blsp_uart2; + }; + + chosen { + stdout-path = "serial0"; + }; + + reserved-memory { + /* Additional memory used by Samsung firmware modifications */ + tz-apps@85500000 { + reg = <0x0 0x85500000 0x0 0xb00000>; + no-map; + }; + }; + + gpio-hall-sensor { + compatible = "gpio-keys"; + + pinctrl-0 = <&gpio_hall_sensor_default>; + pinctrl-names = "default"; + + label = "GPIO Hall Effect Sensor"; + + event-hall-sensor { + label = "Hall Effect Sensor"; + gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; + linux,input-type = ; + linux,code = ; + linux,can-disable; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + pinctrl-0 = <&gpio_keys_default>; + pinctrl-names = "default"; + + label = "GPIO Buttons"; + + button-volume-up { + label = "Volume Up"; + gpios = <&tlmm 107 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + button-home { + label = "Home"; + gpios = <&tlmm 109 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&blsp_i2c1 { + status = "okay"; + + muic: extcon@25 { + compatible = "siliconmitus,sm5502-muic"; + reg = <0x25>; + + interrupt-parent = <&tlmm>; + interrupts = <12 IRQ_TYPE_EDGE_FALLING>; + + pinctrl-0 = <&muic_int_default>; + pinctrl-names = "default"; + }; +}; + +&blsp_uart2 { + status = "okay"; +}; + +&pm8916_resin { + linux,code = ; + status = "okay"; +}; + +&pm8916_rpm_regulators { + pm8916_l17: l17 { + regulator-min-microvolt = <2850000>; + regulator-max-microvolt = <2850000>; + }; +}; + +&sdhc_1 { + status = "okay"; +}; + +&sdhc_2 { + pinctrl-0 = <&sdc2_default &sdc2_cd_default>; + pinctrl-1 = <&sdc2_sleep &sdc2_cd_default>; + pinctrl-names = "default", "sleep"; + + cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; + + status = "okay"; +}; + +&usb { + extcon = <&muic>, <&muic>; + status = "okay"; +}; + +&usb_hs_phy { + extcon = <&muic>; +}; + +&wcnss { + status = "okay"; +}; + +&wcnss_iris { + compatible = "qcom,wcn3660b"; +}; + +&tlmm { + gpio_hall_sensor_default: gpio-hall-sensor-default-state { + pins = "gpio52"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + gpio_keys_default: gpio-keys-default-state { + pins = "gpio107", "gpio109"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + + muic_int_default: muic-int-default-state { + pins = "gpio12"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + sdc2_cd_default: sdc2-cd-default-state { + pins = "gpio38"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; +}; From patchwork Thu Jun 22 02:04:58 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: 695869 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 1C631EB64D8 for ; Thu, 22 Jun 2023 02:05:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbjFVCFT (ORCPT ); Wed, 21 Jun 2023 22:05:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230243AbjFVCFP (ORCPT ); Wed, 21 Jun 2023 22:05:15 -0400 Received: from mail-4319.protonmail.ch (mail-4319.protonmail.ch [185.70.43.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C82E61BE2; Wed, 21 Jun 2023 19:05:09 -0700 (PDT) Date: Thu, 22 Jun 2023 02:04:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1687399508; x=1687658708; bh=FCm+LLmKGdTwYZa44TvNge6VPclbxNgOtwQ/JZjfxVg=; 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=vQSOl7LdADyVUI/tt9Oocyp5M0iV2Byv+zwXhGBqN9bFfpBXGcMtu+5z+/9ucUNbF WhJwUeEQT0KvlaL6H6j1Pjvig2ZdxktOp2lkJ36BGPkgvVCKCsCVxW1+9ZEQLGCGIq 4i3dzWJii+CWxO9Rj2F/bkx4tJ57rzboNw7ggJxWzEFQ1vRAxd5vnijySSbFOSMRkp jvhsD+L+N+3MUchrZPzeEp8mPkozyjyzPQATql86gGtoShf7bIs5J31wf8R0fSaGJL vSV+cVuv+NMDdtBJHbMyE+rcbbiRLOXKOc39JF3uig5wBEFmVMaoYbqk3RGAv1kCYP OVjtWvUwvd8vA== 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 3/8] arm64: dts: qcom: msm8939-samsung-a7: Add touch key Message-ID: <20230622020448.65791-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 Add the CORERIVER TC360 touch key together with the necessary fixed regulator for it. Note that for some reason Samsung decided to connect this to GPIOs where no hardware I2C bus is available, so we need to fall back to software bit-banging using i2c-gpio. Signed-off-by: Lin, Meng-Bo --- .../boot/dts/qcom/msm8939-samsung-a7.dts | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts index cf2738bc3313..98a2738eb8ea 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts @@ -68,6 +68,63 @@ button-home { linux,code = ; }; }; + + i2c-tkey { + compatible = "i2c-gpio"; + sda-gpios = <&tlmm 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&tlmm 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + + pinctrl-0 = <&tkey_i2c_default>; + pinctrl-names = "default"; + + #address-cells = <1>; + #size-cells = <0>; + + touchkey@20 { + /* Note: Actually an ABOV MCU that implements same interface */ + compatible = "coreriver,tc360-touchkey"; + reg = <0x20>; + + interrupt-parent = <&tlmm>; + interrupts = <20 IRQ_TYPE_EDGE_FALLING>; + + vcc-supply = <®_touch_key>; + vdd-supply = <®_keyled>; + vddio-supply = <&pm8916_l6>; + + linux,keycodes = ; + + pinctrl-0 = <&tkey_default>; + pinctrl-names = "default"; + }; + }; + + reg_keyled: regulator-keyled { + compatible = "regulator-fixed"; + regulator-name = "keyled"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + /* NOTE: On some variants e.g. SM-A700FD it's GPIO 91 */ + gpio = <&tlmm 100 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-0 = <&tkey_led_en_default>; + pinctrl-names = "default"; + }; + + reg_touch_key: regulator-touch-key { + compatible = "regulator-fixed"; + regulator-name = "touch_key"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + + gpio = <&tlmm 56 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-0 = <&tkey_en_default>; + pinctrl-names = "default"; + }; }; &blsp_i2c1 { @@ -160,4 +217,32 @@ sdc2_cd_default: sdc2-cd-default-state { drive-strength = <2>; bias-pull-up; }; + + tkey_default: tkey-default-state { + pins = "gpio20"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + tkey_en_default: tkey-en-default-state { + pins = "gpio56"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + tkey_i2c_default: tkey-i2c-default-state { + pins = "gpio16", "gpio17"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + tkey_led_en_default: tkey-led-en-default-state { + pins = "gpio100"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; }; 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"; From patchwork Thu Jun 22 02:05:26 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: 695868 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 4F381EB64DC for ; Thu, 22 Jun 2023 02:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230230AbjFVCFh (ORCPT ); Wed, 21 Jun 2023 22:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbjFVCFg (ORCPT ); Wed, 21 Jun 2023 22:05:36 -0400 X-Greylist: delayed 77 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 21 Jun 2023 19:05:32 PDT Received: from mail-40140.protonmail.ch (mail-40140.protonmail.ch [185.70.40.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 878191BD8; Wed, 21 Jun 2023 19:05:32 -0700 (PDT) Date: Thu, 22 Jun 2023 02:05:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1687399530; x=1687658730; bh=uIImkaJUqEIc4EnN1u23yWQQQI9ILKskx9wiXhE1ldM=; 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=C3ClYcTssq1Vu2nWdNc92Khz9hdkZelqa6LM+pU9NukIe8kweBetyyxEedAJ2CUac xCmL/nl53Nsx8D4dWdjUK0xnQPsz1i/DFcUEh8gbHYTNczV+rbzmHt8AZCUTFM2UYF es0BN+CclC1UFc1qDC1QjBeoFfoqx7Lq5Jx15xIdR/XH1znSYaDDjC/x1F0pv0s7Gf e+8GnJu2x8cxDy3SdHCCyjcp4046VrDwVoIuLDu31S9NjEEtBpw3FXTaqEzIQPQBR7 Apa8imih8wsNzUKeaCGqYS70tjIDfpctEGgBAJcik2IzyLHrGbc6YEJppZhYGdDYFW 6jMJQx+a24vFw== 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 5/8] arm64: dts: qcom: msm8939-samsung-a7: Add rt5033 battery Message-ID: <20230622020515.65823-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 The Samsung Galaxy A7 uses a Richtek RT5033 PMIC as battery fuel gauge, charger, flash LED and for some regulators. For now, only add the fuel gauge/battery device to the device tree, so we can check the remaining battery percentage. The other RT5033 drivers need some more work first before they can be used properly. Signed-off-by: Lin, Meng-Bo --- .../boot/dts/qcom/msm8939-samsung-a7.dts | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts index 6a817038a3b9..271dcea6da94 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts @@ -69,6 +69,29 @@ button-home { }; }; + i2c-fg { + compatible = "i2c-gpio"; + sda-gpios = <&tlmm 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&tlmm 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + + pinctrl-0 = <&fg_i2c_default>; + pinctrl-names = "default"; + + #address-cells = <1>; + #size-cells = <0>; + + battery@35 { + compatible = "richtek,rt5033-battery"; + reg = <0x35>; + + interrupt-parent = <&tlmm>; + interrupts = <121 IRQ_TYPE_EDGE_BOTH>; + + pinctrl-0 = <&fg_alert_default>; + pinctrl-names = "default"; + }; + }; + i2c-sensor { compatible = "i2c-gpio"; sda-gpios = <&tlmm 84 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; @@ -234,6 +257,20 @@ accel_int_default: accel-int-default-state { bias-disable; }; + fg_alert_default: fg-alert-default-state { + pins = "gpio121"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + fg_i2c_default: fg-i2c-default-state { + pins = "gpio105", "gpio106"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + gpio_hall_sensor_default: gpio-hall-sensor-default-state { pins = "gpio52"; function = "gpio"; From patchwork Thu Jun 22 02:05:39 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: 695000 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 2EC36EB64D8 for ; Thu, 22 Jun 2023 02:06:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230050AbjFVCF7 (ORCPT ); Wed, 21 Jun 2023 22:05:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230121AbjFVCFz (ORCPT ); Wed, 21 Jun 2023 22:05:55 -0400 Received: from mail-4318.protonmail.ch (mail-4318.protonmail.ch [185.70.43.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E625D1BD8 for ; Wed, 21 Jun 2023 19:05:49 -0700 (PDT) Date: Thu, 22 Jun 2023 02:05:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1687399548; x=1687658748; bh=wbmH1oH6ly/6UPYctPqfteW/k7noLOx6DZi3okRB1Ok=; 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=c5b3GWg8+t1vwqKJS6ttd6IEIUcJlacQMYofXtzNyXc2L72VvVC9gUOZLxsYS6fAY x84JqmCOFCFtgKvzAu+KrfpnQs0HP6SBCGKSjPfnaIS2mWCEidMhGCvNrDH2zCtgK3 AW0mYGAr5PYmiWw68Ex1/C4xZm/R/I//xKRPbKrpt0ghdwEvSLQeiL3XUH7JcLXtsc FPizCTmyf117BGG7pnK6fpItRlWp0XTV7DSjp8At6zz7UbOcX/3PDY04DuSJpHJmT2 gD04EVdkrYfEjpVTwSsjpmY9VN3zvxTWFHGE9uuE1H/kOLufIOMONS11OzTL53XCKo ADyIsgP0E86Zw== 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 6/8] arm64: dts: qcom: msm8939-samsung-a7: Add NFC Message-ID: <20230622020530.65845-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 The Galaxy A7 has a NXP PN547, which is supported by the nxp-nci-i2c driver in mainline. It seems to detect NFC tags using "nfctool" just fine, although more testing is difficult given there seem to be very few useful applications making use of the Linux NFC subsystem. Note that for some reason Samsung decided to connect the I2C pins to GPIOs where no hardware I2C bus is available, so we need to fall back to software bit-banging with i2c-gpio. Signed-off-by: Lin, Meng-Bo --- .../boot/dts/qcom/msm8939-samsung-a7.dts | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts index 271dcea6da94..dcbc8a97ce63 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts @@ -92,6 +92,32 @@ battery@35 { }; }; + i2c-nfc { + compatible = "i2c-gpio"; + sda-gpios = <&tlmm 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&tlmm 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + + pinctrl-0 = <&nfc_i2c_default>; + pinctrl-names = "default"; + + #address-cells = <1>; + #size-cells = <0>; + + nfc@2b { + compatible = "nxp,pn547", "nxp,nxp-nci-i2c"; + reg = <0x2b>; + + interrupt-parent = <&tlmm>; + interrupts = <21 IRQ_TYPE_EDGE_RISING>; + + enable-gpios = <&tlmm 116 GPIO_ACTIVE_HIGH>; + firmware-gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>; + + pinctrl-0 = <&nfc_default>; + pinctrl-names = "default"; + }; + }; + i2c-sensor { compatible = "i2c-gpio"; sda-gpios = <&tlmm 84 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; @@ -292,6 +318,29 @@ muic_int_default: muic-int-default-state { bias-disable; }; + nfc_default: nfc-default-state { + irq-pins { + pins = "gpio21"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + nfc-pins { + pins = "gpio49", "gpio116"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + }; + + nfc_i2c_default: nfc-i2c-default-state { + pins = "gpio0", "gpio1"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + sdc2_cd_default: sdc2-cd-default-state { pins = "gpio38"; function = "gpio"; From patchwork Thu Jun 22 02:05:51 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: 695867 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 C2921EB64D7 for ; Thu, 22 Jun 2023 02:06:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229796AbjFVCGb (ORCPT ); Wed, 21 Jun 2023 22:06:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230264AbjFVCG3 (ORCPT ); Wed, 21 Jun 2023 22:06:29 -0400 Received: from mail-40132.protonmail.ch (mail-40132.protonmail.ch [185.70.40.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6A8D1FE7; Wed, 21 Jun 2023 19:06:08 -0700 (PDT) Date: Thu, 22 Jun 2023 02:05:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1687399566; x=1687658766; bh=9Osyd7zMvptKqruHnCZMd8o/FOKHIT+eTshZCfZIz54=; 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=u5+aWGZ0/uGAFfyormP+GoQyr+P5jEWm+No4L3iLzpoJaIPhxN+aMaky+SeTe15WT 3ClmMjE0N+QWDrAKwQePapQ50ScXmCtYDxkAQTuOgxEyPmjCXRqjJ3aiLMqIyDmnip PBGZuunXpt3yTyfMzC6qh5uHZ/xI2sH6XPb67lEvxrgIT819a+As3RvAcov6+s7kJP tBelNZmitaSm6u3VoFrFJY6a20hJvPjccPM6+irXRzGiSXfLT2P3culoVxCVWE9SaW BA9qafWd4AGxfFTk5/bjHCmezoQ/Fcjk7hihOBuChG9gl1Z/Nh7WXiFdN3C5kk35dy XqH0AGlIEuplA== 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 7/8] arm64: dts: qcom: msm8939-samsung-a7: Add vibrator Message-ID: <20230622020541.65860-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 motor driver controlled with PWM signal with a fixed regulator that powers the driver and is controlled by enable signal. Signed-off-by: Lin, Meng-Bo --- .../boot/dts/qcom/msm8939-samsung-a7.dts | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts index dcbc8a97ce63..ea74b61782de 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts @@ -185,6 +185,16 @@ touchkey@20 { }; }; + pwm_vibrator: pwm-vibrator { + compatible = "clk-pwm"; + #pwm-cells = <2>; + + clocks = <&gcc GCC_GP2_CLK>; + + pinctrl-0 = <&motor_pwm_default>; + pinctrl-names = "default"; + }; + reg_keyled: regulator-keyled { compatible = "regulator-fixed"; regulator-name = "keyled"; @@ -211,6 +221,28 @@ reg_touch_key: regulator-touch-key { pinctrl-0 = <&tkey_en_default>; pinctrl-names = "default"; }; + + reg_vibrator: regulator-vibrator { + compatible = "regulator-fixed"; + regulator-name = "motor_en"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + + gpio = <&tlmm 86 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-0 = <&motor_en_default>; + pinctrl-names = "default"; + }; + + vibrator { + compatible = "pwm-vibrator"; + + pwms = <&pwm_vibrator 0 100000>; + pwm-names = "enable"; + + vcc-supply = <®_vibrator>; + }; }; &blsp_i2c1 { @@ -311,6 +343,18 @@ gpio_keys_default: gpio-keys-default-state { bias-pull-up; }; + motor_en_default: motor-en-default-state { + pins = "gpio86"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + motor_pwm_default: motor-pwm-default-state { + pins = "gpio50"; + function = "gcc_gp2_clk_a"; + }; + muic_int_default: muic-int-default-state { pins = "gpio12"; function = "gpio"; From patchwork Thu Jun 22 02:06:02 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: 694999 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 41824EB64D7 for ; Thu, 22 Jun 2023 02:06:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbjFVCGj (ORCPT ); Wed, 21 Jun 2023 22:06:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230272AbjFVCGh (ORCPT ); Wed, 21 Jun 2023 22:06:37 -0400 Received: from mail-40141.protonmail.ch (mail-40141.protonmail.ch [185.70.40.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F204A1FC0 for ; Wed, 21 Jun 2023 19:06:17 -0700 (PDT) Date: Thu, 22 Jun 2023 02:06:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1687399570; x=1687658770; bh=7SfUXgxDKFs8VyBnB08DD7BLN92E+2qCeSvNcbRx2Aw=; 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=fv0DP/u8s/kP/JRVUax0RBzP3gLl7iEwVlP98yiAxlxhM/Y5i7rR5EUzWNjbz6CWO s6w6HCEhbEMiYRBwhYk0lJ4pga+LmWLxPVsAr+Pj4WGN9URrD+pfJS3lxwTnc4IbwD JQK2Zwm7lcX+RRJfh7mmRw3iJ77zUo0VfrvGZvCH4qJpZfItrQqb9H5OUSI32hV79o ZdDUY2tVFmNmdQYvTZhglu1fFS+Y0262Pj/F6Allrs2gBL1BtxYvU9WU+rlj+4D7jX 7wSkjsi692IvaVG+R5EjCY6QARRxKLQTBc6RNzMazA4NDo372eLGE0EYtVJ77akiWl 1K2WRio8FELIw== 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 8/8] arm64: dts: qcom: msm8939-samsung-a7: Add touchscreen Message-ID: <20230622020553.65878-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 Cypress TrueTouch Generation 5 that is connected to blsp_i2c5. Add it to the device tree. Signed-off-by: Lin, Meng-Bo --- .../boot/dts/qcom/msm8939-samsung-a7.dts | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts index ea74b61782de..66e56ac59998 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts @@ -222,6 +222,33 @@ reg_touch_key: regulator-touch-key { pinctrl-names = "default"; }; + reg_tsp_vdd: regulator-tsp-vdd { + compatible = "regulator-fixed"; + regulator-name = "tsp_vdd"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&pm8916_s4>; + + gpio = <&tlmm 8 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-0 = <®_tsp_io_en_default>; + pinctrl-names = "default"; + }; + + reg_vdd_tsp: regulator-vdd-tsp { + compatible = "regulator-fixed"; + regulator-name = "vdd_tsp"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + gpio = <&tlmm 73 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-0 = <®_tsp_en_default>; + pinctrl-names = "default"; + }; + reg_vibrator: regulator-vibrator { compatible = "regulator-fixed"; regulator-name = "motor_en"; @@ -260,6 +287,24 @@ muic: extcon@25 { }; }; +&blsp_i2c5 { + status = "okay"; + + touchscreen@24 { + compatible = "cypress,tt21000"; + + reg = <0x24>; + interrupt-parent = <&tlmm>; + interrupts = <13 IRQ_TYPE_EDGE_FALLING>; + + vdd-supply = <®_vdd_tsp>; + vddio-supply = <®_tsp_vdd>; + + pinctrl-0 = <&tsp_int_default>; + pinctrl-names = "default"; + }; +}; + &blsp_uart2 { status = "okay"; }; @@ -385,6 +430,20 @@ nfc_i2c_default: nfc-i2c-default-state { bias-disable; }; + reg_tsp_en_default: reg-tsp-en-default-state { + pins = "gpio73"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + reg_tsp_io_en_default: reg-tsp-io-en-default-state { + pins = "gpio8"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + sdc2_cd_default: sdc2-cd-default-state { pins = "gpio38"; function = "gpio"; @@ -426,4 +485,11 @@ tkey_led_en_default: tkey-led-en-default-state { drive-strength = <2>; bias-disable; }; + + tsp_int_default: tsp-int-default-state { + pins = "gpio13"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; };