Closed alikates closed 1 year ago
why not use:
&wcd_codec {
qcom,gnd-jack-type-normally-open;
qcom,hphl-jack-type-normally-open;
qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
qcom,micbias1-ext-cap;
vdd-cdc-io-supply = <&pm8953_l5>;
vdd-cdc-tx-rx-cx-supply = <&pm8953_s4>;
vdd-micbias-supply = <&pm8953_l13>;
status = "okay";
};
I tested it successfully in the past 6.2, enabling also jack-sensing and button detection. I'm retesting it on top of 6.3 right now
Yeah my snippet works enabling
input xiaomi-vince Headset Jack /dev/input/event4 working
dmesg:
[ 23.144131] qcom,pm8916-wcd-spmi-codec 200f000.spmi:pmic@1:codec@f000: PMIC REV: 0 CODEC Version: 4
[ 23.144624] qcom,pm8916-wcd-spmi-codec 200f000.spmi:pmic@1:codec@f000: ASoC: sink widget PDM_RX1 overwritten
[ 23.144789] qcom,pm8916-wcd-spmi-codec 200f000.spmi:pmic@1:codec@f000: ASoC: source widget PDM_RX1 overwritten
[ 23.144826] qcom,pm8916-wcd-spmi-codec 200f000.spmi:pmic@1:codec@f000: ASoC: source widget PDM_RX1 overwritten
[ 23.144845] qcom,pm8916-wcd-spmi-codec 200f000.spmi:pmic@1:codec@f000: ASoC: sink widget PDM_RX1 overwritten
[ 23.144865] qcom,pm8916-wcd-spmi-codec 200f000.spmi:pmic@1:codec@f000: ASoC: sink widget PDM_RX1 overwritten
[ 23.144887] qcom,pm8916-wcd-spmi-codec 200f000.spmi:pmic@1:codec@f000: ASoC: sink widget ADC1 overwritten
[ 23.144917] qcom,pm8916-wcd-spmi-codec 200f000.spmi:pmic@1:codec@f000: ASoC: sink widget ADC1 overwritten
[ 23.144946] qcom,pm8916-wcd-spmi-codec 200f000.spmi:pmic@1:codec@f000: ASoC: sink widget PDM_RX1 overwritten
[ 23.145339] qcom,pm8916-wcd-spmi-codec 200f000.spmi:pmic@1:codec@f000: ASoC: source widget PDM_RX3 overwritten
[ 23.145456] qcom,pm8916-wcd-spmi-codec 200f000.spmi:pmic@1:codec@f000: ASoC: source widget PDM_RX3 overwritten
[ 23.191429] input: xiaomi-vince Headset Jack as /devices/platform/soc@0/c051000.sound-card/sound/card0/input4
and removing a lot of annoying messages. values are taken from downstream and adapted to mainline documentation entries [Documentation/devicetree/bindings/sound/qcom,msm8916-wcd-analog.txt]
evtest
Input device name: "xiaomi-vince Headset Jack"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 114 (KEY_VOLUMEDOWN)
Event code 115 (KEY_VOLUMEUP)
Event code 164 (KEY_PLAYPAUSE)
Event code 260 (BTN_4)
Event code 582 (KEY_VOICECOMMAND)
Event type 5 (EV_SW)
Event code 2 (SW_HEADPHONE_INSERT) state 0
Event code 4 (SW_MICROPHONE_INSERT) state 0
Properties:
Testing ... (interrupt to exit)
Event: time 1682711729.987215, type 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), value 1
Event: time 1682711729.987215, type 5 (EV_SW), code 4 (SW_MICROPHONE_INSERT), value 1
Event: time 1682711729.987215, -------------- SYN_REPORT ------------
Event: time 1682711736.067520, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 1
Event: time 1682711741.425098, -------------- SYN_REPORT ------------
Event: time 1682711746.310584, type 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), value 0
Event: time 1682711746.310584, type 5 (EV_SW), code 4 (SW_MICROPHONE_INSERT), value 0
Currently the digital codec driver does not probe because it depends on wcd_codec, which was disabled on xiaomi devices.
This assumes all xiaomi devices have the same wiring for the audio