From 3470828f5cee834466f58543307f9e3deb9eb8a2 Mon Sep 17 00:00:00 2001 From: Mayank Rana Date: Fri, 31 Jan 2020 15:32:33 -0800 Subject: [PATCH] ARM: dts: msm: Add VBUS/ID configuration for USB secondary port on Lahaina This change adds GPIO configuration for USB VBUS/ID detection and enabling 5v vbus in host mode. It adds extcon_usb2 device node for using this configuration through USB extcon gpio driver for notifying vbus/ID status on connecting USB cable. Change-Id: I54727cc9112e74b4c8829442fc6e727bbd20beab --- qcom/lahaina-cdp.dtsi | 16 ++++++++++++++++ qcom/lahaina-mtp.dtsi | 16 ++++++++++++++++ qcom/lahaina-pinctrl.dtsi | 9 +++++++++ qcom/lahaina-pmic-overlay.dtsi | 19 +++++++++++++++++++ 4 files changed, 60 insertions(+) diff --git a/qcom/lahaina-cdp.dtsi b/qcom/lahaina-cdp.dtsi index 262a4d3a5205..b13e8f377a00 100644 --- a/qcom/lahaina-cdp.dtsi +++ b/qcom/lahaina-cdp.dtsi @@ -27,6 +27,18 @@ linux,can-disable; }; }; + + extcon_usb1: extcon_usb1 { + compatible = "linux,extcon-usb-gpio"; + vbus-gpio = <&pm8350_gpios 9 GPIO_ACTIVE_HIGH>; + id-gpio = <&tlmm 51 GPIO_ACTIVE_HIGH>; + vbus-out-gpio = <&pm8350_gpios 8 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&usb2_vbus_det_default + &usb2_id_det_default + &usb2_vbus_boost_default>; + }; }; &sdhc_2 { @@ -97,3 +109,7 @@ &pm8350c_flash { status = "ok"; }; + +&usb1 { + extcon = <&extcon_usb1>; +}; diff --git a/qcom/lahaina-mtp.dtsi b/qcom/lahaina-mtp.dtsi index 16168a2b7089..b1b8c737c673 100644 --- a/qcom/lahaina-mtp.dtsi +++ b/qcom/lahaina-mtp.dtsi @@ -27,6 +27,18 @@ linux,can-disable; }; }; + + extcon_usb1: extcon_usb1 { + compatible = "linux,extcon-usb-gpio"; + vbus-gpio = <&pm8350_gpios 9 GPIO_ACTIVE_HIGH>; + id-gpio = <&tlmm 51 GPIO_ACTIVE_HIGH>; + vbus-out-gpio = <&pm8350_gpios 8 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&usb2_vbus_det_default + &usb2_id_det_default + &usb2_vbus_boost_default>; + }; }; &sdhc_2 { @@ -97,3 +109,7 @@ &pm8350c_flash { status = "ok"; }; + +&usb1 { + extcon = <&extcon_usb1>; +}; diff --git a/qcom/lahaina-pinctrl.dtsi b/qcom/lahaina-pinctrl.dtsi index 830dfd29efe7..bdfadf82ad79 100644 --- a/qcom/lahaina-pinctrl.dtsi +++ b/qcom/lahaina-pinctrl.dtsi @@ -1657,6 +1657,15 @@ }; }; }; + + usb2_id_det_default: usb2_id_det_default { + config { + pins = "gpio51"; + function = "gpio"; + input-enable; + bias-pull-up; + }; + }; }; pmx_sde: pmx_sde { sde_dsi_active: sde_dsi_active { diff --git a/qcom/lahaina-pmic-overlay.dtsi b/qcom/lahaina-pmic-overlay.dtsi index 8bd48c2a458b..41b3bb4e9f08 100644 --- a/qcom/lahaina-pmic-overlay.dtsi +++ b/qcom/lahaina-pmic-overlay.dtsi @@ -17,6 +17,25 @@ power-source = <1>; }; }; + + usb2_vbus_boost { + usb2_vbus_boost_default: usb2_vbus_boost_default { + pins = "gpio8"; + function = "normal"; + output-low; + power-source = <0>; /* 1.8V input supply */ + }; + }; + + usb2_vbus_det { + usb2_vbus_det_default: usb2_vbus_det_default { + pins = "gpio9"; + function = "normal"; + input-enable; + bias-disable; + power-source = <0>; /* 1.8V input supply */ + }; + }; }; &qupv3_se13_i2c {