xref: /freebsd/sys/contrib/device-tree/Bindings/soundwire/qcom,sdw.txt (revision 6be3386466ab79a84b48429ae66244f21526d3df)
1c66ec88fSEmmanuel VadotQualcomm SoundWire Controller Bindings
2c66ec88fSEmmanuel Vadot
3c66ec88fSEmmanuel Vadot
4c66ec88fSEmmanuel VadotThis binding describes the Qualcomm SoundWire Controller along with its
5c66ec88fSEmmanuel Vadotboard specific bus parameters.
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadot- compatible:
8c66ec88fSEmmanuel Vadot	Usage: required
9c66ec88fSEmmanuel Vadot	Value type: <stringlist>
10c66ec88fSEmmanuel Vadot	Definition: must be "qcom,soundwire-v<MAJOR>.<MINOR>.<STEP>",
11c66ec88fSEmmanuel Vadot		    Example:
12c66ec88fSEmmanuel Vadot			"qcom,soundwire-v1.3.0"
13c66ec88fSEmmanuel Vadot			"qcom,soundwire-v1.5.0"
14*6be33864SEmmanuel Vadot			"qcom,soundwire-v1.5.1"
15c66ec88fSEmmanuel Vadot			"qcom,soundwire-v1.6.0"
16c66ec88fSEmmanuel Vadot- reg:
17c66ec88fSEmmanuel Vadot	Usage: required
18c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
19c66ec88fSEmmanuel Vadot	Definition: the base address and size of SoundWire controller
20c66ec88fSEmmanuel Vadot		    address space.
21c66ec88fSEmmanuel Vadot
22c66ec88fSEmmanuel Vadot- interrupts:
23c66ec88fSEmmanuel Vadot	Usage: required
24c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
25c66ec88fSEmmanuel Vadot	Definition: should specify the SoundWire Controller IRQ
26c66ec88fSEmmanuel Vadot
27c66ec88fSEmmanuel Vadot- clock-names:
28c66ec88fSEmmanuel Vadot	Usage: required
29c66ec88fSEmmanuel Vadot	Value type: <stringlist>
30c66ec88fSEmmanuel Vadot	Definition: should be "iface" for SoundWire Controller interface clock
31c66ec88fSEmmanuel Vadot
32c66ec88fSEmmanuel Vadot- clocks:
33c66ec88fSEmmanuel Vadot	Usage: required
34c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
35c66ec88fSEmmanuel Vadot	Definition: should specify the SoundWire Controller interface clock
36c66ec88fSEmmanuel Vadot
37c66ec88fSEmmanuel Vadot- #sound-dai-cells:
38c66ec88fSEmmanuel Vadot	Usage: required
39c66ec88fSEmmanuel Vadot	Value type: <u32>
40c66ec88fSEmmanuel Vadot	Definition: must be 1 for digital audio interfaces on the controller.
41c66ec88fSEmmanuel Vadot
42c66ec88fSEmmanuel Vadot- qcom,dout-ports:
43c66ec88fSEmmanuel Vadot	Usage: required
44c66ec88fSEmmanuel Vadot	Value type: <u32>
45c66ec88fSEmmanuel Vadot	Definition: must be count of data out ports
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel Vadot- qcom,din-ports:
48c66ec88fSEmmanuel Vadot	Usage: required
49c66ec88fSEmmanuel Vadot	Value type: <u32>
50c66ec88fSEmmanuel Vadot	Definition: must be count of data in ports
51c66ec88fSEmmanuel Vadot
52c66ec88fSEmmanuel Vadot- qcom,ports-offset1:
53c66ec88fSEmmanuel Vadot	Usage: required
54c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
55c66ec88fSEmmanuel Vadot	Definition: should specify payload transport window offset1 of each
56c66ec88fSEmmanuel Vadot		    data port. Out ports followed by In ports.
57c66ec88fSEmmanuel Vadot		    More info in MIPI Alliance SoundWire 1.0 Specifications.
58c66ec88fSEmmanuel Vadot
59c66ec88fSEmmanuel Vadot- qcom,ports-offset2:
60c66ec88fSEmmanuel Vadot	Usage: required
61c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
62c66ec88fSEmmanuel Vadot	Definition: should specify payload transport window offset2 of each
63c66ec88fSEmmanuel Vadot		    data port. Out ports followed by In ports.
64c66ec88fSEmmanuel Vadot		    More info in MIPI Alliance SoundWire 1.0 Specifications.
65c66ec88fSEmmanuel Vadot
66c66ec88fSEmmanuel Vadot- qcom,ports-sinterval-low:
67c66ec88fSEmmanuel Vadot	Usage: required
68c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
69c66ec88fSEmmanuel Vadot	Definition: should be sample interval low of each data port.
70c66ec88fSEmmanuel Vadot		    Out ports followed by In ports. Used for Sample Interval
71c66ec88fSEmmanuel Vadot		    calculation.
72c66ec88fSEmmanuel Vadot		    More info in MIPI Alliance SoundWire 1.0 Specifications.
73c66ec88fSEmmanuel Vadot
74c66ec88fSEmmanuel Vadot- qcom,ports-word-length:
75c66ec88fSEmmanuel Vadot	Usage: optional
76c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
77c66ec88fSEmmanuel Vadot	Definition: should be size of payload channel sample.
78c66ec88fSEmmanuel Vadot		    More info in MIPI Alliance SoundWire 1.0 Specifications.
79c66ec88fSEmmanuel Vadot
80c66ec88fSEmmanuel Vadot- qcom,ports-block-pack-mode:
81c66ec88fSEmmanuel Vadot	Usage: optional
82c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
83c66ec88fSEmmanuel Vadot	Definition: should be 0 or 1 to indicate the block packing mode.
84c66ec88fSEmmanuel Vadot		    0 to indicate Blocks are per Channel
85c66ec88fSEmmanuel Vadot		    1 to indicate Blocks are per Port.
86c66ec88fSEmmanuel Vadot		    Out ports followed by In ports.
87c66ec88fSEmmanuel Vadot		    More info in MIPI Alliance SoundWire 1.0 Specifications.
88c66ec88fSEmmanuel Vadot
89c66ec88fSEmmanuel Vadot- qcom,ports-block-group-count:
90c66ec88fSEmmanuel Vadot	Usage: optional
91c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
92c66ec88fSEmmanuel Vadot	Definition: should be in range 1 to 4 to indicate how many sample
93c66ec88fSEmmanuel Vadot		    intervals are combined into a payload.
94c66ec88fSEmmanuel Vadot		    Out ports followed by In ports.
95c66ec88fSEmmanuel Vadot		    More info in MIPI Alliance SoundWire 1.0 Specifications.
96c66ec88fSEmmanuel Vadot
97c66ec88fSEmmanuel Vadot- qcom,ports-lane-control:
98c66ec88fSEmmanuel Vadot	Usage: optional
99c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
100c66ec88fSEmmanuel Vadot	Definition: should be in range 0 to 7 to identify which	data lane
101c66ec88fSEmmanuel Vadot		    the data port uses.
102c66ec88fSEmmanuel Vadot		    Out ports followed by In ports.
103c66ec88fSEmmanuel Vadot		    More info in MIPI Alliance SoundWire 1.0 Specifications.
104c66ec88fSEmmanuel Vadot
105c66ec88fSEmmanuel Vadot- qcom,ports-hstart:
106c66ec88fSEmmanuel Vadot	Usage: optional
107c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
108c66ec88fSEmmanuel Vadot	Definition: should be number identifying lowerst numbered coloum in
109c66ec88fSEmmanuel Vadot		    SoundWire Frame, i.e. left edge of the Transport sub-frame
110c66ec88fSEmmanuel Vadot		    for each port. Values between 0 and 15 are valid.
111c66ec88fSEmmanuel Vadot		    Out ports followed by In ports.
112c66ec88fSEmmanuel Vadot		    More info in MIPI Alliance SoundWire 1.0 Specifications.
113c66ec88fSEmmanuel Vadot
114c66ec88fSEmmanuel Vadot- qcom,ports-hstop:
115c66ec88fSEmmanuel Vadot	Usage: optional
116c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
117c66ec88fSEmmanuel Vadot	Definition: should be number identifying highest numbered coloum in
118c66ec88fSEmmanuel Vadot		    SoundWire Frame, i.e. the right edge of the Transport
119c66ec88fSEmmanuel Vadot		    sub-frame for each port. Values between 0 and 15 are valid.
120c66ec88fSEmmanuel Vadot		    Out ports followed by In ports.
121c66ec88fSEmmanuel Vadot		    More info in MIPI Alliance SoundWire 1.0 Specifications.
122c66ec88fSEmmanuel Vadot
123c66ec88fSEmmanuel Vadot- qcom,dports-type:
124c66ec88fSEmmanuel Vadot	Usage: optional
125c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
126c66ec88fSEmmanuel Vadot	Definition: should be one of the following types
127c66ec88fSEmmanuel Vadot		    0 for reduced port
128c66ec88fSEmmanuel Vadot		    1 for simple ports
129c66ec88fSEmmanuel Vadot		    2 for full port
130c66ec88fSEmmanuel Vadot		    Out ports followed by In ports.
131c66ec88fSEmmanuel Vadot		    More info in MIPI Alliance SoundWire 1.0 Specifications.
132c66ec88fSEmmanuel Vadot
133c66ec88fSEmmanuel VadotNote:
134c66ec88fSEmmanuel Vadot	More Information on detail of encoding of these fields can be
135c66ec88fSEmmanuel Vadotfound in MIPI Alliance SoundWire 1.0 Specifications.
136c66ec88fSEmmanuel Vadot
137c66ec88fSEmmanuel Vadot= SoundWire devices
138c66ec88fSEmmanuel VadotEach subnode of the bus represents SoundWire device attached to it.
139c66ec88fSEmmanuel VadotThe properties of these nodes are defined by the individual bindings.
140c66ec88fSEmmanuel Vadot
141c66ec88fSEmmanuel Vadot= EXAMPLE
142c66ec88fSEmmanuel VadotThe following example represents a SoundWire controller on DB845c board
143c66ec88fSEmmanuel Vadotwhich has controller integrated inside WCD934x codec on SDM845 SoC.
144c66ec88fSEmmanuel Vadot
145c66ec88fSEmmanuel Vadotsoundwire: soundwire@c85 {
146c66ec88fSEmmanuel Vadot	compatible = "qcom,soundwire-v1.3.0";
147c66ec88fSEmmanuel Vadot	reg = <0xc85 0x20>;
148c66ec88fSEmmanuel Vadot	interrupts = <20 IRQ_TYPE_EDGE_RISING>;
149c66ec88fSEmmanuel Vadot	clocks = <&wcc>;
150c66ec88fSEmmanuel Vadot	clock-names = "iface";
151c66ec88fSEmmanuel Vadot	#sound-dai-cells = <1>;
152c66ec88fSEmmanuel Vadot	qcom,dports-type = <0>;
153c66ec88fSEmmanuel Vadot	qcom,dout-ports	= <6>;
154c66ec88fSEmmanuel Vadot	qcom,din-ports	= <2>;
155c66ec88fSEmmanuel Vadot	qcom,ports-sinterval-low = /bits/ 8  <0x07 0x1F 0x3F 0x7 0x1F 0x3F 0x0F 0x0F>;
156c66ec88fSEmmanuel Vadot	qcom,ports-offset1 = /bits/ 8 <0x01 0x02 0x0C 0x6 0x12 0x0D 0x07 0x0A >;
157c66ec88fSEmmanuel Vadot	qcom,ports-offset2 = /bits/ 8 <0x00 0x00 0x1F 0x00 0x00 0x1F 0x00 0x00>;
158c66ec88fSEmmanuel Vadot
159c66ec88fSEmmanuel Vadot	/* Left Speaker */
160c66ec88fSEmmanuel Vadot	left{
161c66ec88fSEmmanuel Vadot		....
162c66ec88fSEmmanuel Vadot	};
163c66ec88fSEmmanuel Vadot
164c66ec88fSEmmanuel Vadot	/* Right Speaker */
165c66ec88fSEmmanuel Vadot	right{
166c66ec88fSEmmanuel Vadot		....
167c66ec88fSEmmanuel Vadot	};
168c66ec88fSEmmanuel Vadot};
169