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