AnsweredAssumed Answered

Can't see any i2c device in /dev/ directory (like dev/i2c-0 and dev/i2c-1)

Question asked by Lin Hsin Han on Oct 1, 2018
Latest reply on Oct 3, 2018 by Pavel Chubakov

Dear all,


I have loaded the compiled QorIQ-SDK-V1.2-20120614-yocto linux kernel module on p1021 (2C, 900M) based board and get into linux prompt. Then I try to let it support for i2c interface.


I have modified menuconfig like below:


Device drivers --->         
   I2C support  --->            
      <*> I2C support                
         [*]   Enable compatibility bits for old user-space                
         <*>   I2C device interface                
         <*>   I2C bus multiplexing support                        
                  Multiplexer I2C Chip support  --->                
         [*]   Autoselect pertinent helper modules                        
                  I2C Hardware Bus support  --->                            
                  <*> GPIO-based bitbanging I2C
                  <*> I2C/SMBus Test Stub

And modified device tree as below:

soc@ffe00000 {
     ranges = <0x0 0x0 0xffe00000 0x100000>;
     #address-cells = <0x1>;
     #size-cells = <0x1>;
     device_type = "soc";
     compatible = "fsl,p1021-immr", "simple-bus";
     bus-frequency = <0x0>;
     i2c1: i2c@3000 {
      status = "okay";
      #address-cells = <0x1>;
      #size-cells = <0x0>;
      cell-index = <0x0>;
      compatible = "fsl-i2c";
      reg = <0x3000 0x100>;
      interrupts = <0x2b 0x2 0x0 0x0>;
      i2c2: i2c@3100 {
            status = "okay";
            #address-cells = <0x1>;
            #size-cells = <0x0>;
            cell-index = <0x1>;
            compatible = "fsl-i2c";
            reg = <0x3100 0x100>;
            interrupts = <0x2b 0x2 0x0 0x0>;


After load the kernel, I can't see any i2c device in /dev/ directory (dev/i2c-0 and dev/i2c-1). And can't see any file in /sys/class/i2c-dev/ directory.

root@p1021rdb:/# ls /dev/i2c*
ls: /dev/i2c*: No such file or directory
root@p1021rdb:~# ls /sys/class/i2c-dev/


And I try to modify menuconfig to set I2C device interface as modularizes (<M> I2C device interface). But when I use modprobe command, it show below error.


root@p1021rdb:/mnt# modprobe i2c-dev
modprobe: module i2c-dev not found in modules.dep


Can someone guide me how to resolve this issue? What could be going wrong here?


Thanks for your help,

Best Regards,