xref: /freebsd/sys/contrib/device-tree/Bindings/sound/cs42l42.txt (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1CS42L42 audio CODEC
2
3Required properties:
4
5  - compatible : "cirrus,cs42l42"
6
7  - reg : the I2C address of the device for I2C.
8
9  - VP-supply, VCP-supply, VD_FILT-supply, VL-supply, VA-supply :
10  power supplies for the device, as covered in
11  Documentation/devicetree/bindings/regulator/regulator.txt.
12
13Optional properties:
14
15  - reset-gpios : a GPIO spec for the reset pin. If specified, it will be
16  deasserted before communication to the codec starts.
17
18  - interrupts : IRQ line info CS42L42.
19  (See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
20  for further information relating to interrupt properties)
21
22  - cirrus,ts-inv : Boolean property. Sets the behaviour of the jack plug
23  detect switch.
24
25  0 = (Default) Shorted to tip when unplugged, open when plugged.
26      This is "inverted tip sense (ITS)" in the datasheet.
27
28  1 = Open when unplugged, shorted to tip when plugged.
29      This is "normal tip sense (TS)" in the datasheet.
30
31  - cirrus,ts-dbnc-rise : Debounce the rising edge of TIP_SENSE_PLUG. With no
32  debounce, the tip sense pin might be noisy on a plug event.
33
34  0 - 0ms,
35  1 - 125ms,
36  2 - 250ms,
37  3 - 500ms,
38  4 - 750ms,
39  5 - (Default) 1s,
40  6 - 1.25s,
41  7 - 1.5s,
42
43  - cirrus,ts-dbnc-fall : Debounce the falling edge of TIP_SENSE_UNPLUG.
44  With no debounce, the tip sense pin might be noisy on an unplug event.
45
46  0 - 0ms,
47  1 - 125ms,
48  2 - 250ms,
49  3 - 500ms,
50  4 - 750ms,
51  5 - (Default) 1s,
52  6 - 1.25s,
53  7 - 1.5s,
54
55  - cirrus,btn-det-init-dbnce : This sets how long the driver sleeps after
56  enabling button detection interrupts. After auto-detection and before
57  servicing button interrupts, the HS bias needs time to settle. If you
58  don't wait, there is possibility for erroneous button interrupt.
59
60  0ms - 200ms,
61  Default = 100ms
62
63  - cirrus,btn-det-event-dbnce : This sets how long the driver delays after
64  receiving a button press interrupt. With level detect interrupts, you want
65  to wait a small amount of time to make sure the button press is making a
66  clean connection with the bias resistors.
67
68  0ms - 20ms,
69  Default = 10ms
70
71  - cirrus,bias-lvls : For a level-detect headset button scheme, each button
72  will bias the mic pin to a certain voltage. To determine which button was
73  pressed, the driver will compare this biased voltage to sequential,
74  decreasing voltages and will stop when a comparator is tripped,
75  indicating a comparator voltage < bias voltage. This value represents a
76  percentage of the internally generated HS bias voltage. For different
77  hardware setups, a designer might want to tweak this. This is an array of
78  descending values for the comparator voltage.
79
80  Array of 4 values
81  Each 0-63
82  < x1 x2 x3 x4 >
83  Default = < 15 8 4 1>
84
85  - cirrus,hs-bias-sense-disable: This is boolean property. If present the
86  HSBIAS sense is disabled. Configures HSBIAS output current sense through
87  the external 2.21-k resistor. HSBIAS_SENSE is hardware feature to reduce
88  the potential pop noise during the headset plug out slowly. But on some
89  platforms ESD voltage will affect it causing test to fail, especially
90  with CTIA headset type. For different hardware setups, a designer might
91  want to tweak default behavior.
92
93Example:
94
95cs42l42: cs42l42@48 {
96	compatible = "cirrus,cs42l42";
97	reg = <0x48>;
98	VA-supply = <&dummy_vreg>;
99	VP-supply = <&dummy_vreg>;
100	VCP-supply = <&dummy_vreg>;
101	VD_FILT-supply = <&dummy_vreg>;
102	VL-supply = <&dummy_vreg>;
103
104	reset-gpios = <&axi_gpio_0 1 0>;
105	interrupt-parent = <&gpio0>;
106	interrupts = <55 8>
107
108	cirrus,ts-inv = <0x00>;
109	cirrus,ts-dbnc-rise = <0x05>;
110	cirrus,ts-dbnc-fall = <0x00>;
111	cirrus,btn-det-init-dbnce = <100>;
112	cirrus,btn-det-event-dbnce = <10>;
113	cirrus,bias-lvls = <0x0F 0x08 0x04 0x01>;
114	cirrus,hs-bias-ramp-rate = <0x02>;
115};
116