brintos

brintos / linux-shallow public Read only

0
0
Text · 5.7 KiB · a54f194 Raw
240 lines · yaml
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause2%YAML 1.23---4$id: http://devicetree.org/schemas/sound/nuvoton,nau8825.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: NAU8825 audio CODEC8 9maintainers:10  - John Hsu <KCHSU0@nuvoton.com>11 12allOf:13  - $ref: dai-common.yaml#14 15properties:16  compatible:17    enum:18      - nuvoton,nau882519 20  reg:21    maxItems: 122 23  interrupts:24    maxItems: 125 26  nuvoton,jkdet-enable:27    description:28      Enable jack detection via JKDET pin.29    type: boolean30 31  nuvoton,jkdet-pull-enable:32    description:33      Enable JKDET pin pull.34      If set - pin pull enabled, otherwise pin in high impedance state.35    type: boolean36 37  nuvoton,jkdet-pull-up:38    description:39      Pull-up JKDET pin.40      If set then JKDET pin is pull up, otherwise pull down.41    type: boolean42 43  nuvoton,jkdet-polarity:44    $ref: /schemas/types.yaml#/definitions/uint3245    description:46      JKDET pin polarity.47    enum:48      - 0 # active high49      - 1 # active low50    default: 151 52  nuvoton,vref-impedance:53    $ref: /schemas/types.yaml#/definitions/uint3254    description:55      VREF Impedance selection.56    enum:57      - 0 # Open58      - 1 # 25 kOhm59      - 2 # 125 kOhm60      - 3 # 2.5 kOhm61    default: 262 63  nuvoton,micbias-voltage:64    $ref: /schemas/types.yaml#/definitions/uint3265    description:66      Micbias voltage level.67    enum:68      - 0 # VDDA69      - 1 # VDDA70      - 2 # VDDA * 1.171      - 3 # VDDA * 1.272      - 4 # VDDA * 1.373      - 5 # VDDA * 1.474      - 6 # VDDA * 1.5375      - 7 # VDDA * 1.5376    default: 677 78  nuvoton,sar-threshold-num:79    $ref: /schemas/types.yaml#/definitions/uint3280    description:81      Number of buttons supported.82    minimum: 183    maximum: 484    default: 485 86  nuvoton,sar-threshold:87    $ref: /schemas/types.yaml#/definitions/uint32-array88    description:89      Impedance threshold for each button. Array that contains up to 8 buttons90      configuration. SAR value is calculated as91      SAR = 255 * MICBIAS / SAR_VOLTAGE * R / (2000 + R) where MICBIAS is92      configured by 'nuvoton,micbias-voltage', SAR_VOLTAGE is configured by93      'nuvoton,sar-voltage', R - button impedance.94      Refer datasheet section 10.2 for more information about threshold95      calculation.96    minItems: 197    maxItems: 498    items:99      minimum: 0100      maximum: 255101 102  nuvoton,sar-hysteresis:103    $ref: /schemas/types.yaml#/definitions/uint32104    description:105      Button impedance measurement hysteresis.106    default: 0107 108  nuvoton,sar-voltage:109    $ref: /schemas/types.yaml#/definitions/uint32110    description:111      Reference voltage for button impedance measurement.112    enum:113      - 0 # VDDA114      - 1 # VDDA115      - 2 # VDDA * 1.1116      - 3 # VDDA * 1.2117      - 4 # VDDA * 1.3118      - 5 # VDDA * 1.4119      - 6 # VDDA * 1.53120      - 7 # VDDA * 1.53121    default: 6122 123  nuvoton,sar-compare-time:124    $ref: /schemas/types.yaml#/definitions/uint32125    description:126      SAR compare time.127    enum:128      - 0 # 500 ns129      - 1 # 1 us130      - 2 # 2 us131      - 3 # 4 us132    default: 1133 134  nuvoton,sar-sampling-time:135    $ref: /schemas/types.yaml#/definitions/uint32136    description:137      SAR sampling time.138    enum:139      - 0 # 2 us140      - 1 # 4 us141      - 2 # 8 us142      - 3 # 16 us143    default: 1144 145  nuvoton,short-key-debounce:146    $ref: /schemas/types.yaml#/definitions/uint32147    description:148      Button short key press debounce time.149    enum:150      - 0 # 30 ms151      - 1 # 50 ms152      - 2 # 100 ms153      - 3 # 30 ms154    default: 3155 156  nuvoton,jack-insert-debounce:157    $ref: /schemas/types.yaml#/definitions/uint32158    description:159      number from 0 to 7 that sets debounce time to 2^(n+2) ms.160    maximum: 7161    default: 7162 163  nuvoton,jack-eject-debounce:164    $ref: /schemas/types.yaml#/definitions/uint32165    description:166      number from 0 to 7 that sets debounce time to 2^(n+2) ms167    maximum: 7168    default: 0169 170  nuvoton,crosstalk-enable:171    description:172      make crosstalk function enable if set.173    type: boolean174 175  nuvoton,adcout-drive-strong:176    description:177      make the drive strength of ADCOUT IO PIN strong if set.178      Otherwise, the drive keeps normal strength.179    type: boolean180 181  nuvoton,adc-delay-ms:182    description:183      Delay (in ms) to make input path stable and avoid pop noise.184      The default value is 125 and range between 125 to 500 ms.185    minimum: 125186    maximum: 500187    default: 125188 189  clocks:190    maxItems: 1191 192  clock-names:193    items:194      - const: mclk195 196  '#sound-dai-cells':197    const: 0198 199required:200  - compatible201  - reg202 203unevaluatedProperties: false204 205examples:206  - |207    #include <dt-bindings/gpio/gpio.h>208    #include <dt-bindings/interrupt-controller/irq.h>209    i2c {210        #address-cells = <1>;211        #size-cells = <0>;212        codec@1a {213            #sound-dai-cells = <0>;214            compatible = "nuvoton,nau8825";215            reg = <0x1a>;216            interrupt-parent = <&gpio>;217            interrupts = <38 IRQ_TYPE_LEVEL_LOW>;218            nuvoton,jkdet-enable;219            nuvoton,jkdet-pull-enable;220            nuvoton,jkdet-pull-up;221            nuvoton,jkdet-polarity = <GPIO_ACTIVE_LOW>;222            nuvoton,vref-impedance = <2>;223            nuvoton,micbias-voltage = <6>;224            // Setup 4 buttons impedance according to Android specification225            nuvoton,sar-threshold-num = <4>;226            nuvoton,sar-threshold = <0xc 0x1e 0x38 0x60>;227            nuvoton,sar-hysteresis = <1>;228            nuvoton,sar-voltage = <0>;229            nuvoton,sar-compare-time = <0>;230            nuvoton,sar-sampling-time = <0>;231            nuvoton,short-key-debounce = <2>;232            nuvoton,jack-insert-debounce = <7>;233            nuvoton,jack-eject-debounce = <7>;234            nuvoton,crosstalk-enable;235 236            clock-names = "mclk";237            clocks = <&tegra_pmc 1>;238        };239    };240