All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Michael Walle <michael@walle.cc>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
	Jonas Gorski <jonas.gorski@gmail.com>,
	Necip Fazil Yildiran <fazilyildiran@gmail.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4 02/15] gpio: regmap: set gpio_chip of_node
Date: Thu, 4 Mar 2021 16:44:47 +0100	[thread overview]
Message-ID: <68F60F3F-33DD-4183-84F9-8D62BFA8A8F1@gmail.com> (raw)
In-Reply-To: <CAHp75VdkCxBeh_cWwN9dKRpEMntMp22yVjWRCuYumhMzrWi+SA@mail.gmail.com>



> El 4 mar 2021, a las 16:28, Andy Shevchenko <andy.shevchenko@gmail.com> escribió:
> 
> On Thu, Mar 4, 2021 at 5:24 PM Álvaro Fernández Rojas <noltari@gmail.com> wrote:
>>> El 4 mar 2021, a las 16:17, Andy Shevchenko <andy.shevchenko@gmail.com> escribió:
>>> On Thu, Mar 4, 2021 at 5:06 PM Álvaro Fernández Rojas <noltari@gmail.com> wrote:
>>>>> El 4 mar 2021, a las 11:35, Andy Shevchenko <andy.shevchenko@gmail.com> escribió:
>>>>> On Thu, Mar 4, 2021 at 10:57 AM Álvaro Fernández Rojas
>>>>> <noltari@gmail.com> wrote:
>>> 
>>>>>> + * @of_node:           (Optional) The device node
>>>>> 
>>>>>> +       struct device_node *of_node;
>>>>> 
>>>>> Can we use fwnode from day 1, please?
>>>> 
>>>> Could you explain this? I haven’t dealt with fwnode never :$
>>>> BTW, this is done to fix this check when parsing gpio ranges:
>>>> https://github.com/torvalds/linux/blob/f69d02e37a85645aa90d18cacfff36dba370f797/drivers/gpio/gpiolib-of.c#L933-L934
>>> 
>>> Use struct fwnode_handle pointer instead of OF-specific one.
>> 
>> But is that compatible with the current gpiolib-of code? :$
> 
> Yes (after a bit of amendment I have sent today as v2:
> https://lore.kernel.org/linux-gpio/20210304150215.80652-1-andriy.shevchenko@linux.intel.com/T/#u).

Well that doesn’t fulfill my definition of “current gpiolib-of code”…
@Linus what should I do about this?

> 
>>> Also here is the question, why do you need to have that field in the
>>> regmap config structure and can't simply use the parent's fwnode?
>>> Also I'm puzzled why it's not working w/o this patch: GPIO library
>>> effectively assigns parent's fwnode (okay, of_node right now).
>> 
>> Because gpio regmap a child node of the pin controller, which is the one probed (gpio regmap is probed from the pin controller).
>> Therefore the parent’s fwnode is useless, since the correct gpio_chip node is the child's one (we have pin-ranges declared in the child node, referencing the parent pinctrl node).
> 
> I see. Can you point me out to the code where we get the node and
> where it's being retrieved / filled?

Sure, this is where the child node is searched: https://github.com/Noltari/linux/blob/6d1ebb8ff26ed54592eef1fcd3b58834acb48c04/drivers/pinctrl/bcm/pinctrl-bcm63xx.c#L100-L109
Then the gpio child node is probed and assigned here: https://github.com/Noltari/linux/blob/6d1ebb8ff26ed54592eef1fcd3b58834acb48c04/drivers/pinctrl/bcm/pinctrl-bcm63xx.c#L51

Basically, I based that part of the code on the ingenic pin controller: https://github.com/torvalds/linux/blob/f69d02e37a85645aa90d18cacfff36dba370f797/drivers/pinctrl/pinctrl-ingenic.c#L2485-L2491
https://github.com/torvalds/linux/blob/f69d02e37a85645aa90d18cacfff36dba370f797/Documentation/devicetree/bindings/pinctrl/ingenic%2Cpinctrl.yaml#L155-L176

> 
> -- 
> With Best Regards,
> Andy Shevchenko

Best regards,
Álvaro.

WARNING: multiple messages have this Message-ID (diff)
From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Michael Walle <michael@walle.cc>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
	Jonas Gorski <jonas.gorski@gmail.com>,
	Necip Fazil Yildiran <fazilyildiran@gmail.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4 02/15] gpio: regmap: set gpio_chip of_node
Date: Thu, 4 Mar 2021 16:44:47 +0100	[thread overview]
Message-ID: <68F60F3F-33DD-4183-84F9-8D62BFA8A8F1@gmail.com> (raw)
In-Reply-To: <CAHp75VdkCxBeh_cWwN9dKRpEMntMp22yVjWRCuYumhMzrWi+SA@mail.gmail.com>



