xref: /linux/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
16116df7fSDavid Rhodes# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
26116df7fSDavid Rhodes%YAML 1.2
36116df7fSDavid Rhodes---
46116df7fSDavid Rhodes$id: http://devicetree.org/schemas/sound/cirrus,cs35l41.yaml#
56116df7fSDavid Rhodes$schema: http://devicetree.org/meta-schemas/core.yaml#
66116df7fSDavid Rhodes
76116df7fSDavid Rhodestitle: Cirrus Logic CS35L41 Speaker Amplifier
86116df7fSDavid Rhodes
96116df7fSDavid Rhodesmaintainers:
106116df7fSDavid Rhodes  - david.rhodes@cirrus.com
116116df7fSDavid Rhodes
126116df7fSDavid Rhodesdescription: |
136116df7fSDavid Rhodes  CS35L41 is a boosted mono Class D amplifier with DSP
146116df7fSDavid Rhodes  speaker protection and equalization
156116df7fSDavid Rhodes
166116df7fSDavid Rhodesproperties:
176116df7fSDavid Rhodes  compatible:
186116df7fSDavid Rhodes    enum:
196116df7fSDavid Rhodes      - cirrus,cs35l40
206116df7fSDavid Rhodes      - cirrus,cs35l41
216116df7fSDavid Rhodes
226116df7fSDavid Rhodes  reg:
236116df7fSDavid Rhodes    maxItems: 1
246116df7fSDavid Rhodes
25642e4f9bSKrzysztof Kozlowski  interrupts:
26642e4f9bSKrzysztof Kozlowski    maxItems: 1
27642e4f9bSKrzysztof Kozlowski
286116df7fSDavid Rhodes  '#sound-dai-cells':
296116df7fSDavid Rhodes    description:
306116df7fSDavid Rhodes      The first cell indicating the audio interface.
316116df7fSDavid Rhodes    const: 1
326116df7fSDavid Rhodes
336116df7fSDavid Rhodes  reset-gpios:
346116df7fSDavid Rhodes    maxItems: 1
356116df7fSDavid Rhodes
366116df7fSDavid Rhodes  VA-supply:
376116df7fSDavid Rhodes    description: voltage regulator phandle for the VA supply
386116df7fSDavid Rhodes
396116df7fSDavid Rhodes  VP-supply:
406116df7fSDavid Rhodes    description: voltage regulator phandle for the VP supply
416116df7fSDavid Rhodes
426116df7fSDavid Rhodes  cirrus,boost-peak-milliamp:
436116df7fSDavid Rhodes    description:
446116df7fSDavid Rhodes      Boost-converter peak current limit in mA.
456116df7fSDavid Rhodes      Configures the peak current by monitoring the current through the boost FET.
466116df7fSDavid Rhodes      Range starts at 1600 mA and goes to a maximum of 4500 mA with increments
476116df7fSDavid Rhodes      of 50 mA. See section 4.3.6 of the datasheet for details.
48c1b9c2f0SKrzysztof Kozlowski    $ref: /schemas/types.yaml#/definitions/uint32
496116df7fSDavid Rhodes    minimum: 1600
506116df7fSDavid Rhodes    maximum: 4500
516116df7fSDavid Rhodes    default: 4500
526116df7fSDavid Rhodes
536116df7fSDavid Rhodes  cirrus,boost-ind-nanohenry:
546116df7fSDavid Rhodes    description:
556116df7fSDavid Rhodes      Boost inductor value, expressed in nH. Valid
566116df7fSDavid Rhodes      values include 1000, 1200, 1500 and 2200.
57c1b9c2f0SKrzysztof Kozlowski    $ref: /schemas/types.yaml#/definitions/uint32
586116df7fSDavid Rhodes    minimum: 1000
596116df7fSDavid Rhodes    maximum: 2200
606116df7fSDavid Rhodes
616116df7fSDavid Rhodes  cirrus,boost-cap-microfarad:
626116df7fSDavid Rhodes    description:
636116df7fSDavid Rhodes      Total equivalent boost capacitance on the VBST
646116df7fSDavid Rhodes      and VAMP pins, derated at 11 volts DC. The value must be rounded to the
656116df7fSDavid Rhodes      nearest integer and expressed in uF.
66c1b9c2f0SKrzysztof Kozlowski    $ref: /schemas/types.yaml#/definitions/uint32
676116df7fSDavid Rhodes
686116df7fSDavid Rhodes  cirrus,asp-sdout-hiz:
696116df7fSDavid Rhodes    description:
706116df7fSDavid Rhodes      Audio serial port SDOUT Hi-Z control. Sets the Hi-Z
716116df7fSDavid Rhodes      configuration for SDOUT pin of amplifier.
726116df7fSDavid Rhodes      0 = Logic 0 during unused slots, and while all transmit channels disabled
736116df7fSDavid Rhodes      1 = Hi-Z during unused slots but logic 0 while all transmit channels disabled
746116df7fSDavid Rhodes      2 = (Default) Logic 0 during unused slots, but Hi-Z while all transmit channels disabled
756116df7fSDavid Rhodes      3 = Hi-Z during unused slots and while all transmit channels disabled
76c1b9c2f0SKrzysztof Kozlowski    $ref: /schemas/types.yaml#/definitions/uint32
776116df7fSDavid Rhodes    minimum: 0
786116df7fSDavid Rhodes    maximum: 3
796116df7fSDavid Rhodes    default: 2
806116df7fSDavid Rhodes
814b047ec3SDavid Rhodes  cirrus,boost-type:
824b047ec3SDavid Rhodes    description:
834b047ec3SDavid Rhodes      Configures the type of Boost being used.
844b047ec3SDavid Rhodes      Internal boost requires boost-peak-milliamp, boost-ind-nanohenry and
854b047ec3SDavid Rhodes      boost-cap-microfarad.
864b047ec3SDavid Rhodes      External Boost must have GPIO1 as GPIO output. GPIO1 will be set high to
874b047ec3SDavid Rhodes      enable boost voltage.
88*340307d7SLucas Tanure      Shared boost allows two amplifiers to share a single boost circuit by
89*340307d7SLucas Tanure      communicating on the MDSYNC bus. The active amplifier controls the boost
90*340307d7SLucas Tanure      circuit using combined data from both amplifiers. GPIO1 should be
91*340307d7SLucas Tanure      configured for Sync when shared boost is used. Shared boost is not
92*340307d7SLucas Tanure      compatible with External boost. Active amplifier requires
93*340307d7SLucas Tanure      boost-peak-milliamp, boost-ind-nanohenry and boost-cap-microfarad.
944b047ec3SDavid Rhodes      0 = Internal Boost
954b047ec3SDavid Rhodes      1 = External Boost
96*340307d7SLucas Tanure      2 = Shared Boost Active
97*340307d7SLucas Tanure      3 = Shared Boost Passive
98c1b9c2f0SKrzysztof Kozlowski    $ref: /schemas/types.yaml#/definitions/uint32
994b047ec3SDavid Rhodes    minimum: 0
100*340307d7SLucas Tanure    maximum: 3
1014b047ec3SDavid Rhodes
1026116df7fSDavid Rhodes  cirrus,gpio1-polarity-invert:
1036116df7fSDavid Rhodes    description:
1046116df7fSDavid Rhodes      Boolean which specifies whether the GPIO1
1056116df7fSDavid Rhodes      level is inverted. If this property is not present the level is not inverted.
1066116df7fSDavid Rhodes    type: boolean
1076116df7fSDavid Rhodes
1086116df7fSDavid Rhodes  cirrus,gpio1-output-enable:
1096116df7fSDavid Rhodes    description:
1106116df7fSDavid Rhodes      Boolean which specifies whether the GPIO1 pin
1116116df7fSDavid Rhodes      is configured as an output. If this property is not present the
1126116df7fSDavid Rhodes      pin will be configured as an input.
1136116df7fSDavid Rhodes    type: boolean
1146116df7fSDavid Rhodes
1156116df7fSDavid Rhodes  cirrus,gpio1-src-select:
1166116df7fSDavid Rhodes    description:
1176116df7fSDavid Rhodes      Configures the function of the GPIO1 pin.
1186116df7fSDavid Rhodes      Note that the options are different from the GPIO2 pin
1196116df7fSDavid Rhodes      0 = High Impedance (Default)
1206116df7fSDavid Rhodes      1 = GPIO
1216116df7fSDavid Rhodes      2 = Sync
1226116df7fSDavid Rhodes      3 = MCLK input
123c1b9c2f0SKrzysztof Kozlowski    $ref: /schemas/types.yaml#/definitions/uint32
1246116df7fSDavid Rhodes    minimum: 0
1256116df7fSDavid Rhodes    maximum: 3
1266116df7fSDavid Rhodes
1276116df7fSDavid Rhodes  cirrus,gpio2-polarity-invert:
1286116df7fSDavid Rhodes    description:
1296116df7fSDavid Rhodes      Boolean which specifies whether the GPIO2
1306116df7fSDavid Rhodes      level is inverted. If this property is not present the level is not inverted.
1316116df7fSDavid Rhodes    type: boolean
1326116df7fSDavid Rhodes
1336116df7fSDavid Rhodes  cirrus,gpio2-output-enable:
1346116df7fSDavid Rhodes    description:
1356116df7fSDavid Rhodes      Boolean which specifies whether the GPIO2 pin
1366116df7fSDavid Rhodes      is configured as an output. If this property is not present the
1376116df7fSDavid Rhodes      pin will be configured as an input.
1386116df7fSDavid Rhodes    type: boolean
1396116df7fSDavid Rhodes
1406116df7fSDavid Rhodes  cirrus,gpio2-src-select:
1416116df7fSDavid Rhodes    description:
1426116df7fSDavid Rhodes      Configures the function of the GPIO2 pin.
1436116df7fSDavid Rhodes      Note that the options are different from the GPIO1 pin.
1446116df7fSDavid Rhodes      0 = High Impedance (Default)
1456116df7fSDavid Rhodes      1 = GPIO
1466116df7fSDavid Rhodes      2 = Open Drain INTB
1476116df7fSDavid Rhodes      3 = MCLK input
1486116df7fSDavid Rhodes      4 = Push-pull INTB (active low)
1496116df7fSDavid Rhodes      5 = Push-pull INT (active high)
150c1b9c2f0SKrzysztof Kozlowski    $ref: /schemas/types.yaml#/definitions/uint32
1516116df7fSDavid Rhodes    minimum: 0
1526116df7fSDavid Rhodes    maximum: 5
1536116df7fSDavid Rhodes
1546116df7fSDavid Rhodesrequired:
1556116df7fSDavid Rhodes  - compatible
1566116df7fSDavid Rhodes  - reg
1576116df7fSDavid Rhodes  - "#sound-dai-cells"
1584b047ec3SDavid Rhodes
1594b047ec3SDavid RhodesallOf:
16058ae9a2aSKrzysztof Kozlowski  - $ref: dai-common.yaml#
1614b047ec3SDavid Rhodes  - if:
1624b047ec3SDavid Rhodes      properties:
1634b047ec3SDavid Rhodes        cirrus,boost-type:
1644b047ec3SDavid Rhodes          const: 0
1654b047ec3SDavid Rhodes    then:
1664b047ec3SDavid Rhodes      required:
1676116df7fSDavid Rhodes        - cirrus,boost-peak-milliamp
1686116df7fSDavid Rhodes        - cirrus,boost-ind-nanohenry
1696116df7fSDavid Rhodes        - cirrus,boost-cap-microfarad
1704b047ec3SDavid Rhodes    else:
1714b047ec3SDavid Rhodes      if:
1724b047ec3SDavid Rhodes        properties:
1734b047ec3SDavid Rhodes          cirrus,boost-type:
1744b047ec3SDavid Rhodes            const: 1
1754b047ec3SDavid Rhodes      then:
1764b047ec3SDavid Rhodes        required:
1774b047ec3SDavid Rhodes          - cirrus,gpio1-output-enable
1784b047ec3SDavid Rhodes          - cirrus,gpio1-src-select
1794b047ec3SDavid Rhodes        properties:
1804b047ec3SDavid Rhodes          cirrus,boost-peak-milliamp: false
1814b047ec3SDavid Rhodes          cirrus,boost-ind-nanohenry: false
1824b047ec3SDavid Rhodes          cirrus,boost-cap-microfarad: false
1834b047ec3SDavid Rhodes          cirrus,gpio1-src-select:
1844b047ec3SDavid Rhodes            enum: [1]
1856116df7fSDavid Rhodes
18658ae9a2aSKrzysztof KozlowskiunevaluatedProperties: false
1876116df7fSDavid Rhodes
1886116df7fSDavid Rhodesexamples:
1896116df7fSDavid Rhodes  - |
190c1b9c2f0SKrzysztof Kozlowski    #include <dt-bindings/gpio/gpio.h>
191c1b9c2f0SKrzysztof Kozlowski
1926116df7fSDavid Rhodes    spi {
1936116df7fSDavid Rhodes        #address-cells = <1>;
1946116df7fSDavid Rhodes        #size-cells = <0>;
1956116df7fSDavid Rhodes
196c1b9c2f0SKrzysztof Kozlowski        cs35l41: speaker-amp@2 {
1976116df7fSDavid Rhodes            #sound-dai-cells = <1>;
1986116df7fSDavid Rhodes            compatible = "cirrus,cs35l41";
1996116df7fSDavid Rhodes            reg = <2>;
2006116df7fSDavid Rhodes            VA-supply = <&dummy_vreg>;
2016116df7fSDavid Rhodes            VP-supply = <&dummy_vreg>;
202c1b9c2f0SKrzysztof Kozlowski            reset-gpios = <&gpio 110 GPIO_ACTIVE_HIGH>;
2034b047ec3SDavid Rhodes
2044b047ec3SDavid Rhodes            cirrus,boost-type = <0>;
2056116df7fSDavid Rhodes            cirrus,boost-peak-milliamp = <4500>;
2066116df7fSDavid Rhodes            cirrus,boost-ind-nanohenry = <1000>;
2076116df7fSDavid Rhodes            cirrus,boost-cap-microfarad = <15>;
2086116df7fSDavid Rhodes        };
2096116df7fSDavid Rhodes    };
210