netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: linux-acpi@vger.kernel.org, linux-i2c@vger.kernel.org,
	netdev@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Paolo Abeni <pabeni@redhat.com>, Wolfram Sang <wsa@kernel.org>
Subject: [PATCH RFC 0/2] Add I2C fwnode lookup/get interfaces
Date: Wed, 7 Dec 2022 11:21:47 +0000	[thread overview]
Message-ID: <Y5B3S6KZTrYlIH8g@shell.armlinux.org.uk> (raw)

Hi,

This RFC series is not intended for the coming merge window, and 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.

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!

 drivers/i2c/i2c-core-acpi.c | 13 +-------
 drivers/i2c/i2c-core-base.c | 72 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/i2c/i2c-core-of.c   | 51 ++------------------------------
 drivers/net/phy/sfp.c       | 13 +-------
 include/linux/i2c.h         |  9 ++++++
 5 files changed, 86 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!

             reply	other threads:[~2022-12-07 11:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 11:21 Russell King (Oracle) [this message]
2022-12-07 11:22 ` [PATCH RFC 1/2] i2c: add fwnode APIs Russell King (Oracle)
2022-12-08 10:04   ` Mika Westerberg
2022-12-08 10:16     ` Russell King (Oracle)
2022-12-19  8:47       ` Russell King (Oracle)
2022-12-19  9:23         ` Mika Westerberg
2022-12-07 11:22 ` [PATCH RFC 2/2] net: sfp: use i2c_get_adapter_by_fwnode() Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y5B3S6KZTrYlIH8g@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).