Re: [PATCH v11 1/7] i2c: core: add callback to change bus frequency

From: Andy Shevchenko

Date: Mon Jul 13 2026 - 12:14:59 EST


On Mon, Jul 13, 2026 at 09:19:57AM +0200, Marcus Folkesson wrote:
> All devices on the same I2C bus share the same clock line and the bus
> frequency has therefor be chosen so that all attached devices are able
> to tolarate that clock rate. IOW, the bus speed must be set for the
> slowest attached device.
>
> With I2C multiplexers/switches on the other hand, it would be possible
> to have different "domains" that runs with different speeds.
>
> Prepare for such a feature by provide an optional callback function to
> change bus frequency.
>
> As a side effect, several bus drivers keep the bus speed in a
> private structure and can now have this value stored in a uniform way
> instead.

...

> + u32 clock_hz; /* bus clock speed */
> + int (*set_clk_freq)(struct i2c_adapter *adap, u32 clock_hz); /* Optional */

Ah, I thought you also updated to _Hz here...

But no need to resend just for that, only in case of a new version for
something else. (Or maybe Andi even can tweak this whilst applying...)

--
With Best Regards,
Andy Shevchenko