Is it possible (and how) to have enabled i2c on pin 3 and 5?

Hello,

I am new to device tree and therefore would like to ask help with i2c enabling. I use my own build of Android based on Radxa sources and would like to turn on i2c on pin 3 and 5.

As far as I understand pin 3 and 5 are i2c7m3, but by default i2c7m0 is enabled and used for audio chip.

Is possible to mux the same I2C Bus to multiple pins - so instead of:

 i2c7: i2c@fec90000 {
     compatible = "rockchip,rk3588-i2c", "rockchip,rk3399-i2c";
 ...
     pinctrl-0 = <&i2c7m0_xfer>;
 
 i2c7 {
     /omit-if-no-ref/
     i2c7m0_xfer: i2c7m0-xfer {
         rockchip,pins =
             /* i2c7_scl_m0 */
             <1 RK_PD0 9 &pcfg_pull_none_smt>,
             /* i2c7_sda_m0 */
             <1 RK_PD1 9 &pcfg_pull_none_smt>;
     };

I can do like:

i2c7: i2c@fec90000 {
    compatible = "rockchip,rk3588-i2c", "rockchip,rk3399-i2c";
...
    pinctrl-0 = <&i2c7m0m3_xfer>;


i2c7 {
    /omit-if-no-ref/
    i2c7m0m3_xfer: i2c7m0m3-xfer {
        rockchip,pins =
            /* i2c7_scl_m0 */
            <1 RK_PD0 9 &pcfg_pull_none_smt>,
            /* i2c7_sda_m0 */
            <1 RK_PD1 9 &pcfg_pull_none_smt>;
            /* i2c7_scl_m3 */
            <4 RK_PB2 9 &pcfg_pull_none_smt>,
            /* i2c7_sda_m3 */
            <4 RK_PB3 9 &pcfg_pull_none_smt>;
    };

Is it correct?

I was facing the same problem as you and I have discovered recently that one of the way to do that is through rsetup command from the terminal

It is not documented anywhere, nor even mentioned, I have no idea if this is going to work but it might be the solution for what you are looking for

1 Like

As far as I understand rsetup will just apply overlay and the overlay itself turn off i2c7m0 and turn on i2c7m3 instead, but that is confusion since i2c7m0 is used by Audio chip.