Re: [PATCH v4 14/18] arm64: dts: qcom: pm8150b: Add a TCPM description

Konrad Dybcio
2023-03-18T13:13:46Z

On 18.03.2023 13:18, Bryan O'Donoghue wrote:
> Type-C port management functionality lives inside of the PMIC block on
> pm8150b.
>
> The Type-C port management logic controls orientation detection, vbus/vconn
> sense and to send/receive Type-C Power Domain messages.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> arch/arm64/boot/dts/qcom/pm8150b.dtsi | 70 +++++++++++++++++++++++++++
> 1 file changed, 70 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/pm8150b.dtsi b/arch/arm64/boot/dts/qcom/pm8150b.dtsi
> index 66752cc063d60..6db32bdbf5747 100644
> --- a/arch/arm64/boot/dts/qcom/pm8150b.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm8150b.dtsi
> @@ -7,6 +7,8 @@
> #include <dt-bindings/iio/qcom,spmi-vadc.h>
> #include <dt-bindings/interrupt-controller/irq.h>
> #include <dt-bindings/spmi/spmi.h>
> +#include <dt-bindings/usb/typec/qcom,pmic-typec.h>
> +#include <dt-bindings/usb/typec/qcom,pmic-pdphy.h>
>
> / {
> thermal-zones {
> @@ -37,6 +39,14 @@ trip2 {
> };
> };
> };
> +
> + tcpm: pm8150b-tcpm {
> + compatible = "qcom,pmic-virt-tcpm";
> + qcom,pmic-typec = <&pm8150b_typec>;
> + qcom,pmic-pdphy = <&pm8150b_pdphy>;
> +
> + status = "disabled";
> + };
> };
>
> &spmi_bus {
> @@ -59,6 +69,66 @@ pm8150b_vbus: usb-vbus-regulator@1100 {
> reg = <0x1100>;
> };
>
> + pm8150b_typec: typec@1500 {
> + compatible = "qcom,pm8150b-typec";
> + reg = <0x1500>;
> + interrupts = <0x2 0x15 PMIC_TYPEC_OR_RID_IRQ
> + IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x15 PMIC_TYPEC_VPD_IRQ
> + IRQ_TYPE_EDGE_BOTH>,
> + <0x2 0x15 PMIC_TYPEC_CC_STATE_IRQ
> + IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x15 PMIC_TYPEC_VCONN_OC_IRQ
> + IRQ_TYPE_EDGE_BOTH>,
> + <0x2 0x15 PMIC_TYPEC_VBUS_IRQ
> + IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x15 PMIC_TYPEC_ATTACH_DETACH_IRQ
> + IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x15 PMIC_TYPEC_LEGACY_CABLE_IRQ
> + IRQ_TYPE_EDGE_BOTH>,
> + <0x2 0x15 PMIC_TYPEC_TRY_SNK_SRC_IRQ
> + IRQ_TYPE_EDGE_RISING>;
> + interrupt-names = "or-rid-detect-change",
> + "vpd-detect",
> + "cc-state-change",
> + "vconn-oc",
> + "vbus-change",
> + "attach-detach",
> + "legacy-cable-detect",
> + "try-snk-src-detect";
> + vdd-vbus-supply = <&pm8150b_vbus>;
This belongs in the board dt, it references nodes defined there.
> + };
> +
> + pm8150b_pdphy: pdphy@1700 {
> + compatible = "qcom,pm8150b-pdphy";
> + reg = <0x1700>;
> + interrupts = <0x2 0x17 PMIC_PDPHY_SIG_TX_IRQ
> + IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 PMIC_PDPHY_SIG_RX_IRQ
> + IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 PMIC_PDPHY_MSG_TX_IRQ
> + IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 PMIC_PDPHY_MSG_RX_IRQ
> + IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 PMIC_PDPHY_MSG_TX_FAIL_IRQ
> + IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 PMIC_PDPHY_MSG_TX_DISCARD_IRQ
> + IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 PMIC_PDPHY_MSG_RX_DISCARD_IRQ
> + IRQ_TYPE_EDGE_RISING>,
> + <0x2 0x17 PMIC_PDPHY_FR_SWAP_IRQ
> + IRQ_TYPE_EDGE_RISING>;
> + interrupt-names = "sig-tx",
> + "sig-rx",
> + "msg-tx",
> + "msg-rx",
> + "msg-tx-failed",
> + "msg-tx-discarded",
> + "msg-rx-discarded",
> + "fr-swap";
> + vdd-phy-supply = <&vreg_l2a_3p1>;
This belongs in the board dt, it references nodes defined there.

The rest lgtm, I think!

Konrad
> + };
> +
> pm8150b_temp: temp-alarm@2400 {
> compatible = "qcom,spmi-temp-alarm";
> reg = <0x2400>;