149d45bcdSMatthew Barth# methods
249d45bcdSMatthew Barth
349d45bcdSMatthew Barth## Description
4*a49e3f19SPatrick Williams
549d45bcdSMatthew BarthAn array of method objects used to detect the fan's present state. Each
649d45bcdSMatthew Barthsupported method requires its own set of attributes to be provided.
749d45bcdSMatthew Barth
849d45bcdSMatthew Barth## Attribute Value(s)
9*a49e3f19SPatrick Williams
1049d45bcdSMatthew BarthMethod `type`:
11*a49e3f19SPatrick Williams
12*a49e3f19SPatrick Williams- ["tach"](#tach)
13*a49e3f19SPatrick Williams- ["gpio"](#gpio)
1449d45bcdSMatthew Barth
1549d45bcdSMatthew Barth### "tach"
16*a49e3f19SPatrick Williams
1749d45bcdSMatthew BarthRequires an array of `sensors` of each fan tach D-Bus sensor name to be used to
1849d45bcdSMatthew Barthdetermine fan presence. This is the name of the fan tach sensor located under
1949d45bcdSMatthew Barththe `/xyz/openbmc_project/sensors/fan_tach/` D-Bus path.
2049d45bcdSMatthew Barth
2149d45bcdSMatthew Barth```
2249d45bcdSMatthew Barth"type": "tach",
2349d45bcdSMatthew Barth"sensors": [
2449d45bcdSMatthew Barth  "fan0_0"
2549d45bcdSMatthew Barth]
2649d45bcdSMatthew Barth```
2749d45bcdSMatthew Barth
2849d45bcdSMatthew Barth### "gpio"
29*a49e3f19SPatrick Williams
3049d45bcdSMatthew BarthDetects fans with dedicated GPIOs using Linux
3149d45bcdSMatthew Barth[gpio-keys](https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt)
3249d45bcdSMatthew Barthdevice tree bindings, where the event number is provided via the `key`
3349d45bcdSMatthew Barthattribute.
3449d45bcdSMatthew Barth
3549d45bcdSMatthew Barth```
3649d45bcdSMatthew Barth"type": "gpio",
3749d45bcdSMatthew Barth"key": 1,
38a4386a3eSMatt Spinler"physpath": "/sys/bus/i2c/devices/1-0001",
3949d45bcdSMatthew Barth"devpath": "/dev/input/by-path/platform-gpio-keys-polled-event"
4049d45bcdSMatthew Barth```
4149d45bcdSMatthew Barth
4249d45bcdSMatthew Barth## Example
43*a49e3f19SPatrick Williams
4449d45bcdSMatthew Barth<pre><code>
4549d45bcdSMatthew Barth[
4649d45bcdSMatthew Barth  {
4749d45bcdSMatthew Barth    "name": "fan0",
4849d45bcdSMatthew Barth    "path": "/system/chassis/motherboard/fan0",
4949d45bcdSMatthew Barth    <b><i>"methods": [
5049d45bcdSMatthew Barth      {
5149d45bcdSMatthew Barth        "type": "tach",
5249d45bcdSMatthew Barth        "sensors": [
5349d45bcdSMatthew Barth          "fan0_0"
5449d45bcdSMatthew Barth        ]
5549d45bcdSMatthew Barth      }
5649d45bcdSMatthew Barth    ]</i></b>,
5749d45bcdSMatthew Barth    "rpolicy": {
5849d45bcdSMatthew Barth      "type": "anyof"
5949d45bcdSMatthew Barth    }"
6049d45bcdSMatthew Barth  }
6149d45bcdSMatthew Barth]
6249d45bcdSMatthew Barth</code></pre>
63