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