linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: Michael Walle <michael@walle.cc>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Jonas Gorski <jonas.gorski@gmail.com>,
	Necip Fazil Yildiran <fazilyildiran@gmail.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v6 02/15] gpio: regmap: set gpio_chip of_node
Date: Wed, 10 Mar 2021 20:12:27 +0100	[thread overview]
Message-ID: <DC6BACCE-C76F-41C5-8CB9-BEF3257B3B57@gmail.com> (raw)
In-Reply-To: <7e35bfd395f3ae40029b0f3cb2bc8f70@walle.cc>

Hi Michael,

> El 10 mar 2021, a las 19:27, Michael Walle <michael@walle.cc> escribió:
> 
> Am 2021-03-10 13:54, schrieb Álvaro Fernández Rojas:
>> This is needed for properly registering GPIO regmap as a child of a regmap
>> pin controller.
>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>> Reviewed-by: Michael Walle <michael@walle.cc>
>> ---
>> v6: add comment and simplify of_node assignment
> 
> Ah, I see you add the comment for the documentation. Nice. But I'd
> like to see it in the code, too. See below.

Ah, sorry for that, I thought you wanted it on the header.
Excuse me for that...

> 
>> v5: switch to fwnode
>> v4: fix documentation
>> v3: introduce patch needed for properly parsing gpio-range
>> drivers/gpio/gpio-regmap.c  | 1 +
>> include/linux/gpio/regmap.h | 4 ++++
>> 2 files changed, 5 insertions(+)
>> diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
>> index 5412cb3b0b2a..d4fc656e70b0 100644
>> --- a/drivers/gpio/gpio-regmap.c
>> +++ b/drivers/gpio/gpio-regmap.c
>> @@ -249,6 +249,7 @@ struct gpio_regmap *gpio_regmap_register(const
>> struct gpio_regmap_config *config
>> 	chip = &gpio->gpio_chip;
>> 	chip->parent = config->parent;
> 
> If there will be a new version, please add the following comment:

Right now I don’t know that either, because I’m honestly getting tired of this…

> 
> /* gpiolib will use of_node of the parent if chip->of_node is NULL */
> 
>>> +       chip->of_node = to_of_node(config->fwnode);
> 
> Otherwise, it is not obvious that config->fwnode is optional.

Yes, you’re right.

> 
> -michael
> 
>> +	chip->of_node = to_of_node(config->fwnode);
>> 	chip->base = -1;
>> 	chip->ngpio = config->ngpio;
>> 	chip->names = config->names;
>> diff --git a/include/linux/gpio/regmap.h b/include/linux/gpio/regmap.h
>> index ad76f3d0a6ba..334dd928042b 100644
>> --- a/include/linux/gpio/regmap.h
>> +++ b/include/linux/gpio/regmap.h
>> @@ -4,6 +4,7 @@
>> #define _LINUX_GPIO_REGMAP_H
>> struct device;
>> +struct fwnode_handle;
>> struct gpio_regmap;
>> struct irq_domain;
>> struct regmap;
>> @@ -16,6 +17,8 @@ struct regmap;
>>  * @parent:		The parent device
>>  * @regmap:		The regmap used to access the registers
>>  *			given, the name of the device is used
>> + * @fwnode:		(Optional) The firmware node.
>> + *			If not given, the fwnode of the parent is used.
>>  * @label:		(Optional) Descriptive name for GPIO controller.
>>  *			If not given, the name of the device is used.
>>  * @ngpio:		Number of GPIOs
>> @@ -57,6 +60,7 @@ struct regmap;
>> struct gpio_regmap_config {
>> 	struct device *parent;
>> 	struct regmap *regmap;
>> +	struct fwnode_handle *fwnode;
>> 	const char *label;
>> 	int ngpio;


  reply	other threads:[~2021-03-10 19:13 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 12:54 [PATCH v6 00/15] pinctrl: add BCM63XX pincontrol support Álvaro Fernández Rojas
2021-03-10 12:54 ` [PATCH v6 01/15] gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP Álvaro Fernández Rojas
2021-03-10 12:54 ` [PATCH v6 02/15] gpio: regmap: set gpio_chip of_node Álvaro Fernández Rojas
2021-03-10 14:01   ` Andy Shevchenko
2021-03-10 18:27   ` Michael Walle
2021-03-10 19:12     ` Álvaro Fernández Rojas [this message]
2021-03-11  1:16       ` Linus Walleij
2021-03-10 12:54 ` [PATCH v6 03/15] pinctrl: bcm: add bcm63xx base code Álvaro Fernández Rojas
2021-03-10 14:07   ` Andy Shevchenko
2021-03-10 17:50   ` Rob Herring
2021-03-11  1:09     ` Linus Walleij
2021-03-11 14:57       ` Rob Herring
2021-03-11 16:13         ` Linus Walleij
2021-03-11 17:00           ` Álvaro Fernández Rojas
2021-03-11 18:24             ` Rob Herring
2021-03-11 18:32               ` Álvaro Fernández Rojas
2021-03-10 12:54 ` [PATCH v6 04/15] dt-bindings: add BCM6328 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-10 17:45   ` Rob Herring
2021-03-10 18:03     ` Álvaro Fernández Rojas
2021-03-10 18:45       ` Rob Herring
2021-03-10 19:10         ` Álvaro Fernández Rojas
2021-03-10 20:52           ` Rob Herring
2021-03-11 17:09             ` Álvaro Fernández Rojas
2021-03-11 18:14               ` Rob Herring
2021-03-11 18:34                 ` Álvaro Fernández Rojas
2021-03-15 15:57                 ` Linus Walleij
2021-03-11  1:22       ` Linus Walleij
2021-03-10 12:54 ` [PATCH v6 05/15] pinctrl: add a pincontrol driver for BCM6328 Álvaro Fernández Rojas
2021-03-10 12:54 ` [PATCH v6 06/15] dt-bindings: add BCM6358 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-10 12:54 ` [PATCH v6 07/15] pinctrl: add a pincontrol driver for BCM6358 Álvaro Fernández Rojas
2021-03-10 12:54 ` [PATCH v6 08/15] dt-bindings: add BCM6362 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-10 12:54 ` [PATCH v6 09/15] pinctrl: add a pincontrol driver for BCM6362 Álvaro Fernández Rojas
2021-03-10 12:54 ` [PATCH v6 10/15] dt-bindings: add BCM6368 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-10 12:54 ` [PATCH v6 11/15] pinctrl: add a pincontrol driver for BCM6368 Álvaro Fernández Rojas
2021-03-10 12:55 ` [PATCH v6 12/15] dt-bindings: add BCM63268 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-10 12:55 ` [PATCH v6 13/15] pinctrl: add a pincontrol driver for BCM63268 Álvaro Fernández Rojas
2021-03-10 12:55 ` [PATCH v6 14/15] dt-bindings: add BCM6318 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-10 12:55 ` [PATCH v6 15/15] pinctrl: add a pincontrol driver for BCM6318 Álvaro Fernández Rojas

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=DC6BACCE-C76F-41C5-8CB9-BEF3257B3B57@gmail.com \
    --to=noltari@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=fazilyildiran@gmail.com \
    --cc=jonas.gorski@gmail.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=michael@walle.cc \
    --cc=robh+dt@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).