xref: /linux/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml (revision 26b8eb8a98c18b2ee4ea76d99fa2b2a5ccbc1b6c)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/hwmon/microchip,emc2305.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Microchip EMC2305 SMBus compliant PWM fan controller
8
9maintainers:
10  - Michael Shych <michaelsh@nvidia.com>
11
12description:
13  Microchip EMC2301/2/3/5 pwm controller which supports up to five programmable
14  fan control circuits.
15
16properties:
17  compatible:
18    oneOf:
19      - enum:
20          - microchip,emc2305
21      - items:
22          - enum:
23              - microchip,emc2303
24              - microchip,emc2302
25              - microchip,emc2301
26          - const: microchip,emc2305
27
28  reg:
29    maxItems: 1
30
31  '#address-cells':
32    const: 1
33
34  '#size-cells':
35    const: 0
36
37  '#pwm-cells':
38    const: 3
39    description: |
40      Number of cells in a PWM specifier.
41      - cell 0: The PWM frequency
42      - cell 1: The PWM polarity: 0 or PWM_POLARITY_INVERTED
43      - cell 2: The PWM output config:
44           - 0 (Open-Drain)
45           - 1 (Push-Pull)
46
47patternProperties:
48  '^fan@[0-4]$':
49    $ref: fan-common.yaml#
50    unevaluatedProperties: false
51    properties:
52      reg:
53        description:
54          The fan number used to determine the associated PWM channel.
55        maxItems: 1
56
57      fan-shutdown-percent:
58        description:
59          PWM duty cycle in percent applied to the fan during shutdown.
60        minimum: 0
61        maximum: 100
62
63    required:
64      - reg
65
66required:
67  - compatible
68  - reg
69
70additionalProperties: false
71
72examples:
73  - |
74    #include <dt-bindings/pwm/pwm.h>
75    i2c {
76        #address-cells = <1>;
77        #size-cells = <0>;
78
79        fan_controller: fan-controller@2f {
80            compatible = "microchip,emc2305";
81            reg = <0x2f>;
82            #address-cells = <1>;
83            #size-cells = <0>;
84            #pwm-cells = <3>;
85
86            fan@0 {
87                reg = <0x0>;
88                pwms = <&fan_controller 26000 PWM_POLARITY_INVERTED 1>;
89                fan-shutdown-percent = <100>;
90                #cooling-cells = <2>;
91            };
92
93            fan@1 {
94                reg = <0x1>;
95                pwms = <&fan_controller 26000 0 1>;
96                fan-shutdown-percent = <50>;
97                #cooling-cells = <2>;
98            };
99
100            fan@2 {
101                reg = <0x2>;
102                pwms = <&fan_controller 26000 0 1>;
103                #cooling-cells = <2>;
104            };
105
106            fan@3 {
107                reg = <0x3>;
108                pwms = <&fan_controller 26000 0 1>;
109                #cooling-cells = <2>;
110            };
111
112            fan@4 {
113                reg = <0x4>;
114                pwms = <&fan_controller 26000 0 1>;
115                #cooling-cells = <2>;
116            };
117        };
118    };
119...
120