This is a cache of https://discuss.96boards.org/t/add-i2c-device-tp-driver-development/597. It is a snapshot of the page at 2024-09-19T05:10:26.458+0000.
Add <strong>i2c</strong> device, tp driver development - HiKey - 96Boards Forum

Add i2c device, tp driver development

Hi, I’m developing a touchscreen driver with Hikey.

I added the hi6220.dtsi, followed the example of i2c2, as below:

i2c1: i2c@f7101000 {
			compatible = &quot;snps,designware-i2c&quot;;
			#address-cells = &lt;1&gt;;
			#size-cells = &lt;0&gt;;
			reg = &lt;0x0 0xf7101000 0x0 0x1000&gt;;
			interrupts = &lt;0 45 4&gt;;

			clocks = &lt;&amp;clock_sys HI6220_i2c1_CLK&gt;;

			clock-names = &quot;clk_i2c1&quot;;
			i2c-sda-hold-time-ns = &lt;300&gt;;
			delay-reg = &lt;0x0 0x0e8 0x0 4&gt;;
			reset-controller-reg = &lt;0x320 0x324 0x328 3&gt;;
			pinctrl-names = &quot;default&quot;;
			pinctrl-0 = &lt;&amp;i2c1_pmx_func &amp;i2c1_cfg_func&gt;;
			status = &quot;ok&quot;;

                        focaltech_ts@38 {
                                        compatible= &quot;focaltech,focaltech_ts&quot;;
                                        reg = &lt;0x38&gt;;
                                        interrupt-parent = &lt;&amp;gpio2&gt;;
                                        interrupts = &lt;2 2&gt;; 
                            };
}
i2c2: i2c@f7102000 {
			compatible = &quot;snps,designware-i2c&quot;;
			#address-cells = &lt;1&gt;;
			#size-cells = &lt;0&gt;;
			reg = &lt;0x0 0xf7102000 0x0 0x1000&gt;;
			interrupts = &lt;0 46 4&gt;;

			clocks = &lt;&amp;clock_sys HI6220_i2c2_CLK&gt;;
			clock-names = &quot;clk_i2c2&quot;;
			i2c-sda-hold-time-ns = &lt;300&gt;;
			delay-reg = &lt;0x0 0x0f8 0x0 4&gt;;
			reset-controller-reg = &lt;0x330 0x334 0x338 3&gt;;
			pinctrl-names = &quot;default&quot;;
			pinctrl-0 = &lt;&amp;i2c2_pmx_func &amp;i2c2_cfg_func&gt;;
			status = &quot;ok&quot;;

			adv7533: adv7533@39 {
				compatible = &quot;adi,adv7533&quot;;
				reg = &lt;0x39&gt;;
				interrupt-parent = &lt;&amp;gpio1&gt;;
				interrupts = &lt;1 2&gt;;
				pd-gpio = &lt;&amp;gpio0 4 0&gt;;
				adi,input-depth = &lt;8&gt;;
				adi,input-colorspace = &quot;rgb&quot;;
				adi,input-clock = &quot;1x&quot;;
				adi,clock-delay = &lt;0&gt;;
				adi,embedded-sync;
			};
		 };

as the kernel log showed:

[    2.813844] i2c_designware f7101000.i2c: could not find pctldev for node /smb/pinmux@f7010000/i2c1_pmx_func, deferring probe
[    2.813871] i2c_designware f7102000.i2c: could not find pctldev for node /smb/pinmux@f7010000/i2c2_pmx_func, deferring probe

I tried to access the i2c1, but i got a 121(remote i/o error).

[    6.947623] [FTS] fts_i2c_read_universal. line: 112.  i2c read error.
[    6.954061] FTS, read 0xA8: ret: -121, 00, 00, 00
[    6.958773] FTS, i2c_client.addr: 38, i2c_client.irq: 80

So can someone help out of this?

I am also trying same. Did you try to get something now?