> El 4 mar 2021, a las 16:28, Andy Shevchenko <andy.shevchenko@gmail.com> escribió:
> 
> On Thu, Mar 4, 2021 at 5:24 PM Álvaro Fernández Rojas <noltari@gmail.com> wrote:
>>> El 4 mar 2021, a las 16:17, Andy Shevchenko <andy.shevchenko@gmail.com> escribió:
>>> On Thu, Mar 4, 2021 at 5:06 PM Álvaro Fernández Rojas <noltari@gmail.com> wrote:
>>>>> El 4 mar 2021, a las 11:35, Andy Shevchenko <andy.shevchenko@gmail.com> escribió:
>>>>> On Thu, Mar 4, 2021 at 10:57 AM Álvaro Fernández Rojas
>>>>> <noltari@gmail.com> wrote:
>>> 
>>>>>> + * @of_node:           (Optional) The device node
>>>>> 
>>>>>> +       struct device_node *of_node;
>>>>> 
>>>>> Can we use fwnode from day 1, please?
>>>> 
>>>> Could you explain this? I haven’t dealt with fwnode never :$
>>>> BTW, this is done to fix this check when parsing gpio ranges:
>>>> https://github.com/torvalds/linux/blob/f69d02e37a85645aa90d18cacfff36dba370f797/drivers/gpio/gpiolib-of.c#L933-L934
>>> 
>>> Use struct fwnode_handle pointer instead of OF-specific one.
>> 
>> But is that compatible with the current gpiolib-of code? :$
> 
> Yes (after a bit of amendment I have sent today as v2:
> https://lore.kernel.org/linux-gpio/20210304150215.80652-1-andriy.shevchenko@linux.intel.com/T/#u).

Well that doesn’t fulfill my definition of “current gpiolib-of code”…
@Linus what should I do about this?

> 
>>> Also here is the question, why do you need to have that field in the
>>> regmap config structure and can't simply use the parent's fwnode?
>>> Also I'm puzzled why it's not working w/o this patch: GPIO library
>>> effectively assigns parent's fwnode (okay, of_node right now).
>> 
>> Because gpio regmap a child node of the pin controller, which is the one probed (gpio regmap is probed from the pin controller).
>> Therefore the parent’s fwnode is useless, since the correct gpio_chip node is the child's one (we have pin-ranges declared in the child node, referencing the parent pinctrl node).
> 
> I see. Can you point me out to the code where we get the node and
> where it's being retrieved / filled?

Sure, this is where the child node is searched: https://github.com/Noltari/linux/blob/6d1ebb8ff26ed54592eef1fcd3b58834acb48c04/drivers/pinctrl/bcm/pinctrl-bcm63xx.c#L100-L109
Then the gpio child node is probed and assigned here: https://github.com/Noltari/linux/blob/6d1ebb8ff26ed54592eef1fcd3b58834acb48c04/drivers/pinctrl/bcm/pinctrl-bcm63xx.c#L51

Basically, I based that part of the code on the ingenic pin controller: https://github.com/torvalds/linux/blob/f69d02e37a85645aa90d18cacfff36dba370f797/drivers/pinctrl/pinctrl-ingenic.c#L2485-L2491
https://github.com/torvalds/linux/blob/f69d02e37a85645aa90d18cacfff36dba370f797/Documentation/devicetree/bindings/pinctrl/ingenic%2Cpinctrl.yaml#L155-L176

> 
> -- 
> With Best Regards,
> Andy Shevchenko

Best regards,
Álvaro.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-03-04 15:46 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04  8:56 [PATCH v4 00/15] pinctrl: add BCM63XX pincontrol support Álvaro Fernández Rojas
2021-03-04  8:56 ` Álvaro Fernández Rojas
2021-03-04  8:56 ` [PATCH v4 01/15] gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP Álvaro Fernández Rojas
2021-03-04  8:56   ` Álvaro Fernández Rojas
2021-03-04 10:33   ` Andy Shevchenko
2021-03-04 10:33     ` Andy Shevchenko
2021-03-04 10:36   ` Álvaro Fernández Rojas
2021-03-04 10:36     ` Álvaro Fernández Rojas
2021-03-09 16:20   ` Linus Walleij
2021-03-09 16:20     ` Linus Walleij
2021-03-04  8:56 ` [PATCH v4 02/15] gpio: regmap: set gpio_chip of_node Álvaro Fernández Rojas
2021-03-04  8:56   ` Álvaro Fernández Rojas
2021-03-04 10:35   ` Andy Shevchenko
2021-03-04 10:35     ` Andy Shevchenko
2021-03-04 15:06     ` Álvaro Fernández Rojas
2021-03-04 15:06       ` Álvaro Fernández Rojas
2021-03-04 15:17       ` Andy Shevchenko
2021-03-04 15:17         ` Andy Shevchenko
2021-03-04 15:24         ` Álvaro Fernández Rojas
2021-03-04 15:24           ` Álvaro Fernández Rojas
2021-03-04 15:28           ` Andy Shevchenko
2021-03-04 15:28             ` Andy Shevchenko
2021-03-04 15:44             ` Álvaro Fernández Rojas [this message]
2021-03-04 15:44               ` Álvaro Fernández Rojas
2021-03-04 16:33               ` Andy Shevchenko
2021-03-04 16:33                 ` Andy Shevchenko
2021-03-04 16:46                 ` Andy Shevchenko
2021-03-04 16:46                   ` Andy Shevchenko
2021-03-04 17:24                   ` Michael Walle
2021-03-04 17:24                     ` Michael Walle
2021-03-05  9:44                     ` Andy Shevchenko
2021-03-05  9:44                       ` Andy Shevchenko
2021-03-05  7:45                 ` Álvaro Fernández Rojas
2021-03-05  7:45                   ` Álvaro Fernández Rojas
2021-03-05  9:49                   ` Andy Shevchenko
2021-03-05  9:49                     ` Andy Shevchenko
2021-03-04  8:56 ` [PATCH v4 03/15] pinctrl: bcm: add bcm63xx base code Álvaro Fernández Rojas
2021-03-04  8:56   ` Álvaro Fernández Rojas
2021-03-04 10:43   ` Andy Shevchenko
2021-03-04 10:43     ` Andy Shevchenko
2021-03-04 11:17     ` Álvaro Fernández Rojas
2021-03-04 11:17       ` Álvaro Fernández Rojas
2021-03-04 12:09       ` Andy Shevchenko
2021-03-04 12:09         ` Andy Shevchenko
2021-03-04 12:28         ` Álvaro Fernández Rojas
2021-03-04 12:28           ` Álvaro Fernández Rojas
2021-03-04 15:19           ` Andy Shevchenko
2021-03-04 15:19             ` Andy Shevchenko
2021-03-04  8:56 ` [PATCH v4 04/15] Documentation: add BCM6328 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-04  8:56   ` Álvaro Fernández Rojas
2021-03-04 12:53   ` Michael Walle
2021-03-04 12:53     ` Michael Walle
2021-03-04  8:57 ` [PATCH v4 05/15] pinctrl: add a pincontrol driver for BCM6328 Álvaro Fernández Rojas
2021-03-04  8:57   ` Álvaro Fernández Rojas
2021-03-04 10:49   ` Andy Shevchenko
2021-03-04 10:49     ` Andy Shevchenko
2021-03-04 11:13     ` Álvaro Fernández Rojas
2021-03-04 11:13       ` Álvaro Fernández Rojas
2021-03-04 12:12       ` Andy Shevchenko
2021-03-04 12:12         ` Andy Shevchenko
2021-03-04 12:25         ` Álvaro Fernández Rojas
2021-03-04 12:25           ` Álvaro Fernández Rojas
2021-03-04 15:25           ` Andy Shevchenko
2021-03-04 15:25             ` Andy Shevchenko
2021-03-04 15:33             ` Álvaro Fernández Rojas
2021-03-04 15:33               ` Álvaro Fernández Rojas
2021-03-04 15:36               ` Andy Shevchenko
2021-03-04 15:36                 ` Andy Shevchenko
2021-03-04  8:57 ` [PATCH v4 06/15] Documentation: add BCM6358 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-04  8:57   ` Álvaro Fernández Rojas
2021-03-04  8:57 ` [PATCH v4 07/15] pinctrl: add a pincontrol driver for BCM6358 Álvaro Fernández Rojas
2021-03-04  8:57   ` Álvaro Fernández Rojas
2021-03-04  8:57 ` [PATCH v4 08/15] Documentation: add BCM6362 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-04  8:57   ` Álvaro Fernández Rojas
2021-03-04  8:57 ` [PATCH v4 09/15] pinctrl: add a pincontrol driver for BCM6362 Álvaro Fernández Rojas
2021-03-04  8:57   ` Álvaro Fernández Rojas
2021-03-04  8:57 ` [PATCH v4 10/15] Documentation: add BCM6368 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-04  8:57   ` Álvaro Fernández Rojas
2021-03-04  8:57 ` [PATCH v4 11/15] pinctrl: add a pincontrol driver for BCM6368 Álvaro Fernández Rojas
2021-03-04  8:57   ` Álvaro Fernández Rojas
2021-03-04  8:57 ` [PATCH v4 12/15] Documentation: add BCM63268 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-04  8:57   ` Álvaro Fernández Rojas
2021-03-04  8:57 ` [PATCH v4 13/15] pinctrl: add a pincontrol driver for BCM63268 Álvaro Fernández Rojas
2021-03-04  8:57   ` Álvaro Fernández Rojas
2021-03-04  8:57 ` [PATCH v4 14/15] Documentation: add BCM6318 pincontroller binding documentation Álvaro Fernández Rojas
2021-03-04  8:57   ` Álvaro Fernández Rojas
2021-03-04  8:57 ` [PATCH v4 15/15] pinctrl: add a pincontrol driver for BCM6318 Álvaro Fernández Rojas
2021-03-04  8:57   ` Á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=68F60F3F-33DD-4183-84F9-8D62BFA8A8F1@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 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.