xref: /freebsd/sys/contrib/device-tree/Bindings/sound/cirrus,cs35l41.yaml (revision cb7aa33ac6cd46a5434798e50363136e64f3ae98)
18cc087a1SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
28cc087a1SEmmanuel Vadot%YAML 1.2
38cc087a1SEmmanuel Vadot---
48cc087a1SEmmanuel Vadot$id: http://devicetree.org/schemas/sound/cirrus,cs35l41.yaml#
58cc087a1SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
68cc087a1SEmmanuel Vadot
78cc087a1SEmmanuel Vadottitle: Cirrus Logic CS35L41 Speaker Amplifier
88cc087a1SEmmanuel Vadot
98cc087a1SEmmanuel Vadotmaintainers:
108cc087a1SEmmanuel Vadot  - david.rhodes@cirrus.com
118cc087a1SEmmanuel Vadot
128cc087a1SEmmanuel Vadotdescription: |
138cc087a1SEmmanuel Vadot  CS35L41 is a boosted mono Class D amplifier with DSP
148cc087a1SEmmanuel Vadot  speaker protection and equalization
158cc087a1SEmmanuel Vadot
168cc087a1SEmmanuel Vadotproperties:
178cc087a1SEmmanuel Vadot  compatible:
188cc087a1SEmmanuel Vadot    enum:
198cc087a1SEmmanuel Vadot      - cirrus,cs35l40
208cc087a1SEmmanuel Vadot      - cirrus,cs35l41
218cc087a1SEmmanuel Vadot
228cc087a1SEmmanuel Vadot  reg:
238cc087a1SEmmanuel Vadot    maxItems: 1
248cc087a1SEmmanuel Vadot
25*cb7aa33aSEmmanuel Vadot  interrupts:
26*cb7aa33aSEmmanuel Vadot    maxItems: 1
27*cb7aa33aSEmmanuel Vadot
288cc087a1SEmmanuel Vadot  '#sound-dai-cells':
298cc087a1SEmmanuel Vadot    description:
308cc087a1SEmmanuel Vadot      The first cell indicating the audio interface.
318cc087a1SEmmanuel Vadot    const: 1
328cc087a1SEmmanuel Vadot
338cc087a1SEmmanuel Vadot  reset-gpios:
348cc087a1SEmmanuel Vadot    maxItems: 1
358cc087a1SEmmanuel Vadot
368cc087a1SEmmanuel Vadot  VA-supply:
378cc087a1SEmmanuel Vadot    description: voltage regulator phandle for the VA supply
388cc087a1SEmmanuel Vadot
398cc087a1SEmmanuel Vadot  VP-supply:
408cc087a1SEmmanuel Vadot    description: voltage regulator phandle for the VP supply
418cc087a1SEmmanuel Vadot
428cc087a1SEmmanuel Vadot  cirrus,boost-peak-milliamp:
438cc087a1SEmmanuel Vadot    description:
448cc087a1SEmmanuel Vadot      Boost-converter peak current limit in mA.
458cc087a1SEmmanuel Vadot      Configures the peak current by monitoring the current through the boost FET.
468cc087a1SEmmanuel Vadot      Range starts at 1600 mA and goes to a maximum of 4500 mA with increments
478cc087a1SEmmanuel Vadot      of 50 mA. See section 4.3.6 of the datasheet for details.
48*cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
498cc087a1SEmmanuel Vadot    minimum: 1600
508cc087a1SEmmanuel Vadot    maximum: 4500
518cc087a1SEmmanuel Vadot    default: 4500
528cc087a1SEmmanuel Vadot
538cc087a1SEmmanuel Vadot  cirrus,boost-ind-nanohenry:
548cc087a1SEmmanuel Vadot    description:
558cc087a1SEmmanuel Vadot      Boost inductor value, expressed in nH. Valid
568cc087a1SEmmanuel Vadot      values include 1000, 1200, 1500 and 2200.
57*cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
588cc087a1SEmmanuel Vadot    minimum: 1000
598cc087a1SEmmanuel Vadot    maximum: 2200
608cc087a1SEmmanuel Vadot
618cc087a1SEmmanuel Vadot  cirrus,boost-cap-microfarad:
628cc087a1SEmmanuel Vadot    description:
638cc087a1SEmmanuel Vadot      Total equivalent boost capacitance on the VBST
648cc087a1SEmmanuel Vadot      and VAMP pins, derated at 11 volts DC. The value must be rounded to the
658cc087a1SEmmanuel Vadot      nearest integer and expressed in uF.
66*cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
678cc087a1SEmmanuel Vadot
688cc087a1SEmmanuel Vadot  cirrus,asp-sdout-hiz:
698cc087a1SEmmanuel Vadot    description:
708cc087a1SEmmanuel Vadot      Audio serial port SDOUT Hi-Z control. Sets the Hi-Z
718cc087a1SEmmanuel Vadot      configuration for SDOUT pin of amplifier.
728cc087a1SEmmanuel Vadot      0 = Logic 0 during unused slots, and while all transmit channels disabled
738cc087a1SEmmanuel Vadot      1 = Hi-Z during unused slots but logic 0 while all transmit channels disabled
748cc087a1SEmmanuel Vadot      2 = (Default) Logic 0 during unused slots, but Hi-Z while all transmit channels disabled
758cc087a1SEmmanuel Vadot      3 = Hi-Z during unused slots and while all transmit channels disabled
76*cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
778cc087a1SEmmanuel Vadot    minimum: 0
788cc087a1SEmmanuel Vadot    maximum: 3
798cc087a1SEmmanuel Vadot    default: 2
808cc087a1SEmmanuel Vadot
81d5b0e70fSEmmanuel Vadot  cirrus,boost-type:
82d5b0e70fSEmmanuel Vadot    description:
83d5b0e70fSEmmanuel Vadot      Configures the type of Boost being used.
84d5b0e70fSEmmanuel Vadot      Internal boost requires boost-peak-milliamp, boost-ind-nanohenry and
85d5b0e70fSEmmanuel Vadot      boost-cap-microfarad.
86d5b0e70fSEmmanuel Vadot      External Boost must have GPIO1 as GPIO output. GPIO1 will be set high to
87d5b0e70fSEmmanuel Vadot      enable boost voltage.
88d5b0e70fSEmmanuel Vadot      0 = Internal Boost
89d5b0e70fSEmmanuel Vadot      1 = External Boost
90*cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
91d5b0e70fSEmmanuel Vadot    minimum: 0
92d5b0e70fSEmmanuel Vadot    maximum: 1
93d5b0e70fSEmmanuel Vadot
948cc087a1SEmmanuel Vadot  cirrus,gpio1-polarity-invert:
958cc087a1SEmmanuel Vadot    description:
968cc087a1SEmmanuel Vadot      Boolean which specifies whether the GPIO1
978cc087a1SEmmanuel Vadot      level is inverted. If this property is not present the level is not inverted.
988cc087a1SEmmanuel Vadot    type: boolean
998cc087a1SEmmanuel Vadot
1008cc087a1SEmmanuel Vadot  cirrus,gpio1-output-enable:
1018cc087a1SEmmanuel Vadot    description:
1028cc087a1SEmmanuel Vadot      Boolean which specifies whether the GPIO1 pin
1038cc087a1SEmmanuel Vadot      is configured as an output. If this property is not present the
1048cc087a1SEmmanuel Vadot      pin will be configured as an input.
1058cc087a1SEmmanuel Vadot    type: boolean
1068cc087a1SEmmanuel Vadot
1078cc087a1SEmmanuel Vadot  cirrus,gpio1-src-select:
1088cc087a1SEmmanuel Vadot    description:
1098cc087a1SEmmanuel Vadot      Configures the function of the GPIO1 pin.
1108cc087a1SEmmanuel Vadot      Note that the options are different from the GPIO2 pin
1118cc087a1SEmmanuel Vadot      0 = High Impedance (Default)
1128cc087a1SEmmanuel Vadot      1 = GPIO
1138cc087a1SEmmanuel Vadot      2 = Sync
1148cc087a1SEmmanuel Vadot      3 = MCLK input
115*cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
1168cc087a1SEmmanuel Vadot    minimum: 0
1178cc087a1SEmmanuel Vadot    maximum: 3
1188cc087a1SEmmanuel Vadot
1198cc087a1SEmmanuel Vadot  cirrus,gpio2-polarity-invert:
1208cc087a1SEmmanuel Vadot    description:
1218cc087a1SEmmanuel Vadot      Boolean which specifies whether the GPIO2
1228cc087a1SEmmanuel Vadot      level is inverted. If this property is not present the level is not inverted.
1238cc087a1SEmmanuel Vadot    type: boolean
1248cc087a1SEmmanuel Vadot
1258cc087a1SEmmanuel Vadot  cirrus,gpio2-output-enable:
1268cc087a1SEmmanuel Vadot    description:
1278cc087a1SEmmanuel Vadot      Boolean which specifies whether the GPIO2 pin
1288cc087a1SEmmanuel Vadot      is configured as an output. If this property is not present the
1298cc087a1SEmmanuel Vadot      pin will be configured as an input.
1308cc087a1SEmmanuel Vadot    type: boolean
1318cc087a1SEmmanuel Vadot
1328cc087a1SEmmanuel Vadot  cirrus,gpio2-src-select:
1338cc087a1SEmmanuel Vadot    description:
1348cc087a1SEmmanuel Vadot      Configures the function of the GPIO2 pin.
1358cc087a1SEmmanuel Vadot      Note that the options are different from the GPIO1 pin.
1368cc087a1SEmmanuel Vadot      0 = High Impedance (Default)
1378cc087a1SEmmanuel Vadot      1 = GPIO
1388cc087a1SEmmanuel Vadot      2 = Open Drain INTB
1398cc087a1SEmmanuel Vadot      3 = MCLK input
1408cc087a1SEmmanuel Vadot      4 = Push-pull INTB (active low)
1418cc087a1SEmmanuel Vadot      5 = Push-pull INT (active high)
142*cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
1438cc087a1SEmmanuel Vadot    minimum: 0
1448cc087a1SEmmanuel Vadot    maximum: 5
1458cc087a1SEmmanuel Vadot
1468cc087a1SEmmanuel Vadotrequired:
1478cc087a1SEmmanuel Vadot  - compatible
1488cc087a1SEmmanuel Vadot  - reg
1498cc087a1SEmmanuel Vadot  - "#sound-dai-cells"
150d5b0e70fSEmmanuel Vadot
151d5b0e70fSEmmanuel VadotallOf:
1528bab661aSEmmanuel Vadot  - $ref: dai-common.yaml#
153d5b0e70fSEmmanuel Vadot  - if:
154d5b0e70fSEmmanuel Vadot      properties:
155d5b0e70fSEmmanuel Vadot        cirrus,boost-type:
156d5b0e70fSEmmanuel Vadot          const: 0
157d5b0e70fSEmmanuel Vadot    then:
158d5b0e70fSEmmanuel Vadot      required:
1598cc087a1SEmmanuel Vadot        - cirrus,boost-peak-milliamp
1608cc087a1SEmmanuel Vadot        - cirrus,boost-ind-nanohenry
1618cc087a1SEmmanuel Vadot        - cirrus,boost-cap-microfarad
162d5b0e70fSEmmanuel Vadot    else:
163d5b0e70fSEmmanuel Vadot      if:
164d5b0e70fSEmmanuel Vadot        properties:
165d5b0e70fSEmmanuel Vadot          cirrus,boost-type:
166d5b0e70fSEmmanuel Vadot            const: 1
167d5b0e70fSEmmanuel Vadot      then:
168d5b0e70fSEmmanuel Vadot        required:
169d5b0e70fSEmmanuel Vadot          - cirrus,gpio1-output-enable
170d5b0e70fSEmmanuel Vadot          - cirrus,gpio1-src-select
171d5b0e70fSEmmanuel Vadot        properties:
172d5b0e70fSEmmanuel Vadot          cirrus,boost-peak-milliamp: false
173d5b0e70fSEmmanuel Vadot          cirrus,boost-ind-nanohenry: false
174d5b0e70fSEmmanuel Vadot          cirrus,boost-cap-microfarad: false
175d5b0e70fSEmmanuel Vadot          cirrus,gpio1-src-select:
176d5b0e70fSEmmanuel Vadot            enum: [1]
1778cc087a1SEmmanuel Vadot
1788bab661aSEmmanuel VadotunevaluatedProperties: false
1798cc087a1SEmmanuel Vadot
1808cc087a1SEmmanuel Vadotexamples:
1818cc087a1SEmmanuel Vadot  - |
182*cb7aa33aSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
183*cb7aa33aSEmmanuel Vadot
1848cc087a1SEmmanuel Vadot    spi {
1858cc087a1SEmmanuel Vadot        #address-cells = <1>;
1868cc087a1SEmmanuel Vadot        #size-cells = <0>;
1878cc087a1SEmmanuel Vadot
188*cb7aa33aSEmmanuel Vadot        cs35l41: speaker-amp@2 {
1898cc087a1SEmmanuel Vadot            #sound-dai-cells = <1>;
1908cc087a1SEmmanuel Vadot            compatible = "cirrus,cs35l41";
1918cc087a1SEmmanuel Vadot            reg = <2>;
1928cc087a1SEmmanuel Vadot            VA-supply = <&dummy_vreg>;
1938cc087a1SEmmanuel Vadot            VP-supply = <&dummy_vreg>;
194*cb7aa33aSEmmanuel Vadot            reset-gpios = <&gpio 110 GPIO_ACTIVE_HIGH>;
195d5b0e70fSEmmanuel Vadot
196d5b0e70fSEmmanuel Vadot            cirrus,boost-type = <0>;
1978cc087a1SEmmanuel Vadot            cirrus,boost-peak-milliamp = <4500>;
1988cc087a1SEmmanuel Vadot            cirrus,boost-ind-nanohenry = <1000>;
1998cc087a1SEmmanuel Vadot            cirrus,boost-cap-microfarad = <15>;
2008cc087a1SEmmanuel Vadot        };
2018cc087a1SEmmanuel Vadot    };
202