diff mbox series

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

Message ID 20230318121828.739424-15-bryan.odonoghue@linaro.org (mailing list archive)
State Superseded
Headers show
Series Add Qualcomm PMIC TPCM support | expand

Commit Message

Bryan O'Donoghue March 18, 2023, 12:18 p.m. UTC
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(+)

Comments

Konrad Dybcio March 18, 2023, 1:13 p.m. UTC | #1
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>;
kernel test robot March 18, 2023, 9:09 p.m. UTC | #2
Hi Bryan,

I love your patch! Yet something to improve:

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on usb/usb-next usb/usb-linus robh/for-next broonie-regulator/for-next lee-mfd/for-mfd-next linus/master v6.3-rc2 next-20230317]
[cannot apply to lee-mfd/for-mfd-fixes]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bryan-O-Donoghue/dt-bindings-regulator-qcom-usb-vbus-regulator-Mark-reg-as-required/20230318-202034
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link:    https://lore.kernel.org/r/20230318121828.739424-15-bryan.odonoghue%40linaro.org
patch subject: [PATCH v4 14/18] arm64: dts: qcom: pm8150b: Add a TCPM description
config: arm-randconfig-r046-20230319 (https://download.01.org/0day-ci/archive/20230319/202303190420.SG155iKR-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/f22a2d4f99f0527b2429c054e4c918c2dee8ec89
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Bryan-O-Donoghue/dt-bindings-regulator-qcom-usb-vbus-regulator-Mark-reg-as-required/20230318-202034
        git checkout f22a2d4f99f0527b2429c054e4c918c2dee8ec89
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303190420.SG155iKR-lkp@intel.com/

All errors (new ones prefixed by >>):

>> ERROR: Input tree has errors, aborting (use -f to force output)
diff mbox series

Patch

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>;
+		};
+
+		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>;
+		};
+
 		pm8150b_temp: temp-alarm@2400 {
 			compatible = "qcom,spmi-temp-alarm";
 			reg = <0x2400>;