How can I setup I2C3 in mainline Linux kernel?

Hello!

I have some trubble with my I2C3 device.

I added I2C3 in device-tree (tegra124-apalis-eval.dts file).

    /*I2C3 Enable CAM AR0134*/
    i2c@7000c500 {
    	status = "okay";
    	clock-frequency = <100000>;
    };

And I add pinmux in tegra124-apalis-pinmux.dtsi.

       /* Apalis I2C3 (CAM) */
		cam_i2c_scl_pbb1 {
			nvidia,pins = "cam_i2c_scl_pbb1";
			nvidia,function = "i2c3";
			nvidia,pull = <TEGRA_PIN_PULL_NONE>;
			nvidia,tristate = <TEGRA_PIN_DISABLE>;
			nvidia,enable-input = <TEGRA_PIN_ENABLE>;
			nvidia,open-drain = <TEGRA_PIN_ENABLE>;
		};
		cam_i2c_sda_pbb2 {
			nvidia,pins = "cam_i2c_sda_pbb2";
			nvidia,function = "i2c3";
			nvidia,pull = <TEGRA_PIN_PULL_NONE>;
			nvidia,tristate = <TEGRA_PIN_DISABLE>;
			nvidia,enable-input = <TEGRA_PIN_ENABLE>;
			nvidia,open-drain = <TEGRA_PIN_ENABLE>;
		};

But when I use i2cdetect, only this shows up.

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:       -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

And also I don’t see clock on cam_scl_pin.
I checked pull up resistor on my circuit board. It’s ok.

What’s maybe wrong?

Sorry for my English.

Thank you!

I am not quite sure what and why exactly you would want to modify anything anywhere as all I2C buses including the camera one should really be working just fine out-of-the-box. E.g. after installing our stock Apalis_TK1_Mainline_LinuxImageV2.7Beta1_20170112.tar.bz2 using the mainline Linux 4.9 kernel, I get the following result with an OV5640 module connected which shows up on address 0x3c:

root@apalis-tk1-mainline:~# i2cdetect -r -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

Yes. You are right.

I got answer from i2c2 and i2c4. But didn’t get from i2c3.

root@apalis-tk1-mainline:~# i2cdetect -y -r 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@apalis-tk1-mainline:~# i2cdetect -y -r 4
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- UU -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: UU -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 

If you can check your i2c3. Please.

Maybe It’s HW problem. But I’m not seeing what reason might be.

Thanks.

According to the datasheet for AR0134 0x18 is it’s alternative address, are you sure it’s not in the results you’re getting. Please remember that apalis TK1 only supports cameras with CSI interface.

I’m figured out.
Thanks.