191 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,nau8824.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: NAU8824 audio CODEC8 9maintainers:10 - John Hsu <KCHSU0@nuvoton.com>11 12allOf:13 - $ref: dai-common.yaml#14 15properties:16 compatible:17 enum:18 - nuvoton,nau882419 20 reg:21 maxItems: 122 23 '#sound-dai-cells':24 const: 025 26 clocks:27 items:28 - description: The phandle of the master clock to the CODEC29 30 clock-names:31 items:32 - const: mclk33 34 interrupts:35 maxItems: 136 37 nuvoton,jkdet-polarity:38 $ref: /schemas/types.yaml#/definitions/uint3239 description:40 JKDET pin polarity.41 enum:42 - 0 # active high43 - 1 # active low44 default: 145 46 nuvoton,vref-impedance:47 $ref: /schemas/types.yaml#/definitions/uint3248 description:49 VREF Impedance selection.50 enum:51 - 0 # Open52 - 1 # 25 kOhm53 - 2 # 125 kOhm54 - 3 # 2.5 kOhm55 default: 256 57 nuvoton,micbias-voltage:58 $ref: /schemas/types.yaml#/definitions/uint3259 description:60 Micbias voltage level.61 enum:62 - 0 # VDDA63 - 1 # VDDA64 - 2 # VDDA * 1.165 - 3 # VDDA * 1.266 - 4 # VDDA * 1.367 - 5 # VDDA * 1.468 - 6 # VDDA * 1.5369 - 7 # VDDA * 1.5370 default: 671 72 nuvoton,sar-threshold-num:73 $ref: /schemas/types.yaml#/definitions/uint3274 description:75 Number of buttons supported.76 minimum: 177 maximum: 878 default: 479 80 nuvoton,sar-threshold:81 $ref: /schemas/types.yaml#/definitions/uint32-array82 description:83 Impedance threshold for each button. Array that contains up to 8 buttons84 configuration. SAR value is calculated as85 SAR = 255 * MICBIAS / SAR_VOLTAGE * R / (2000 + R) where MICBIAS is86 configured by 'nuvoton,micbias-voltage', SAR_VOLTAGE is configured by87 'nuvoton,sar-voltage', R - button impedance.88 Refer datasheet section 10.2 for more information about threshold89 calculation.90 minItems: 191 maxItems: 892 items:93 minimum: 094 maximum: 25595 96 nuvoton,sar-hysteresis:97 $ref: /schemas/types.yaml#/definitions/uint3298 description:99 Button impedance measurement hysteresis.100 default: 0101 102 nuvoton,sar-voltage:103 $ref: /schemas/types.yaml#/definitions/uint32104 description:105 Reference voltage for button impedance measurement.106 enum:107 - 0 # VDDA108 - 1 # VDDA109 - 2 # VDDA * 1.1110 - 3 # VDDA * 1.2111 - 4 # VDDA * 1.3112 - 5 # VDDA * 1.4113 - 6 # VDDA * 1.53114 - 7 # VDDA * 1.53115 default: 6116 117 nuvoton,sar-compare-time:118 $ref: /schemas/types.yaml#/definitions/uint32119 description:120 SAR compare time.121 enum:122 - 0 # 500ns123 - 1 # 1us124 - 2 # 2us125 - 3 # 4us126 default: 1127 128 nuvoton,sar-sampling-time:129 $ref: /schemas/types.yaml#/definitions/uint32130 description:131 SAR sampling time.132 enum:133 - 0 # 2us134 - 1 # 4us135 - 2 # 8us136 - 3 # 16us137 default: 1138 139 nuvoton,short-key-debounce:140 $ref: /schemas/types.yaml#/definitions/uint32141 description:142 Button short key press debounce time.143 enum:144 - 0 # 30 ms145 - 1 # 50 ms146 - 2 # 100 ms147 default: 0148 149 nuvoton,jack-eject-debounce:150 $ref: /schemas/types.yaml#/definitions/uint32151 description:152 Jack ejection debounce time.153 enum:154 - 0 # 0 ms155 - 1 # 1 ms156 - 2 # 10 ms157 default: 1158 159required:160 - compatible161 - reg162 163unevaluatedProperties: false164 165examples:166 - |167 #include <dt-bindings/gpio/gpio.h>168 #include <dt-bindings/interrupt-controller/irq.h>169 i2c {170 #address-cells = <1>;171 #size-cells = <0>;172 codec@1a {173 #sound-dai-cells = <0>;174 compatible = "nuvoton,nau8824";175 reg = <0x1a>;176 interrupt-parent = <&gpio>;177 interrupts = <38 IRQ_TYPE_LEVEL_LOW>;178 nuvoton,vref-impedance = <2>;179 nuvoton,micbias-voltage = <6>;180 nuvoton,sar-threshold-num = <4>;181 // Setup 4 buttons impedance according to Android specification182 nuvoton,sar-threshold = <0xc 0x1e 0x38 0x60>;183 nuvoton,sar-hysteresis = <0>;184 nuvoton,sar-voltage = <6>;185 nuvoton,sar-compare-time = <1>;186 nuvoton,sar-sampling-time = <1>;187 nuvoton,short-key-debounce = <0>;188 nuvoton,jack-eject-debounce = <1>;189 };190 };191