linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC v2 0/2] Add I2C fwnode lookup/get interfaces
@ 2022-12-19  9:50 Russell King (Oracle)
  2022-12-19  9:52 ` [PATCH RFC net-next v2 1/2] i2c: add fwnode APIs Russell King (Oracle)
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Russell King (Oracle) @ 2022-12-19  9:50 UTC (permalink / raw)
  To: linux-acpi, linux-i2c, netdev
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Heiner Kallweit,
	Jakub Kicinski, Mika Westerberg, Paolo Abeni, Wolfram Sang

Hi,

This RFC series is intended for the next merge window, but we will need
to decide how to merge it as it is split across two subsystems. These
patches have been generated against the net-next, since patch 2 depends
on a recently merged patch in that tree (which is now in mainline.)

Currently, the SFP code attempts to work out what kind of fwnode we
found when looking up the I2C bus for the SFP cage, converts the fwnode
to the appropriate firmware specific representation to then call the
appropriate I2C layer function. This is inefficient, since the device
model provides a way to locate items on a bus_type by fwnode.

In order to reduce this complexity, this series adds fwnode interfaces
to the I2C subsystem to allow I2C adapters to be looked up. I also
accidentally also converted the I2C clients to also be looked up, so
I've left that in patch 1 if people think that could be useful - if
not, I'll remove it.

We could also convert the of_* functions to be inline in i2c.h and
remove the stub of_* functions and exports.

Do we want these to live in i2c-core-fwnode.c ? I don't see a Kconfig
symbol that indicates whether we want fwnode support, and I know there
are people looking to use software nodes to lookup the SFP I2C bus
(which is why the manual firmware-specific code in sfp.c is a problem.)

Thanks!

v2: updated patch 1 with docbook comments.

 drivers/i2c/i2c-core-acpi.c | 13 +-----
 drivers/i2c/i2c-core-base.c | 98 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/i2c/i2c-core-of.c   | 51 ++---------------------
 drivers/net/phy/sfp.c       | 13 +-----
 include/linux/i2c.h         |  9 +++++
 5 files changed, 112 insertions(+), 72 deletions(-)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-01-10 17:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-19  9:50 [PATCH RFC v2 0/2] Add I2C fwnode lookup/get interfaces Russell King (Oracle)
2022-12-19  9:52 ` [PATCH RFC net-next v2 1/2] i2c: add fwnode APIs Russell King (Oracle)
2022-12-19 10:55   ` Mika Westerberg
2022-12-19  9:52 ` [PATCH RFC net-next v2 2/2] net: sfp: use i2c_get_adapter_by_fwnode() Russell King (Oracle)
2022-12-19 10:55   ` Mika Westerberg
2023-01-03 12:20 ` [PATCH RFC v2 0/2] Add I2C fwnode lookup/get interfaces Russell King (Oracle)
2023-01-09 11:48 ` Wolfram Sang
2023-01-10 13:02   ` Russell King (Oracle)
2023-01-10 17:36     ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).