xref: /linux/Documentation/devicetree/bindings/sound/cirrus,cs35l45.yaml (revision 374b54532b1c94076799518cad5c33536eaf0c1b)
172661ff7SRichard Fitzgerald# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
272661ff7SRichard Fitzgerald%YAML 1.2
372661ff7SRichard Fitzgerald---
472661ff7SRichard Fitzgerald$id: http://devicetree.org/schemas/sound/cirrus,cs35l45.yaml#
572661ff7SRichard Fitzgerald$schema: http://devicetree.org/meta-schemas/core.yaml#
672661ff7SRichard Fitzgerald
772661ff7SRichard Fitzgeraldtitle: Cirrus Logic CS35L45 Speaker Amplifier
872661ff7SRichard Fitzgerald
972661ff7SRichard Fitzgeraldmaintainers:
1072661ff7SRichard Fitzgerald  - Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
1172661ff7SRichard Fitzgerald  - Richard Fitzgerald <rf@opensource.cirrus.com>
1272661ff7SRichard Fitzgerald
1372661ff7SRichard Fitzgeralddescription: |
1472661ff7SRichard Fitzgerald  CS35L45 is a Boosted Mono Class D Amplifier with DSP
1572661ff7SRichard Fitzgerald  Speaker Protection and Adaptive Battery Management.
1672661ff7SRichard Fitzgerald
1758ae9a2aSKrzysztof KozlowskiallOf:
1858ae9a2aSKrzysztof Kozlowski  - $ref: dai-common.yaml#
1958ae9a2aSKrzysztof Kozlowski
2072661ff7SRichard Fitzgeraldproperties:
2172661ff7SRichard Fitzgerald  compatible:
2272661ff7SRichard Fitzgerald    enum:
2372661ff7SRichard Fitzgerald      - cirrus,cs35l45
2472661ff7SRichard Fitzgerald
2572661ff7SRichard Fitzgerald  reg:
2672661ff7SRichard Fitzgerald    maxItems: 1
2772661ff7SRichard Fitzgerald
2872661ff7SRichard Fitzgerald  '#sound-dai-cells':
2972661ff7SRichard Fitzgerald    const: 1
3072661ff7SRichard Fitzgerald
3172661ff7SRichard Fitzgerald  reset-gpios:
3272661ff7SRichard Fitzgerald    maxItems: 1
3372661ff7SRichard Fitzgerald
3472661ff7SRichard Fitzgerald  vdd-a-supply:
3572661ff7SRichard Fitzgerald    description: voltage regulator phandle for the VDD_A supply
3672661ff7SRichard Fitzgerald
3772661ff7SRichard Fitzgerald  vdd-batt-supply:
3872661ff7SRichard Fitzgerald    description: voltage regulator phandle for the VDD_BATT supply
3972661ff7SRichard Fitzgerald
4072661ff7SRichard Fitzgerald  spi-max-frequency:
4172661ff7SRichard Fitzgerald    maximum: 5000000
4272661ff7SRichard Fitzgerald
4372661ff7SRichard Fitzgerald  cirrus,asp-sdout-hiz-ctrl:
4472661ff7SRichard Fitzgerald    description:
4572661ff7SRichard Fitzgerald      Audio serial port SDOUT Hi-Z control. Sets the Hi-Z
4672661ff7SRichard Fitzgerald      configuration for SDOUT pin of amplifier. Logical OR of
4772661ff7SRichard Fitzgerald      CS35L45_ASP_TX_HIZ_xxx values.
48d9e909e2SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
4972661ff7SRichard Fitzgerald    minimum: 0
5072661ff7SRichard Fitzgerald    maximum: 3
5172661ff7SRichard Fitzgerald    default: 2
5272661ff7SRichard Fitzgerald
53c6cec088SVlad.KarpovichpatternProperties:
54c6cec088SVlad.Karpovich  "^cirrus,gpio-ctrl[1-3]$":
55c6cec088SVlad.Karpovich    description:
56c6cec088SVlad.Karpovich      GPIO pins configuration.
57c6cec088SVlad.Karpovich    type: object
58c6cec088SVlad.Karpovich    additionalProperties: false
59c6cec088SVlad.Karpovich    properties:
60c6cec088SVlad.Karpovich      gpio-dir:
61c6cec088SVlad.Karpovich        description:
62c6cec088SVlad.Karpovich          GPIO pin direction. Valid only when 'gpio-ctrl' is 1
63c6cec088SVlad.Karpovich            0 = Output
64c6cec088SVlad.Karpovich            1 = Input
65*374b5453SKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
66c6cec088SVlad.Karpovich        minimum: 0
67c6cec088SVlad.Karpovich        maximum: 1
68c6cec088SVlad.Karpovich        default: 1
69c6cec088SVlad.Karpovich      gpio-lvl:
70c6cec088SVlad.Karpovich        description:
71c6cec088SVlad.Karpovich          GPIO level. Valid only when 'gpio-ctrl' is 1 and 'gpio-dir' is 0
72c6cec088SVlad.Karpovich            0 = Low
73c6cec088SVlad.Karpovich            1 = High
74*374b5453SKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
75c6cec088SVlad.Karpovich        minimum: 0
76c6cec088SVlad.Karpovich        maximum: 1
77c6cec088SVlad.Karpovich        default: 0
78c6cec088SVlad.Karpovich      gpio-op-cfg:
79c6cec088SVlad.Karpovich        description:
80c6cec088SVlad.Karpovich          GPIO level. Valid only when 'gpio-ctrl' is 1 and 'gpio-dir' is 0
81c6cec088SVlad.Karpovich            0 = CMOS
82c6cec088SVlad.Karpovich            1 = Open Drain
83*374b5453SKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
84c6cec088SVlad.Karpovich        minimum: 0
85c6cec088SVlad.Karpovich        maximum: 1
86c6cec088SVlad.Karpovich        default: 0
87c6cec088SVlad.Karpovich      gpio-pol:
88c6cec088SVlad.Karpovich        description:
89c6cec088SVlad.Karpovich          GPIO output polarity select. Valid only when 'gpio-ctrl' is 1
90c6cec088SVlad.Karpovich          and 'gpio-dir' is 0
91c6cec088SVlad.Karpovich            0 = Non-inverted, Active High
92c6cec088SVlad.Karpovich            1 = Inverted, Active Low
93*374b5453SKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
94c6cec088SVlad.Karpovich        minimum: 0
95c6cec088SVlad.Karpovich        maximum: 1
96c6cec088SVlad.Karpovich        default: 0
97c6cec088SVlad.Karpovich      gpio-ctrl:
98c6cec088SVlad.Karpovich        description:
99c6cec088SVlad.Karpovich          Defines the function of the GPIO pin.
100c6cec088SVlad.Karpovich          GPIO1
101c6cec088SVlad.Karpovich            0 = High impedance input
102c6cec088SVlad.Karpovich            1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
103c6cec088SVlad.Karpovich            2 = Pin acts as MDSYNC, direction controlled by MDSYNC
104c6cec088SVlad.Karpovich            3-7 = Reserved
105c6cec088SVlad.Karpovich          GPIO2
106c6cec088SVlad.Karpovich            0 = High impedance input
107c6cec088SVlad.Karpovich            1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
108c6cec088SVlad.Karpovich            2 = Pin acts as open drain INT
109c6cec088SVlad.Karpovich            3 = Reserved
110c6cec088SVlad.Karpovich            4 = Pin acts as push-pull output INT. Active low.
111c6cec088SVlad.Karpovich            5 = Pin acts as push-pull output INT. Active high.
112c6cec088SVlad.Karpovich            6,7 = Reserved
113c6cec088SVlad.Karpovich          GPIO3
114c6cec088SVlad.Karpovich            0 = High impedance input
115c6cec088SVlad.Karpovich            1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
116c6cec088SVlad.Karpovich            2-7 = Reserved
117*374b5453SKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
118c6cec088SVlad.Karpovich        minimum: 0
119c6cec088SVlad.Karpovich        maximum: 7
120c6cec088SVlad.Karpovich        default: 0
12172661ff7SRichard Fitzgeraldrequired:
12272661ff7SRichard Fitzgerald  - compatible
12372661ff7SRichard Fitzgerald  - reg
12472661ff7SRichard Fitzgerald  - "#sound-dai-cells"
12572661ff7SRichard Fitzgerald
12658ae9a2aSKrzysztof KozlowskiunevaluatedProperties: false
12772661ff7SRichard Fitzgerald
12872661ff7SRichard Fitzgeraldexamples:
12972661ff7SRichard Fitzgerald  - |
13072661ff7SRichard Fitzgerald    #include <dt-bindings/sound/cs35l45.h>
13172661ff7SRichard Fitzgerald    spi {
13272661ff7SRichard Fitzgerald        #address-cells = <1>;
13372661ff7SRichard Fitzgerald        #size-cells = <0>;
13472661ff7SRichard Fitzgerald
13572661ff7SRichard Fitzgerald        cs35l45: cs35l45@2 {
13672661ff7SRichard Fitzgerald          #sound-dai-cells = <1>;
13772661ff7SRichard Fitzgerald          compatible = "cirrus,cs35l45";
13872661ff7SRichard Fitzgerald          reg = <2>;
13972661ff7SRichard Fitzgerald          spi-max-frequency = <5000000>;
14072661ff7SRichard Fitzgerald          vdd-a-supply = <&dummy_vreg>;
14172661ff7SRichard Fitzgerald          vdd-batt-supply = <&dummy_vreg>;
14272661ff7SRichard Fitzgerald          reset-gpios = <&gpio 110 0>;
14372661ff7SRichard Fitzgerald          cirrus,asp-sdout-hiz-ctrl = <(CS35L45_ASP_TX_HIZ_UNUSED |
14472661ff7SRichard Fitzgerald                                        CS35L45_ASP_TX_HIZ_DISABLED)>;
145c6cec088SVlad.Karpovich          cirrus,gpio-ctrl1 {
146c6cec088SVlad.Karpovich             gpio-ctrl = <0x2>;
147c6cec088SVlad.Karpovich          };
148c6cec088SVlad.Karpovich          cirrus,gpio-ctrl2 {
149c6cec088SVlad.Karpovich             gpio-ctrl = <0x2>;
150c6cec088SVlad.Karpovich          };
151c6cec088SVlad.Karpovich          cirrus,gpio-ctrl3 {
152c6cec088SVlad.Karpovich             gpio-ctrl = <0x1>;
153c6cec088SVlad.Karpovich             gpio-dir = <0x1>;
154c6cec088SVlad.Karpovich          };
15572661ff7SRichard Fitzgerald        };
15672661ff7SRichard Fitzgerald    };
157