linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: "Linus Walleij" <linus.walleij@linaro.org>,
	"Maíra Canal" <maira.canal@usp.br>
Cc: hongxing.zhu@nxp.com, lorenzo.pieralisi@arm.com, robh@kernel.org,
	bhelgaas@google.com, helgaas@kernel.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, kernel@pengutronix.de, linux-imx@nxp.com,
	linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] PCI: imx6: Replace legacy gpio interface for gpiod interface
Date: Mon, 25 Apr 2022 14:07:53 +0200	[thread overview]
Message-ID: <56052bc6e3b6cab6bfdfc5f706ec9984bea16bba.camel@pengutronix.de> (raw)
In-Reply-To: <CACRpkdYmw4yBm3Y1P42TcRs4fFNEiy3LXxmO_j=zeTv_usDR+g@mail.gmail.com>

Hi Linus,

Am Donnerstag, dem 21.04.2022 um 01:24 +0200 schrieb Linus Walleij:
> Hi Maira and sorry for being slow on reviews.
> 
> On Tue, Nov 2, 2021 at 2:04 AM Maíra Canal <maira.canal@usp.br> wrote:
> 
> > -               gpio_set_value_cansleep(imx6_pcie->reset_gpio,
> > +               gpiod_set_raw_value_cansleep(imx6_pcie->reset_gpio,
> >                                         !imx6_pcie->gpio_active_high);
> 
> Hm I see you got advised to use the raw api. I'm not so sure about
> that I like v1 better.
> 
> > +       imx6_pcie->reset_gpio = devm_gpiod_get_optional(dev, "reset",
> > +                       imx6_pcie->gpio_active_high ?  GPIOD_OUT_HIGH : GPIOD_OUT_LOW);
> > +       if (IS_ERR(imx6_pcie->reset_gpio))
> > +               return dev_err_probe(dev, PTR_ERR(imx6_pcie->reset_gpio),
> > +                               "unable to get reset gpio\n");
> 
> Where is this descriptor coming from? Device trees? Can't we just fix the
> DTS file(s) in that case given how wrong they are if they don't set
> GPIO_ACTIVE_LOW flag on this IRQ.

The binding explicitly describes the GPIO as not polarity aware and has
a separate property "reset-gpio-active-high" to avoid breaking old
DTBs. I don't think it's helpful to dismiss this explicit backward
compat just because the driver code looks nicer that way.

Regards,
Lucas


  reply	other threads:[~2022-04-25 12:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02  1:03 [PATCH v3] PCI: imx6: Replace legacy gpio interface for gpiod interface Maíra Canal
2022-04-08 14:23 ` Lorenzo Pieralisi
2022-04-08 14:46   ` Maíra Canal
2022-04-11 11:59     ` Francesco Dolcini
2022-04-11 16:03       ` Lucas Stach
2022-04-12 11:02         ` Maíra Canal
2022-04-11 15:25     ` Lorenzo Pieralisi
2022-04-20 23:24 ` Linus Walleij
2022-04-25 12:07   ` Lucas Stach [this message]
2022-04-25 13:40     ` Linus Walleij

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=56052bc6e3b6cab6bfdfc5f706ec9984bea16bba.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=hongxing.zhu@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=maira.canal@usp.br \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@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).