Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3170647pxb; Tue, 12 Oct 2021 23:52:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuo/kLNpTLd/l2w8lOc3P6fe0UFeeAUqkzYLw6sJNnbyZtdqotZUaAmZakhliq5b0XGUKs X-Received: by 2002:a17:902:a414:b0:13e:45cd:1939 with SMTP id p20-20020a170902a41400b0013e45cd1939mr34056502plq.54.1634107937882; Tue, 12 Oct 2021 23:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634107937; cv=none; d=google.com; s=arc-20160816; b=n0+a7bWzjKcTFIabPNOEw8YFHwl6Q2HundFoA6/F146Fw2gP3g1MoqmR0v6iKX6cr6 j3rXk+8+N24JBPZenydD0HbuLuY+7HWtjkNaRbgN0UtypCs6natSwOqe8GVGmkHRRuGG 16UcyFF+OZpUDuXHn1fvWIwCTmo0ACJd2WM/Zhaf6R+s6IA2MOfgdCWikOkp5eWb/+0z IGiKCGJmqCktTt3TN9n7InJJx6lSLEJWQf4ptZqx6wWz0152zAgfuR5SZ9SltZBl7TFo Js1FrDoekFXRuN2GQwW2f8mXQlcVmmt9TGkelJRs4jK2st+iOINsZwpdJ9WV7V7VIO/W GGMQ== 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=1ZFyXssI7TrFyz6t72UIWjHiVPEaGRTFviZ9B7b1svQ=; b=Xbmekw2gWx8wwRcImCJNpsR3h+diRf+2w34nwa3a8LRrJGmJRsdNk6wFZHXAydktZ9 V8w3XV5SwAlHUiQoHtuedibYjCKlL0TLyRnFTal7vU2KyxEYWZz6qw6n2q6dIb0xSKop dI6gr/N+dxt9nqtdIxtpNPvRo6dbouwH+Hh9WYGAN6S0yOMSWuvVwtUx8LdeaZ0QWWaY QmOmufq7oRrun0IX/B80mhsC21PuyY6h/7WdFz0UA4YZbGsvQhFeqIbRJt3T7f+DJ81F qBk/bxHBM5cHiwtfdTM8RwBy6vnr5Ikvf74OtBDs/4asN7BV5Z3FYwaTUYtMGipKDBYd +GrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iPAivlo5; 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 u4si4458079plf.415.2021.10.12.23.52.05; Tue, 12 Oct 2021 23:52:17 -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=iPAivlo5; 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 S233614AbhJMGvp (ORCPT + 99 others); Wed, 13 Oct 2021 02:51:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237918AbhJMGvp (ORCPT ); Wed, 13 Oct 2021 02:51:45 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37650C061714 for ; Tue, 12 Oct 2021 23:49:42 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id z11so7250985lfj.4 for ; Tue, 12 Oct 2021 23:49: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=1ZFyXssI7TrFyz6t72UIWjHiVPEaGRTFviZ9B7b1svQ=; b=iPAivlo5uIKBxRfNUXcOVhQG7osPvDAYsKhzpbHwuoQ9aRqJOVq0CIRSJJLsHiVUUR esn/LxUxQJ3bT6IDck5KrRR4XQfGxDdO1QkAnr3Efw+Jbn0XB6gZpc621AyVERubhwWH hl+97CPoXQzYj7hxmpDhOVSF3m6+2E3dxeqPQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1ZFyXssI7TrFyz6t72UIWjHiVPEaGRTFviZ9B7b1svQ=; b=Wg9tNYk4KrgcSGKsiHorYVEsJlYLzX2IXf2bOJ+Wk0I256PCGYC95iuPrA8x0pQX2t G4j7i8Kdn2CTwUPZQ3HFy0DFoemQnvKdsRhpRGz6H+yaX0K6gGh2e8vxbAzwzMDeAD53 UXrloL+J7fmlv5A7AUuIbEp1G6ahqHLAzgKbTxuNHMxAb7bwzvIkDwnY6q7zjJMMQB/t vl5Q1hVELBXLX41ROM6/zTnaVhp8iRDAngVWu2nAuh/2Sieb+KvD6a5RrPuhhB3ET1gR IV0PRlnp5bg20pCPyBIQXZOsKhwtoU/l11pSkJ7OHzellj5ulmtHAmUYGVbcxaNTu4ZY wtkA== X-Gm-Message-State: AOAM531O6Sfx0pLsPe0EdkhC4WtgQCTuNOAp4ErZmq1CRXSzVvqBLy/B Q6XKYMMjMPgt4EMPzdYLggnNzyNC7ellF2ipzIE62Q== X-Received: by 2002:ac2:5627:: with SMTP id b7mr9696386lff.670.1634107780512; Tue, 12 Oct 2021 23:49:40 -0700 (PDT) MIME-Version: 1.0 References: <20210924080632.28410-1-zhiyong.tao@mediatek.com> <20210924080632.28410-3-zhiyong.tao@mediatek.com> <37eac06e20d82c0fe37a5d8e5633cbbc48d4af29.camel@mediatek.com> In-Reply-To: <37eac06e20d82c0fe37a5d8e5633cbbc48d4af29.camel@mediatek.com> From: Chen-Yu Tsai Date: Wed, 13 Oct 2021 14:49:29 +0800 Message-ID: Subject: Re: [PATCH v14 2/5] dt-bindings: pinctrl: mt8195: change pull up/down description To: "zhiyong.tao" Cc: Rob Herring , Linus Walleij , Mark Rutland , Matthias Brugger , Sean Wang , srv_heupstream , hui.liu@mediatek.com, Light Hsieh , Biao Huang , Hongzhou Yang , Sean Wang , Seiya Wang , Devicetree List , LKML , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "moderated list:ARM/Mediatek SoC support" , "open list:GPIO SUBSYSTEM" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 9:59 AM zhiyong.tao wrote: > > On Wed, 2021-09-29 at 16:47 -0500, Rob Herring wrote: > > On Fri, Sep 24, 2021 at 04:06:29PM +0800, Zhiyong Tao wrote: > > > For supporting SI units in "bias-pull-down" & "bias-pull-up", > > > change pull up/down description > > > and add "mediatek,rsel_resistance_in_si_unit" description. > > > > > > Signed-off-by: Zhiyong Tao > > > --- > > > .../bindings/pinctrl/pinctrl-mt8195.yaml | 86 > > > ++++++++++++++++++- > > > 1 file changed, 84 insertions(+), 2 deletions(-) > > > > > > diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl- > > > mt8195.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl- > > > mt8195.yaml > > > index 2f12ec59eee5..5f642bef72af 100644 > > > --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8195.yaml > > > +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8195.yaml > > > @@ -49,6 +49,12 @@ properties: > > > description: The interrupt outputs to sysirq. > > > maxItems: 1 > > > > > > + mediatek,rsel_resistance_in_si_unit: > > > > s/_/-/ > > Hi Rob, > > what do you mean? He means: replace the hyphens ("-") with underscores ("_"). (s/X/Y/ is a regular expression.) > > > > > + type: boolean > > > + description: | > > > + Identifying i2c pins pull up/down type which is RSEL. It can > > > support > > > + RSEL define or si unit value(ohm) to set different > > > resistance. > > > > Aren't the RSEL and ohms disjoint values? 0-207 for RSEL and >1000 > > for > > ohms. Why is this property even needed. > > > No, they aren't. > As we talked in v11. "mediatek,rsel_resistance_in_si_unit" is only a > flag. > > > > Hi ChenYu, > > In the next version, we provide a solution which we discussed internal > to avoid value clashes. > > The solution: > 1. We will keep the define "MTK_PULL_SET_RSEL_000 200". It won't > change. > > 2. We will add a property in pio dtsi node, for example, > the property name is "rsel_resistance_in_si_unit". > We will add a flag "rsel_si_unit" in pinctrl device. > in probe function, we will identify the property name > "rsel_resistance_in_si_unit" to set the flag "rsel_si_unit" value. > So it can void value clashes. > > 3.We will provide the define "MTK_PULL_SET_RSEL_000 200" and si unit > two solution. users can support which solution by add property > "rsel_resistance_in_si_unit" in dts node or not. Right. I thought that is what is implemented in this version already? Also I just realized that this binding is limited in scope to just the MT8195, for which we already know that the RSEL values do not overlap with MTK_PULL_SET_RSEL_*. I assume that is why Rob thinks the flag is unnecessary. > > > + > > > #PIN CONFIGURATION NODES > > > patternProperties: > > > '-pins$': > > > @@ -85,9 +91,85 @@ patternProperties: > > > 2/4/6/8/10/12/14/16mA in mt8195. > > > enum: [0, 1, 2, 3, 4, 5, 6, 7] > > > > > > - bias-pull-down: true > > > + bias-pull-down: > > > + description: | > > > + For pull down type is normal, it don't need add RSEL & > > > R1R0 define > > > + and resistance value. > > > + For pull down type is PUPD/R0/R1 type, it can add R1R0 > > > define to > > > + set different resistance. It can support > > > "MTK_PUPD_SET_R1R0_00" & > > > + "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & > > > "MTK_PUPD_SET_R1R0_11" > > > + define in mt8195. > > > + For pull down type is RSEL, it can add RSEL define & > > > resistance value(ohm) > > > + to set different resistance by identifying property > > > "mediatek,rsel_resistance_in_si_unit". > > > + It can support "MTK_PULL_SET_RSEL_000" & > > > "MTK_PULL_SET_RSEL_001" > > > + & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" & > > > "MTK_PULL_SET_RSEL_100" > > > + & "MTK_PULL_SET_RSEL_101" & "MTK_PULL_SET_RSEL_110" & > > > "MTK_PULL_SET_RSEL_111" > > > + define in mt8195. It can also support resistance > > > value(ohm) "75000" & "5000" in mt8195. > > > + oneOf: > > > > Because of the indentation, this is all just part of 'description'. > > Can you help to give some suggestion to fix it? Unindent it by two spaces, so that it is at the same level with "description:". > > > + - enum: [100, 101, 102, 103] > > > + - description: mt8195 pull down PUPD/R0/R1 type define > > > value. > > > > This entry is always true. > > why is it always true? we only get define value. > "100~104" are means that "#define MTK_PUPD_SET_R1R0_10 102" in > include/dt-bindings/pinctrl/mt65xx.h. "description" is not a conditional match, so it always evaluates to true. Based on my limited DT schema and YAML knowledge, I think the underlying issue is that you have the structure incorrectly defined. "-" denotes a list item. So in your example, you have "enum" and "description" as separate associative arrays, each as a list item part of the "oneOf" list. What you want is actually: oneOf: - enum: [100, 101, 102, 103] description: mt8195 pull down PUPD/R0/R1 type define value. - enum: [200, 201, 202, 203, 204, 205, 206, 207] description: mt8195 pull down RSEL type define value. So that "enum" and "description" are part of the same associative array. Note the lack of a "-" and the extra indentation in front of "description". Regards ChenYu > > > > > + - enum: [200, 201, 202, 203, 204, 205, 206, 207] > > > > Are these supposed to be hex? > yes, it is patch 1/5 define "#define MTK_PULL_SET_RSEL_000 200". > > > > > + - description: mt8195 pull down RSEL type define > > > value. > > > > And so is this one. That makes 'oneOf' always false. > > why is it always false? we only get the si unit value. > > > > > > + - enum: [75000, 5000] > > > + - description: mt8195 pull down RSEL type si unit > > > value(ohm). > > > + > > > + An example of using RSEL define: > > > + pincontroller { > > > + i2c0_pin { > > > + pinmux = ; > > > + bias-pull-down = ; > > > + }; > > > + }; > > > + An example of using si unit resistance value(ohm): > > > + &pio { > > > + mediatek,rsel_resistance_in_si_unit; > > > + } > > > + pincontroller { > > > + i2c0_pin { > > > + pinmux = ; > > > + bias-pull-down = <75000>; > > > + }; > > > + }; > > > > > > - bias-pull-up: true > > > + bias-pull-up: > > > + description: | > > > + For pull up type is normal, it don't need add RSEL & > > > R1R0 define > > > + and resistance value. > > > + For pull up type is PUPD/R0/R1 type, it can add R1R0 > > > define to > > > + set different resistance. It can support > > > "MTK_PUPD_SET_R1R0_00" & > > > + "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & > > > "MTK_PUPD_SET_R1R0_11" > > > + define in mt8195. > > > + For pull up type is RSEL, it can add RSEL define & > > > resistance value(ohm) > > > + to set different resistance by identifying property > > > "mediatek,rsel_resistance_in_si_unit". > > > + It can support "MTK_PULL_SET_RSEL_000" & > > > "MTK_PULL_SET_RSEL_001" > > > + & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" & > > > "MTK_PULL_SET_RSEL_100" > > > + & "MTK_PULL_SET_RSEL_101" & "MTK_PULL_SET_RSEL_110" & > > > "MTK_PULL_SET_RSEL_111" > > > + define in mt8195. It can also support resistance > > > value(ohm) > > > + "1000" & "1500" & "2000" & "3000" & "4000" & "5000" & > > > "10000" & "75000" in mt8195. > > > + oneOf: > > > + - enum: [100, 101, 102, 103] > > > + - description: mt8195 pull up PUPD/R0/R1 type define > > > value. > > > + - enum: [200, 201, 202, 203, 204, 205, 206, 207] > > > + - description: mt8195 pull up RSEL type define value. > > > + - enum: [1000, 1500, 2000, 3000, 4000, 5000, 10000, > > > 75000] > > > + - description: mt8195 pull up RSEL type si unit > > > value(ohm). > > > > Same issues here. > > > > > + An example of using RSEL define: > > > + pincontroller { > > > + i2c0_pin { > > > + pinmux = ; > > > + bias-pull-up = ; > > > + }; > > > + }; > > > + An example of using si unit resistance value(ohm): > > > + &pio { > > > + mediatek,rsel_resistance_in_si_unit; > > > + } > > > + pincontroller { > > > + i2c0_pin { > > > + pinmux = ; > > > + bias-pull-up = <1000>; > > > + }; > > > + }; > > > > > > bias-disable: true > > > > > > -- > > > 2.25.1 > > > > > > > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek