linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Light Hsieh <light.hsieh@mediatek.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	"moderated list:ARM/Mediatek SoC support" 
	<linux-mediatek@lists.infradead.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Sean Wang <sean.wang@kernel.org>, <kuohong.wang@mediatek.com>
Subject: Re: [PATCH v7 5/6] Backward compatible to previous Mediatek's bias-pull usage
Date: Tue, 7 Jan 2020 20:16:40 +0800	[thread overview]
Message-ID: <1578399400.16092.14.camel@mtkswgap22> (raw)
In-Reply-To: <CACRpkdbto2goahTjzozi_LXXo1QNUTV1wm_rwoFOTcb36w0jkw@mail.gmail.com>

On Tue, 2020-01-07 at 11:40 +0100, Linus Walleij wrote:
> On Tue, Dec 31, 2019 at 2:41 PM Light Hsieh <light.hsieh@mediatek.com> wrote:
> 
> > Refine mtk_pinconf_set()/mtk_pinconf_get() for backward compatibility to
> > previous MediaTek's bias-pull usage.
> > In PINCTRL_MTK that use pinctrl-mtk-common.c, bias-pull setting for pins
> > with 2 pull resistors can be specified as value for bias-pull-up and
> > bias-pull-down. For example:
> >     bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
> >     bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
> >     bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
> >     bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
> >     bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
> >     bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
> >     bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
> >     bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
> >
> > On the other hand, PINCTRL_MTK_PARIS use customized properties
> > "mediatek,pull-up-adv" and "mediatek,pull-down-adv" to specify bias-pull
> > setting for pins with 2 pull resistors.
> > This introduce in-compatibility in device tree and increase porting
> > effort to MediaTek's customer that had already used PINCTRL_MTK version.
> > Besides, if customers are not aware of this change and still write devicetree
> > for PINCTRL_MTK version, they may encounter runtime failure with pinctrl and
> > spent time to debug.
> >
> > This patch adds backward compatible to previous MediaTek's bias-pull usage
> > so that Mediatek's customer need not use a new devicetree property name.
> > The rationale is that: changing driver implementation had better leave
> > interface unchanged.
> 
> Are these devicetree bindings upstream, or are these bindings never
> submitted for inclusion in the official device tree bindings?
> 
> I don't really want to encourage out-of-tree non-canonical device
> tree experiments.
> 
> On the other hand I want running code.
> 
> I suppose if there is a solid use case for backwards compatibility
> that also affect independent developers (such as people just
> hacking around with these devices) then we could add it.
> 
> Yours,
> Linus Walleij

Use of "bias-pull-down = <MTK_PUPD_SET_R1R0_XX>" had already been
described in
Documentation/devicetree/binding/pinctrl/pinctrl-mt65xx.txt.
Previous MediaTek chips using pinctrl-mtk-common.c had already use such
binding. This is so-called backward compatibility.

Besides, according to
Documentation/devicetree/binding/pinctrl/pincfg-node.yaml, bias-pull-up
and bias-pull-down can have an optional argument to select pull strength
when supported by hardware.
So, I think the propose of using "mediatek,pull-up-adv" and
"mediatek,pull-down-adv" is not necessary. However, I fail to stop
upstream of using "mediatek,pull-up-adv" and "mediatek,pull-down-adv" in
pinctrl-mtk-common-v2.c.

Light Hsieh



  reply	other threads:[~2020-01-07 12:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-31 13:41 [PATCH v7 1/6] Check gpio pin number and use binary search in mtk_hw_pin_field_lookup() Light Hsieh
2019-12-31 13:41 ` [PATCH v7 2/6] Supporting driving setting without mapping current to register value Light Hsieh
2020-01-04  4:48   ` Dejin Zheng
2020-01-17  8:35   ` Sean Wang
2019-12-31 13:41 ` [PATCH v7 3/6] Refine mtk_pinconf_get() and mtk_pinconf_set() Light Hsieh
2019-12-31 13:41 ` [PATCH v7 4/6] Refine mtk_pinconf_get() Light Hsieh
2019-12-31 13:41 ` [PATCH v7 5/6] Backward compatible to previous Mediatek's bias-pull usage Light Hsieh
2020-01-07 10:40   ` Linus Walleij
2020-01-07 12:16     ` Light Hsieh [this message]
2020-01-07 13:26       ` Linus Walleij
2020-01-17  9:18   ` Sean Wang
2019-12-31 13:41 ` [PATCH v7 6/6] Add support for pin configuration dump via debugfs Light Hsieh
2020-01-17  9:05   ` Sean Wang
2020-01-02  9:02 ` [PATCH v7 1/6] Check gpio pin number and use binary search in mtk_hw_pin_field_lookup() Yingjoe Chen
2020-01-17  8:30 ` Sean Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1578399400.16092.14.camel@mtkswgap22 \
    --to=light.hsieh@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kuohong.wang@mediatek.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=sean.wang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).