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: 695100 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 2CA3EEB64DC for ; Thu, 22 Jun 2023 02:05:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229921AbjFVCFT (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: devicetree@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; + }; };