xref: /linux/Documentation/devicetree/bindings/sound/cirrus,cs35l45.yaml (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/cirrus,cs35l45.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Cirrus Logic CS35L45 Speaker Amplifier
8
9maintainers:
10  - Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
11  - Richard Fitzgerald <rf@opensource.cirrus.com>
12
13description: |
14  CS35L45 is a Boosted Mono Class D Amplifier with DSP
15  Speaker Protection and Adaptive Battery Management.
16
17allOf:
18  - $ref: dai-common.yaml#
19
20properties:
21  compatible:
22    enum:
23      - cirrus,cs35l45
24
25  reg:
26    maxItems: 1
27
28  interrupts:
29    maxItems: 1
30
31  '#sound-dai-cells':
32    const: 1
33
34  reset-gpios:
35    maxItems: 1
36
37  vdd-a-supply:
38    description: voltage regulator phandle for the VDD_A supply
39
40  vdd-batt-supply:
41    description: voltage regulator phandle for the VDD_BATT supply
42
43  spi-max-frequency:
44    maximum: 5000000
45
46  cirrus,asp-sdout-hiz-ctrl:
47    description:
48      Audio serial port SDOUT Hi-Z control. Sets the Hi-Z
49      configuration for SDOUT pin of amplifier. Logical OR of
50      CS35L45_ASP_TX_HIZ_xxx values.
51    $ref: /schemas/types.yaml#/definitions/uint32
52    minimum: 0
53    maximum: 3
54    default: 2
55
56patternProperties:
57  "^cirrus,gpio-ctrl[1-3]$":
58    description:
59      GPIO pins configuration.
60    type: object
61    additionalProperties: false
62    properties:
63      gpio-dir:
64        description:
65          GPIO pin direction. Valid only when 'gpio-ctrl' is 1
66            0 = Output
67            1 = Input
68        $ref: /schemas/types.yaml#/definitions/uint32
69        minimum: 0
70        maximum: 1
71        default: 1
72      gpio-lvl:
73        description:
74          GPIO level. Valid only when 'gpio-ctrl' is 1 and 'gpio-dir' is 0
75            0 = Low
76            1 = High
77        $ref: /schemas/types.yaml#/definitions/uint32
78        minimum: 0
79        maximum: 1
80        default: 0
81      gpio-op-cfg:
82        description:
83          GPIO level. Valid only when 'gpio-ctrl' is 1 and 'gpio-dir' is 0
84            0 = CMOS
85            1 = Open Drain
86        $ref: /schemas/types.yaml#/definitions/uint32
87        minimum: 0
88        maximum: 1
89        default: 0
90      gpio-pol:
91        description:
92          GPIO output polarity select. Valid only when 'gpio-ctrl' is 1
93          and 'gpio-dir' is 0
94            0 = Non-inverted, Active High
95            1 = Inverted, Active Low
96        $ref: /schemas/types.yaml#/definitions/uint32
97        minimum: 0
98        maximum: 1
99        default: 0
100      gpio-ctrl:
101        description:
102          Defines the function of the GPIO pin.
103          GPIO1
104            0 = High impedance input
105            1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
106            2 = Pin acts as MDSYNC, direction controlled by MDSYNC
107            3-7 = Reserved
108          GPIO2
109            0 = High impedance input
110            1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
111            2 = Pin acts as open drain INT
112            3 = Reserved
113            4 = Pin acts as push-pull output INT. Active low.
114            5 = Pin acts as push-pull output INT. Active high.
115            6,7 = Reserved
116          GPIO3
117            0 = High impedance input
118            1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
119            2-7 = Reserved
120        $ref: /schemas/types.yaml#/definitions/uint32
121        minimum: 0
122        maximum: 7
123        default: 0
124required:
125  - compatible
126  - reg
127  - "#sound-dai-cells"
128
129unevaluatedProperties: false
130
131examples:
132  - |
133    #include <dt-bindings/sound/cs35l45.h>
134    spi {
135        #address-cells = <1>;
136        #size-cells = <0>;
137
138        cs35l45: cs35l45@2 {
139          #sound-dai-cells = <1>;
140          compatible = "cirrus,cs35l45";
141          reg = <2>;
142          spi-max-frequency = <5000000>;
143          vdd-a-supply = <&dummy_vreg>;
144          vdd-batt-supply = <&dummy_vreg>;
145          reset-gpios = <&gpio 110 0>;
146          cirrus,asp-sdout-hiz-ctrl = <(CS35L45_ASP_TX_HIZ_UNUSED |
147                                        CS35L45_ASP_TX_HIZ_DISABLED)>;
148          cirrus,gpio-ctrl1 {
149             gpio-ctrl = <0x2>;
150          };
151          cirrus,gpio-ctrl2 {
152             gpio-ctrl = <0x2>;
153          };
154          cirrus,gpio-ctrl3 {
155             gpio-ctrl = <0x1>;
156             gpio-dir = <0x1>;
157          };
158        };
159    };
160