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