All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Pali Rohár" <pali@kernel.org>
Cc: "Shawn Guo" <shawn.guo@linaro.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] PCI: mvebu: switch to using gpiod API
Date: Tue, 6 Sep 2022 15:41:23 -0700	[thread overview]
Message-ID: <YxfMkzW+5W3Hm1dU@google.com> (raw)
In-Reply-To: <20220906220901.p2c44we7i4c35uvx@pali>

On Wed, Sep 07, 2022 at 12:09:01AM +0200, Pali Rohár wrote:
> On Tuesday 06 September 2022 14:52:42 Dmitry Torokhov wrote:
> > On Tue, Sep 06, 2022 at 11:41:14PM +0200, Pali Rohár wrote:
> > > On Tuesday 06 September 2022 14:26:32 Dmitry Torokhov wrote:

> > > would not be such easy as during startup we need to reset endpoint card.
> > > Normally just putting it from reset, but if card was not reset state
> > > prior probing driver then it is needed to first put it into reset...
> > > 
> > > I would fix it this issue after your patch is merged to prevent any
> > > other merge conflicts.
> > > 
> > > How to tell devm_fwnode_gpiod_get() function that caller is not
> > > interested in changing signal line? Just by changing GPIOD_OUT_HIGH to 0?
> > 
> > I think there are 2 options:
> > 
> > 1. Start with GPIOD_OUT_LOW (i.e. reset is explicitly deasserted), and
> > then in powerup/powerdown you do explicit on/off transitions with proper
> > timings.
> 
> PERST# is active-low. So deasserting means to put it into high state.
> But device tree can specify if line is active-high as on some board
> designs is GPIO output connected to inverter (or to level shifter with
> additional logic of signal inversion). So what [GPIOD_]OUT_LOW means in
> this context? Just it is needed that from driver point of view always
> value 1 means reset active and 0 means reset inactive, independently of
> double (triple?) inversions.

Think of GPIOD_OUT_LOW and GPIOD_OUT_HIGH as logical off and on, or
logical deactivate/activate. Gpiolib will take into account declared
polarity of the line when it drives the output, so for lines marked as
GPIO_ACTIVE_HIGH GPIO_OUT_HIGH will result in line driven HIGH, whereas
for lines marked as GPIO_ACTIVE_LOW GPIO_OUT_HIGH will result in the
line being driven LOW.

Linus, do you think we should introduce GPIOD_OUT_INACTIVE /
GPIOD_OUT_ACTIVE or GPIOD_OUT_DEASSERTED / GPIOD_OUT_ASSERTED and
deprecate existing GPIOD_OUT_LOW and GPIO_OUT_HIGH?

Thanks.

-- 
Dmitry

  reply	other threads:[~2022-09-06 22:41 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06 20:43 [PATCH 1/2] PCI: histb: switch to using gpiod API Dmitry Torokhov
2022-09-06 20:43 ` [PATCH 2/2] PCI: mvebu: " Dmitry Torokhov
2022-09-06 21:16   ` Pali Rohár
2022-09-06 21:26     ` Dmitry Torokhov
2022-09-06 21:40       ` Dmitry Torokhov
2022-09-06 21:42         ` Pali Rohár
2022-09-06 21:41       ` Pali Rohár
2022-09-06 21:52         ` Dmitry Torokhov
2022-09-06 22:09           ` Pali Rohár
2022-09-06 22:41             ` Dmitry Torokhov [this message]
2022-09-11 12:58               ` Pali Rohár
2022-09-14 10:35               ` Linus Walleij
2022-09-14 12:10                 ` Bartosz Golaszewski
2022-09-14 12:48                   ` Linus Walleij
2022-09-14 13:00                   ` Kent Gibson
2022-09-14 13:36                     ` Linus Walleij
2022-09-15  2:23                   ` Kent Gibson
2022-09-15  8:51                     ` Linus Walleij
2022-09-15  9:30                       ` Kent Gibson
2022-09-16  7:22                         ` Bartosz Golaszewski
2022-09-18 14:37                           ` Linus Walleij
2022-09-18 23:58                           ` Kent Gibson
2022-09-08  8:42     ` Linus Walleij
2022-09-07  4:11   ` kernel test robot
2022-09-09 20:10   ` kernel test robot
2022-09-06 21:08 ` [PATCH 1/2] PCI: histb: " Pali Rohár
2022-09-06 21:41   ` Dmitry Torokhov
2022-09-06 21:46     ` Pali Rohár
2022-09-08  8:37 ` Linus Walleij
2022-11-11 15:01 ` Lorenzo Pieralisi
2022-11-11 15:20   ` Dmitry Torokhov
2022-11-14 10:58 ` (subset) " Lorenzo Pieralisi

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=YxfMkzW+5W3Hm1dU@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=brgl@bgdev.pl \
    --cc=kw@linux.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=pali@kernel.org \
    --cc=robh@kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.