I have some linux kernel & SFP/I2C driver issue.
I am using a buildroot linux kernel for an embedded board.
I need to be able to read the eeprom file of the SFP i2c device.
1. working case:
When SFP module is inserted in my development unit board from the start (before the kernel loads up) then when startup completed i can see and read the eeprom file in the path: /sys/class/i2c-adapter/i2c-1/1-0050/eeprom
- kernel prints on startup the i2c device scan result:
2. not working case:
If there is no SFP module inserted on startup,and kernel completes the boot procces, then when i'm inserting the SFP module in,i observe that the path:
/sys/class/i2c-adapter/i2c-1/1-0050/ DOESN'T include the eeprom file.
- The device tree part of the sfp-eeprom code:
My guess is the SFP driver is responsible for that trigger that should happen once the SFP module is inserted, and should trigger the creation of eeprom file.
Would like to ask you what am i missing ? some binding code from sfp driver to trigger the i2c scan or something?
Any suggestion?
Thanks in advance.




at24_probein "drivers/misc/eeprom/at24.c" is being called because the device is listed in the device tree. Butat24_probetests whether the EEPROM is actually present on the I2C bus and returns a-ENODEVerror if it is not detected. If some operating system trigger (e.g. in UDEV) occurs when you insert the SFP module, you could use that to load a device tree overlay containing the EEPROM device. - Ian Abbott