xref: /freebsd/sys/contrib/device-tree/Bindings/sound/nau8824.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel VadotNuvoton NAU8824 audio codec
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotThis device supports I2C only.
4*c66ec88fSEmmanuel Vadot
5*c66ec88fSEmmanuel VadotRequired properties:
6*c66ec88fSEmmanuel Vadot  - compatible : Must be "nuvoton,nau8824"
7*c66ec88fSEmmanuel Vadot
8*c66ec88fSEmmanuel Vadot  - reg : the I2C address of the device. This is either 0x1a (CSB=0) or 0x1b (CSB=1).
9*c66ec88fSEmmanuel Vadot
10*c66ec88fSEmmanuel VadotOptional properties:
11*c66ec88fSEmmanuel Vadot  - nuvoton,jkdet-polarity: JKDET pin polarity. 0 - active high, 1 - active low.
12*c66ec88fSEmmanuel Vadot
13*c66ec88fSEmmanuel Vadot  - nuvoton,vref-impedance: VREF Impedance selection
14*c66ec88fSEmmanuel Vadot      0 - Open
15*c66ec88fSEmmanuel Vadot      1 - 25 kOhm
16*c66ec88fSEmmanuel Vadot      2 - 125 kOhm
17*c66ec88fSEmmanuel Vadot      3 - 2.5 kOhm
18*c66ec88fSEmmanuel Vadot
19*c66ec88fSEmmanuel Vadot  - nuvoton,micbias-voltage: Micbias voltage level.
20*c66ec88fSEmmanuel Vadot      0 - VDDA
21*c66ec88fSEmmanuel Vadot      1 - VDDA
22*c66ec88fSEmmanuel Vadot      2 - VDDA * 1.1
23*c66ec88fSEmmanuel Vadot      3 - VDDA * 1.2
24*c66ec88fSEmmanuel Vadot      4 - VDDA * 1.3
25*c66ec88fSEmmanuel Vadot      5 - VDDA * 1.4
26*c66ec88fSEmmanuel Vadot      6 - VDDA * 1.53
27*c66ec88fSEmmanuel Vadot      7 - VDDA * 1.53
28*c66ec88fSEmmanuel Vadot
29*c66ec88fSEmmanuel Vadot  - nuvoton,sar-threshold-num: Number of buttons supported
30*c66ec88fSEmmanuel Vadot  - nuvoton,sar-threshold: Impedance threshold for each button. Array that contains up to 8 buttons configuration. SAR value is calculated as
31*c66ec88fSEmmanuel Vadot    SAR = 255 * MICBIAS / SAR_VOLTAGE * R / (2000 + R)
32*c66ec88fSEmmanuel Vadot    where MICBIAS is configured by 'nuvoton,micbias-voltage', SAR_VOLTAGE is configured by 'nuvoton,sar-voltage', R - button impedance.
33*c66ec88fSEmmanuel Vadot    Refer datasheet section 10.2 for more information about threshold calculation.
34*c66ec88fSEmmanuel Vadot
35*c66ec88fSEmmanuel Vadot  - nuvoton,sar-hysteresis: Button impedance measurement hysteresis.
36*c66ec88fSEmmanuel Vadot
37*c66ec88fSEmmanuel Vadot  - nuvoton,sar-voltage: Reference voltage for button impedance measurement.
38*c66ec88fSEmmanuel Vadot      0 - VDDA
39*c66ec88fSEmmanuel Vadot      1 - VDDA
40*c66ec88fSEmmanuel Vadot      2 - VDDA * 1.1
41*c66ec88fSEmmanuel Vadot      3 - VDDA * 1.2
42*c66ec88fSEmmanuel Vadot      4 - VDDA * 1.3
43*c66ec88fSEmmanuel Vadot      5 - VDDA * 1.4
44*c66ec88fSEmmanuel Vadot      6 - VDDA * 1.53
45*c66ec88fSEmmanuel Vadot      7 - VDDA * 1.53
46*c66ec88fSEmmanuel Vadot
47*c66ec88fSEmmanuel Vadot  - nuvoton,sar-compare-time: SAR compare time
48*c66ec88fSEmmanuel Vadot      0 - 500 ns
49*c66ec88fSEmmanuel Vadot      1 - 1 us
50*c66ec88fSEmmanuel Vadot      2 - 2 us
51*c66ec88fSEmmanuel Vadot      3 - 4 us
52*c66ec88fSEmmanuel Vadot
53*c66ec88fSEmmanuel Vadot  - nuvoton,sar-sampling-time: SAR sampling time
54*c66ec88fSEmmanuel Vadot      0 - 2 us
55*c66ec88fSEmmanuel Vadot      1 - 4 us
56*c66ec88fSEmmanuel Vadot      2 - 8 us
57*c66ec88fSEmmanuel Vadot      3 - 16 us
58*c66ec88fSEmmanuel Vadot
59*c66ec88fSEmmanuel Vadot  - nuvoton,short-key-debounce: Button short key press debounce time.
60*c66ec88fSEmmanuel Vadot      0 - 30 ms
61*c66ec88fSEmmanuel Vadot      1 - 50 ms
62*c66ec88fSEmmanuel Vadot      2 - 100 ms
63*c66ec88fSEmmanuel Vadot
64*c66ec88fSEmmanuel Vadot  - nuvoton,jack-eject-debounce: Jack ejection debounce time.
65*c66ec88fSEmmanuel Vadot      0 - 0 ms
66*c66ec88fSEmmanuel Vadot      1 - 1 ms
67*c66ec88fSEmmanuel Vadot      2 - 10 ms
68*c66ec88fSEmmanuel Vadot
69*c66ec88fSEmmanuel Vadot
70*c66ec88fSEmmanuel VadotExample:
71*c66ec88fSEmmanuel Vadot
72*c66ec88fSEmmanuel Vadot  headset: nau8824@1a {
73*c66ec88fSEmmanuel Vadot      compatible = "nuvoton,nau8824";
74*c66ec88fSEmmanuel Vadot      reg = <0x1a>;
75*c66ec88fSEmmanuel Vadot      interrupt-parent = <&gpio>;
76*c66ec88fSEmmanuel Vadot      interrupts = <TEGRA_GPIO(E, 6) IRQ_TYPE_LEVEL_LOW>;
77*c66ec88fSEmmanuel Vadot      nuvoton,vref-impedance = <2>;
78*c66ec88fSEmmanuel Vadot      nuvoton,micbias-voltage = <6>;
79*c66ec88fSEmmanuel Vadot      // Setup 4 buttons impedance according to Android specification
80*c66ec88fSEmmanuel Vadot      nuvoton,sar-threshold-num = <4>;
81*c66ec88fSEmmanuel Vadot      nuvoton,sar-threshold = <0xc 0x1e 0x38 0x60>;
82*c66ec88fSEmmanuel Vadot      nuvoton,sar-hysteresis = <0>;
83*c66ec88fSEmmanuel Vadot      nuvoton,sar-voltage = <6>;
84*c66ec88fSEmmanuel Vadot      nuvoton,sar-compare-time = <1>;
85*c66ec88fSEmmanuel Vadot      nuvoton,sar-sampling-time = <1>;
86*c66ec88fSEmmanuel Vadot      nuvoton,short-key-debounce = <0>;
87*c66ec88fSEmmanuel Vadot      nuvoton,jack-eject-debounce = <1>;
88*c66ec88fSEmmanuel Vadot  };
89