From 88931d2659df753594d5b326a0547f76f06681c5 Mon Sep 17 00:00:00 2001 From: tinno18 Date: Tue, 7 Dec 2021 15:08:22 +0800 Subject: [PATCH] Hawaii+OLED:usb bringup dts porting from https://gerrit.mot.com/#/c/2136995/ add extcon ,dwc3 dr_mode to otg qcom/discrete_charging_hawao.dtsi qcom/khaje-hawao-common-overlay.dtsi qcom/khaje-usb.dtsi qcom/sgm7220_hawao.dtsi Change-Id: I4186a430295998f7d50aa8701c900806f4b9157f Reviewed-on: https://gerrit.mot.com/2136995 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Submit-Approved: Jira Key Tested-by: Jira Key Reviewed-by: SLTApproved: Submit-Approved: Tested-by: Reviewed-by: Ying Shen Reviewed-on: https://gerrit.mot.com/2142466 Reviewed-by: Wang Wang --- qcom/discrete_charging_hawao.dtsi | 4 +-- qcom/khaje-hawao-common-overlay.dtsi | 9 ++++- qcom/sgm7220_hawao.dtsi | 50 ++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 qcom/sgm7220_hawao.dtsi diff --git a/qcom/discrete_charging_hawao.dtsi b/qcom/discrete_charging_hawao.dtsi index fe3d79cfd743..210858d16323 100644 --- a/qcom/discrete_charging_hawao.dtsi +++ b/qcom/discrete_charging_hawao.dtsi @@ -187,8 +187,8 @@ }; }; -/* + &usb0 { extcon = <&eud>,<&mmi_discrete_charger>; }; -*/ + diff --git a/qcom/khaje-hawao-common-overlay.dtsi b/qcom/khaje-hawao-common-overlay.dtsi index 1dd135b57458..24c25d1f3b56 100644 --- a/qcom/khaje-hawao-common-overlay.dtsi +++ b/qcom/khaje-hawao-common-overlay.dtsi @@ -16,7 +16,7 @@ #include "khaje-hawao-fps-overlay_evb.dtsi" #include "khaje-hawao-touchscreen-overlay.dtsi" #include "khaje-hawao-nfc-overlay.dtsi" -#include "sgm7220.dtsi" +#include "sgm7220_hawao.dtsi" #include "discrete_charging_hawao.dtsi" &firmware { @@ -103,3 +103,10 @@ aw9610x,firmware_name = "aw9610x_0"; }; }; + + +&usb0 { + dwc3@4e00000 { + dr_mode = "otg"; + }; +}; diff --git a/qcom/sgm7220_hawao.dtsi b/qcom/sgm7220_hawao.dtsi new file mode 100644 index 000000000000..4016797db56c --- /dev/null +++ b/qcom/sgm7220_hawao.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_se1_i2c { + status = "okay"; + sgm7220: 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 = <5>; /* 0: Unknown, 1: SNK, 2: SRC */ + /* 3: DRP, 4: Try.SRC, 5: 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 84 0x0>; + sgm7220,intr_gpio_num = <84>; + pinctrl-names = "default"; + pinctrl-0 = <&sgm7220_int_n>; + }; +}; + + +&tlmm { + sgm7220_int_n: sgm7220_int_n { + mux { + pins = "gpio84"; + function = "gpio"; + }; + + config { + pins = "gpio84"; + drive-strength = <2>; + bias-pull-up; + }; + }; +}; +