xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/sound/da7218.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunDialog Semiconductor DA7218 Audio Codec bindings
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunDA7218 is an audio codec with HP detect feature.
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun======
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunRequired properties:
8*4882a593Smuzhiyun- compatible : Should be "dlg,da7217" or "dlg,da7218"
9*4882a593Smuzhiyun- reg: Specifies the I2C slave address
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun- VDD-supply: VDD power supply for the device
12*4882a593Smuzhiyun- VDDMIC-supply: VDDMIC power supply for the device
13*4882a593Smuzhiyun- VDDIO-supply: VDDIO power supply for the device
14*4882a593Smuzhiyun  (See Documentation/devicetree/bindings/regulator/regulator.txt for further
15*4882a593Smuzhiyun   information relating to regulators)
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunOptional properties:
18*4882a593Smuzhiyun- interrupts: IRQ line info for DA7218 chip.
19*4882a593Smuzhiyun  (See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for
20*4882a593Smuzhiyun   further information relating to interrupt properties)
21*4882a593Smuzhiyun- interrupt-names : Name associated with interrupt line. Should be "wakeup" if
22*4882a593Smuzhiyun  interrupt is to be used to wake system, otherwise "irq" should be used.
23*4882a593Smuzhiyun- wakeup-source: Flag to indicate this device can wake system (suspend/resume).
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun- clocks : phandle and clock specifier for codec MCLK.
26*4882a593Smuzhiyun- clock-names : Clock name string for 'clocks' attribute, should be "mclk".
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun- dlg,micbias1-lvl-millivolt : Voltage (mV) for Mic Bias 1
29*4882a593Smuzhiyun	[<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>, <3000>]
30*4882a593Smuzhiyun- dlg,micbias2-lvl-millivolt : Voltage (mV) for Mic Bias 2
31*4882a593Smuzhiyun	[<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>, <3000>]
32*4882a593Smuzhiyun- dlg,mic1-amp-in-sel : Mic1 input source type
33*4882a593Smuzhiyun	["diff", "se_p", "se_n"]
34*4882a593Smuzhiyun- dlg,mic2-amp-in-sel : Mic2 input source type
35*4882a593Smuzhiyun	["diff", "se_p", "se_n"]
36*4882a593Smuzhiyun- dlg,dmic1-data-sel : DMIC1 channel select based on clock edge.
37*4882a593Smuzhiyun	["lrise_rfall", "lfall_rrise"]
38*4882a593Smuzhiyun- dlg,dmic1-samplephase : When to sample audio from DMIC1.
39*4882a593Smuzhiyun	["on_clkedge", "between_clkedge"]
40*4882a593Smuzhiyun- dlg,dmic1-clkrate-hz : DMic1 clock frequency (Hz).
41*4882a593Smuzhiyun	[<1500000>, <3000000>]
42*4882a593Smuzhiyun- dlg,dmic2-data-sel : DMic2 channel select based on clock edge.
43*4882a593Smuzhiyun	["lrise_rfall", "lfall_rrise"]
44*4882a593Smuzhiyun- dlg,dmic2-samplephase : When to sample audio from DMic2.
45*4882a593Smuzhiyun	["on_clkedge", "between_clkedge"]
46*4882a593Smuzhiyun- dlg,dmic2-clkrate-hz : DMic2 clock frequency (Hz).
47*4882a593Smuzhiyun	[<1500000>, <3000000>]
48*4882a593Smuzhiyun- dlg,hp-diff-single-supply : Boolean flag, use single supply for HP
49*4882a593Smuzhiyun			      (DA7217 only)
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun======
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunOptional Child node - 'da7218_hpldet' (DA7218 only):
54*4882a593Smuzhiyun
55*4882a593SmuzhiyunOptional properties:
56*4882a593Smuzhiyun- dlg,jack-rate-us : Time between jack detect measurements (us)
57*4882a593Smuzhiyun	[<5>, <10>, <20>, <40>, <80>, <160>, <320>, <640>]
58*4882a593Smuzhiyun- dlg,jack-debounce : Number of debounce measurements taken for jack detect
59*4882a593Smuzhiyun	[<0>, <2>, <3>, <4>]
60*4882a593Smuzhiyun- dlg,jack-threshold-pct : Threshold level for jack detection (% of VDD)
61*4882a593Smuzhiyun	[<84>, <88>, <92>, <96>]
62*4882a593Smuzhiyun- dlg,comp-inv : Boolean flag, invert comparator output
63*4882a593Smuzhiyun- dlg,hyst : Boolean flag, enable hysteresis
64*4882a593Smuzhiyun- dlg,discharge : Boolean flag, auto discharge of Mic Bias on jack removal
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun======
67*4882a593Smuzhiyun
68*4882a593SmuzhiyunExample:
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun	codec: da7218@1a {
71*4882a593Smuzhiyun		compatible = "dlg,da7218";
72*4882a593Smuzhiyun		reg = <0x1a>;
73*4882a593Smuzhiyun		interrupt-parent = <&gpio6>;
74*4882a593Smuzhiyun		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
75*4882a593Smuzhiyun		wakeup-source;
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun		VDD-supply = <&reg_audio>;
78*4882a593Smuzhiyun		VDDMIC-supply = <&reg_audio>;
79*4882a593Smuzhiyun		VDDIO-supply = <&reg_audio>;
80*4882a593Smuzhiyun
81*4882a593Smuzhiyun		clocks = <&clks 201>;
82*4882a593Smuzhiyun		clock-names = "mclk";
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun		dlg,micbias1-lvl-millivolt = <2600>;
85*4882a593Smuzhiyun		dlg,micbias2-lvl-millivolt = <2600>;
86*4882a593Smuzhiyun		dlg,mic1-amp-in-sel = "diff";
87*4882a593Smuzhiyun		dlg,mic2-amp-in-sel = "diff";
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun		dlg,dmic1-data-sel = "lrise_rfall";
90*4882a593Smuzhiyun		dlg,dmic1-samplephase = "on_clkedge";
91*4882a593Smuzhiyun		dlg,dmic1-clkrate-hz = <3000000>;
92*4882a593Smuzhiyun		dlg,dmic2-data-sel = "lrise_rfall";
93*4882a593Smuzhiyun		dlg,dmic2-samplephase = "on_clkedge";
94*4882a593Smuzhiyun		dlg,dmic2-clkrate-hz = <3000000>;
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun		da7218_hpldet {
97*4882a593Smuzhiyun			dlg,jack-rate-us = <40>;
98*4882a593Smuzhiyun			dlg,jack-debounce = <2>;
99*4882a593Smuzhiyun			dlg,jack-threshold-pct = <84>;
100*4882a593Smuzhiyun			dlg,hyst;
101*4882a593Smuzhiyun		};
102*4882a593Smuzhiyun	};
103