1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/hwmon/gpio-fan.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Fan connected to GPIO lines
8
9maintainers:
10  - Rob Herring <robh@kernel.org>
11
12properties:
13  compatible:
14    const: gpio-fan
15
16  gpios:
17    description: |
18      Specifies the pins that map to bits in the control value,
19      ordered MSB-->LSB.
20    minItems: 1
21    maxItems: 7
22
23  alarm-gpios:
24    maxItems: 1
25
26  fan-supply:
27    description: Power supply for fan
28
29  gpio-fan,speed-map:
30    $ref: /schemas/types.yaml#/definitions/uint32-matrix
31    minItems: 2
32    maxItems: 127
33    items:
34      items:
35        - description: fan speed in RPMs
36        - description: control value
37    description: |
38      A mapping of possible fan RPM speeds and the
39      control value that should be set to achieve them. This array
40      must have the RPM values in ascending order.
41
42  '#cooling-cells':
43    const: 2
44
45required:
46  - compatible
47  - gpios
48  - gpio-fan,speed-map
49
50additionalProperties: false
51
52examples:
53  - |
54    gpio-fan {
55      compatible = "gpio-fan";
56      gpios = <&gpio2 14 1
57               &gpio2 13 1>;
58      gpio-fan,speed-map = <   0 0>,
59                           <3000 1>,
60                           <6000 2>;
61      alarm-gpios = <&gpio2 15 1>;
62      #cooling-cells = <2>; /* min followed by max */
63    };
64