From b6189b30bfeea7cc30318227b602cafd0eadf5bc Mon Sep 17 00:00:00 2001 From: chailu1 Date: Tue, 31 Aug 2021 14:00:34 +0800 Subject: [PATCH] arm/dts: Add sgm7220 configure typec/sgm7220 Add sgm7220 driver configure Change-Id: I4c5c7816Montana86680007e844d25b31ef3d3404c81 Signed-off-by: chailu1 Reviewed-on: https://gerrit.mot.com/2055215 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- qcom/blair-nopmi-milanf-common-overlay.dtsi | 1 + qcom/sgm7220.dtsi | 50 +++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 qcom/sgm7220.dtsi diff --git a/qcom/blair-nopmi-milanf-common-overlay.dtsi b/qcom/blair-nopmi-milanf-common-overlay.dtsi index 551cf36eacaf..55dcb78ebf57 100644 --- a/qcom/blair-nopmi-milanf-common-overlay.dtsi +++ b/qcom/blair-nopmi-milanf-common-overlay.dtsi @@ -12,6 +12,7 @@ #include "blair-milanf-common-overlay.dtsi" #include "blair-nopmi-moto-common-overlay.dtsi" #include "tcpc_config.dtsi" +#include "sgm7220.dtsi" #include "rt9426a.dtsi" &usb0 { diff --git a/qcom/sgm7220.dtsi b/qcom/sgm7220.dtsi new file mode 100644 index 000000000000..36e795804a50 --- /dev/null +++ b/qcom/sgm7220.dtsi @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 motorola Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR tcpcA PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +&qupv3_se8_i2c { + status = "okay"; + sgm7220@47 { + compatible = "sgm,usb_type_c_sgm7220"; + reg = <0x47>; + status = "okay"; + tcpc-dual,supported_modes = <0>; /* 0: dfp/ufp, */ + /* 1: dfp, 2: ufp */ + sgm7220-tcpc,name = "type_c_port0"; /* tcpc_device's name */ + sgm7220-tcpc,role_def = <4>; /* 0: SNK Only, 1: SRC Only, 2: DRP, */ + /* 3: Try.SRC, 4: Try.SNK */ + sgm7220-tcpc,rp_level = <0>; /* 0: Default, 1: 1.5, 2: 3.0 */ + sgm7220-tcpc,vconn_supply = <0>; /* 0: Never, 1: Always, */ + /* 2: EMarkOnly, 3: StartOnly */ + sgm7220,intr_gpio = <&tlmm 11 0x0>; + sgm7220,intr_gpio_num = <11>; + pinctrl-names = "default"; + pinctrl-0 = <&sgm7220_int_n>; + }; +}; + + +&tlmm { + sgm7220_int_n: sgm7220_int_n { + mux { + pins = "gpio11"; + function = "gpio"; + }; + + config { + pins = "gpio11"; + drive-strength = <2>; + bias-pull-up; + }; + }; +}; +