Environment : x86 / Ubuntu 14.04
I want obtain something similar to
&i2c0 {
eeprom: eeprom@50 {
compatible = "at,24c32";
reg = <0x50>;
};
};
But because in x86 no Device Tree is available, I am follow i2c/instantiating-device
document in the Linux kernel and use "Method 4: Instantiate from user-space".
Process to instantiate:
- Load at24 driver
- Load i2c-dev driver
Instantiate:
# echo eeprom 0x50 > /sys/bus/i2c/devices/i2c-0/new_device
Response from kernel in dmesg:
i2c i2c-0: new_device: Instantiated device eeprom at 0x50
A directory is created "0-0050". Found in
/sys/bus/i2c/devices/i2c-0/0-0050
- This directory contains several files, but there is no file called "eeprom" in it.
Why the "eeprom" files are not created?
P.S:
The directory contains:
root@peio-t52r:~/etxoh# ls -la /sys/bus/i2c/devices/i2c-0/0-0050
total 0
drwxr-xr-x 3 root root 0 sep 25 15:06 .
drwxr-xr-x 5 root root 0 sep 25 14:48 ..
-r--r--r-- 1 root root 4096 sep 25 15:06 modalias
-r--r--r-- 1 root root 4096 sep 25 15:06 name
drwxr-xr-x 2 root root 0 sep 25 15:06 power
lrwxrwxrwx 1 root root 0 sep 25 15:06 subsystem -> ../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 sep 25 15:06 uevent
And file "name" contains:
root@peio-t52r:~/etxoh# cat /sys/bus/i2c/devices/i2c-0/0-0050/name
eeprom
Use "24c32" instead of "eeprom" when instantiate I2C devices.
In my board with AT24C02 SPD EEPROM, instantiate AT24C02 on bus 2
The kernel message shows
The directory contains
The eeprom file is