xref: /linux/Documentation/devicetree/bindings/sound/cirrus,cs35l45.yaml (revision d0611f617d823a87f04186ad165e2990208c040b)
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
28*d0611f61SKonrad Dybcio  interrupts:
29*d0611f61SKonrad Dybcio    maxItems: 1
30*d0611f61SKonrad Dybcio
3172661ff7SRichard Fitzgerald  '#sound-dai-cells':
3272661ff7SRichard Fitzgerald    const: 1
3372661ff7SRichard Fitzgerald
3472661ff7SRichard Fitzgerald  reset-gpios:
3572661ff7SRichard Fitzgerald    maxItems: 1
3672661ff7SRichard Fitzgerald
3772661ff7SRichard Fitzgerald  vdd-a-supply:
3872661ff7SRichard Fitzgerald    description: voltage regulator phandle for the VDD_A supply
3972661ff7SRichard Fitzgerald
4072661ff7SRichard Fitzgerald  vdd-batt-supply:
4172661ff7SRichard Fitzgerald    description: voltage regulator phandle for the VDD_BATT supply
4272661ff7SRichard Fitzgerald
4372661ff7SRichard Fitzgerald  spi-max-frequency:
4472661ff7SRichard Fitzgerald    maximum: 5000000
4572661ff7SRichard Fitzgerald
4672661ff7SRichard Fitzgerald  cirrus,asp-sdout-hiz-ctrl:
4772661ff7SRichard Fitzgerald    description:
4872661ff7SRichard Fitzgerald      Audio serial port SDOUT Hi-Z control. Sets the Hi-Z
4972661ff7SRichard Fitzgerald      configuration for SDOUT pin of amplifier. Logical OR of
5072661ff7SRichard Fitzgerald      CS35L45_ASP_TX_HIZ_xxx values.
51d9e909e2SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
5272661ff7SRichard Fitzgerald    minimum: 0
5372661ff7SRichard Fitzgerald    maximum: 3
5472661ff7SRichard Fitzgerald    default: 2
5572661ff7SRichard Fitzgerald
56c6cec088SVlad.KarpovichpatternProperties:
57c6cec088SVlad.Karpovich  "^cirrus,gpio-ctrl[1-3]$":
58c6cec088SVlad.Karpovich    description:
59c6cec088SVlad.Karpovich      GPIO pins configuration.
60c6cec088SVlad.Karpovich    type: object
61c6cec088SVlad.Karpovich    additionalProperties: false
62c6cec088SVlad.Karpovich    properties:
63c6cec088SVlad.Karpovich      gpio-dir:
64c6cec088SVlad.Karpovich        description:
65c6cec088SVlad.Karpovich          GPIO pin direction. Valid only when 'gpio-ctrl' is 1
66c6cec088SVlad.Karpovich            0 = Output
67c6cec088SVlad.Karpovich            1 = Input
68374b5453SKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
69c6cec088SVlad.Karpovich        minimum: 0
70c6cec088SVlad.Karpovich        maximum: 1
71c6cec088SVlad.Karpovich        default: 1
72c6cec088SVlad.Karpovich      gpio-lvl:
73c6cec088SVlad.Karpovich        description:
74c6cec088SVlad.Karpovich          GPIO level. Valid only when 'gpio-ctrl' is 1 and 'gpio-dir' is 0
75c6cec088SVlad.Karpovich            0 = Low
76c6cec088SVlad.Karpovich            1 = High
77374b5453SKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
78c6cec088SVlad.Karpovich        minimum: 0
79c6cec088SVlad.Karpovich        maximum: 1
80c6cec088SVlad.Karpovich        default: 0
81c6cec088SVlad.Karpovich      gpio-op-cfg:
82c6cec088SVlad.Karpovich        description:
83c6cec088SVlad.Karpovich          GPIO level. Valid only when 'gpio-ctrl' is 1 and 'gpio-dir' is 0
84c6cec088SVlad.Karpovich            0 = CMOS
85c6cec088SVlad.Karpovich            1 = Open Drain
86374b5453SKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
87c6cec088SVlad.Karpovich        minimum: 0
88c6cec088SVlad.Karpovich        maximum: 1
89c6cec088SVlad.Karpovich        default: 0
90c6cec088SVlad.Karpovich      gpio-pol:
91c6cec088SVlad.Karpovich        description:
92c6cec088SVlad.Karpovich          GPIO output polarity select. Valid only when 'gpio-ctrl' is 1
93c6cec088SVlad.Karpovich          and 'gpio-dir' is 0
94c6cec088SVlad.Karpovich            0 = Non-inverted, Active High
95c6cec088SVlad.Karpovich            1 = Inverted, Active Low
96374b5453SKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
97c6cec088SVlad.Karpovich        minimum: 0
98c6cec088SVlad.Karpovich        maximum: 1
99c6cec088SVlad.Karpovich        default: 0
100c6cec088SVlad.Karpovich      gpio-ctrl:
101c6cec088SVlad.Karpovich        description:
102c6cec088SVlad.Karpovich          Defines the function of the GPIO pin.
103c6cec088SVlad.Karpovich          GPIO1
104c6cec088SVlad.Karpovich            0 = High impedance input
105c6cec088SVlad.Karpovich            1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
106c6cec088SVlad.Karpovich            2 = Pin acts as MDSYNC, direction controlled by MDSYNC
107c6cec088SVlad.Karpovich            3-7 = Reserved
108c6cec088SVlad.Karpovich          GPIO2
109c6cec088SVlad.Karpovich            0 = High impedance input
110c6cec088SVlad.Karpovich            1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
111c6cec088SVlad.Karpovich            2 = Pin acts as open drain INT
112c6cec088SVlad.Karpovich            3 = Reserved
113c6cec088SVlad.Karpovich            4 = Pin acts as push-pull output INT. Active low.
114c6cec088SVlad.Karpovich            5 = Pin acts as push-pull output INT. Active high.
115c6cec088SVlad.Karpovich            6,7 = Reserved
116c6cec088SVlad.Karpovich          GPIO3
117c6cec088SVlad.Karpovich            0 = High impedance input
118c6cec088SVlad.Karpovich            1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
119c6cec088SVlad.Karpovich            2-7 = Reserved
120374b5453SKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
121c6cec088SVlad.Karpovich        minimum: 0
122c6cec088SVlad.Karpovich        maximum: 7
123c6cec088SVlad.Karpovich        default: 0
12472661ff7SRichard Fitzgeraldrequired:
12572661ff7SRichard Fitzgerald  - compatible
12672661ff7SRichard Fitzgerald  - reg
12772661ff7SRichard Fitzgerald  - "#sound-dai-cells"
12872661ff7SRichard Fitzgerald
12958ae9a2aSKrzysztof KozlowskiunevaluatedProperties: false
13072661ff7SRichard Fitzgerald
13172661ff7SRichard Fitzgeraldexamples:
13272661ff7SRichard Fitzgerald  - |
13372661ff7SRichard Fitzgerald    #include <dt-bindings/sound/cs35l45.h>
13472661ff7SRichard Fitzgerald    spi {
13572661ff7SRichard Fitzgerald        #address-cells = <1>;
13672661ff7SRichard Fitzgerald        #size-cells = <0>;
13772661ff7SRichard Fitzgerald
13872661ff7SRichard Fitzgerald        cs35l45: cs35l45@2 {
13972661ff7SRichard Fitzgerald          #sound-dai-cells = <1>;
14072661ff7SRichard Fitzgerald          compatible = "cirrus,cs35l45";
14172661ff7SRichard Fitzgerald          reg = <2>;
14272661ff7SRichard Fitzgerald          spi-max-frequency = <5000000>;
14372661ff7SRichard Fitzgerald          vdd-a-supply = <&dummy_vreg>;
14472661ff7SRichard Fitzgerald          vdd-batt-supply = <&dummy_vreg>;
14572661ff7SRichard Fitzgerald          reset-gpios = <&gpio 110 0>;
14672661ff7SRichard Fitzgerald          cirrus,asp-sdout-hiz-ctrl = <(CS35L45_ASP_TX_HIZ_UNUSED |
14772661ff7SRichard Fitzgerald                                        CS35L45_ASP_TX_HIZ_DISABLED)>;
148c6cec088SVlad.Karpovich          cirrus,gpio-ctrl1 {
149c6cec088SVlad.Karpovich             gpio-ctrl = <0x2>;
150c6cec088SVlad.Karpovich          };
151c6cec088SVlad.Karpovich          cirrus,gpio-ctrl2 {
152c6cec088SVlad.Karpovich             gpio-ctrl = <0x2>;
153c6cec088SVlad.Karpovich          };
154c6cec088SVlad.Karpovich          cirrus,gpio-ctrl3 {
155c6cec088SVlad.Karpovich             gpio-ctrl = <0x1>;
156c6cec088SVlad.Karpovich             gpio-dir = <0x1>;
157c6cec088SVlad.Karpovich          };
15872661ff7SRichard Fitzgerald        };
15972661ff7SRichard Fitzgerald    };
160