summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/sound/nau8825.txt
blob: 2f5e973285a648a3a7ea1bedb5d5cc9c79311589 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Nuvoton NAU8825 audio codec

This device supports I2C only.

Required properties:
  - compatible : Must be "nuvoton,nau8825"

  - reg : the I2C address of the device. This is either 0x1a (CSB=0) or 0x1b (CSB=1).

Optional properties:
  - nuvoton,jkdet-enable: Enable jack detection via JKDET pin.
  - nuvoton,jkdet-pull-enable: Enable JKDET pin pull. If set - pin pull enabled,
      otherwise pin in high impedance state.
  - nuvoton,jkdet-pull-up: Pull-up JKDET pin. If set then JKDET pin is pull up, otherwise pull down.
  - nuvoton,jkdet-polarity: JKDET pin polarity. 0 - active high, 1 - active low.

  - nuvoton,vref-impedance: VREF Impedance selection
      0 - Open
      1 - 25 kOhm
      2 - 125 kOhm
      3 - 2.5 kOhm

  - nuvoton,micbias-voltage: Micbias voltage level.
      0 - VDDA
      1 - VDDA
      2 - VDDA * 1.1
      3 - VDDA * 1.2
      4 - VDDA * 1.3
      5 - VDDA * 1.4
      6 - VDDA * 1.53
      7 - VDDA * 1.53

  - nuvoton,sar-threshold-num: Number of buttons supported
  - nuvoton,sar-threshold: Impedance threshold for each button. Array that contains up to 8 buttons configuration. SAR value is calculated as
    SAR = 255 * MICBIAS / SAR_VOLTAGE * R / (2000 + R)
    where MICBIAS is configured by 'nuvoton,micbias-voltage', SAR_VOLTAGE is configured by 'nuvoton,sar-voltage', R - button impedance.
    Refer datasheet section 10.2 for more information about threshold calculation.

  - nuvoton,sar-hysteresis: Button impedance measurement hysteresis.

  - nuvoton,sar-voltage: Reference voltage for button impedance measurement.
      0 - VDDA
      1 - VDDA
      2 - VDDA * 1.1
      3 - VDDA * 1.2
      4 - VDDA * 1.3
      5 - VDDA * 1.4
      6 - VDDA * 1.53
      7 - VDDA * 1.53

  - nuvoton,sar-compare-time: SAR compare time
      0 - 500 ns
      1 - 1 us
      2 - 2 us
      3 - 4 us

  - nuvoton,sar-sampling-time: SAR sampling time
      0 - 2 us
      1 - 4 us
      2 - 8 us
      3 - 16 us

  - nuvoton,short-key-debounce: Button short key press debounce time.
      0 - 30 ms
      1 - 50 ms
      2 - 100 ms
      3 - 30 ms

  - nuvoton,jack-insert-debounce: number from 0 to 7 that sets debounce time to 2^(n+2) ms
  - nuvoton,jack-eject-debounce: number from 0 to 7 that sets debounce time to 2^(n+2) ms

  - nuvoton,crosstalk-bypass: make crosstalk function bypass if set.

  - clocks: list of phandle and clock specifier pairs according to common clock bindings for the
      clocks described in clock-names
  - clock-names: should include "mclk" for the MCLK master clock

Example:

  headset: nau8825@1a {
      compatible = "nuvoton,nau8825";
      reg = <0x1a>;
      interrupt-parent = <&gpio>;
      interrupts = <TEGRA_GPIO(E, 6) IRQ_TYPE_LEVEL_LOW>;
      nuvoton,jkdet-enable;
      nuvoton,jkdet-pull-enable;
      nuvoton,jkdet-pull-up;
      nuvoton,jkdet-polarity = <GPIO_ACTIVE_LOW>;
      nuvoton,vref-impedance = <2>;
      nuvoton,micbias-voltage = <6>;
      // Setup 4 buttons impedance according to Android specification
      nuvoton,sar-threshold-num = <4>;
      nuvoton,sar-threshold = <0xc 0x1e 0x38 0x60>;
      nuvoton,sar-hysteresis = <1>;
      nuvoton,sar-voltage = <0>;
      nuvoton,sar-compare-time = <0>;
      nuvoton,sar-sampling-time = <0>;
      nuvoton,short-key-debounce = <2>;
      nuvoton,jack-insert-debounce = <7>;
      nuvoton,jack-eject-debounce = <7>;
      nuvoton,crosstalk-bypass;

      clock-names = "mclk";
      clocks = <&tegra_car TEGRA210_CLK_CLK_OUT_2>;
  };