From c7dbd68dfafeaf65a99cfe4d93aa74fae772d2a0 Mon Sep 17 00:00:00 2001 From: "he.he" Date: Mon, 9 Sep 2019 22:48:17 -0400 Subject: [PATCH] usb: TOSHIBA Disk Can't Be Recognized on the Port of USB 2.0 [1/1] PD#SWPL-14156 Problem: TOSHIBA Disk can't be recognized on the Port of USB 2.0 and since then any disk can't be recognized.This is because that the CCS flag of the PORTSC is still set and if write 0 to 0x38 of usb phy register the CCS will change to 0 and so that other disks can be recognized. Solution: when the enumeration fails, call set_usb_phy_host_tuning. Verify: test pass on u212 Change-Id: I507f269afc825de75c7dcce5f79c9c1dd7793d84 Signed-off-by: he.he --- drivers/amlogic/usb/phy/phy-aml-new-usb-v2.h | 2 +- drivers/usb/core/hub.c | 3 +++ drivers/usb/core/hub.h | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/usb/phy/phy-aml-new-usb-v2.h b/drivers/amlogic/usb/phy/phy-aml-new-usb-v2.h index a9c3ed1..dd07843 100644 --- a/drivers/amlogic/usb/phy/phy-aml-new-usb-v2.h +++ b/drivers/amlogic/usb/phy/phy-aml-new-usb-v2.h @@ -23,4 +23,4 @@ extern int amlogic_new_usbphy_reset_v2(struct amlogic_usb_v2 *phy); extern int amlogic_new_usbphy_reset_phycfg_v2 (struct amlogic_usb_v2 *phy, int cnt); - +void set_usb_phy_host_tuning(int port, int default_val); diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index f21a90b..6b6479d 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4982,6 +4982,9 @@ loop: done: hub_port_disable(hub, port1, 1); +#ifdef CONFIG_AMLOGIC_USB2PHY + set_usb_phy_host_tuning(port1 - 1, 1); +#endif if (hcd->driver->relinquish_port && !hub->hdev->parent) { if (status != -ENOTCONN && status != -ENODEV) hcd->driver->relinquish_port(hcd, port1); diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h index 34c1a7e..d82a20b 100644 --- a/drivers/usb/core/hub.h +++ b/drivers/usb/core/hub.h @@ -124,6 +124,9 @@ extern int hub_port_debounce(struct usb_hub *hub, int port1, bool must_be_connected); extern int usb_clear_port_feature(struct usb_device *hdev, int port1, int feature); +#ifdef CONFIG_AMLOGIC_USB2PHY +void set_usb_phy_host_tuning(int port, int default_val); +#endif static inline bool hub_is_port_power_switchable(struct usb_hub *hub) { -- 2.7.4