Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8937.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2381,6 +2381,11 @@
qcom,sd-lines = <0 1>;
};

dai@17 {
reg = <PRIMARY_MI2S_TX>;
qcom,sd-lines = <0 1>;
};

dai@20 {
reg = <TERTIARY_MI2S_TX>;
qcom,sd-lines = <0 1>;
Expand Down
42 changes: 42 additions & 0 deletions arch/arm64/boot/dts/qcom/pm8953.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,47 @@
reg = <1 SPMI_USID>;
#address-cells = <1>;
#size-cells = <0>;

wcd_codec: codec@f000 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly is the issue here? Could you please explain?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can cherry-pick the related commits from msm8953 tree

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";
};
};
};
150 changes: 144 additions & 6 deletions arch/arm64/boot/dts/qcom/sdm429-lenovo-tbx505x.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
#include <dt-bindings/arm/qcom,ids.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/sound/qcom,q6afe.h>
#include <dt-bindings/sound/qcom,q6asm.h>
#include "sdm429.dtsi"
#include "pm8953.dtsi"
#include "pmi632.dtsi"
#include "msm8937-qdsp6.dtsi"

/ {
model = "Lenovo Tab M10 HD";
Expand All @@ -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>;
};
};
Expand Down Expand Up @@ -171,6 +174,14 @@
status = "okay";
};

&apr {
status = "okay";
};

&lpass_codec {
status = "okay";
};

&rpm_requests {
regulators {
compatible = "qcom,rpm-pm8953-regulators";
Expand Down Expand Up @@ -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>;

Expand All @@ -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 {
Expand Down Expand Up @@ -482,3 +608,15 @@
&xo_board {
clock-frequency = <19200000>;
};

&q6afedai {
status = "okay";
};

&q6routing {
status = "okay";
};

&q6asmdai {
status = "okay";
};
1 change: 1 addition & 0 deletions drivers/mfd/qcom-spmi-pmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Comment thread
Kaloyan501 marked this conversation as resolved.
{ .compatible = "qcom,pm8941", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8950", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8994", .data = N_USIDS(2) },
Expand Down
1 change: 0 additions & 1 deletion out

This file was deleted.