18c2ecf20Sopenharmony_ci============================== 28c2ecf20Sopenharmony_ciLinux I2C slave EEPROM backend 38c2ecf20Sopenharmony_ci============================== 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ciby Wolfram Sang <wsa@sang-engineering.com> in 2014-20 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciThis backend simulates an EEPROM on the connected I2C bus. Its memory contents 88c2ecf20Sopenharmony_cican be accessed from userspace via this file located in sysfs:: 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci /sys/bus/i2c/devices/<device-directory>/slave-eeprom 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ciThe following types are available: 24c02, 24c32, 24c64, and 24c512. Read-only 138c2ecf20Sopenharmony_civariants are also supported. The name needed for instantiating has the form 148c2ecf20Sopenharmony_ci'slave-<type>[ro]'. Examples follow: 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci24c02, read/write, address 0x64: 178c2ecf20Sopenharmony_ci # echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-1/new_device 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci24c512, read-only, address 0x42: 208c2ecf20Sopenharmony_ci # echo slave-24c512ro 0x1042 > /sys/bus/i2c/devices/i2c-1/new_device 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciYou can also preload data during boot if a device-property named 238c2ecf20Sopenharmony_ci'firmware-name' contains a valid filename (DT or ACPI only). 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ciAs of 2015, Linux doesn't support poll on binary sysfs files, so there is no 268c2ecf20Sopenharmony_cinotification when another master changed the content. 27