xref: /linux/Documentation/devicetree/bindings/sound/cirrus,cs35l36.yaml (revision e5c91aac491def6ab3f90c4cc246e3fcb0f8f058)
1# SPDX-License-Identifier: GPL-2.0-only
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/cirrus,cs35l36.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Cirrus Logic CS35L36 Speaker Amplifier
8
9maintainers:
10  - David Rhodes <drhodes@opensource.cirrus.com>
11  - patches@opensource.cirrus.com
12
13description:
14  CS35L36 is a boosted mono Class D amplifier
15
16allOf:
17  - $ref: dai-common.yaml#
18
19properties:
20  compatible:
21    enum:
22      - cirrus,cs35l36
23
24  reg:
25    maxItems: 1
26
27  interrupts:
28    maxItems: 1
29
30  VA-supply:
31    description: Voltage regulator of analog internal section
32
33  VP-supply:
34    description: Voltage regulator of boost converter
35
36  reset-gpios:
37    maxItems: 1
38
39  cirrus,boost-ctl-millivolt:
40    description: Boost converter output voltage (step 50)
41    $ref: /schemas/types.yaml#/definitions/uint32
42    minimum: 2550
43    maximum: 12000
44
45  cirrus,boost-peak-milliamp:
46    description: Boost-converter peak current limit (step 50)
47    $ref: /schemas/types.yaml#/definitions/uint32
48    default: 4500
49    minimum: 1600
50    maximum: 4500
51
52  cirrus,boost-ind-nanohenry:
53    description: Initial inductor estimation reference value (1000=1μH, 1200=1.2μH)
54    $ref: /schemas/types.yaml#/definitions/uint32
55    default: 1000
56
57  cirrus,multi-amp-mode:
58    description: Hi-Z ASP port when more than one amplifier in system
59    type: boolean
60
61  cirrus,boost-ctl-select:
62    description: Boost converter control source selection
63    $ref: /schemas/types.yaml#/definitions/uint32
64    default: 1
65    enum:
66      - 0 # Control Port
67      - 1 # Class
68      - 2 # Sync
69
70  cirrus,amp-pcm-inv:
71    description: Invert incoming PCM data when true
72    type: boolean
73
74  cirrus,imon-pol-inv:
75    description: Invert polarity of outbound IMON feedback when true
76    type: boolean
77
78  cirrus,vmon-pol-inv:
79    description: Invert polarity of outbound VMON feedback when true
80    type: boolean
81
82  cirrus,dcm-mode-enable:
83    description: Enable boost converter automatic Discontinuous Conduction Mode
84    type: boolean
85
86  cirrus,weak-fet-disable:
87    description: Reduce output driver strength in Weak-FET Drive Mode when true
88    type: boolean
89
90  cirrus,classh-wk-fet-delay-ms:
91    description: Weak-FET entry delay
92    default: 100
93    enum: [0, 5, 10, 50, 100, 200, 500, 1000]
94
95  cirrus,classh-weak-fet-thld-millivolt:
96    description: Weak-FET drive threshold
97    $ref: /schemas/types.yaml#/definitions/uint32
98    enum: [50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700]
99
100  cirrus,temp-warn-threshold:
101    description: Overtemperature warning threshold
102    $ref: /schemas/types.yaml#/definitions/uint32
103    default: 2
104    enum:
105      - 0 # 105°C
106      - 1 # 115°C
107      - 2 # 125°C
108      - 3 # 135°C
109
110  cirrus,irq-drive-select:
111    description: Interrupt output driver type
112    $ref: /schemas/types.yaml#/definitions/uint32
113    default: 1
114    enum:
115      - 0 # open-drain
116      - 1 # push-pull
117
118  cirrus,irq-gpio-select:
119    description: Programmable IRQ pin selection
120    $ref: /schemas/types.yaml#/definitions/uint32
121    enum:
122      - 0 # PDM_DATA/SWIRE_SD/INT
123      - 1 # GPIO
124
125  cirrus,vpbr-config:
126    $ref: "#/$defs/vpbr-config"
127
128$defs:
129  vpbr-config:
130    description: Brownout prevention configuration sub-node
131    type: object
132    additionalProperties: false
133
134    properties:
135      cirrus,vpbr-en:
136        description: VBST brownout prevention enable
137        $ref: /schemas/types.yaml#/definitions/uint32
138        default: 0
139        enum:
140          - 0 # disabled
141          - 1 # enabled
142
143      cirrus,vpbr-thld:
144        description: Initial VPBR threshold voltage
145        $ref: /schemas/types.yaml#/definitions/uint32
146        minimum: 2
147        maximum: 31
148
149      cirrus,vpbr-atk-rate:
150        description: Attenuation attack step rate
151        $ref: /schemas/types.yaml#/definitions/uint32
152        minimum: 0
153        maximum: 7
154
155      cirrus,vpbr-atk-vol:
156        description: VP brownout prevention step size
157        $ref: /schemas/types.yaml#/definitions/uint32
158        minimum: 0
159        maximum: 7
160
161      cirrus,vpbr-max-attn:
162        description: Maximum attenuation during VP brownout prevention (dB)
163        $ref: /schemas/types.yaml#/definitions/uint32
164        minimum: 0
165        maximum: 15
166
167      cirrus,vpbr-wait:
168        description: Delay between brownout clearance and attenuation release (ms)
169        $ref: /schemas/types.yaml#/definitions/uint32
170        default: 1
171        enum:
172          - 0 # 10
173          - 1 # 100
174          - 2 # 250
175          - 3 # 500
176
177      cirrus,vpbr-rel-rate:
178        description: Attenuation release step rate
179        $ref: /schemas/types.yaml#/definitions/uint32
180        minimum: 0
181        maximum: 7
182
183      cirrus,vpbr-mute-en:
184        description: Mute audio if maximum attenuation reached
185        $ref: /schemas/types.yaml#/definitions/uint32
186        minimum: 0
187        maximum: 1
188
189required:
190  - compatible
191  - reg
192  - interrupts
193  - VA-supply
194  - cirrus,boost-ctl-millivolt
195  - cirrus,boost-peak-milliamp
196
197unevaluatedProperties: false
198
199examples:
200  - |
201    #include <dt-bindings/gpio/gpio.h>
202    #include <dt-bindings/interrupt-controller/irq.h>
203
204    i2c {
205        #address-cells = <1>;
206        #size-cells = <0>;
207
208        codec@40 {
209            compatible = "cirrus,cs35l36";
210            reg = <0x40>;
211            VA-supply = <&dummy_vreg>;
212            VP-supply = <&dummy_vreg>;
213            reset-gpios = <&gpio0 54 GPIO_ACTIVE_HIGH>;
214            interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
215
216            cirrus,boost-ind-nanohenry = <1000>;
217            cirrus,boost-ctl-millivolt = <10000>;
218            cirrus,boost-peak-milliamp = <4500>;
219            cirrus,boost-ctl-select = <0>;
220            cirrus,classh-wk-fet-delay-ms = <100>;
221            cirrus,classh-weak-fet-thld-millivolt = <100>;
222            cirrus,temp-warn-threshold = <1>;
223            cirrus,multi-amp-mode;
224            cirrus,irq-drive-select = <1>;
225            cirrus,irq-gpio-select = <1>;
226
227            cirrus,vpbr-config {
228                cirrus,vpbr-en = <0>;
229                cirrus,vpbr-thld = <5>;
230                cirrus,vpbr-atk-rate = <2>;
231                cirrus,vpbr-atk-vol = <1>;
232                cirrus,vpbr-max-attn = <9>;
233                cirrus,vpbr-wait = <1>;
234                cirrus,vpbr-rel-rate = <5>;
235                cirrus,vpbr-mute-en = <0>;
236            };
237        };
238    };
239
240...
241