Skip to content

Commit 59d3d60

Browse files
Wolfram Sangwsakernel
authored andcommitted
i2c: slave-eeprom: update documentation
Add more details which have either been missing ever since or describe recent additions. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Reviewed-by: Luca Ceresoli <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 5f90786 commit 59d3d60

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed
Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
==============================
2-
Linux I2C slave eeprom backend
2+
Linux I2C slave EEPROM backend
33
==============================
44

5-
by Wolfram Sang <[email protected]> in 2014-15
5+
by Wolfram Sang <[email protected]> in 2014-20
66

7-
This is a proof-of-concept backend which acts like an EEPROM on the connected
8-
I2C bus. The memory contents can be modified from userspace via this file
9-
located in sysfs::
7+
This backend simulates an EEPROM on the connected I2C bus. Its memory contents
8+
can be accessed from userspace via this file located in sysfs::
109

1110
/sys/bus/i2c/devices/<device-directory>/slave-eeprom
1211

12+
The following types are available: 24c02, 24c32, 24c64, and 24c512. Read-only
13+
variants are also supported. The name needed for instantiating has the form
14+
'slave-<type>[ro]'. Examples follow:
15+
16+
24c02, read/write, address 0x64:
17+
# echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-1/new_device
18+
19+
24c512, read-only, address 0x42:
20+
# echo slave-24c512ro 0x1042 > /sys/bus/i2c/devices/i2c-1/new_device
21+
22+
You can also preload data during boot if a device-property named
23+
'firmware-name' contains a valid filename (DT or ACPI only).
24+
1325
As of 2015, Linux doesn't support poll on binary sysfs files, so there is no
1426
notification when another master changed the content.

drivers/i2c/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ if I2C_SLAVE
118118

119119
config I2C_SLAVE_EEPROM
120120
tristate "I2C eeprom slave driver"
121+
help
122+
This backend makes Linux behave like an I2C EEPROM. Please read
123+
Documentation/i2c/slave-eeprom-backend.rst for further details.
121124

122125
endif
123126

0 commit comments

Comments
 (0)