Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1678913pxj; Wed, 19 May 2021 11:16:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxz/OU3TH0a/tl47ZvnALIdXT0WNq0P0Fjx/fBNf/9q1Bs9yrATq14wTv90CjJ15bHNY/Z8 X-Received: by 2002:a17:906:1dc2:: with SMTP id v2mr496151ejh.8.1621448200435; Wed, 19 May 2021 11:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621448200; cv=none; d=google.com; s=arc-20160816; b=Dnbqtt5SteZo91hhqlRPB5mQBXuDR3IsuPdf3aijI8kBEaFOhT8KIwrWCWWrdcc735 UqHsPLOsSxdcAG8POZOaL9XjSeOBYA2r7kGiqIGJcHhqkrriNEyiL2WCVIqV5eamNbPK 0wZ2AIhtsR9yUd3VKBoWTQnj173wT1m2XQzQ6eLpZKD/lsy6HVSEPyts8mWa5h7XDy30 g+wGP1AnAzBIZU3LH+pH9GFGcIoSGc+CoK/6dovvXVakCCZdzzjWxJSgFDMqywAtDjNG UB+ITaYG+nwzuKan5FeT83wDomZ33Hz6RVhdNSFDTcNOomiMv3ScyvEx8FssLXglkJSu Vllg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=zIep+mDf5u2lcxAQ599gQS4SQzw/nWv5n3LYaeTIvWc=; b=RCpx1qGGV1AwiyeOd4do+58lnRREisrQYlZvJHQR0tvgSKfsq29mwkXMy25iNqR1wy madDlsX6/D00DtqKLwMmqsOQ51Ni139ZEX3S8M6C5yXlcLKP/Y2fMPTIVsx342vKz69O HjzRYTJHG7xlSS69gjZrlZOJuk8vNwntm9x9l/tUhme4mk2tqKkCqR6bNAtXwWKukelb wcEXnlYvvwW/Zo4he0miXkGhQ7eiMKgsuTJBXwC9qlWKxpUN9w6dvHauv81s1xSPvFH4 wRpGNXkLnC4gIYwczer4q2GYvDR+JvNIxpAhe7NOYG3pfXW/Yb8TcnO7RywDKLEuPEP7 RG4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r1si305723ejd.259.2021.05.19.11.16.15; Wed, 19 May 2021 11:16:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232297AbhEROcK (ORCPT + 99 others); Tue, 18 May 2021 10:32:10 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:51681 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232197AbhEROcH (ORCPT ); Tue, 18 May 2021 10:32:07 -0400 Received: from mail-qk1-f198.google.com ([209.85.222.198]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lj0kB-0003ax-3N for linux-kernel@vger.kernel.org; Tue, 18 May 2021 14:30:47 +0000 Received: by mail-qk1-f198.google.com with SMTP id 140-20020a3704920000b02903a568b50545so1576370qke.7 for ; Tue, 18 May 2021 07:30:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zIep+mDf5u2lcxAQ599gQS4SQzw/nWv5n3LYaeTIvWc=; b=EQKq2aQSezjD1ir2Q0APPzMsQRcl2paJb++k5reA6wqBDVi/xLO4HBtIL9vELre7zB +wvlmYrQSJHszNzsaZ02G3uzQgTQ11+YdKI9562F9x1hmmsRC7qhaIoUdcwxxuphfENN l0Rw6th9oamPycOoeVbih/TLnwE6zmlGTRRXCxLLP/RxOUYnHS/4G4OHyKZ1zOCFT4kr Xsz5yVUtpFXyGQ0ZwCHhlg4csQdRU92uhpYPY/QONJTv4WESTPeJWnstKihTPbCrhWo6 HnaSRkc4ZRqrw7HaNYWsBEofTbjxVP/SU87N/FF7Wf/BBZJxFUTRMcqxqKWlp6TEoRNh BCwg== X-Gm-Message-State: AOAM531M3t+FKezFORzQ+++iHpgkD9TzxVkuKfcUudhOyfoUi6NU5l+7 vv/pna5bQtaQ0wARPi9RCGMFdeMNj41cSu3ZQPLDmhqacrP0anog4qyuD8m6o57sphIP5h8c54k Vj95ILjGl5lmhiysO9TQT74bI7KZf6TSvF9EGtLywiQ== X-Received: by 2002:a05:622a:210:: with SMTP id b16mr5045001qtx.51.1621348246228; Tue, 18 May 2021 07:30:46 -0700 (PDT) X-Received: by 2002:a05:622a:210:: with SMTP id b16mr5044978qtx.51.1621348246015; Tue, 18 May 2021 07:30:46 -0700 (PDT) Received: from [192.168.1.4] ([45.237.48.6]) by smtp.gmail.com with ESMTPSA id h14sm3811162qto.58.2021.05.18.07.30.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 May 2021 07:30:45 -0700 (PDT) Subject: Re: [linux-nfc] [PATCH 2/2] nfc: s3fwrn5: i2c: Enable optional clock from device tree To: Stephan Gerhold , "David S. Miller" , Jakub Kicinski Cc: Rob Herring , linux-nfc@lists.01.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bongsu Jeon , ~postmarketos/upstreaming@lists.sr.ht References: <20210518133935.571298-1-stephan@gerhold.net> <20210518133935.571298-2-stephan@gerhold.net> From: Krzysztof Kozlowski Message-ID: Date: Tue, 18 May 2021 10:30:43 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210518133935.571298-2-stephan@gerhold.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thanks for the patch. On 18/05/2021 09:39, Stephan Gerhold wrote: > s3fwrn5 has a NFC_CLK_REQ output GPIO, which is asserted whenever > the clock is needed for the current operation. This GPIO can be either > connected directly to the clock provider, or must be monitored by > this driver. > > As an example for the first case, on many Qualcomm devices the > NFC clock is provided by the main PMIC. The clock can be either > permanently enabled (clocks = <&rpmcc RPM_SMD_BB_CLK2>) or enabled > only when requested through a special input pin on the PMIC > (clocks = <&rpmcc RPM_SMD_BB_CLK2_PIN>). > > On the Samsung Galaxy A3/A5 (2015, Qualcomm MSM8916) this mechanism > is used with S3FWRN5's NFC_CLK_REQ output GPIO to enable the clock > only when necessary. However, to make that work the s3fwrn5 driver > must keep the RPM_SMD_BB_CLK2_PIN clock enabled. This contradicts the code. You wrote that pin should be kept enabled (somehow... by driver? by it's firmware?) but your code requests the clock from provider. > > This commit adds support for this by requesting an optional clock Don't write "This commit". https://elixir.bootlin.com/linux/latest/source/Documentation/process/submitting-patches.rst#L89 > and keeping it permanently enabled. Note that the actual (physical) > clock won't be permanently enabled since this will depend on the > output of NFC_CLK_REQ from S3FWRN5. What pin is that "NFC_CLK_REQ"? I cannot find such name. Is it GPIO2? What clock are you talking here? The one going to the modem part? I also don't see here how this clock is going to be automatically on-off... driver does not perform such. Unless you speak about your particular HW configuration where the GPIO is somehow connected with AND (but then it is not relevant to the code). > > In the future (when needed by some other device) this could be > extended to work for the second case (monitoring the NFC_CLK_REQ > GPIO and enabling the clock from the kernel when needed). > > Signed-off-by: Stephan Gerhold > --- > drivers/nfc/s3fwrn5/i2c.c | 32 ++++++++++++++++++++++++++++++-- > 1 file changed, 30 insertions(+), 2 deletions(-) > Best regards, Krzysztof