Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: dt-bindings: nau8824: Convert to dtschema

Convert the NAU8824 audio CODEC bindings to DT schema.

Signed-off-by: David Lin <CTLIN0@nuvoton.com
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230515065557.614125-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org

authored by

David Lin and committed by
Mark Brown
518a1742 20ef7f21

+182 -88
-88
Documentation/devicetree/bindings/sound/nau8824.txt
··· 1 - Nuvoton NAU8824 audio codec 2 - 3 - This device supports I2C only. 4 - 5 - Required properties: 6 - - compatible : Must be "nuvoton,nau8824" 7 - 8 - - reg : the I2C address of the device. This is either 0x1a (CSB=0) or 0x1b (CSB=1). 9 - 10 - Optional properties: 11 - - nuvoton,jkdet-polarity: JKDET pin polarity. 0 - active high, 1 - active low. 12 - 13 - - nuvoton,vref-impedance: VREF Impedance selection 14 - 0 - Open 15 - 1 - 25 kOhm 16 - 2 - 125 kOhm 17 - 3 - 2.5 kOhm 18 - 19 - - nuvoton,micbias-voltage: Micbias voltage level. 20 - 0 - VDDA 21 - 1 - VDDA 22 - 2 - VDDA * 1.1 23 - 3 - VDDA * 1.2 24 - 4 - VDDA * 1.3 25 - 5 - VDDA * 1.4 26 - 6 - VDDA * 1.53 27 - 7 - VDDA * 1.53 28 - 29 - - nuvoton,sar-threshold-num: Number of buttons supported 30 - - nuvoton,sar-threshold: Impedance threshold for each button. Array that contains up to 8 buttons configuration. SAR value is calculated as 31 - SAR = 255 * MICBIAS / SAR_VOLTAGE * R / (2000 + R) 32 - where MICBIAS is configured by 'nuvoton,micbias-voltage', SAR_VOLTAGE is configured by 'nuvoton,sar-voltage', R - button impedance. 33 - Refer datasheet section 10.2 for more information about threshold calculation. 34 - 35 - - nuvoton,sar-hysteresis: Button impedance measurement hysteresis. 36 - 37 - - nuvoton,sar-voltage: Reference voltage for button impedance measurement. 38 - 0 - VDDA 39 - 1 - VDDA 40 - 2 - VDDA * 1.1 41 - 3 - VDDA * 1.2 42 - 4 - VDDA * 1.3 43 - 5 - VDDA * 1.4 44 - 6 - VDDA * 1.53 45 - 7 - VDDA * 1.53 46 - 47 - - nuvoton,sar-compare-time: SAR compare time 48 - 0 - 500 ns 49 - 1 - 1 us 50 - 2 - 2 us 51 - 3 - 4 us 52 - 53 - - nuvoton,sar-sampling-time: SAR sampling time 54 - 0 - 2 us 55 - 1 - 4 us 56 - 2 - 8 us 57 - 3 - 16 us 58 - 59 - - nuvoton,short-key-debounce: Button short key press debounce time. 60 - 0 - 30 ms 61 - 1 - 50 ms 62 - 2 - 100 ms 63 - 64 - - nuvoton,jack-eject-debounce: Jack ejection debounce time. 65 - 0 - 0 ms 66 - 1 - 1 ms 67 - 2 - 10 ms 68 - 69 - 70 - Example: 71 - 72 - headset: nau8824@1a { 73 - compatible = "nuvoton,nau8824"; 74 - reg = <0x1a>; 75 - interrupt-parent = <&gpio>; 76 - interrupts = <TEGRA_GPIO(E, 6) IRQ_TYPE_LEVEL_LOW>; 77 - nuvoton,vref-impedance = <2>; 78 - nuvoton,micbias-voltage = <6>; 79 - // Setup 4 buttons impedance according to Android specification 80 - nuvoton,sar-threshold-num = <4>; 81 - nuvoton,sar-threshold = <0xc 0x1e 0x38 0x60>; 82 - nuvoton,sar-hysteresis = <0>; 83 - nuvoton,sar-voltage = <6>; 84 - nuvoton,sar-compare-time = <1>; 85 - nuvoton,sar-sampling-time = <1>; 86 - nuvoton,short-key-debounce = <0>; 87 - nuvoton,jack-eject-debounce = <1>; 88 - };
+182
Documentation/devicetree/bindings/sound/nuvoton,nau8824.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/sound/nuvoton,nau8824.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NAU8824 audio CODEC 8 + 9 + maintainers: 10 + - John Hsu <KCHSU0@nuvoton.com> 11 + 12 + allOf: 13 + - $ref: dai-common.yaml# 14 + 15 + properties: 16 + compatible: 17 + enum: 18 + - nuvoton,nau8824 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + '#sound-dai-cells': 24 + const: 0 25 + 26 + interrupts: 27 + maxItems: 1 28 + 29 + nuvoton,jkdet-polarity: 30 + $ref: /schemas/types.yaml#/definitions/uint32 31 + description: 32 + JKDET pin polarity. 33 + enum: 34 + - 0 # active high 35 + - 1 # active low 36 + default: 1 37 + 38 + nuvoton,vref-impedance: 39 + $ref: /schemas/types.yaml#/definitions/uint32 40 + description: 41 + VREF Impedance selection. 42 + enum: 43 + - 0 # Open 44 + - 1 # 25 kOhm 45 + - 2 # 125 kOhm 46 + - 3 # 2.5 kOhm 47 + default: 2 48 + 49 + nuvoton,micbias-voltage: 50 + $ref: /schemas/types.yaml#/definitions/uint32 51 + description: 52 + Micbias voltage level. 53 + enum: 54 + - 0 # VDDA 55 + - 1 # VDDA 56 + - 2 # VDDA * 1.1 57 + - 3 # VDDA * 1.2 58 + - 4 # VDDA * 1.3 59 + - 5 # VDDA * 1.4 60 + - 6 # VDDA * 1.53 61 + - 7 # VDDA * 1.53 62 + default: 6 63 + 64 + nuvoton,sar-threshold-num: 65 + $ref: /schemas/types.yaml#/definitions/uint32 66 + description: 67 + Number of buttons supported. 68 + minimum: 1 69 + maximum: 8 70 + default: 4 71 + 72 + nuvoton,sar-threshold: 73 + $ref: /schemas/types.yaml#/definitions/uint32-array 74 + description: 75 + Impedance threshold for each button. Array that contains up to 8 buttons 76 + configuration. SAR value is calculated as 77 + SAR = 255 * MICBIAS / SAR_VOLTAGE * R / (2000 + R) where MICBIAS is 78 + configured by 'nuvoton,micbias-voltage', SAR_VOLTAGE is configured by 79 + 'nuvoton,sar-voltage', R - button impedance. 80 + Refer datasheet section 10.2 for more information about threshold 81 + calculation. 82 + minItems: 1 83 + maxItems: 8 84 + items: 85 + minimum: 0 86 + maximum: 255 87 + 88 + nuvoton,sar-hysteresis: 89 + $ref: /schemas/types.yaml#/definitions/uint32 90 + description: 91 + Button impedance measurement hysteresis. 92 + default: 0 93 + 94 + nuvoton,sar-voltage: 95 + $ref: /schemas/types.yaml#/definitions/uint32 96 + description: 97 + Reference voltage for button impedance measurement. 98 + enum: 99 + - 0 # VDDA 100 + - 1 # VDDA 101 + - 2 # VDDA * 1.1 102 + - 3 # VDDA * 1.2 103 + - 4 # VDDA * 1.3 104 + - 5 # VDDA * 1.4 105 + - 6 # VDDA * 1.53 106 + - 7 # VDDA * 1.53 107 + default: 6 108 + 109 + nuvoton,sar-compare-time: 110 + $ref: /schemas/types.yaml#/definitions/uint32 111 + description: 112 + SAR compare time. 113 + enum: 114 + - 0 # 500ns 115 + - 1 # 1us 116 + - 2 # 2us 117 + - 3 # 4us 118 + default: 1 119 + 120 + nuvoton,sar-sampling-time: 121 + $ref: /schemas/types.yaml#/definitions/uint32 122 + description: 123 + SAR sampling time. 124 + enum: 125 + - 0 # 2us 126 + - 1 # 4us 127 + - 2 # 8us 128 + - 3 # 16us 129 + default: 1 130 + 131 + nuvoton,short-key-debounce: 132 + $ref: /schemas/types.yaml#/definitions/uint32 133 + description: 134 + Button short key press debounce time. 135 + enum: 136 + - 0 # 30 ms 137 + - 1 # 50 ms 138 + - 2 # 100 ms 139 + default: 0 140 + 141 + nuvoton,jack-eject-debounce: 142 + $ref: /schemas/types.yaml#/definitions/uint32 143 + description: 144 + Jack ejection debounce time. 145 + enum: 146 + - 0 # 0 ms 147 + - 1 # 1 ms 148 + - 2 # 10 ms 149 + default: 1 150 + 151 + required: 152 + - compatible 153 + - reg 154 + 155 + unevaluatedProperties: false 156 + 157 + examples: 158 + - | 159 + #include <dt-bindings/gpio/gpio.h> 160 + #include <dt-bindings/interrupt-controller/irq.h> 161 + i2c { 162 + #address-cells = <1>; 163 + #size-cells = <0>; 164 + codec@1a { 165 + #sound-dai-cells = <0>; 166 + compatible = "nuvoton,nau8824"; 167 + reg = <0x1a>; 168 + interrupt-parent = <&gpio>; 169 + interrupts = <38 IRQ_TYPE_LEVEL_LOW>; 170 + nuvoton,vref-impedance = <2>; 171 + nuvoton,micbias-voltage = <6>; 172 + nuvoton,sar-threshold-num = <4>; 173 + // Setup 4 buttons impedance according to Android specification 174 + nuvoton,sar-threshold = <0xc 0x1e 0x38 0x60>; 175 + nuvoton,sar-hysteresis = <0>; 176 + nuvoton,sar-voltage = <6>; 177 + nuvoton,sar-compare-time = <1>; 178 + nuvoton,sar-sampling-time = <1>; 179 + nuvoton,short-key-debounce = <0>; 180 + nuvoton,jack-eject-debounce = <1>; 181 + }; 182 + };