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