xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/sound/rockchip,rk3308-codec.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1* Rockchip RK3308 Internal Codec
2
3Required properties:
4
5- compatible: "rockchip,rk3308-codec"
6- reg: The physical base address of the controller and length of memory
7  mapped region.
8- rockchip,grf: The phandle of the syscon node for GRF register.
9- clocks: A list of phandle + clock-specifer pairs, one for each entry in
10  clock-names.
11- clock-names: It should be "acodec".
12- resets : Must contain an entry for each entry in reset-names.
13- reset-names : Must include the following entries: "acodec-reset".
14
15Optional properties:
16- rockchip,enable-all-adcs: This is a boolean type property, that shows whether
17  force enable all of ADCs. The following shows the relationship between grps
18  and ADC:
19  * grp 0 -- select ADC1 / ADC2
20  * grp 1 -- select ADC3 / ADC4
21  * grp 2 -- select ADC5 / ADC6
22  * grp 3 -- select ADC7 / ADC8
23  If the property is not used, the enabled ADC groups refer to needed channels
24  via configure hw_params.
25
26- rockchip,adc-grps-route: This is a variable length array, that shows the
27  mapping route of ACODEC sdo to I2S sdi. By default, they are one-to-one
28  mapping:
29  * sdi_0 <-- sdo_0
30  * sdi_1 <-- sdo_1
31  * sdi_2 <-- sdo_2
32  * sdi_3 <-- sdo_3
33  If you would like to change the route mapping like this:
34  * sdi_0 <-- sdo_3
35  * sdi_1 <-- sdo_0
36  * sdi_2 <-- sdo_2
37  * sdi_3 <-- sdo_1
38  You need to add the property on dts:
39  - rockchip,adc-grps-route = <3 0 2 1>;
40
41- rockchip,delay-loopback-handle-ms: This property points out that the delay for
42  handling ADC after enable PAs during loopback.
43- rockchip,delay-start-play-ms: This property points out the delay ms of start
44  playback according to different amplifier performance.
45- rockchip,en-always-grps: This property will keep the needed ADCs enabled
46  always after enabling once.
47- rockchip,loopback-grp: It points out the ADC group which is the loopback used.
48- rockchip,no-deep-low-power: The codec will not enter deep low power mode
49  during suspend.
50- rockchip,no-hp-det: If there is no headphone on boards, we don't need to
51  enable headphone detection.
52- rockchip,micbias1: Using internal micbias1 supply which are from codec.
53- rockchip,micbias2: Using internal micbias2 supply which are from codec.
54- hp-ctl-gpios: The gpio of head phone controller.
55- pa-drv-gpios: The gpio of poweramplifier controller
56- rockchip,delay-pa-drv-ms: This property points out that the delay for
57  power on amplifier
58- spk-ctl-gpios: The gpio of speak controller.
59
60Example for rk3308 internal codec:
61
62acodec: acodec@ff560000 {
63	compatible = "rockchip,rk3308-codec";
64	reg = <0x0 0xff560000 0x0 0x10000>;
65	rockchip,grf = <&grf>;
66	clocks = <&cru PCLK_ACODEC>;
67	clock-names = "acodec";
68	resets = <&cru SRST_ACODEC_P>;
69	reset-names = "acodec-reset";
70	rockchip,loopback-grp = <0>;
71	hp-ctl-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
72	pa-drv-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>;
73	spk-ctl-gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
74	status = "okay";
75};
76