xref: /openbmc/phosphor-fan-presence/docs/presence/eeprom.md (revision 64fb88c1bfd81e970b15f13938d59fc04d030b0f)
1bc4179e9SMatt Spinler# eeprom
2bc4179e9SMatt Spinler
3bc4179e9SMatt Spinler## Description
4a49e3f19SPatrick Williams
5a49e3f19SPatrick WilliamsSome fans have EEPROMs on them. In these cases, the `eeprom` JSON stanza can be
6a49e3f19SPatrick Williamsused to have the application re-bind the EEPROM driver to the EEPROM instance
7a49e3f19SPatrick Williamsafter a new fan is detected. This will trigger the EEPROM to be read by the
8a49e3f19SPatrick Williamsappropriate code if the platform is configured to do so.
9bc4179e9SMatt Spinler
10bc4179e9SMatt SpinlerThis is optional and only required if the above behavior is desired.
11bc4179e9SMatt Spinler
12bc4179e9SMatt Spinler## Keys
13a49e3f19SPatrick Williams
14a49e3f19SPatrick Williams- ["bus_address"](#bus_address)
15a49e3f19SPatrick Williams- ["driver_name"](#driver_name)
16a49e3f19SPatrick Williams- ["bind_delay_ms"](#bind_delay_ms)
17bc4179e9SMatt Spinler
18bc4179e9SMatt Spinler### "bus_address"
19a49e3f19SPatrick Williams
20bc4179e9SMatt SpinlerThe I2C bus and address string of the form BB-AAAA that is used by the I2C
21bc4179e9SMatt Spinlersubsystem in sysfs.
22bc4179e9SMatt Spinler
23*64fb88c1SGeorge Liu```text
24bc4179e9SMatt Spinler"bus_address": "3-0050"
25bc4179e9SMatt Spinler```
26bc4179e9SMatt Spinler
27bc4179e9SMatt Spinler### "driver_name"
28a49e3f19SPatrick Williams
29bc4179e9SMatt SpinlerThe name of the eeprom driver in sysfs.
30bc4179e9SMatt Spinler
31*64fb88c1SGeorge Liu```text
32bc4179e9SMatt Spinler"driver_name": "at24"
33bc4179e9SMatt Spinler```
34bc4179e9SMatt Spinler
35bc4179e9SMatt Spinler### "bind_delay_ms"
36a49e3f19SPatrick Williams
37bc4179e9SMatt SpinlerThe number of milliseconds to wait after a fan is detected before binding the
38bc4179e9SMatt Spinlerdriver to the device in case the device takes some time to initialize after
39a49e3f19SPatrick Williamsbeing plugged into power. If no delay is required, a value of zero can be used.
40bc4179e9SMatt Spinler
41*64fb88c1SGeorge Liu```text
42bc4179e9SMatt Spinler"bind_delay_ms": 1000
43bc4179e9SMatt Spinler```
44bc4179e9SMatt Spinler
45bc4179e9SMatt Spinler## Example
46a49e3f19SPatrick Williams
476d3e18c0SGeorge Liu```json
48bc4179e9SMatt Spinler[
49bc4179e9SMatt Spinler  {
50bc4179e9SMatt Spinler    "name": "fan0",
51bc4179e9SMatt Spinler    "path": "/system/chassis/motherboard/fan0",
52bc4179e9SMatt Spinler    "methods": [
53bc4179e9SMatt Spinler      {
54bc4179e9SMatt Spinler        "type": "tach",
556d3e18c0SGeorge Liu        "sensors": ["fan0_0"]
56bc4179e9SMatt Spinler      }
57bc4179e9SMatt Spinler    ],
58bc4179e9SMatt Spinler    "rpolicy": {
59bc4179e9SMatt Spinler      "type": "anyof"
60bc4179e9SMatt Spinler    },
616d3e18c0SGeorge Liu    "eeprom": {
62bc4179e9SMatt Spinler      "bus_address": "30-0050",
63bc4179e9SMatt Spinler      "driver_name": "at24",
64bc4179e9SMatt Spinler      "bind_delay_ms": 1000
656d3e18c0SGeorge Liu    }
66bc4179e9SMatt Spinler  }
67bc4179e9SMatt Spinler]
686d3e18c0SGeorge Liu```
69