Skip to contentSkip to conversation

i2c: of: Populate fwnode in of_i2c_get_board_info()

PATCH In review Saravana Kannan 3 participants 6 messages Nov 15, 2019 – Nov 16, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: of: Populate fwnode in of_i2c_get_board_info()

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 <[email protected]>

---
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/[email protected]/

 drivers/i2c/i2c-core-of.c | 1 +
 1 file changed, 1 insertion(+)
drivers/i2c/i2c-core-of.c +1 -0
index 6f632d543fcc..4e913c890a7b 100644
@@ -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;
Signature · 1 line
2.24.0.432.g9d3f5f5b63-goog
#1 lore raw
Quoted 7 lines · Saravana Kannan

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 <[email protected]>
Quoted 8 lines

---
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/[email protected]/

 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

#2 lore raw
Quoted 12 lines · Greg Kroah-Hartman
Quoted 11 lines · Saravana Kannan

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 <[email protected]>

---
The of_devlink feature is present in driver-core-next branch. It started off with [1] but it has been improving since then.

Quoted 7 lines
Quoted 4 lines

[1] -- https://lore.kernel.org/linux-acpi/[email protected]/

 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.

#3 lore raw
Quoted 16 lines · Wolfram Sang
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Saravana Kannan

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 <[email protected]>

---
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/[email protected]/

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
 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

#4 lore raw
In reply to Wolfram Sang
Quoted 15 lines · Wolfram Sang
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Saravana Kannan

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 <[email protected]>

---
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/[email protected]/

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
 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 :)

Acked-by
#5 lore raw
Quoted 5 lines
Quoted 2 lines

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!