bcf363f
From patchwork Fri Jul 14 02:20:42 2017
bcf363f
Content-Type: text/plain; charset="utf-8"
bcf363f
MIME-Version: 1.0
bcf363f
Content-Transfer-Encoding: 7bit
bcf363f
Subject: [v2] arm64: dts: qcom: Force host mode for USB on apq8016-sbc
bcf363f
From: Stephen Boyd <sboyd@codeaurora.org>
bcf363f
X-Patchwork-Id: 9839803
bcf363f
Message-Id: <20170714022042.13886-1-sboyd@codeaurora.org>
bcf363f
To: Andy Gross <andy.gross@linaro.org>
bcf363f
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
bcf363f
 linux-arm-kernel@lists.infradead.org, Rob Clark <robdclark@gmail.com>
bcf363f
Date: Thu, 13 Jul 2017 19:20:42 -0700
bcf363f
bcf363f
Commit ed75d6a96905 ("arm64: dts: qcom: Collapse usb support into
bcf363f
one node") breaks host mode support on apq8016-sbc boards. This
bcf363f
is because the mux driver (tc7usb40mu) hasn't been merged.
bcf363f
Without that driver, we can't toggle the GPIO going to the mux to
bcf363f
route out the D+/D- lines to the USB hub that's on the board.
bcf363f
bcf363f
One solution would be to totally revert this change, but that
bcf363f
opens us up to other problems when two USB drivers are operating
bcf363f
the same hardware block at the same time. Let's modify the DT so
bcf363f
that the USB controller is always in host mode and connected to
bcf363f
the hub so that things like USB keyboards and mouses work. This
bcf363f
is the mode that most people prefer anyway with these devices. We
bcf363f
also delete the usb-switch node because the binding was never
bcf363f
accepted upstream.
bcf363f
bcf363f
In the future, we can add muxing support and then update the DT
bcf363f
to support both modes at runtime. Patches to support this are
bcf363f
already on the mailing list.
bcf363f
bcf363f
Fixes: ed75d6a96905 ("arm64: dts: qcom: Collapse usb support into one node")
bcf363f
Reported-by: Rob Clark <robdclark@gmail.com>
bcf363f
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
bcf363f
---
bcf363f
bcf363f
I noticed that I accidently removed the vbus notifier part of the phy.
bcf363f
Without it, we'll change settings that shouldn't changed. The thing
bcf363f
that we don't have is the ID pin on this board, not the vbus. That's
bcf363f
the only difference from v1.
bcf363f
bcf363f
 arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi |  1 +
bcf363f
 arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi           | 13 ++++---------
bcf363f
 2 files changed, 5 insertions(+), 9 deletions(-)
bcf363f
bcf363f
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi
bcf363f
index d94640812194..790b7775b901 100644
bcf363f
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi
bcf363f
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi
bcf363f
@@ -17,6 +17,7 @@
bcf363f
 			function = PMIC_GPIO_FUNC_NORMAL;
bcf363f
 			power-source = <PM8916_GPIO_VPH>;
bcf363f
 			input-disable;
bcf363f
+			output-high;
bcf363f
 		};
bcf363f
 	};
bcf363f
 
bcf363f
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
bcf363f
index bd310ac1967a..bb9e29e6b164 100644
bcf363f
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
bcf363f
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
bcf363f
@@ -213,11 +213,14 @@
bcf363f
 		};
bcf363f
 
bcf363f
 		usb@78d9000 {
bcf363f
-			extcon = <&usb_id>, <&usb_id>;
bcf363f
+			extcon = <&usb_id>;
bcf363f
 			status = "okay";
bcf363f
 			adp-disable;
bcf363f
 			hnp-disable;
bcf363f
 			srp-disable;
bcf363f
+			dr_mode = "host";
bcf363f
+			pinctrl-names = "default";
bcf363f
+			pinctrl-0 = <&usb_sw_sel_pm>;
bcf363f
 			ulpi {
bcf363f
 				phy {
bcf363f
 					v1p8-supply = <&pm8916_l7>;
bcf363f
@@ -342,14 +345,6 @@
bcf363f
 		pinctrl-0 = <&usb_id_default>;
bcf363f
 	};
bcf363f
 
bcf363f
-	usb-switch {
bcf363f
-		compatible = "toshiba,tc7usb40mu";
bcf363f
-		switch-gpios = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>;
bcf363f
-		extcon = <&usb_id>;
bcf363f
-		pinctrl-names = "default";
bcf363f
-		pinctrl-0 = <&usb_sw_sel_pm>;
bcf363f
-	};
bcf363f
-
bcf363f
 	hdmi-out {
bcf363f
 		compatible = "hdmi-connector";
bcf363f
 		type = "a";