[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210802135839.4clqd34npppwasyh@mobilestation>
Date: Mon, 2 Aug 2021 16:58:39 +0300
From: Serge Semin <fancer.lancer@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Serge Semin <Sergey.Semin@...kalelectronics.ru>,
Rob Herring <robh+dt@...nel.org>,
Lee Jones <lee.jones@...aro.org>, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org,
Hoan Tran <hoan@...amperecomputing.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: Re: [PATCH v1 2/4] gpio: dwapb: Read GPIO base from gpio-base
property
+Cc Rob
On Mon, Jul 26, 2021 at 03:54:34PM +0300, Andy Shevchenko wrote:
> For backward compatibility with some legacy devices introduce
> a new (*) property gpio-base to read GPIO base. This will allow
> further cleanup of the driver.
>
> *) Note, it's not new for GPIO library since mockup driver is
> using it already.
You are right but I don't think it's a good idea to advertise the
pure Linux-internal property "gpio-base" to any use-case like OF
and ACPI FW nodes. Especially seeing we don't have it described in the
DT-bindings and noting that the mockup driver is dedicated for the
GPIO tests only. What about restricting the property usage for the
SW-nodes only by adding an additional check: is_software_node() here?
@Linus, @Bartosz, @Rob, what do you think about that?
-Sergey
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> drivers/gpio/gpio-dwapb.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
> index f6ae69d5d644..e3011d4e17b0 100644
> --- a/drivers/gpio/gpio-dwapb.c
> +++ b/drivers/gpio/gpio-dwapb.c
> @@ -581,7 +581,8 @@ static struct dwapb_platform_data *dwapb_gpio_get_pdata(struct device *dev)
> pp->ngpio = DWAPB_MAX_GPIOS;
> }
>
> - pp->gpio_base = -1;
> + if (fwnode_property_read_u32(fwnode, "gpio-base", &pp->gpio_base))
> + pp->gpio_base = -1;
>
> /*
> * Only port A can provide interrupts in all configurations of
> --
> 2.30.2
>
Powered by blists - more mailing lists