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: 454259 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 D8FF3C4743E 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 C308D61402 for ; Fri, 4 Jun 2021 17:31:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbhFDRdf (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: devicetree@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 --- .../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:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 454786 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 3D1BFC48BCD for ; Fri, 4 Jun 2021 17:31:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 256CF61402 for ; Fri, 4 Jun 2021 17:31:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbhFDRdf (ORCPT ); Fri, 4 Jun 2021 13:33:35 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([81.169.146.166]:21590 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229892AbhFDRdf (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=l55rhKH4Dx8Fp6s4B+kF/C7//GauUwiimnHkQ+a4vlGGOaPvE/fE0t0L8qfdFJ3m+K 2HW35jy1C1BCNfolX3I0222EfAbTldKwI+YUggA9aGesepUUNMCazyTWN0X0pZJY2UOF V3JKo08OISpGiejMBiOiep+0L//MtFwmfyfe+9sjn4lRov8cOMGFiJse/h3cVO8osAHs 2MkWJ8XsTC2H9GPZPqU6KBFb2ydnvV8+b8i9McPAE4t4qsRwiDfwwgIcoEONMSlsCiOK VI4zt+kaiK/mEADKAimVmVMhUJhWdcPuPuqKg4B8vUyw7KHU/5UdFElxodw6w7ZOLF9Q YDfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1622827904; 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=p5NILU7nBxqDVCT63ZMrQiTlk9TVc6ktp8Fo++xWkA4=; b=f0utWWOup+1wOkvor9y5bn4uvnOLe6ucWWNmPpoIDLa2T8SNM91n4jHmggtKRkzS6W wDscKNRX3BntU+O0xVlrcd8GpjMFw8RQmXZT6Cs3Rp+eGaJZ+decaoZF+VCRiDVcMwom T7sPfmNVXu/5e4dftCVryWRan9KXA/dEmTt3Qwx77D1w97ZTi6RCvRs3TQ2MXdWN2kK1 E1HCzcp72ja3IUSnl+1ZUW87Y14lJDuw6f0qfvUgrK9sxRJWf6wz+6C6UrCQBp7hDG8n 70DrGlaHr3EczbygAcBP4huAtfOKpbWUzfW4R5n8IWqZn516hDCXMJ7I1SkMMRgxjZy0 tDZQ== 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=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=p5NILU7nBxqDVCT63ZMrQiTlk9TVc6ktp8Fo++xWkA4=; b=NrbxsoQkcKWEu1Plr1g7DmSrfLI71GJLm2QQA9Z7OhImR2EGs0KhGbq22P00y0Qp4r sbnrUBI+0vjRYam5queEWpF0uqQ1DEy1yqHFqaJud0XcQYnAclsief66+erecTR2roLT L5WwAY9/ijpYNFI55gi1u6B8D6RBQrw1hcKweb4PSpIZtfp7Gu4vGRMvm3SAyFGclTIH UUJya5OZ0THbpNtVHKWxEbWeJ0THuGgXfFQQuonsTIB0ImglXpGu1ZadsvuSbVBelLmb 97FxRVehbHOa0E0q7aGyboUNVNDr4yw5lbMgPFYkICJKIvMri903Nn1o7OSg8hZuicCZ gJ7w== 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 y01375x54HViH5Y (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 2/5] arm64: dts: qcom: msm8916-samsung-a3u: Add touch key regulators Date: Fri, 4 Jun 2021 19:27:39 +0200 Message-Id: <20210604172742.10593-2-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: devicetree@vger.kernel.org From: Michael Srba The touch key MCU and LED is supplied by two separate fixed regulators that can be enabled through GPIO 86 and 60. Add them to the device tree. Signed-off-by: Michael Srba [stephan: extend commit message] Signed-off-by: Stephan Gerhold --- .../boot/dts/qcom/msm8916-samsung-a3u-eur.dts | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts index 661f41ad978b..6cc2eaeb1d33 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts @@ -20,6 +20,37 @@ reg_panel_vdd3: regulator-panel-vdd3 { pinctrl-names = "default"; pinctrl-0 = <&panel_vdd3_default>; }; + + reg_touch_key: regulator-touch-key { + compatible = "regulator-fixed"; + regulator-name = "touch_key"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + + gpio = <&msmgpio 86 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-names = "default"; + pinctrl-0 = <&tkey_en_default>; + }; + + reg_key_led: regulator-key-led { + compatible = "regulator-fixed"; + regulator-name = "key_led"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + gpio = <&msmgpio 60 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-names = "default"; + pinctrl-0 = <&tkey_led_en_default>; + }; +}; + +&touchkey { + vcc-supply = <®_touch_key>; + vdd-supply = <®_key_led>; }; &accelerometer { @@ -81,6 +112,22 @@ panel_vdd3_default: panel-vdd3-default { bias-disable; }; + tkey_en_default: tkey-en-default { + pins = "gpio86"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + + tkey_led_en_default: tkey-led-en-default { + pins = "gpio60"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + ts_int_default: ts-int-default { pins = "gpio13"; 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: 454257 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 4C33CC48BE6 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 3943E61042 for ; Fri, 4 Jun 2021 17:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231176AbhFDRdh (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: devicetree@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"; From patchwork Fri Jun 4 17:27:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 454258 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 F1EC0C48BDF for ; Fri, 4 Jun 2021 17:31:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD07961042 for ; Fri, 4 Jun 2021 17:31:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231175AbhFDRdh (ORCPT ); Fri, 4 Jun 2021 13:33:37 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.170]:35868 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231132AbhFDRdh (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=FWkBjSJ9NzrBBKVQXJdixKMdux64NXMe1Z/fvatnpx55G3g2gi0Zi/tx5eFGXVKdVt fkuYY6jxXlBLnmhIh5/FqmuElEWZr3jJOoba6Sx5zYWxvnbqYGPX5Tb91wcP2hGgf57J aRliAYAEYdKxAV4tWzobnfYoGv8Db+wCsJJHTEpw6ujucQf3OEYrR7cvJveZXZQS01LF 1K0ypaoMeWfSbAGl4ROHEJjrDv5mvnwNKcrgbN1a7FBOdU8MZbipLqCtIdZ8+O2dxLS6 UPQhwty4otx/vwYZw9Uozxxb/wCxSLRHXjA7kwYDe/xoLKfyDY/U/qiq/mYYPXlFtvSo gyfQ== 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=JyS3FQxJZ5yMJJEmnO8zGk2QyVkrz3MttXjb4FvQI1k=; b=RrsBYJ87kPEIqcUcnpMb8nsEs5oPa+U2TCxEP1s68MsQDzCOoxxFw7hqVtS5hseAbn ts/FPVmbZY4cQ0sXhmqmpVUkMO5xqqmpQ5gtY4jD3YkqLGrqLvI1zkHcPwpdaSYjJcki 5VNYwKNdONW62NQkhe7ysC7a8T1Nnyyzm30TGzd/GP/BL4FXJFWZmFSVnKr8NWULDo3m Kdy6lBkUmdQVNgi0E1sclsNWacgkrQOGg04Q/t9pSIw8XTmNzEvpH7/UetA7++pqRcNa QHQFzjByIPhXI+EeutK9lLpfYQx0a7k8/6jAdgRtYBz7W6Vox14Xh6/golO5KRBKm9zZ vSDA== 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=JyS3FQxJZ5yMJJEmnO8zGk2QyVkrz3MttXjb4FvQI1k=; b=A51x1wkyHoxG6JA32EObMN5MFjLoqRf2dFkMYsm6JSYRLXQlik6HGI7fVNyWoHloxJ h7v74fsARmoy8Yt2/Us9f8C5JrBy7h4jmfyYIjcft/3aUtm11c3JCdz+nJKYDutGlBxe w7T/j9Uc6/N8rbWGoDTj6wGKpyIHlvParPuZQv3XfzJVBM8xcOrNzSew8jh0DDA/gxZu 9XcFKC+52WzRhXXkP1vqsTGBb+KxKmF850kZ4EvEc0ak44gR3E426uLYKyhm1fXXGyIE ZzlzdlPg/4j5AI1Pl0cu03+ZqLeEPqy8A18QG6hcGq1t4PQHz6mfCjo9OQBCopi2kpzZ Grwg== 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 y01375x54HVjH5a (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 4 Jun 2021 19:31:45 +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 4/5] arm64: dts: qcom: msm8916-samsung-a2015: Add rt5033 battery Date: Fri, 4 Jun 2021 19:27:41 +0200 Message-Id: <20210604172742.10593-4-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: devicetree@vger.kernel.org The Samsung Galaxy A3/A5 use 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: Stephan Gerhold --- .../qcom/msm8916-samsung-a2015-common.dtsi | 22 +++++++++++++++++++ 1 file changed, 22 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 3c77e7ef9eda..9a6988ded29d 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi @@ -151,6 +151,20 @@ magnetometer@12 { }; }; +&blsp_i2c4 { + status = "okay"; + + battery@35 { + compatible = "richtek,rt5033-battery"; + reg = <0x35>; + interrupt-parent = <&msmgpio>; + interrupts = <121 IRQ_TYPE_EDGE_BOTH>; + + pinctrl-names = "default"; + pinctrl-0 = <&fg_alert_default>; + }; +}; + &blsp1_uart2 { status = "okay"; }; @@ -313,6 +327,14 @@ accel_int_default: accel-int-default { bias-disable; }; + fg_alert_default: fg-alert-default { + pins = "gpio121"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + gpio_keys_default: gpio-keys-default { pins = "gpio107", "gpio109"; function = "gpio"; From patchwork Fri Jun 4 17:27:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 454785 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 9259EC49EA2 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 8008B61042 for ; Fri, 4 Jun 2021 17:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231140AbhFDRdi (ORCPT ); Fri, 4 Jun 2021 13:33:38 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.81]:13066 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230508AbhFDRdh (ORCPT ); Fri, 4 Jun 2021 13:33:37 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1622827906; cv=none; d=strato.com; s=strato-dkim-0002; b=FfNbc5Ygj+VwOZMsmA4zRq9MiRJWkVPuke4BFF2udE1vuzy/u+Fbrxj1/z0lWvhyWG +rml+4a65aHPVk9Z8EQXy3new/0FgB5VtUUW3u7SPsM+1Iloks203FS7zj6IfwnSShX3 3sE6v3Kk8aOoyZ2OZuyFy1yaNrNmpoh7IrmM4dNtxCEfvfiCGDFk82Oon4oAgMa6ta/U ikk0RoLbLejKZkmc2MW5A12ct2xUb9qbTVK+lgvBGxtGCVyt3akVzjWp7iLj+hQnOsif UgyOe0JlH8JzcU+UNXUkrKpzz0CiYsnwJErtSqMaAba9+F1bdoYCn5t49jmRK86FGxQ+ lS+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1622827906; 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=mSYYPDriWafDsRnOq+e+C/pvcp+yUcNz2lLVJri/j88=; b=IWgknCRaeyrVDK3X7+5SLVpW9oIjsi8OhhJP2BpZp9eZf7gLWKf2zyx2fwCdqhJ3fa TTyh4S2p7Hf2MoYlKztNDPPaxXN4lX+Ypv14zXFtYsVzUkTfiAFBWIXaaJR6/xpmndLR vAcslNkCJIM9RXwKf5jzVH28yExCChyfVP8uZIj+7D4tcZwwVp52/NuMWHN3wC1wEVZK BI6jlUGZaXgb2PBNMlQZ72fgOxChnIeG4Wf2RrInaQDCRnISeErCzK1ld4ymMhMhXN3i Jdteudg5irVLG5eUvgyBWzCvKcx+LeptDW/hYqtPx0zgTUeSlK5QrLRGpSad+kz3IqAA LcDg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1622827906; 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=mSYYPDriWafDsRnOq+e+C/pvcp+yUcNz2lLVJri/j88=; b=r+j84QF89zvDdLE7k8FmaZs0SncsfWMPV/vhiKwKMludSV99CLoPjulewG5Ssg0gUr uBrIm3KjpAGFTvQ2RV1qqxBbjUMUpEVguEQt+QtOwcj8Z5eyGymU2MlDoMlTWowkMnjV 9d71ikyuzY3cnnOodtK4TXPW8slRswtBsmtabAf7Ix8urHWKlFz2HMPpacAe082WG+wA ue86k32ud6kDRKP1FmNMRshWWa0N28cHaK4xrBGUqb2h6pNWM0Ra7z0drXGRd10ttmME L589hKlcwK1Z2MwVzOuh6S7Z6pw7btCxLx8WTD/yrHGJ2tHmfqTRE/hpuj6F4IeD2yJz 4Naw== 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 y01375x54HVjH5b (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 4 Jun 2021 19:31:45 +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 , Krzysztof Kozlowski Subject: [PATCH 5/5] arm64: dts: qcom: msm8916-samsung-a2015: Add NFC Date: Fri, 4 Jun 2021 19:27:42 +0200 Message-Id: <20210604172742.10593-5-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: devicetree@vger.kernel.org The Samsung Galaxy A3/A5 both have a Samsung S3FWRN5 NFC chip that works quite well with the s3fwrn5 driver in the Linux NFC subsystem. The clock setup for the NFC chip is a bit special (although this seems to be a common approach used for Qualcomm devices with NFC): The NFC chip has an output GPIO that is asserted whenever the clock is needed to function properly. On the A3/A5 this is wired up to PM8916 GPIO2, which is then configured with a special function (NFC_CLK_REQ or BB_CLK2_REQ). Enabling the rpmcc RPM_SMD_BB_CLK2_PIN clock will then instruct PM8916 to automatically enable the clock whenever the NFC chip requests it. The advantage is that the clock is only enabled when needed and we don't need to manage it ourselves from the NFC driver. 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. Cc: Krzysztof Kozlowski Signed-off-by: Stephan Gerhold Acked-by: Krzysztof Kozlowski --- .../qcom/msm8916-samsung-a2015-common.dtsi | 64 +++++++++++++++++++ 1 file changed, 64 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 9a6988ded29d..9b4b7de7cec2 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi @@ -4,6 +4,7 @@ #include #include #include +#include / { aliases { @@ -124,6 +125,34 @@ touchkey: touchkey@20 { pinctrl-0 = <&tkey_default>; }; }; + + i2c-nfc { + compatible = "i2c-gpio"; + sda-gpios = <&msmgpio 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&msmgpio 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + + pinctrl-names = "default"; + pinctrl-0 = <&nfc_i2c_default>; + + #address-cells = <1>; + #size-cells = <0>; + + nfc@27 { + compatible = "samsung,s3fwrn5-i2c"; + reg = <0x27>; + + interrupt-parent = <&msmgpio>; + interrupts = <21 IRQ_TYPE_EDGE_RISING>; + + en-gpios = <&msmgpio 20 GPIO_ACTIVE_HIGH>; + wake-gpios = <&msmgpio 49 GPIO_ACTIVE_HIGH>; + + clocks = <&rpmcc RPM_SMD_BB_CLK2_PIN>; + + pinctrl-names = "default"; + pinctrl-0 = <&nfc_default &nfc_clk_req>; + }; + }; }; &blsp_i2c2 { @@ -384,6 +413,30 @@ muic_int_default: muic-int-default { bias-disable; }; + nfc_default: nfc-default { + pins = "gpio20", "gpio49"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + + irq { + pins = "gpio21"; + function = "gpio"; + + drive-strength = <2>; + bias-pull-down; + }; + }; + + nfc_i2c_default: nfc-i2c-default { + pins = "gpio0", "gpio1"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + tkey_default: tkey-default { pins = "gpio98"; function = "gpio"; @@ -408,3 +461,14 @@ tsp_en_default: tsp-en-default { bias-disable; }; }; + +&pm8916_gpios { + nfc_clk_req: nfc-clk-req { + pins = "gpio2"; + function = "func1"; + + input-enable; + bias-disable; + power-source = ; + }; +};