diff --git a/.gitignore b/.gitignore index 3a7241c941f5e6..9fde78db89dcdb 100644 --- a/.gitignore +++ b/.gitignore @@ -184,3 +184,8 @@ sphinx_*/ # Rust analyzer configuration /rust-project.json +output.txt +xargs +out +arch/arm64/configs/config-postmarketos-qcom-msm89x7 +arch/arm64/configs/example_defconfig diff --git a/arch/arm64/boot/dts/qcom/msm8937.dtsi b/arch/arm64/boot/dts/qcom/msm8937.dtsi index 1f353287b15b07..fe1b772ae38306 100644 --- a/arch/arm64/boot/dts/qcom/msm8937.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8937.dtsi @@ -2381,6 +2381,11 @@ qcom,sd-lines = <0 1>; }; + dai@17 { + reg = ; + qcom,sd-lines = <0 1>; + }; + dai@20 { reg = ; qcom,sd-lines = <0 1>; diff --git a/arch/arm64/boot/dts/qcom/pm8953.dtsi b/arch/arm64/boot/dts/qcom/pm8953.dtsi index 64258505f9babb..1946d93f896874 100644 --- a/arch/arm64/boot/dts/qcom/pm8953.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8953.dtsi @@ -124,5 +124,47 @@ reg = <1 SPMI_USID>; #address-cells = <1>; #size-cells = <0>; + + wcd_codec: codec@f000 { + compatible = "qcom,pm8916-wcd-analog-codec"; + reg = <0xf000 0x200>; + reg-names = "pmic-codec-core"; + clocks = <&q6afecc LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE + LPASS_CLK_ATTRIBUTE_COUPLE_NO>; + clock-names = "mclk"; + interrupt-parent = <&spmi_bus>; + interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>, + <0x1 0xf0 0x1 IRQ_TYPE_NONE>, + <0x1 0xf0 0x2 IRQ_TYPE_NONE>, + <0x1 0xf0 0x3 IRQ_TYPE_NONE>, + <0x1 0xf0 0x4 IRQ_TYPE_NONE>, + <0x1 0xf0 0x5 IRQ_TYPE_NONE>, + <0x1 0xf0 0x6 IRQ_TYPE_NONE>, + <0x1 0xf0 0x7 IRQ_TYPE_NONE>, + <0x1 0xf1 0x0 IRQ_TYPE_NONE>, + <0x1 0xf1 0x1 IRQ_TYPE_NONE>, + <0x1 0xf1 0x2 IRQ_TYPE_NONE>, + <0x1 0xf1 0x3 IRQ_TYPE_NONE>, + <0x1 0xf1 0x4 IRQ_TYPE_NONE>, + <0x1 0xf1 0x5 IRQ_TYPE_NONE>; + interrupt-names = "cdc_spk_cnp_int", + "cdc_spk_clip_int", + "cdc_spk_ocp_int", + "mbhc_ins_rem_det1", + "mbhc_but_rel_det", + "mbhc_but_press_det", + "mbhc_ins_rem_det", + "mbhc_switch_int", + "cdc_ear_ocp_int", + "cdc_hphr_ocp_int", + "cdc_hphl_ocp_det", + "cdc_ear_cnp_int", + "cdc_hphr_cnp_int", + "cdc_hphl_cnp_int"; + + #sound-dai-cells = <1>; + + status = "disabled"; + }; }; }; diff --git a/arch/arm64/boot/dts/qcom/sdm429-lenovo-tbx505x.dts b/arch/arm64/boot/dts/qcom/sdm429-lenovo-tbx505x.dts index 36d7e1a168597f..23d267e3251d5b 100644 --- a/arch/arm64/boot/dts/qcom/sdm429-lenovo-tbx505x.dts +++ b/arch/arm64/boot/dts/qcom/sdm429-lenovo-tbx505x.dts @@ -9,9 +9,12 @@ #include #include #include +#include +#include #include "sdm429.dtsi" #include "pm8953.dtsi" #include "pmi632.dtsi" +#include "msm8937-qdsp6.dtsi" / { model = "Lenovo Tab M10 HD"; @@ -37,12 +40,12 @@ format = "r8g8b8"; clocks = <&gcc GCC_MDSS_AHB_CLK>, - <&gcc GCC_MDSS_AXI_CLK>, - <&gcc GCC_MDSS_VSYNC_CLK>, - <&gcc GCC_MDSS_MDP_CLK>, - <&gcc GCC_MDSS_BYTE0_CLK>, - <&gcc GCC_MDSS_PCLK0_CLK>, - <&gcc GCC_MDSS_ESC0_CLK>; + <&gcc GCC_MDSS_AXI_CLK>, + <&gcc GCC_MDSS_VSYNC_CLK>, + <&gcc GCC_MDSS_MDP_CLK>, + <&gcc GCC_MDSS_BYTE0_CLK>, + <&gcc GCC_MDSS_PCLK0_CLK>, + <&gcc GCC_MDSS_ESC0_CLK>; power-domains = <&gcc MDSS_GDSC>; }; }; @@ -171,6 +174,14 @@ status = "okay"; }; +&apr { + status = "okay"; +}; + +&lpass_codec { + status = "okay"; +}; + &rpm_requests { regulators { compatible = "qcom,rpm-pm8953-regulators"; @@ -421,6 +432,40 @@ clock-frequency = <32768>; }; +/* + * msm8937.dtsi defines sound: sound-card@c051000 with status = "disabled" + * and the required reg/reg-names for the iomux registers. We enable it + * here and add the board-specific DAI links and routing. + */ +&sound { + status = "okay"; + model = "tbx505x-audio"; + + audio-routing = + "Headphone Jack", "HPH_L", + "Headphone Jack", "HPH_R", + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS External2"; +}; + +/* + * WCD analog codec — PM8953 internal. + */ +&wcd_codec { + status = "okay"; + + qcom,hphl-jack-type-normally-open; + qcom,gnd-jack-type-normally-open; + qcom,micbias1-ext-cap; + qcom,micbias2-ext-cap; + qcom,mbhc-vthreshold-low = <75 150 237 450 500>; + qcom,mbhc-vthreshold-high = <75 150 237 450 500>; + + vdd-cdc-io-supply = <&pm8953_l5>; + vdd-cdc-tx-rx-cx-supply = <&pm8953_s4>; + vdd-micbias-supply = <&pm8953_l13>; +}; + &tlmm { gpio-reserved-ranges = <0 4>; @@ -444,6 +489,87 @@ drive-strength = <2>; bias-disable; }; + + /* + * PDM bus — downstream misleadingly named "pri-mi2s-gpios" + * but function is cdc_pdm0, not MI2S. + */ + cdc_pdm_a_default: cdc-pdm-a-default-state { + pins = "gpio69", "gpio73", "gpio74"; + function = "cdc_pdm0"; + drive-strength = <8>; + bias-disable; + }; + + cdc_pdm_a_sleep: cdc-pdm-a-sleep-state { + pins = "gpio69", "gpio73", "gpio74"; + function = "cdc_pdm0"; + drive-strength = <2>; + bias-disable; + }; + + cdc_pdm_b_default: cdc-pdm-b-default-state { + pins = "gpio70", "gpio71", "gpio72"; + function = "cdc_pdm0"; + drive-strength = <8>; + bias-disable; + }; + + cdc_pdm_b_sleep: cdc-pdm-b-sleep-state { + pins = "gpio70", "gpio71", "gpio72"; + function = "cdc_pdm0"; + drive-strength = <2>; + bias-disable; + }; + + /* External speaker PA — GPIO 48 */ + ext_spk_pa_default: ext-spk-pa-default-state { + pins = "gpio48"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + output-high; + }; + + ext_spk_pa_sleep: ext-spk-pa-sleep-state { + pins = "gpio48"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + output-low; + }; + + /* + * Quinary MI2S — for WSA speaker path if needed later. + * GPIO 88 = SCK, GPIO 89 = WS (confirmed from DTB). + */ + quin_mi2s_active: quin-mi2s-active-state { + pins = "gpio88"; + function = "pri_mi2s"; + drive-strength = <8>; + bias-disable; + }; + + quin_mi2s_sleep: quin-mi2s-sleep-state { + pins = "gpio88"; + function = "pri_mi2s"; + drive-strength = <2>; + bias-pull-down; + }; + + quin_mi2s_ws_active: quin-mi2s-ws-active-state { + pins = "gpio89"; + function = "pri_mi2s_ws"; + drive-strength = <8>; + bias-disable; + }; + + quin_mi2s_ws_sleep: quin-mi2s-ws-sleep-state { + pins = "gpio89"; + function = "pri_mi2s_ws"; + drive-strength = <2>; + bias-pull-down; + }; }; &usb { @@ -482,3 +608,15 @@ &xo_board { clock-frequency = <19200000>; }; + +&q6afedai { + status = "okay"; +}; + +&q6routing { + status = "okay"; +}; + +&q6asmdai { + status = "okay"; +}; diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c index b4b178caf754d8..8a1af2a9f0c6c6 100644 --- a/drivers/mfd/qcom-spmi-pmic.c +++ b/drivers/mfd/qcom-spmi-pmic.c @@ -54,6 +54,7 @@ static const struct of_device_id pmic_spmi_id_table[] = { { .compatible = "qcom,pm8909", .data = N_USIDS(2) }, { .compatible = "qcom,pm8916", .data = N_USIDS(2) }, { .compatible = "qcom,pm8937", .data = N_USIDS(2) }, + { .compatible = "qcom,pm8953", .data = N_USIDS(2) }, { .compatible = "qcom,pm8941", .data = N_USIDS(2) }, { .compatible = "qcom,pm8950", .data = N_USIDS(2) }, { .compatible = "qcom,pm8994", .data = N_USIDS(2) }, diff --git a/out b/out deleted file mode 120000 index 8c95b97a83b192..00000000000000 --- a/out +++ /dev/null @@ -1 +0,0 @@ -.output \ No newline at end of file