hc
2023-05-26 a23f51ed7a39e452c1037343a84d7db1ca2c5bd7
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
* Rockchip RK3308 Internal Codec
 
Required properties:
 
- compatible: "rockchip,rk3308-codec"
- reg: The physical base address of the controller and length of memory
  mapped region.
- rockchip,grf: The phandle of the syscon node for GRF register.
- clocks: A list of phandle + clock-specifer pairs, one for each entry in
  clock-names.
- clock-names: It should be "acodec".
- resets : Must contain an entry for each entry in reset-names.
- reset-names : Must include the following entries: "acodec-reset".
 
Optional properties:
- rockchip,enable-all-adcs: This is a boolean type property, that shows whether
  force enable all of ADCs. The following shows the relationship between grps
  and ADC:
  * grp 0 -- select ADC1 / ADC2
  * grp 1 -- select ADC3 / ADC4
  * grp 2 -- select ADC5 / ADC6
  * grp 3 -- select ADC7 / ADC8
  If the property is not used, the enabled ADC groups refer to needed channels
  via configure hw_params.
 
- rockchip,adc-grps-route: This is a variable length array, that shows the
  mapping route of ACODEC sdo to I2S sdi. By default, they are one-to-one
  mapping:
  * sdi_0 <-- sdo_0
  * sdi_1 <-- sdo_1
  * sdi_2 <-- sdo_2
  * sdi_3 <-- sdo_3
  If you would like to change the route mapping like this:
  * sdi_0 <-- sdo_3
  * sdi_1 <-- sdo_0
  * sdi_2 <-- sdo_2
  * sdi_3 <-- sdo_1
  You need to add the property on dts:
  - rockchip,adc-grps-route = <3 0 2 1>;
 
- rockchip,delay-loopback-handle-ms: This property points out that the delay for
  handling ADC after enable PAs during loopback.
- rockchip,delay-start-play-ms: This property points out the delay ms of start
  playback according to different amplifier performance.
- rockchip,en-always-grps: This property will keep the needed ADCs enabled
  always after enabling once.
- rockchip,loopback-grp: It points out the ADC group which is the loopback used.
- rockchip,no-deep-low-power: The codec will not enter deep low power mode
  during suspend.
- rockchip,no-hp-det: If there is no headphone on boards, we don't need to
  enable headphone detection.
- rockchip,micbias1: Using internal micbias1 supply which are from codec.
- rockchip,micbias2: Using internal micbias2 supply which are from codec.
- hp-ctl-gpios: The gpio of head phone controller.
- pa-drv-gpios: The gpio of poweramplifier controller
- rockchip,delay-pa-drv-ms: This property points out that the delay for
  power on amplifier
- spk-ctl-gpios: The gpio of speak controller.
 
Example for rk3308 internal codec:
 
acodec: acodec@ff560000 {
   compatible = "rockchip,rk3308-codec";
   reg = <0x0 0xff560000 0x0 0x10000>;
   rockchip,grf = <&grf>;
   clocks = <&cru PCLK_ACODEC>;
   clock-names = "acodec";
   resets = <&cru SRST_ACODEC_P>;
   reset-names = "acodec-reset";
   rockchip,loopback-grp = <0>;
   hp-ctl-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
   pa-drv-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>;
   spk-ctl-gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
   status = "okay";
};