Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5954898pxv; Thu, 29 Jul 2021 02:44:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLTlZJWk84/bVLs2UsDNqUDdJ31tvGYfNqSvon23bC1ZtQsAFGazBMFyf46YkwB3gROJOR X-Received: by 2002:a6b:f40a:: with SMTP id i10mr3404680iog.139.1627551881714; Thu, 29 Jul 2021 02:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627551881; cv=none; d=google.com; s=arc-20160816; b=efGAWr3RfqPDgneEg4+j+yxbRHGbyauek4xoBS8qQd5pjiADOxDz8Qu+C0EqTuLiDr BQdeCpJmUTcmepTl2+2Xm+/5bEvpiKeuhoiqBrcZVXWOkO11ticCJ/7VKvLCaJ+zrU02 ybg1J4v4chDNrnMLeKY9pWqncv3lEeYMhHnqFNa/sRdTWZlcSK5eqnjeQsEB8+PNgX/0 bFI4V27DDV7hCfsidgfmfx/BzmZ3GQQ6MjJveo+NqQS6lqMANkjWlED9otCXr+GdVCZy 5/SmuE3kZOPwtkeyKSBpHPUuLyfT9K3l00bva2jvG9MqnfUt5iOjFwJL6q+qSwA32Vu5 8wQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rsaad1GJ/XkOm8cfftebiAxoVa/TpWToS62izuGJ9pY=; b=0wHDClifSLHXVqOphCj5RCKBEzSDQMSCI/Q3HFYq2TwLyZsjUvEcZ18tyv3MLsGJ+y sSsqEGOlsy1NzkBfKVVn7dRloPkcqVbK2ZEoVD9Pn0TjJDFiWKN2F8JwZxdJuFQwVJRn mw+Yr2Gbx36agjRy8kH3kPTl/q91rOnlo0qTFBcqvYXZ6YqtZST5Y35lbqzFvhVuZkkw bxrdj22N2pVSudILUYdULFzg4UBEXcnK6BSRaZBKSHgEs0SBYujptgFZZ57sIpyE2ubu 84WHw8FV/CgNL60xd6qml77WxpT6Z/M4Y6gqW3IOktKt9DkyCobxhvEHH8upTkYMM19f hbvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ROFh5zsD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si2973397ios.10.2021.07.29.02.44.29; Thu, 29 Jul 2021 02:44:41 -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; dkim=pass header.i=@chromium.org header.s=google header.b=ROFh5zsD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235141AbhG2Jnq (ORCPT + 99 others); Thu, 29 Jul 2021 05:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235019AbhG2Jnq (ORCPT ); Thu, 29 Jul 2021 05:43:46 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DC02C0613C1 for ; Thu, 29 Jul 2021 02:43:43 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id a26so9779417lfr.11 for ; Thu, 29 Jul 2021 02:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rsaad1GJ/XkOm8cfftebiAxoVa/TpWToS62izuGJ9pY=; b=ROFh5zsDdjGB7xsZ3gfN08X4TCqyLE5GcRkJ/K9oEApY7i/IignrvExID9mp+hgOyH m+q2hwtfQ3PcGy4Zu1LihgEvq5qWFR/OkQ+71zz+O8nUDZjw76nkxxU3HSuT73irF7KN 57aQnO2wW+VyKNylkZJkCNV4eqIcS2Gdtt3M0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rsaad1GJ/XkOm8cfftebiAxoVa/TpWToS62izuGJ9pY=; b=XRK0HXS6ZDR6nc3nFWAzTHyyxDs8v7XWrRzx78l8EsK3kZlNteXyDeHrii+mGTzje6 6W59oiqHxP5zXGDcq97xEORL+pliUtDfW5eqbY7ISD8GmA+R5UVbEJyZH+VxzVLEZUEU KKEMl0D7I8dY+ik6Ct6XffXRPT+LNPuIsyo9+eWs1fJT1hRnyOuJYKQ7PmgtiIFYynwp jAhHFk1WylZuK+IN+vW5MNBfXUeeDd2vQIff80aQsh6esJ3Kyk7ZTYfneQ/wOgBfdsu4 JtR7QMMiIEdXVCoxUDKm9bDIMCTXURjDU4ILK4DIX5o1WF9OrJq6UliHllQT3ww0gwMW FsSw== X-Gm-Message-State: AOAM533OYOIoZOdzVG4ezMiT9u89N92XGa5gmxwDkrMoFNpy10oiXYCt iYp6KCpYVjSfHD7aMl4YrRcv5jlVAGMUu0JDXE7Y6w== X-Received: by 2002:a05:6512:a89:: with SMTP id m9mr3260592lfu.342.1627551821389; Thu, 29 Jul 2021 02:43:41 -0700 (PDT) MIME-Version: 1.0 References: <20210710081722.1828-1-zhiyong.tao@mediatek.com> <20210710081722.1828-2-zhiyong.tao@mediatek.com> <1626940470.29611.9.camel@mhfsdcap03> <07388dac4e25e0f260725e8f80ba099d5aa80949.camel@mediatek.com> In-Reply-To: <07388dac4e25e0f260725e8f80ba099d5aa80949.camel@mediatek.com> From: Chen-Yu Tsai Date: Thu, 29 Jul 2021 17:43:30 +0800 Message-ID: Subject: Re: [PATCH v10 1/2] dt-bindings: pinctrl: mt8195: add rsel define To: "zhiyong.tao" Cc: Rob Herring , Linus Walleij , mark.rutland@arm.com, Matthias Brugger , Sean Wang , srv_heupstream , hui.liu@mediatek.com, Eddie Huang , light.hsieh@mediatek.com, biao.huang@mediatek.com, hongzhou.yang@mediatek.com, Sean Wang , Seiya Wang , Devicetree List , LKML , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "moderated list:ARM/Mediatek SoC support" , linux-gpio@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 29, 2021 at 4:23 PM zhiyong.tao wrote: > > On Mon, 2021-07-26 at 16:02 +0800, Chen-Yu Tsai wrote: > > On Thu, Jul 22, 2021 at 3:54 PM zhiyong tao > > wrote: > > > > > > On Tue, 2021-07-13 at 15:17 +0800, Chen-Yu Tsai wrote: > > > > Hi, > > > > > > > > On Sat, Jul 10, 2021 at 4:17 PM Zhiyong Tao < > > > > zhiyong.tao@mediatek.com> wrote: > > > > > > > > > > This patch adds rsel define for mt8195. > > > > > > > > > > Signed-off-by: Zhiyong Tao > > > > > --- > > > > > include/dt-bindings/pinctrl/mt65xx.h | 9 +++++++++ > > > > > 1 file changed, 9 insertions(+) > > > > > > > > > > diff --git a/include/dt-bindings/pinctrl/mt65xx.h b/include/dt- > > > > > bindings/pinctrl/mt65xx.h > > > > > index 7e16e58fe1f7..f5934abcd1bd 100644 > > > > > --- a/include/dt-bindings/pinctrl/mt65xx.h > > > > > +++ b/include/dt-bindings/pinctrl/mt65xx.h > > > > > @@ -16,6 +16,15 @@ > > > > > #define MTK_PUPD_SET_R1R0_10 102 > > > > > #define MTK_PUPD_SET_R1R0_11 103 > > > > > > > > > > +#define MTK_PULL_SET_RSEL_000 200 > > > > > +#define MTK_PULL_SET_RSEL_001 201 > > > > > +#define MTK_PULL_SET_RSEL_010 202 > > > > > +#define MTK_PULL_SET_RSEL_011 203 > > > > > +#define MTK_PULL_SET_RSEL_100 204 > > > > > +#define MTK_PULL_SET_RSEL_101 205 > > > > > +#define MTK_PULL_SET_RSEL_110 206 > > > > > +#define MTK_PULL_SET_RSEL_111 207 > > > > > + > > > > > > > > Instead of all the obscure macros and the new custom "rsel" > > > > property, > > > > which BTW is not in the bindings, can't we just list the actual > > > > bias > > > > resistance of each setting? We could also migrate away from R1R0. > > > > > > > > > > ==>Hi Chenyu, > > > The rsel actual bias resistance of each setting: > > > > > > MTK_PULL_SET_RSEL_000:75K in PU, 75k in PD; > > > MTK_PULL_SET_RSEL_001:10k in PU, 5k in PD; > > > MTK_PULL_SET_RSEL_010:5k in PU, 75k in PD; > > > MTK_PULL_SET_RSEL_011:4k in PU, 5K in PD; > > > MTK_PULL_SET_RSEL_100:3k in PU, 75k in PD; > > > MTK_PULL_SET_RSEL_101:2k in PU, 5K in PD; > > > MTK_PULL_SET_RSEL_110:1.5k in PU, 75k in PD; > > > MTK_PULL_SET_RSEL_111:1k in PU, 5k in PD. > > > > > > The rsel actual bias resistance is different between PU and PD. > > > > Thanks. Somehow I missed this when looking through the datasheet. > > This > > encoding is interesting. Since it doesn't make sense to have both > > pull-up and pull-down, even though the hardware seems capable of > > doing > > so, I suppose the intent is to support 75k or 5k for pull-down, and > > (75k, 10k, 5k, 4k, 3k, 2k, 1.5k, 1k) for pull-up? > > > > We could add these values to the binding so we could check for > > misuse. > > > > The range of values seems to also cover those supported by the > > alternative R0/R1 settings. The values for kprow[01] and kpcol[01] > > seem to be different though. > > > > We should get rid of the MTK_PUPD_SET_R1R0_* macros at the same time. > > They seem to be some magic values used with bias-pull-*, which is not > > how the properties should be used. At the same time, they overlap > > with > > mediatek,pull-* properties. > > > > It would be great if we could standardize on the generic pinconf > > properties, and also use real values that fit the requirements of the > > properties, i.e. using real resistance values. I'm not sure if it > > would make sense to enumerate which pins support which configurations > > though. > > > > > > Thanks > > ChenYu > > > > > The rsel actual bias resistance of each setting is different in > different IC. we think that the define "MTK_PULL_SET_RSEL_000" is more > common for all different IC. I see. I personally prefer having things clearly described. I can understand this might be an extra burden to support different chips with different parameters, though this should be fairly straightforward with lookup tables tied to the compatible strings. Let's see if Rob and Linus have anything to add. ChenYu > Thanks. > > > > > Then we can specify the setting with the standard bias-pull- > > > > up/down > > > > properties [1]. > > > > > > > > Also, please ask internally if Mediatek could relicense all the > > > > header > > > > files that Mediatek has contributed under include/dt- > > > > bindings/pinctrl/ [2] > > > > to GPL-2.0 and BSD dual license. These files are part of the DT > > > > bindings > > > > and we really want them to be dual licensed as well, and not just > > > > the > > > > YAML files. > > > > > > > > > > ==> We will confirm it internally and reply it later. > > > > > > Thanks. > > > > > > > > Regards > > > > ChenYu > > > > > > > > > > > > [1] > > > > https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml#L37 > > > > [2] Note that a few files were contributed by other people > > > > > > > > > #define MTK_DRIVE_2mA 2 > > > > > #define MTK_DRIVE_4mA 4 > > > > > #define MTK_DRIVE_6mA 6 > > > > > -- > > > > > 2.18.0 > > > > > _______________________________________________ > > > > > Linux-mediatek mailing list > > > > > Linux-mediatek@lists.infradead.org > > > > > http://lists.infradead.org/mailman/listinfo/linux-mediatek