This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

linux-c6x: i2c problem

Hi, All!

I,m a new in i2c. I want to get access for i2c bus in linux-c6x (I need control i2c switch placed on my board) but I can't see any device files similar to /dev/i2c-x after system was booted. But in sysfs I can see i2c-bus related entries. Here my sysfs log:

/home/embedded/i2c # ls /sys/devices/platform
cio.0 keystone-rapidio.1 serial8250.0
davinci_nand.0 keystone_netcp.0 spi_davinci.0
edma.0 keystone_netcp.1 uevent
i2c_davinci.1 keystone_qmss.0
keystone-pcie.0 serial8250

/home/embedded/i2c # ls /sys/devices/platform/i2c_davinci.1
bus driver i2c-1 modalias subsystem uevent

and

/home/embedded/i2c # ls /sys/devices/platform/i2c_davinci.1/i2c-1/
1-0050 1-0070 delete_device new_device uevent
1-0051 bus name subsystem
I add entry I2C_BOARD_INFO("TCA9548", 0x70) in evm_i2c_info structure.

Please, tell me how I can bind i2c_davinci driver with device node created in /dev directory. 

Thank you.

P.S. In DM816x linux, during board initialization calling omap_register_i2c_bus() and I suppose, device node create automatically. In linux-c6 I can't found something similar.


  • Update: By default CONFIG_I2C_CHARDEV is switch off. After enabling this option device node: /dev/i2c-1 was created and I can work with it using i2c-tools. Here is the patch:

    diff --git a/arch/c6x/configs/ti_evmc6678_defconfig b/arch/c6x/configs/ti_evmc6678_defconfig
    index 38cfc1d..411f045 100644
    --- a/arch/c6x/configs/ti_evmc6678_defconfig
    +++ b/arch/c6x/configs/ti_evmc6678_defconfig
    @@ -677,7 +677,7 @@ CONFIG_DEVPORT=y
    CONFIG_I2C=y
    CONFIG_I2C_BOARDINFO=y
    # CONFIG_I2C_COMPAT is not set
    -# CONFIG_I2C_CHARDEV is not set
    +CONFIG_I2C_CHARDEV=y
    CONFIG_I2C_HELPER_AUTO=y