1# methods
2
3## Description
4An array of method objects used to detect the fan's present state. Each
5supported method requires its own set of attributes to be provided.
6
7## Attribute Value(s)
8Method `type`:
9* ["tach"](#tach)
10* ["gpio"](#gpio)
11
12### "tach"
13Requires an array of `sensors` of each fan tach D-Bus sensor name to be used to
14determine fan presence. This is the name of the fan tach sensor located under
15the `/xyz/openbmc_project/sensors/fan_tach/` D-Bus path.
16
17```
18"type": "tach",
19"sensors": [
20  "fan0_0"
21]
22```
23
24### "gpio"
25Detects fans with dedicated GPIOs using Linux
26[gpio-keys](https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt)
27device tree bindings, where the event number is provided via the `key`
28attribute.
29
30```
31"type": "gpio",
32"key": 1,
33"physpath": "/sys/bus/i2c/devices/1-0001",
34"devpath": "/dev/input/by-path/platform-gpio-keys-polled-event"
35```
36
37## Example
38<pre><code>
39[
40  {
41    "name": "fan0",
42    "path": "/system/chassis/motherboard/fan0",
43    <b><i>"methods": [
44      {
45        "type": "tach",
46        "sensors": [
47          "fan0_0"
48        ]
49      }
50    ]</i></b>,
51    "rpolicy": {
52      "type": "anyof"
53    }"
54  }
55]
56</code></pre>
57