Change I2C clock to 400KHz

I am using Linux colibri-imx8x-06858732 with TorizonCore 5.4.193-rt74-5.7.0. Im is trying to update the clock speed on i2c16 and ic17 to 400kHz to support fast i2c. I tried writing the following overlay without any success. What is the correct way to change the default clk speed of I2C interfaces?

/dts-v1/;
/plugin/;

/ {
compatible = “toradex,colibri-imx8x”;
};

&i2c16 {
clock-frequency = <400000>;
};

&i2c17 {
clock-frequency = <400000>;
};

Hi @fjliving,

Can you please share with us the carrier board you’re using?

I believe the node for the I2C is not correct, I couldn’t find references for these nodes in our device trees. Can you please share which I2C you want to change the clock frequency?

Best Regards,
Hiago.

I2C1 pin 194,196. I believe that is my mistake; should it be @i2c1

Hi @fjliving,

For pins 194 and 196, they are assigned to the following node:

/* Colibri I2C */
&i2c1 {
	#address-cells = <1>;
	#size-cells = <0>;
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c1>;

	/* Atmel maxtouch controller */
	atmel_mxt_ts: touchscreen@4a {
		compatible = "atmel,maxtouch";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_atmel_conn>;
		reg = <0x4a>;
		interrupt-parent = <&lsio_gpio3>;
		interrupts = <20 IRQ_TYPE_EDGE_FALLING>;		/* SODIMM 107 */
		reset-gpios = <&lsio_gpio3 24 GPIO_ACTIVE_HIGH>;	/* SODIMM 106 */
		status = "disabled";
	};
};

(You can check the imx8x-colibri.dtsi file).

So your overlay should be something like this:

/dts-v1/;
/plugin/;

/ {
	compatible = "toradex,colibri-imx8x";
};

&i2c1 {
    clock-frequency = <400000>;
    status = "okay";
};

Best Regards,
Hiago.

Thanks that worked