Thread (32 messages) 32 messages, 2 authors, 2021-12-02

Re: [PATCH v11 2/6] gpiolib: allow to specify the firmware node in struct gpio_chip

From: Bartosz Golaszewski <hidden>
Date: 2021-11-30 18:32:44
Also in: linux-kselftest, lkml

On Tue, Nov 30, 2021 at 5:20 PM Andy Shevchenko
[off-list ref] wrote:
On Tue, Nov 30, 2021 at 06:14:01PM +0200, Andy Shevchenko wrote:
quoted
On Tue, Nov 30, 2021 at 04:41:23PM +0100, Bartosz Golaszewski wrote:
...
quoted
Not sure I understand the proposal. Can you provide couple of (simplest)
examples?

And also it sounds like reinventing a wheel. What problem do you have that you
need to solve this way?
Have you seen these:
        drivers/gpio/gpio-dwapb.c
        drivers/mfd/intel_quark_i2c_gpio.c
?

GPIO driver has a main (controller level) node along with children on per bank
basis. Currently it works with the provided approach (see second driver).

--
With Best Regards,
Andy Shevchenko
Yep, I know dwapd. What happens in probe is that each bank device is
created using the properties from the associated child fwnode but the
parent device's fwnode is actually assigned as the gpiochip's fwnode.
This is logically wrong and OF doesn't do it - it assigns the child
of_node to the child device if gpio_chip->of_node is assigned in the
driver. I'm not sure if ACPI does this.

Non-OF drivers don't have a way to do this and this patch enables it.

I want to add it mostly because gpio-sim can then use the software
node to identify the device in the configfs by that software node but
IMO this is logically correct too.

Bart
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help