From patchwork Fri Jun 4 17:27:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 454212 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F000EC4743D for ; Fri, 4 Jun 2021 17:31:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB25561405 for ; Fri, 4 Jun 2021 17:31:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbhFDRdf (ORCPT ); Fri, 4 Jun 2021 13:33:35 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([81.169.146.165]:23158 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230261AbhFDRdf (ORCPT ); Fri, 4 Jun 2021 13:33:35 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1622827904; cv=none; d=strato.com; s=strato-dkim-0002; b=m9pFcaPadHwKAQEiNm3NeyzwZTNTG1NGHkHfbbcR5LtqzezLmsoq0rcB7beJQCyHom zMLP0isUqNs5vFKqjMm7UPVzIQzUGJtoSEkzUVzAMmMVWE8AcDEyysx86Zc6CbFfqGUg l98Uv1Eebu1/6WHDuP4s4dDaBVZ2Bf9/kWPzHAJpahEtvnQOQ3SPM6hLRwsi/MGqCfsP cd52arDhQiQBDAjp0KDtGu686Ci6mm5ED+yyhYs4l/w4rXhRO5vGdFge1umS2tF6UvB2 OYYb87uZUs5aGjsFYg6wgow4JIQEndFlx3eBTw8ARcnjVTXjhPV14eMR6KEsNYqKKj75 Nx1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1622827904; s=strato-dkim-0002; d=strato.com; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=LVLr555nUQEvEYgAf4PXdZYCbzgO3vN/QlLUV+4x5jY=; b=IR7/Ylqstp3O94+PLActKSdeiHBhVZVZXlLxoVoBiiZl/m1FlaT82uoJkWeNiJOcr5 Qxj+sicRyWxJMoA4q9MS4RWImtM0XgdTAtVZqQ/uq+vRJlp0AJfy4qzJ2Fgc0kG6nPgG eaew965VdgiKkCKjIxhGYZUUAS1xRFAaPhdMnwSeAmcOpe1eliFZclZquD2vYR0NgSPE SqkaI2HHrXbpbLGgfHmHaNpayDY1o+2PkN+3kZ4fY2g+/POMUK5qO+qZaGzbAycigw/G EeGz9RiYSqcbuFftZp41PD/xU6bgPvcYuo2mkVW9oD4bwBtlU/g/asyPKr03RXcL6k0l f1Pw== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1622827904; s=strato-dkim-0002; d=gerhold.net; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=LVLr555nUQEvEYgAf4PXdZYCbzgO3vN/QlLUV+4x5jY=; b=NH0D9LhDFWDAeo9K2dT2Ai7mcPQzc2FOBs7dQ73CpmVlguKCCI6wlcghIuWDKpyBrE xzL67P0XWmNJLpeqkkHWgMna6vhxWSa/39BToUFnomgO7+/edMTb56bTapfuOzWRkSWy 7y3QTLIFeSRQn+NZMuD8Y2HIlC/6KWZ9xJb7u1EoWjtxB2g17Ue6E2eML0ydQ5GuzAt5 nnt23bAhdl3t6ZQBXvG3dMBZZIgD1IPmPO7eUvL1s+FPZJkZmevsXbXeIL0H78Q0bLSt xke8G7XaxAzisNxjtJuaiNz7PrbGDg8nFXmPtFl5aVRfZOhRrBKMrI6Nt1t/kBUQb8mI d1iA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB5m6Pvxo=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x54HVhH5X (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 4 Jun 2021 19:31:43 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Michael Srba , Stephan Gerhold Subject: [PATCH 1/5] arm64: dts: qcom: msm8916-samsung-a2015: Add touch key Date: Fri, 4 Jun 2021 19:27:38 +0200 Message-Id: <20210604172742.10593-1-stephan@gerhold.net> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The Samsung Galaxy A3/A5 both have two capacitive touch keys, connected to an ABOV MCU. It implements the same interface as implemented by the tm2-touchkey driver and works just fine with the coreriver,tc360-touchkey compatible. It's probably actually some Samsung-specific interface that they implement with different MCUs. 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. The vdd/vcc-supply is board-specific and will be added separately for a3u/a5u. Co-developed-by: Michael Srba Signed-off-by: Michael Srba Signed-off-by: Stephan Gerhold Acked-by: Krzysztof Kozlowski --- .../qcom/msm8916-samsung-a2015-common.dtsi | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi index 230ba3ce3277..3c77e7ef9eda 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi @@ -95,6 +95,35 @@ muic: extcon@25 { pinctrl-0 = <&muic_int_default>; }; }; + + i2c-tkey { + compatible = "i2c-gpio"; + sda-gpios = <&msmgpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&msmgpio 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + + pinctrl-names = "default"; + pinctrl-0 = <&tkey_i2c_default>; + + #address-cells = <1>; + #size-cells = <0>; + + touchkey: touchkey@20 { + /* Note: Actually an ABOV MCU that implements same interface */ + compatible = "coreriver,tc360-touchkey"; + reg = <0x20>; + + interrupt-parent = <&msmgpio>; + interrupts = <98 IRQ_TYPE_EDGE_FALLING>; + + /* vcc/vdd-supply are board-specific */ + vddio-supply = <&pm8916_l6>; + + linux,keycodes = ; + + pinctrl-names = "default"; + pinctrl-0 = <&tkey_default>; + }; + }; }; &blsp_i2c2 { @@ -333,6 +362,22 @@ muic_int_default: muic-int-default { bias-disable; }; + tkey_default: tkey-default { + pins = "gpio98"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + + tkey_i2c_default: tkey-i2c-default { + pins = "gpio16", "gpio17"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + tsp_en_default: tsp-en-default { pins = "gpio73"; function = "gpio"; From patchwork Fri Jun 4 17:27:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 454211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47699C48BE5 for ; Fri, 4 Jun 2021 17:31:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E0A361414 for ; Fri, 4 Jun 2021 17:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231132AbhFDRdh (ORCPT ); Fri, 4 Jun 2021 13:33:37 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.80]:12010 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231140AbhFDRdh (ORCPT ); Fri, 4 Jun 2021 13:33:37 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1622827905; cv=none; d=strato.com; s=strato-dkim-0002; b=Y6BFJ4MvxaUHoxYlzpeoERJQZ4gvXaw/DRXBd6dzbULtBrS9g9sNOLnL5hUfcwYX5l nRqecFw3Noe5mazFlITDZcWt6EBWwC3xdhr0ScFQggR37gjuzpKXzB5i7UHszr1IcbPU T8Tr1O0Rcvw3fAhUUkGonLOzb4hYKQBvs6aC8Xox6slj+w/2WY8R31dOWCoK8RtiujHW yAgKLTSYQw65ggtoFycbhZfZFikza7GvgyNx2VL8ee8joFzCtkVbgVEj8RRVrP04DiLu T1E4kWPzYetG+YIC4qzamxzzZEImNZ8ki1X1ss5BtqO5TtnjOOxC8jInlLH8bgVX8e0j XAPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1622827905; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=Hq+OcJNPH3Xp/X5vzez5iIg0BPMu6yTiJFYPPwTrivw=; b=mu+sbMu1MytdpnEjbgb548kW4XbBSqv7VP6Ky7FzMCethty/tApkXf0ZK2Hg1VXQ8m n2F7feXGwN6/Qa6b9yKWfU4k1RLR2nJfAekr9Z+kpwK/Hmi+Vvc9GkDkZSp931Lb0aCC lasZ07/ssKt25XEu0y5cEJI2KF951a/lML7xmzW3FqE/3VJfU5VAPWQBWq/4S/Bk14TW yNHFzIW2C0ipvQnkNOtrs9hHN+nU43WJ8jMiaWtRM8dNMy2p0THnGRPx62wTWmOOM+fe lmcc/+R26ZOUspzNnZd2PW7SM1qzBLVxouG3Fh15j0dKTrpOoMfcAWeJIxMJ4sdzWVJ6 UbIA== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1622827905; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=Hq+OcJNPH3Xp/X5vzez5iIg0BPMu6yTiJFYPPwTrivw=; b=JjjitCN1uG5DgGMzcWOKwCWgpVWqtFmaMBBrUM+oJcZym+pxgNcnwptmAeP31dYtLG zCe568HUWXrWtVijZWYCyRGbnMOr4d1Nld1fmfAEB9/lwb9v0PPvccvBA6VYdjsdaxBR 3Yj8D6gNKr47SoxFp9sHNKagyiKcEtlp8W15FaQdLlRWKHmcJaBofDGIQiVNfgi1BVbo qfPXBhuivGdGJbYSU9UiXDBPAyxCjTEMk4c8dF/uK0C+SS48Mto6PiVAq7d0KbWAkXH7 pM1jA/JJOf1hjFGQW9s1g5sY61mkwYWBx34R52XwaZPbAoXTI2zwQZxqj8716HLV/5Df +KSg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB5m6Pvxo=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x54HViH5Z (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 4 Jun 2021 19:31:44 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Michael Srba , Stephan Gerhold Subject: [PATCH 3/5] arm64: dts: qcom: msm8916-samsung-a5u: Add touch key regulator Date: Fri, 4 Jun 2021 19:27:40 +0200 Message-Id: <20210604172742.10593-3-stephan@gerhold.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210604172742.10593-1-stephan@gerhold.net> References: <20210604172742.10593-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On the Samsung Galaxy A5 the touch key is supplied by a single fixed regulator (enabled via GPIO 97) that supplies both MCU and LED. Add it to the device tree. Signed-off-by: Stephan Gerhold --- .../boot/dts/qcom/msm8916-samsung-a5u-eur.dts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts index dd35c3344358..c2eff5aebf85 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts @@ -7,6 +7,19 @@ / { model = "Samsung Galaxy A5U (EUR)"; compatible = "samsung,a5u-eur", "qcom,msm8916"; + + reg_touch_key: regulator-touch-key { + compatible = "regulator-fixed"; + regulator-name = "touch_key"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + gpio = <&msmgpio 97 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-names = "default"; + pinctrl-0 = <&tkey_en_default>; + }; }; &accelerometer { @@ -42,7 +55,20 @@ iris { }; }; +&touchkey { + vcc-supply = <®_touch_key>; + vdd-supply = <®_touch_key>; +}; + &msmgpio { + tkey_en_default: tkey-en-default { + pins = "gpio97"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + ts_int_default: ts-int-default { pins = "gpio13"; function = "gpio";