summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/sound/sun4i-codec.txt
blob: 66579bbd329455ddc5b18a89ecd17bd2dd805856 (plain)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
* Allwinner A10 Codec

Required properties:
- compatible: must be one of the following compatibles:
		- "allwinner,sun4i-a10-codec"
		- "allwinner,sun6i-a31-codec"
		- "allwinner,sun7i-a20-codec"
		- "allwinner,sun8i-a23-codec"
		- "allwinner,sun8i-h3-codec"
		- "allwinner,sun8i-v3s-codec"
- reg: must contain the registers location and length
- interrupts: must contain the codec interrupt
- dmas: DMA channels for tx and rx dma. See the DMA client binding,
	Documentation/devicetree/bindings/dma/dma.txt
- dma-names: should include "tx" and "rx".
- clocks: a list of phandle + clock-specifer pairs, one for each entry
  in clock-names.
- clock-names: should contain the following:
   - "apb": the parent APB clock for this controller
   - "codec": the parent module clock

Optional properties:
- allwinner,pa-gpios: gpio to enable external amplifier

Required properties for the following compatibles:
		- "allwinner,sun6i-a31-codec"
		- "allwinner,sun8i-a23-codec"
		- "allwinner,sun8i-h3-codec"
		- "allwinner,sun8i-v3s-codec"
- resets: phandle to the reset control for this device
- allwinner,audio-routing: A list of the connections between audio components.
			   Each entry is a pair of strings, the first being the
			   connection's sink, the second being the connection's
			   source. Valid names include:

			   Audio pins on the SoC:
			   "HP"
			   "HPCOM"
			   "LINEIN"	(not on sun8i-v3s)
			   "LINEOUT"	(not on sun8i-a23 or sun8i-v3s)
			   "MIC1"
			   "MIC2"	(not on sun8i-v3s)
			   "MIC3"	(sun6i-a31 only)

			   Microphone biases from the SoC:
			   "HBIAS"
			   "MBIAS"	(not on sun8i-v3s)

			   Board connectors:
			   "Headphone"
			   "Headset Mic"
			   "Line In"
			   "Line Out"
			   "Mic"
			   "Speaker"

Required properties for the following compatibles:
		- "allwinner,sun8i-a23-codec"
		- "allwinner,sun8i-h3-codec"
		- "allwinner,sun8i-v3s-codec"
- allwinner,codec-analog-controls: A phandle to the codec analog controls
				   block in the PRCM.

Example:
codec: codec@1c22c00 {
	#sound-dai-cells = <0>;
	compatible = "allwinner,sun7i-a20-codec";
	reg = <0x01c22c00 0x40>;
	interrupts = <0 30 4>;
	clocks = <&apb0_gates 0>, <&codec_clk>;
	clock-names = "apb", "codec";
	dmas = <&dma 0 19>, <&dma 0 19>;
	dma-names = "rx", "tx";
};

codec: codec@1c22c00 {
	#sound-dai-cells = <0>;
	compatible = "allwinner,sun6i-a31-codec";
	reg = <0x01c22c00 0x98>;
	interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
	clocks = <&ccu CLK_APB1_CODEC>, <&ccu CLK_CODEC>;
	clock-names = "apb", "codec";
	resets = <&ccu RST_APB1_CODEC>;
	dmas = <&dma 15>, <&dma 15>;
	dma-names = "rx", "tx";
	allwinner,audio-routing =
		"Headphone", "HP",
		"Speaker", "LINEOUT",
		"LINEIN", "Line In",
		"MIC1",	"MBIAS",
		"MIC1", "Mic",
		"MIC2", "HBIAS",
		"MIC2", "Headset Mic";
};