[v1] i2c: of: Populate fwnode in of_i2c_get_board_info()
diff mbox series

Message ID 20191115045049.261104-1-saravanak@google.com
State Accepted
Commit 60774d2af07a465dc916321e7428a4c5b7867ed4
Headers show
Series
  • [v1] i2c: of: Populate fwnode in of_i2c_get_board_info()
Related show

Commit Message

Saravana Kannan Nov. 15, 2019, 4:50 a.m. UTC
This allows the of_devlink feature to work across i2c devices too. This
avoid unnecessary probe deferrals of i2c devices, defers consumers of
i2c devices till the i2c devices probe, and allows i2c drivers to
implement sync_state() callbacks.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Saravana Kannan <saravanak@google.com>
---
The of_devlink feature is present in driver-core-next branch. It started
off with [1] but it has been improving since then.

[1] -- https://lore.kernel.org/linux-acpi/20190904211126.47518-1-saravanak@google.com/

 drivers/i2c/i2c-core-of.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Greg KH Nov. 15, 2019, 5:32 a.m. UTC | #1
On Thu, Nov 14, 2019 at 08:50:48PM -0800, Saravana Kannan wrote:
> This allows the of_devlink feature to work across i2c devices too. This
> avoid unnecessary probe deferrals of i2c devices, defers consumers of
> i2c devices till the i2c devices probe, and allows i2c drivers to
> implement sync_state() callbacks.
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> ---
> The of_devlink feature is present in driver-core-next branch. It started
> off with [1] but it has been improving since then.
> 
> [1] -- https://lore.kernel.org/linux-acpi/20190904211126.47518-1-saravanak@google.com/
> 
>  drivers/i2c/i2c-core-of.c | 1 +
>  1 file changed, 1 insertion(+)

Wolfram, I can take this through my tree now if you have no objections
to this.

thanks,

greg k-h
Wolfram Sang Nov. 15, 2019, 9:10 a.m. UTC | #2
On Fri, Nov 15, 2019 at 01:32:01PM +0800, Greg Kroah-Hartman wrote:
> On Thu, Nov 14, 2019 at 08:50:48PM -0800, Saravana Kannan wrote:
> > This allows the of_devlink feature to work across i2c devices too. This
> > avoid unnecessary probe deferrals of i2c devices, defers consumers of
> > i2c devices till the i2c devices probe, and allows i2c drivers to
> > implement sync_state() callbacks.
> > 
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Saravana Kannan <saravanak@google.com>
> > ---
> > The of_devlink feature is present in driver-core-next branch. It started
> > off with [1] but it has been improving since then.
> > 
> > [1] -- https://lore.kernel.org/linux-acpi/20190904211126.47518-1-saravanak@google.com/
> > 
> >  drivers/i2c/i2c-core-of.c | 1 +
> >  1 file changed, 1 insertion(+)
> 
> Wolfram, I can take this through my tree now if you have no objections
> to this.

What would be the advantage? I can also apply it today if you ack it.
Saravana Kannan Nov. 15, 2019, 10:15 p.m. UTC | #3
On Fri, Nov 15, 2019 at 1:10 AM Wolfram Sang <wsa@the-dreams.de> wrote:
>
> On Fri, Nov 15, 2019 at 01:32:01PM +0800, Greg Kroah-Hartman wrote:
> > On Thu, Nov 14, 2019 at 08:50:48PM -0800, Saravana Kannan wrote:
> > > This allows the of_devlink feature to work across i2c devices too. This
> > > avoid unnecessary probe deferrals of i2c devices, defers consumers of
> > > i2c devices till the i2c devices probe, and allows i2c drivers to
> > > implement sync_state() callbacks.
> > >
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Signed-off-by: Saravana Kannan <saravanak@google.com>
> > > ---
> > > The of_devlink feature is present in driver-core-next branch. It started
> > > off with [1] but it has been improving since then.
> > >
> > > [1] -- https://lore.kernel.org/linux-acpi/20190904211126.47518-1-saravanak@google.com/
> > >
> > >  drivers/i2c/i2c-core-of.c | 1 +
> > >  1 file changed, 1 insertion(+)
> >
> > Wolfram, I can take this through my tree now if you have no objections
> > to this.
>
> What would be the advantage?

Of the patch or of him picking it up?

Advantage of the patch is in the commit text. Details of of_devlink
are also provided in the link I gave earlier.

Advantage of Greg picking it up: This patch will get tested/seen with
the set of changes (of_devlink) with which it'll have the biggest
functional impact.

-Saravana
Greg KH Nov. 16, 2019, 12:57 p.m. UTC | #4
On Fri, Nov 15, 2019 at 10:10:36AM +0100, Wolfram Sang wrote:
> On Fri, Nov 15, 2019 at 01:32:01PM +0800, Greg Kroah-Hartman wrote:
> > On Thu, Nov 14, 2019 at 08:50:48PM -0800, Saravana Kannan wrote:
> > > This allows the of_devlink feature to work across i2c devices too. This
> > > avoid unnecessary probe deferrals of i2c devices, defers consumers of
> > > i2c devices till the i2c devices probe, and allows i2c drivers to
> > > implement sync_state() callbacks.
> > > 
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Signed-off-by: Saravana Kannan <saravanak@google.com>
> > > ---
> > > The of_devlink feature is present in driver-core-next branch. It started
> > > off with [1] but it has been improving since then.
> > > 
> > > [1] -- https://lore.kernel.org/linux-acpi/20190904211126.47518-1-saravanak@google.com/
> > > 
> > >  drivers/i2c/i2c-core-of.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > 
> > Wolfram, I can take this through my tree now if you have no objections
> > to this.
> 
> What would be the advantage? I can also apply it today if you ack it.

I think it will not build in your tree if you apply it now as this is a
new api :)
Wolfram Sang Nov. 16, 2019, 6:19 p.m. UTC | #5
> > What would be the advantage? I can also apply it today if you ack it.
> 
> I think it will not build in your tree if you apply it now as this is a
> new api :)

That's a convincing argument :) Have fun with the patch!

Acked-by: Wolfram Sang <wsa@the-dreams.de>

Patch
diff mbox series

diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c
index 6f632d543fcc..4e913c890a7b 100644
--- a/drivers/i2c/i2c-core-of.c
+++ b/drivers/i2c/i2c-core-of.c
@@ -50,6 +50,7 @@  int of_i2c_get_board_info(struct device *dev, struct device_node *node,
 
 	info->addr = addr;
 	info->of_node = node;
+	info->fwnode = of_fwnode_handle(node);
 
 	if (of_property_read_bool(node, "host-notify"))
 		info->flags |= I2C_CLIENT_HOST_NOTIFY;