linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haojian Zhuang <haojian.zhuang@linaro.org>
To: "Marty E. Plummer" <hanetzer@startmail.com>
Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, tony@atomide.com,
	linus.walleij@linaro.org
Subject: Re: pinconf-single: pinctrl-single,bias-pull{up,down} bits help/explanation
Date: Tue, 1 Nov 2022 14:39:35 +0800	[thread overview]
Message-ID: <CAD6h2NT84eLERrx8T_=4qK7d9jum7Lc9QEMnNvd65cptZRTuoA@mail.gmail.com> (raw)
In-Reply-To: <CAD6h2NSahYuqg1T2oW7tHmAeAfqircfeokYhvJYNRVi5TXEDAA@mail.gmail.com>

On Tue, 1 Nov 2022 at 14:20, Haojian Zhuang <haojian.zhuang@linaro.org> wrote:
>
> On Sun, 16 Oct 2022 at 20:14, Marty E. Plummer <hanetzer@startmail.com> wrote:
> >
> > Greetings.
> >
> > What I'm having issue with is the pinctrl-single,bias-pull values. From
> > commit abe4e4675dfc62b7f2328e2c4bce8b5bdcdff7c0 I get a bit of it, and I
> > think I have it mostly figured out:
> >
> > // <[input] [enabled] [disabled] [mask]>;
> > pinctrl-single,bias-pullup = <? 1 0 0x100>;
> > pinctrl-single,bias-pulldown = <? 1 0 0x200>;
> >
> > using mask 0x100 to single out bit 8 and mask 0x200 to single out bit 9,
> > enable values being simple binary on/off. What I don't get is how the
> > input value is determined/calculated.
> >
> > Aside from the above mentioned commit for the am335x-pocketbeagle.dts,
> > which uses a differing pullup control scheme, the only users I can find
> > in the tree are a handful of hisi socs which I don't have a datasheet
> > for to map their usage to register definitions and puzzle this out.
> >
> Excuse me for just noticing the email.
>
> #define  PULL_DIS     0
> #define  PULL_UP        0x100
> #define  PULL_DOWN  0x200
>
> // <[input] [enabled] [disabled] [mask]>
>
> // If you want to pull-up, configure the pin as below.
> pinctrl-single,bias-pullup = <PULL_UP  PULL_UP  0  PULL_UP>
> // If you want to disable pull-up, configure the pin as below.
> pinctrl-single,bias-pullup = <0  PULL_UP  0  PULL_UP>
>
> It seems that the pin configuration in am335x-pocketbeagle.dts is wrong.
> But I don't have the board to verify it.
>

Sorry. I didn't check the comments in the commit carefully.

Obviously, the pinctrl definition is totally different in am335x chip.

bit4 is used to select pull-up or pull-down.
bit3 is used to enable the pull-up/pull-down.

In Hisilicon chip, bit9 is used to enable pull-down and bit8 is used
to enable pull-up.

They're totally different. I suggest you to enable the value in DTS
file and dump the register
value  to check for your own silicon.

Best Regards
Haojian

      reply	other threads:[~2022-11-01  6:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 12:14 pinconf-single: pinctrl-single,bias-pull{up,down} bits help/explanation Marty E. Plummer
2022-11-01  6:20 ` Haojian Zhuang
2022-11-01  6:39   ` Haojian Zhuang [this message]

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='CAD6h2NT84eLERrx8T_=4qK7d9jum7Lc9QEMnNvd65cptZRTuoA@mail.gmail.com' \
    --to=haojian.zhuang@linaro.org \
    --cc=hanetzer@startmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony@atomide.com \
    /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).