xref: /linux/Documentation/devicetree/bindings/hwmon/aspeed,ast2400-pwm-tacho.yaml (revision 532355a756103639816068b89f73cc7789b16275)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/hwmon/aspeed,ast2400-pwm-tacho.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: ASPEED AST2400/AST2500 PWM and Fan Tacho controller
8
9maintainers:
10  - Joel Stanley <joel@jms.id.au>
11  - Andrew Jeffery <andrew@codeconstruct.com.au>
12
13description: >
14  The ASPEED PWM controller can support up to 8 PWM outputs. The ASPEED Fan
15  Tacho controller can support up to 16 Fan tachometer inputs.
16
17  There can be up to 8 fans supported. Each fan can have 1 PWM output and
18  1-2 Fan tach inputs.
19
20properties:
21  compatible:
22    enum:
23      - aspeed,ast2400-pwm-tacho
24      - aspeed,ast2500-pwm-tacho
25
26  reg:
27    maxItems: 1
28
29  '#address-cells':
30    const: 1
31
32  '#size-cells':
33    const: 0
34
35  '#cooling-cells':
36    const: 2
37
38  clocks:
39    maxItems: 1
40
41  resets:
42    maxItems: 1
43
44patternProperties:
45  '^fan@[0-7]$':
46    description: Fan subnode
47    type: object
48    additionalProperties: false
49
50    properties:
51      reg:
52        description: PWM source port index (0 = PWM A, ..., 7 = PWM H)
53        maximum: 7
54
55      cooling-levels:
56        description: PWM duty cycle values for cooling states
57        $ref: /schemas/types.yaml#/definitions/uint8-array
58        minItems: 1
59        maxItems: 16  # Should be enough
60
61      aspeed,fan-tach-ch:
62        description: Fan tachometer input channel
63        $ref: /schemas/types.yaml#/definitions/uint8-array
64        minItems: 1
65        maxItems: 2
66        items:
67          maximum: 15
68
69    required:
70      - reg
71      - aspeed,fan-tach-ch
72
73required:
74  - compatible
75  - reg
76  - '#address-cells'
77  - '#size-cells'
78  - clocks
79  - resets
80
81additionalProperties: false
82
83examples:
84  - |
85    #include <dt-bindings/clock/aspeed-clock.h>
86
87    fan-controller@1e786000 {
88        compatible = "aspeed,ast2500-pwm-tacho";
89        reg = <0x1e786000 0x1000>;
90        #address-cells = <1>;
91        #size-cells = <0>;
92        #cooling-cells = <2>;
93        clocks = <&syscon ASPEED_CLK_APB>;
94        resets = <&syscon ASPEED_RESET_PWM>;
95
96        fan@0 {
97            reg = <0x00>;
98            cooling-levels = /bits/ 8 <125 151 177 203 229 255>;
99            aspeed,fan-tach-ch = /bits/ 8 <0x00>;
100        };
101
102        fan@1 {
103            reg = <0x01>;
104            aspeed,fan-tach-ch = /bits/ 8 <0x01 0x02>;
105        };
106    };
107