[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdZYgym8f0o00EU7QKOUzkzOJZMeZYmQL6XoNLP6V7rz3g@mail.gmail.com>
Date: Mon, 25 Apr 2022 15:40:43 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Lucas Stach <l.stach@...gutronix.de>
Cc: MaĆra Canal <maira.canal@....br>,
hongxing.zhu@....com, lorenzo.pieralisi@....com, robh@...nel.org,
bhelgaas@...gle.com, helgaas@...nel.org, shawnguo@...nel.org,
s.hauer@...gutronix.de, kernel@...gutronix.de, linux-imx@....com,
linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] PCI: imx6: Replace legacy gpio interface for gpiod interface
On Mon, Apr 25, 2022 at 2:07 PM Lucas Stach <l.stach@...gutronix.de> wrote:
> 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.
I see. We handle such things a specific way.
Look in drivers/gpio/gpiolib-of.c, especially the function
of_gpio_flags_quirks().
Here we special-case all bindings which for some reason introduced
something necessary custom, like in this case not using the proper
polarity flag.
Add code to this file in the proper place to handle and hide the
old style DTBs using "reset-gpio-active-high" as active high flag
and assuming active low otherwise in this file.
I imagine it begins with
if (IS_ENABLED(CONFIG_PCI_IMX6)) { ... }
Then modify the code in drivers/pci/controller/dwc/pci-imx6.c
to act as if gpiolib handles polarity inversion. Include all changes
to all files in the same patch so this is changed in tandem (one technical
step).
Yours,
Linus Walleij
Powered by blists - more mailing lists