Skip to content

Commit 88d0d17

Browse files
laklimovbroonie
authored andcommitted
ASoC: dt-bindings: add bindings for pm4125 audio codec
The audio codec IC is found on Qualcomm PM4125/PM2250 PMIC. It has TX and RX soundwire slave devices hence two files are added. Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20250915-pm4125_audio_codec_v1-v4-1-b247b64eec52@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent b9cb410 commit 88d0d17

2 files changed

Lines changed: 213 additions & 0 deletions

File tree

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/sound/qcom,pm4125-codec.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm PM4125 Audio Codec
8+
9+
maintainers:
10+
- Alexey Klimov <alexey.klimov@linaro.org>
11+
12+
description:
13+
The audio codec IC found on Qualcomm PM4125/PM2250 PMIC.
14+
It has RX and TX Soundwire slave devices.
15+
16+
allOf:
17+
- $ref: dai-common.yaml#
18+
19+
properties:
20+
compatible:
21+
const: qcom,pm4125-codec
22+
23+
reg:
24+
description:
25+
Specifies the SPMI base address for the audio codec peripherals. The
26+
address space contains reset register needed to power-on the codec.
27+
maxItems: 1
28+
29+
reg-names:
30+
maxItems: 1
31+
32+
vdd-io-supply:
33+
description: A reference to the 1.8V I/O supply
34+
35+
vdd-cp-supply:
36+
description: A reference to the charge pump I/O supply
37+
38+
vdd-mic-bias-supply:
39+
description: A reference to the 3.3V mic bias supply
40+
41+
vdd-pa-vpos-supply:
42+
description: A reference to the PA VPOS supply
43+
44+
qcom,tx-device:
45+
$ref: /schemas/types.yaml#/definitions/phandle-array
46+
description: A reference to Soundwire tx device phandle
47+
48+
qcom,rx-device:
49+
$ref: /schemas/types.yaml#/definitions/phandle-array
50+
description: A reference to Soundwire rx device phandle
51+
52+
qcom,micbias1-microvolt:
53+
description: micbias1 voltage
54+
minimum: 1800000
55+
maximum: 2850000
56+
57+
qcom,micbias2-microvolt:
58+
description: micbias2 voltage
59+
minimum: 1800000
60+
maximum: 2850000
61+
62+
qcom,micbias3-microvolt:
63+
description: micbias3 voltage
64+
minimum: 1800000
65+
maximum: 2850000
66+
67+
qcom,mbhc-buttons-vthreshold-microvolt:
68+
description:
69+
Array of 8 Voltage threshold values corresponding to headset
70+
button0 - button7
71+
minItems: 8
72+
maxItems: 8
73+
74+
'#sound-dai-cells':
75+
const: 1
76+
77+
required:
78+
- compatible
79+
- reg
80+
- vdd-io-supply
81+
- vdd-cp-supply
82+
- vdd-mic-bias-supply
83+
- vdd-pa-vpos-supply
84+
- qcom,tx-device
85+
- qcom,rx-device
86+
- qcom,micbias1-microvolt
87+
- qcom,micbias2-microvolt
88+
- qcom,micbias3-microvolt
89+
- '#sound-dai-cells'
90+
91+
unevaluatedProperties: false
92+
93+
examples:
94+
- |
95+
#include <dt-bindings/spmi/spmi.h>
96+
97+
spmi {
98+
#address-cells = <2>;
99+
#size-cells = <0>;
100+
101+
pmic {
102+
#address-cells = <1>;
103+
#size-cells = <0>;
104+
105+
audio-codec@f000 {
106+
compatible = "qcom,pm4125-codec";
107+
reg = <0xf000>;
108+
vdd-io-supply = <&pm4125_l15>;
109+
vdd-cp-supply = <&pm4125_s4>;
110+
vdd-pa-vpos-supply = <&pm4125_s4>;
111+
vdd-mic-bias-supply = <&pm4125_l22>;
112+
qcom,micbias1-microvolt = <1800000>;
113+
qcom,micbias2-microvolt = <1800000>;
114+
qcom,micbias3-microvolt = <1800000>;
115+
qcom,rx-device = <&pm4125_rx>;
116+
qcom,tx-device = <&pm4125_tx>;
117+
#sound-dai-cells = <1>;
118+
};
119+
};
120+
};
121+
122+
/* ... */
123+
124+
soundwire@a610000 {
125+
reg = <0x0a610000 0x2000>;
126+
#address-cells = <2>;
127+
#size-cells = <0>;
128+
pm4125_rx: audio-codec@0,4 {
129+
compatible = "sdw20217010c00";
130+
reg = <0 4>;
131+
qcom,rx-port-mapping = <1 3>;
132+
};
133+
};
134+
...
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/sound/qcom,pm4125-sdw.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm SoundWire Slave devices on PM4125/PM2250 PMIC audio codec.
8+
9+
maintainers:
10+
- Alexey Klimov <alexey.klimov@linaro.org>
11+
12+
description:
13+
The audio codec IC found on Qualcomm PM4125/PM2250 PMICs.
14+
It has RX and TX Soundwire slave devices.
15+
16+
properties:
17+
compatible:
18+
const: sdw20217010c00
19+
20+
reg:
21+
maxItems: 1
22+
23+
qcom,tx-port-mapping:
24+
description: |
25+
Specifies static port mapping between device and host tx ports.
26+
In the order of the device port index which are adc1_port, adc23_port,
27+
dmic03_mbhc_port, dmic46_port.
28+
Supports maximum 2 tx soundwire ports.
29+
30+
PM4125 TX Port 1 (ADC1,2 & DMIC0 & MBHC) <=> SWR0 Port 1
31+
PM4125 TX Port 2 (ADC1 & DMIC0,1,2 & MBHC) <=> SWR0 Port 2
32+
33+
$ref: /schemas/types.yaml#/definitions/uint32-array
34+
minItems: 2
35+
maxItems: 2
36+
items:
37+
enum: [1, 2, 3, 4]
38+
39+
qcom,rx-port-mapping:
40+
description: |
41+
Specifies static port mapping between device and host rx ports.
42+
In the order of device port index which are hph_port, clsh_port,
43+
comp_port, lo_port, dsd port.
44+
Supports maximum 2 rx soundwire ports.
45+
46+
PM4125 RX Port 1 (HPH_L/R) <==> SWR1 Port 1 (HPH_L/R)
47+
PM4125 RX Port 2 (COMP_L/R) <==> SWR1 Port 3 (COMP_L/R)
48+
49+
$ref: /schemas/types.yaml#/definitions/uint32-array
50+
minItems: 2
51+
maxItems: 2
52+
items:
53+
enum: [1, 2, 3, 4, 5]
54+
55+
required:
56+
- compatible
57+
- reg
58+
59+
oneOf:
60+
- required:
61+
- qcom,tx-port-mapping
62+
- required:
63+
- qcom,rx-port-mapping
64+
65+
additionalProperties: false
66+
67+
examples:
68+
- |
69+
soundwire@a610000 {
70+
reg = <0x0a610000 0x2000>;
71+
#address-cells = <2>;
72+
#size-cells = <0>;
73+
pm4125_rx: codec@0,1 {
74+
compatible = "sdw20217010c00";
75+
reg = <0 1>;
76+
qcom,rx-port-mapping = <1 3>;
77+
};
78+
};
79+
...

0 commit comments

Comments
 (0)