* "gpio-line-names" property - issue with commit 9427ecbed46cc
@ 2017-12-14 11:54 Christophe LEROY
2017-12-14 13:37 ` Linus Walleij
0 siblings, 1 reply; 6+ messages in thread
From: Christophe LEROY @ 2017-12-14 11:54 UTC (permalink / raw)
To: Mika Westerberg; +Cc: Linus Walleij, linux-gpio
Hello Mika,
In your commit 9427ecbed46cc, you have modified the way the
"gpio-line-names" DT property is handled.
It seems that after that commit, many drivers fail to retrieve that
property. After investigation it seems to be because the driver does not
assign a parent to the gpio_chip.
Why is it necessary now to set a parent to the GPIO chip whereas it was
not necessary before ? In gpio_chip_add_data(), we have:
if (chip->parent) {
gdev->dev.parent = chip->parent;
gdev->dev.of_node = chip->parent->of_node;
}
#ifdef CONFIG_OF_GPIO
/* If the gpiochip has an assigned OF node this takes precedence */
if (chip->of_node)
gdev->dev.of_node = chip->of_node;
#endif
Therefore, as far as a chip->of_node is defined, shouldn't it be
possible to retrieve "gpio-line-names" property as before without parent ?
Is there an easy modification that can be done to your new function
devprop_gpiochip_set_names() in order to have the GPIO drivers work as
before ?
Regards
Christophe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: "gpio-line-names" property - issue with commit 9427ecbed46cc
2017-12-14 11:54 "gpio-line-names" property - issue with commit 9427ecbed46cc Christophe LEROY
@ 2017-12-14 13:37 ` Linus Walleij
2017-12-15 10:08 ` Mika Westerberg
0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2017-12-14 13:37 UTC (permalink / raw)
To: Christophe LEROY, Mika Westerberg; +Cc: linux-gpio
On Thu, Dec 14, 2017 at 12:54 PM, Christophe LEROY
<christophe.leroy@c-s.fr> wrote:
> Why is it necessary now to set a parent to the GPIO chip whereas it was not
> necessary before ?
(...)
> Is there an easy modification that can be done to your new function
> devprop_gpiochip_set_names() in order to have the GPIO drivers work as
> before ?
I am also worried about this.
I have felt that the device property paradigm is too ambitious and assume
too much about the subtle semantic differences between DT and ACPI
DSDT. But maybe I'm just whiney.
Looking forward to good ideas on how to solve this!
Mika: is is possible to revert this without breaking something else, if we
need to?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: "gpio-line-names" property - issue with commit 9427ecbed46cc
2017-12-14 13:37 ` Linus Walleij
@ 2017-12-15 10:08 ` Mika Westerberg
2017-12-15 12:31 ` Linus Walleij
0 siblings, 1 reply; 6+ messages in thread
From: Mika Westerberg @ 2017-12-15 10:08 UTC (permalink / raw)
To: Linus Walleij; +Cc: Christophe LEROY, linux-gpio
On Thu, Dec 14, 2017 at 02:37:07PM +0100, Linus Walleij wrote:
> On Thu, Dec 14, 2017 at 12:54 PM, Christophe LEROY
> <christophe.leroy@c-s.fr> wrote:
>
> > Why is it necessary now to set a parent to the GPIO chip whereas it was not
> > necessary before ?
> (...)
> > Is there an easy modification that can be done to your new function
> > devprop_gpiochip_set_names() in order to have the GPIO drivers work as
> > before ?
>
> I am also worried about this.
>
> I have felt that the device property paradigm is too ambitious and assume
> too much about the subtle semantic differences between DT and ACPI
> DSDT. But maybe I'm just whiney.
>
> Looking forward to good ideas on how to solve this!
I think we can fix this by passing struct fwnode_handle to
devprop_gpiochip_set_names(). Then the existing drivers don't need to be
changed and we update of_gpiochip_add() to call it like:
devprop_gpiochip_set_names(chip, of_fwnode_handle(chip->of_node));
or so.
> Mika: is is possible to revert this without breaking something else, if we
> need to?
It breaks ACPI "gpio-line-names" users but I think we don't need to
revert if if do what I'm proposing above :)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: "gpio-line-names" property - issue with commit 9427ecbed46cc
2017-12-15 10:08 ` Mika Westerberg
@ 2017-12-15 12:31 ` Linus Walleij
2017-12-15 12:39 ` Mika Westerberg
0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2017-12-15 12:31 UTC (permalink / raw)
To: Mika Westerberg; +Cc: Christophe LEROY, linux-gpio
On Fri, Dec 15, 2017 at 11:08 AM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> On Thu, Dec 14, 2017 at 02:37:07PM +0100, Linus Walleij wrote:
>> Looking forward to good ideas on how to solve this!
>
> I think we can fix this by passing struct fwnode_handle to
> devprop_gpiochip_set_names(). Then the existing drivers don't need to be
> changed and we update of_gpiochip_add() to call it like:
>
> devprop_gpiochip_set_names(chip, of_fwnode_handle(chip->of_node));
>
> or so.
>
>> Mika: is is possible to revert this without breaking something else, if we
>> need to?
>
> It breaks ACPI "gpio-line-names" users but I think we don't need to
> revert if if do what I'm proposing above :)
OK let's try that!
Looking forward to your patch. (I hope.)
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: "gpio-line-names" property - issue with commit 9427ecbed46cc
2017-12-15 12:31 ` Linus Walleij
@ 2017-12-15 12:39 ` Mika Westerberg
2017-12-15 13:13 ` Christophe LEROY
0 siblings, 1 reply; 6+ messages in thread
From: Mika Westerberg @ 2017-12-15 12:39 UTC (permalink / raw)
To: Linus Walleij; +Cc: Christophe LEROY, linux-gpio
On Fri, Dec 15, 2017 at 01:31:54PM +0100, Linus Walleij wrote:
> Looking forward to your patch. (I hope.)
Speaking of it, Christophe, are you going to update your patch
accordingly or do you want me to do that?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: "gpio-line-names" property - issue with commit 9427ecbed46cc
2017-12-15 12:39 ` Mika Westerberg
@ 2017-12-15 13:13 ` Christophe LEROY
0 siblings, 0 replies; 6+ messages in thread
From: Christophe LEROY @ 2017-12-15 13:13 UTC (permalink / raw)
To: Mika Westerberg, Linus Walleij; +Cc: linux-gpio
Le 15/12/2017 à 13:39, Mika Westerberg a écrit :
> On Fri, Dec 15, 2017 at 01:31:54PM +0100, Linus Walleij wrote:
>> Looking forward to your patch. (I hope.)
>
> Speaking of it, Christophe, are you going to update your patch
> accordingly or do you want me to do that?
>
Yes I'm working on it
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-12-15 13:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-14 11:54 "gpio-line-names" property - issue with commit 9427ecbed46cc Christophe LEROY
2017-12-14 13:37 ` Linus Walleij
2017-12-15 10:08 ` Mika Westerberg
2017-12-15 12:31 ` Linus Walleij
2017-12-15 12:39 ` Mika Westerberg
2017-12-15 13:13 ` Christophe LEROY
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.