public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] Handle targets with different speed by the same I2C master
@ 2025-04-08 10:11 Vladimir Kondratiev
  2025-04-08 11:53 ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Kondratiev @ 2025-04-08 10:11 UTC (permalink / raw)
  To: linux-i2c@vger.kernel.org

We have a design where several I2C targets with different maximum speed capability
connected to the same I2C bus managed by one I2C master.
We want to communicate with each target with its speed. However there is no way to
specify the bus speed for the I2C message.

I want to propose the following solution:

let's say there's master represented by /dev/i2c-0 with the configured speed
1MHz (I2C_MAX_FAST_MODE_PLUS_FREQ) and most of the targets supports this speed,
but there's also a target capable of 400KHz (I2C_MAX_FAST_MODE_FREQ) at max.

Create virtual I2C adapter (say, /dev/i2c-0-fast) that refers to the real I2C adapter while
have its bus speed set. Software talking with the 400KHz target will communicate with the
/dev/i2c-0-fast. In its message transfer, it will ask real I2C adapter to configure bus speed.
Regular communication can be continued using /dev/i2c-0. This design require no user-space
changes (only device name should be adjusted)

Bus speed can be cached and hardware reconfigured only when needed

Adapters handle i2c_timings in an adapter-specific manner, so I want to implement this as
a modification to the particular I2C adapter (designware), providing OF bindings for the
sub-device

Does it looks like right direction for development? Any other ideas?

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

end of thread, other threads:[~2025-04-10 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 10:11 [RFC] Handle targets with different speed by the same I2C master Vladimir Kondratiev
2025-04-08 11:53 ` Wolfram Sang
2025-04-09 13:52   ` Vladimir Kondratiev
2025-04-10 10:15     ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox