[i2c] I2C adapter device file problem

Jean Delvare khali at linux-fr.org
Tue Sep 19 23:18:31 CEST 2006


Hi Sachin,

> I want to access 'EEPROM' I2C device present on AMCC PPC440GX Evaluation bard.
> 
> I have loaded following drivers:
> 1. i2c-core.ko
> 2. i2c-dev.ko
> 3. eeprom.ko
> 4. i2c-ibm_iic.ko
>  
> The entry in the 'sysfs' got created for drivers and devices.
> ----------------------------------------------------------------------------------------
> -bash-2.05b# cd  /sys/bus/i2c/devices
> -bash-2.05b# ls -la *
> lrwxrwxrwx  1 root root 0 Apr  6 06:42 0-0050 -> ../../../devices/platform/i2c-0/0-0050
> lrwxrwxrwx  1 root root 0 Apr  6 06:42 0-0053 -> ../../../devices/platform/i2c-0/0-0053
> lrwxrwxrwx  1 root root 0 Apr  6 06:42 0-0054 -> ../../../devices/platform/i2c-0/0-0054
> -bash-2.05b# cat ../../../devices/platform/i2c-0/0-0050/name
> eeprom
> ----------------------------------------------------------------------------------------
> As per the documentation (/usr/src/linux/Documentation/i2c/dev-interface),
> I2C adapter files gets created under "/dev/i2c-X"are with with major device number 89.
>  
> But in my case, the device file is not getting created under '/dev/'.
>
> Am I missing anything while loading the driver?

If you are not using devfs nor udev, you need to create the device
nodes manually. You can use the script prog/mkdev/mkdev.sh from the
lm_sensors package to do this.

However given that you loaded the eeprom driver, you can already access
your EEPROM data. Check for the following binary files:
/sys/bus/i2c/devices/0-0050/eeprom
/sys/bus/i2c/devices/0-0053/eeprom
/sys/bus/i2c/devices/0-0054/eeprom

For example try:
# hexdump -C /sys/bus/i2c/devices/0-0050/eeprom

(Or use "od -t x1" if you don't have hexdump.)

You should not try to access the EEPROMs using i2c-dev while the eeprom
driver is loaded.

-- 
Jean Delvare



More information about the i2c mailing list