This is a cache of https://discuss.96boards.org/t/changing-dragonboard-820c-i2c-speed/5677. It is a snapshot of the page at 2024-09-19T09:15:23.937+0000.
Changing Dragonboard 820c <strong>i2c</strong> speed? - DragonBoard 820c - 96Boards Forum

Changing Dragonboard 820c i2c speed?

Hi,
It looks like i2c is default to running at 100 kHz. I would like to run i2c-1 at 400 kHz or 1 MHz.
How can I do that?
I looked at this doc for 410c, but couldn’t figure out how to do it for 820c.
Thanks,
tamo2

So… it looks like 400 kHz works. I added “clock-frequency” in msm8996.dtsi:

		blsp2_i2c1: i2c@075b6000 { // This is i2c-1
		compatible = "qcom,i2c-qup-v2.2.1";
		clock-frequency = <400000>;            <-- Set to 400 kHz.
		...
	};

and data transfer got faster.

I also tried <1000000>, and I also had to change the code in i2c-qup.c:

/* We support frequencies up to FAST Mode (400KHz) */
if (!clk_freq || clk_freq > 400000) ...

to 1000000.

Even though the comment says 400KHz, it seems to work.
Is it safe to do?

It seems safe, actually upstream driver has been recently patched [1][2] to support fast mode plus.

[1] https://patchwork.kernel.org/patch/10392053/
[2] https://patchwork.kernel.org/patch/10392049/

1 Like

Thanks for confirming!