linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] i2c: Allow disabling auto detection via devicetree
@ 2022-04-05 12:16 Vincent Whitchurch
  2022-04-05 12:16 ` [PATCH 1/2] i2c: add binding to prevent device detection Vincent Whitchurch
  2022-04-05 12:16 ` [PATCH 2/2] i2c: core: support no-detect property Vincent Whitchurch
  0 siblings, 2 replies; 7+ messages in thread
From: Vincent Whitchurch @ 2022-04-05 12:16 UTC (permalink / raw)
  To: wsa
  Cc: kernel, Vincent Whitchurch, linux-i2c, devicetree, krzk+dt,
	robh+dt, linux-kernel

When a driver with a ->detect callback (such as lm75) is loaded, the i2c core
performs I2C transactions on the bus to all the addresses listed in that
driver's address_list.  This kind of probing wastes time and as
Documentation/i2c/instantiating-devices.rst says, this method is not
recommended and it is instead advised to list all devices in the devicetree.

However, even if all the devices are listed in the devicetree, there is
currently no way to prevent the core from attempting auto detection short of
patching controller drivers to not pass the I2C_CLASS* bits in adap->class.
The latter is not always possible since generic drivers like i2c-gpio set these
bits.

To avoid this unnecessary probing and reduce boot time, this series adds a
property to the devicetree and support in the I2C core to allow this feature to
be disabled.

Cc: linux-i2c@vger.kernel.org

Cc: devicetree@vger.kernel.org
Cc: krzk+dt@kernel.org
Cc: robh+dt@kernel.org

Cc: linux-kernel@vger.kernel.org

Vincent Whitchurch (2):
  i2c: add binding to prevent device detection
  i2c: core: support no-detect property

 Documentation/devicetree/bindings/i2c/i2c.txt | 4 ++++
 drivers/i2c/i2c-core-base.c                   | 8 +++++++-
 include/linux/i2c.h                           | 1 +
 3 files changed, 12 insertions(+), 1 deletion(-)

-- 
2.34.1


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

end of thread, other threads:[~2022-04-06 12:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 12:16 [PATCH 0/2] i2c: Allow disabling auto detection via devicetree Vincent Whitchurch
2022-04-05 12:16 ` [PATCH 1/2] i2c: add binding to prevent device detection Vincent Whitchurch
2022-04-05 13:57   ` Krzysztof Kozlowski
2022-04-05 14:12     ` Vincent Whitchurch
2022-04-06  7:26       ` Krzysztof Kozlowski
2022-04-06  7:55         ` Krzysztof Kozlowski
2022-04-05 12:16 ` [PATCH 2/2] i2c: core: support no-detect property Vincent Whitchurch

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).