xref: /freebsd/sys/contrib/device-tree/Bindings/sound/qcom,pm8916-wcd-analog-codec.yaml (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1*aa1a8ff2SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2*aa1a8ff2SEmmanuel Vadot%YAML 1.2
3*aa1a8ff2SEmmanuel Vadot---
4*aa1a8ff2SEmmanuel Vadot$id: http://devicetree.org/schemas/sound/qcom,pm8916-wcd-analog-codec.yaml#
5*aa1a8ff2SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*aa1a8ff2SEmmanuel Vadot
7*aa1a8ff2SEmmanuel Vadottitle: Qualcomm PM8916 WCD Analog Audio Codec
8*aa1a8ff2SEmmanuel Vadot
9*aa1a8ff2SEmmanuel Vadotmaintainers:
10*aa1a8ff2SEmmanuel Vadot  - Konrad Dybcio <konradybcio@kernel.org>
11*aa1a8ff2SEmmanuel Vadot
12*aa1a8ff2SEmmanuel Vadotdescription:
13*aa1a8ff2SEmmanuel Vadot  The analog WCD audio codec found on Qualcomm PM8916 PMIC.
14*aa1a8ff2SEmmanuel Vadot
15*aa1a8ff2SEmmanuel Vadotproperties:
16*aa1a8ff2SEmmanuel Vadot  compatible:
17*aa1a8ff2SEmmanuel Vadot    const: qcom,pm8916-wcd-analog-codec
18*aa1a8ff2SEmmanuel Vadot
19*aa1a8ff2SEmmanuel Vadot  reg:
20*aa1a8ff2SEmmanuel Vadot    maxItems: 1
21*aa1a8ff2SEmmanuel Vadot
22*aa1a8ff2SEmmanuel Vadot  interrupts:
23*aa1a8ff2SEmmanuel Vadot    maxItems: 14
24*aa1a8ff2SEmmanuel Vadot
25*aa1a8ff2SEmmanuel Vadot  interrupt-names:
26*aa1a8ff2SEmmanuel Vadot    items:
27*aa1a8ff2SEmmanuel Vadot      - const: cdc_spk_cnp_int
28*aa1a8ff2SEmmanuel Vadot      - const: cdc_spk_clip_int
29*aa1a8ff2SEmmanuel Vadot      - const: cdc_spk_ocp_int
30*aa1a8ff2SEmmanuel Vadot      - const: mbhc_ins_rem_det1
31*aa1a8ff2SEmmanuel Vadot      - const: mbhc_but_rel_det
32*aa1a8ff2SEmmanuel Vadot      - const: mbhc_but_press_det
33*aa1a8ff2SEmmanuel Vadot      - const: mbhc_ins_rem_det
34*aa1a8ff2SEmmanuel Vadot      - const: mbhc_switch_int
35*aa1a8ff2SEmmanuel Vadot      - const: cdc_ear_ocp_int
36*aa1a8ff2SEmmanuel Vadot      - const: cdc_hphr_ocp_int
37*aa1a8ff2SEmmanuel Vadot      - const: cdc_hphl_ocp_det
38*aa1a8ff2SEmmanuel Vadot      - const: cdc_ear_cnp_int
39*aa1a8ff2SEmmanuel Vadot      - const: cdc_hphr_cnp_int
40*aa1a8ff2SEmmanuel Vadot      - const: cdc_hphl_cnp_int
41*aa1a8ff2SEmmanuel Vadot
42*aa1a8ff2SEmmanuel Vadot  vdd-cdc-io-supply:
43*aa1a8ff2SEmmanuel Vadot    description: 1.8V buck supply
44*aa1a8ff2SEmmanuel Vadot
45*aa1a8ff2SEmmanuel Vadot  vdd-cdc-tx-rx-cx-supply:
46*aa1a8ff2SEmmanuel Vadot    description: 1.8V SIDO buck supply
47*aa1a8ff2SEmmanuel Vadot
48*aa1a8ff2SEmmanuel Vadot  vdd-micbias-supply:
49*aa1a8ff2SEmmanuel Vadot    description: micbias supply
50*aa1a8ff2SEmmanuel Vadot
51*aa1a8ff2SEmmanuel Vadot  qcom,mbhc-vthreshold-low:
52*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
53*aa1a8ff2SEmmanuel Vadot    description:
54*aa1a8ff2SEmmanuel Vadot      Array of 5 threshold voltages in mV for 5-button detection on
55*aa1a8ff2SEmmanuel Vadot      headset when MBHC is powered by an internal current source.
56*aa1a8ff2SEmmanuel Vadot    minItems: 5
57*aa1a8ff2SEmmanuel Vadot    maxItems: 5
58*aa1a8ff2SEmmanuel Vadot
59*aa1a8ff2SEmmanuel Vadot  qcom,mbhc-vthreshold-high:
60*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
61*aa1a8ff2SEmmanuel Vadot    description:
62*aa1a8ff2SEmmanuel Vadot      Array of 5 threshold voltages in mV for 5-button detection on
63*aa1a8ff2SEmmanuel Vadot      headset when MBHC is powered from micbias.
64*aa1a8ff2SEmmanuel Vadot    minItems: 5
65*aa1a8ff2SEmmanuel Vadot    maxItems: 5
66*aa1a8ff2SEmmanuel Vadot
67*aa1a8ff2SEmmanuel Vadot  qcom,micbias-lvl:
68*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
69*aa1a8ff2SEmmanuel Vadot    description:
70*aa1a8ff2SEmmanuel Vadot      Voltage (mV) for Mic Bias
71*aa1a8ff2SEmmanuel Vadot
72*aa1a8ff2SEmmanuel Vadot  qcom,hphl-jack-type-normally-open:
73*aa1a8ff2SEmmanuel Vadot    type: boolean
74*aa1a8ff2SEmmanuel Vadot    description:
75*aa1a8ff2SEmmanuel Vadot      True if the HPHL pin on the jack is NO (Normally Open), false if it's
76*aa1a8ff2SEmmanuel Vadot      NC (Normally Closed).
77*aa1a8ff2SEmmanuel Vadot
78*aa1a8ff2SEmmanuel Vadot  qcom,gnd-jack-type-normally-open:
79*aa1a8ff2SEmmanuel Vadot    type: boolean
80*aa1a8ff2SEmmanuel Vadot    description:
81*aa1a8ff2SEmmanuel Vadot      True if the GND pin on the jack is NO (Normally Open), false if it's
82*aa1a8ff2SEmmanuel Vadot      NC (Normally Closed).
83*aa1a8ff2SEmmanuel Vadot
84*aa1a8ff2SEmmanuel Vadot  qcom,micbias1-ext-cap:
85*aa1a8ff2SEmmanuel Vadot    type: boolean
86*aa1a8ff2SEmmanuel Vadot    description:
87*aa1a8ff2SEmmanuel Vadot      True if micbias1 has an external capacitor.
88*aa1a8ff2SEmmanuel Vadot
89*aa1a8ff2SEmmanuel Vadot  qcom,micbias2-ext-cap:
90*aa1a8ff2SEmmanuel Vadot    type: boolean
91*aa1a8ff2SEmmanuel Vadot    description:
92*aa1a8ff2SEmmanuel Vadot      True if micbias2 has an external capacitor.
93*aa1a8ff2SEmmanuel Vadot
94*aa1a8ff2SEmmanuel Vadot  "#sound-dai-cells":
95*aa1a8ff2SEmmanuel Vadot    const: 1
96*aa1a8ff2SEmmanuel Vadot
97*aa1a8ff2SEmmanuel Vadotrequired:
98*aa1a8ff2SEmmanuel Vadot  - compatible
99*aa1a8ff2SEmmanuel Vadot  - reg
100*aa1a8ff2SEmmanuel Vadot
101*aa1a8ff2SEmmanuel VadotadditionalProperties: false
102*aa1a8ff2SEmmanuel Vadot
103*aa1a8ff2SEmmanuel Vadotexamples:
104*aa1a8ff2SEmmanuel Vadot  - |
105*aa1a8ff2SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
106*aa1a8ff2SEmmanuel Vadot    #include <dt-bindings/spmi/spmi.h>
107*aa1a8ff2SEmmanuel Vadot
108*aa1a8ff2SEmmanuel Vadot    pmic@1 {
109*aa1a8ff2SEmmanuel Vadot      compatible = "qcom,pm8916", "qcom,spmi-pmic";
110*aa1a8ff2SEmmanuel Vadot      reg = <0x1 SPMI_USID>;
111*aa1a8ff2SEmmanuel Vadot      #address-cells = <1>;
112*aa1a8ff2SEmmanuel Vadot      #size-cells = <0>;
113*aa1a8ff2SEmmanuel Vadot
114*aa1a8ff2SEmmanuel Vadot      audio-codec@f000 {
115*aa1a8ff2SEmmanuel Vadot        compatible = "qcom,pm8916-wcd-analog-codec";
116*aa1a8ff2SEmmanuel Vadot        reg = <0xf000>;
117*aa1a8ff2SEmmanuel Vadot        qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
118*aa1a8ff2SEmmanuel Vadot        qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
119*aa1a8ff2SEmmanuel Vadot        interrupt-parent = <&spmi_bus>;
120*aa1a8ff2SEmmanuel Vadot        interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>,
121*aa1a8ff2SEmmanuel Vadot              <0x1 0xf0 0x1 IRQ_TYPE_NONE>,
122*aa1a8ff2SEmmanuel Vadot              <0x1 0xf0 0x2 IRQ_TYPE_NONE>,
123*aa1a8ff2SEmmanuel Vadot              <0x1 0xf0 0x3 IRQ_TYPE_NONE>,
124*aa1a8ff2SEmmanuel Vadot              <0x1 0xf0 0x4 IRQ_TYPE_NONE>,
125*aa1a8ff2SEmmanuel Vadot              <0x1 0xf0 0x5 IRQ_TYPE_NONE>,
126*aa1a8ff2SEmmanuel Vadot              <0x1 0xf0 0x6 IRQ_TYPE_NONE>,
127*aa1a8ff2SEmmanuel Vadot              <0x1 0xf0 0x7 IRQ_TYPE_NONE>,
128*aa1a8ff2SEmmanuel Vadot              <0x1 0xf1 0x0 IRQ_TYPE_NONE>,
129*aa1a8ff2SEmmanuel Vadot              <0x1 0xf1 0x1 IRQ_TYPE_NONE>,
130*aa1a8ff2SEmmanuel Vadot              <0x1 0xf1 0x2 IRQ_TYPE_NONE>,
131*aa1a8ff2SEmmanuel Vadot              <0x1 0xf1 0x3 IRQ_TYPE_NONE>,
132*aa1a8ff2SEmmanuel Vadot              <0x1 0xf1 0x4 IRQ_TYPE_NONE>,
133*aa1a8ff2SEmmanuel Vadot              <0x1 0xf1 0x5 IRQ_TYPE_NONE>;
134*aa1a8ff2SEmmanuel Vadot        interrupt-names = "cdc_spk_cnp_int",
135*aa1a8ff2SEmmanuel Vadot                          "cdc_spk_clip_int",
136*aa1a8ff2SEmmanuel Vadot                          "cdc_spk_ocp_int",
137*aa1a8ff2SEmmanuel Vadot                          "mbhc_ins_rem_det1",
138*aa1a8ff2SEmmanuel Vadot                          "mbhc_but_rel_det",
139*aa1a8ff2SEmmanuel Vadot                          "mbhc_but_press_det",
140*aa1a8ff2SEmmanuel Vadot                          "mbhc_ins_rem_det",
141*aa1a8ff2SEmmanuel Vadot                          "mbhc_switch_int",
142*aa1a8ff2SEmmanuel Vadot                          "cdc_ear_ocp_int",
143*aa1a8ff2SEmmanuel Vadot                          "cdc_hphr_ocp_int",
144*aa1a8ff2SEmmanuel Vadot                          "cdc_hphl_ocp_det",
145*aa1a8ff2SEmmanuel Vadot                          "cdc_ear_cnp_int",
146*aa1a8ff2SEmmanuel Vadot                          "cdc_hphr_cnp_int",
147*aa1a8ff2SEmmanuel Vadot                          "cdc_hphl_cnp_int";
148*aa1a8ff2SEmmanuel Vadot        vdd-cdc-io-supply = <&pm8916_l5>;
149*aa1a8ff2SEmmanuel Vadot        vdd-cdc-tx-rx-cx-supply = <&pm8916_l5>;
150*aa1a8ff2SEmmanuel Vadot        vdd-micbias-supply = <&pm8916_l13>;
151*aa1a8ff2SEmmanuel Vadot        #sound-dai-cells = <1>;
152*aa1a8ff2SEmmanuel Vadot      };
153*aa1a8ff2SEmmanuel Vadot    };
154