lkml.org 
[lkml]   [2021]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] gpio: regmap: set gpio_chip of_node
Am 2021-03-04 16:22, schrieb Andy Shevchenko:
> On Thu, Mar 4, 2021 at 5:18 PM Álvaro Fernández Rojas
> <noltari@gmail.com> wrote:
>>
>> This is needed for properly registering gpio regmap as a child of a
>> regmap
>> pin controller.
>
>> + chip->of_node = config->of_node ?:
>> dev_of_node(config->parent);
>
> After a closer look I have no clue why you need this patch at all.
> The second part, i.e. assigning parent's fwnode, is done already in
> the GPIO library core.
> The first part, keeping fwnode in the regmap configuration puzzles me.
> Why?

You're right if chip->of_node is not set it will eventually be set to
node of the parent device.

In case of the BCM driver the parent device is the pinctrl device and
the node is a children (if that is correct I cannot say). So, in this
case you cannot use the node of the parent, because that would be the
pinctrl one.

You could just use
chip->of_node = dev_of_node(config->parent)

But then it is not obvious that it is optional. Hence my suggestion
to explicitly set to the parent of_node if none is supplied.

-michael

\
 
 \ /
  Last update: 2021-03-04 16:33    [W:0.082 / U:2.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site