usb: chipidea: add a flag for turn on vbus early for host
authorLi Jun <b47624@freescale.com>
Wed, 11 Feb 2015 04:45:01 +0000 (12:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 15:19:12 +0000 (16:19 +0100)
Some usb PHYs need power supply from vbus to make it work, eg mxs-phy, if
there is no vbus, USB PHY will not in correct state when the controller starts
to work, for host, this requires vbus should be turned on before setting port
power(PP) of ehci, to work with this kind of USB PHY design, this patch adds
a flag CI_HDRC_TURN_VBUS_EARLY_ON, can be checked by host driver to turn on
vbus while start host.

Signed-off-by: Li Jun <jun.li@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/ci_hdrc_imx.c
include/linux/usb/chipidea.h

index f7f9fd45c9eac738d734e9226c57af99e8ecbb46..389f0e0342596410c89b6c61b52b8907d90f9c0d 100644 (file)
@@ -32,19 +32,23 @@ static const struct ci_hdrc_imx_platform_flag imx27_usb_data = {
 };
 
 static const struct ci_hdrc_imx_platform_flag imx28_usb_data = {
-       .flags = CI_HDRC_IMX28_WRITE_FIX,
+       .flags = CI_HDRC_IMX28_WRITE_FIX |
+               CI_HDRC_TURN_VBUS_EARLY_ON,
 };
 
 static const struct ci_hdrc_imx_platform_flag imx6q_usb_data = {
-       .flags = CI_HDRC_SUPPORTS_RUNTIME_PM,
+       .flags = CI_HDRC_SUPPORTS_RUNTIME_PM |
+               CI_HDRC_TURN_VBUS_EARLY_ON,
 };
 
 static const struct ci_hdrc_imx_platform_flag imx6sl_usb_data = {
-       .flags = CI_HDRC_SUPPORTS_RUNTIME_PM,
+       .flags = CI_HDRC_SUPPORTS_RUNTIME_PM |
+               CI_HDRC_TURN_VBUS_EARLY_ON,
 };
 
 static const struct ci_hdrc_imx_platform_flag imx6sx_usb_data = {
-       .flags = CI_HDRC_SUPPORTS_RUNTIME_PM,
+       .flags = CI_HDRC_SUPPORTS_RUNTIME_PM |
+               CI_HDRC_TURN_VBUS_EARLY_ON,
 };
 
 static const struct of_device_id ci_hdrc_imx_dt_ids[] = {
index 39ba00f0d1d53216d22dce7ae386c7c1a55eb620..ab94f78c4dd15ee4554a4eff996c862b7a6fd869 100644 (file)
@@ -28,6 +28,7 @@ struct ci_hdrc_platform_data {
 #define CI_HDRC_DUAL_ROLE_NOT_OTG      BIT(4)
 #define CI_HDRC_IMX28_WRITE_FIX                BIT(5)
 #define CI_HDRC_FORCE_FULLSPEED                BIT(6)
+#define CI_HDRC_TURN_VBUS_EARLY_ON     BIT(7)
        enum usb_dr_mode        dr_mode;
 #define CI_HDRC_CONTROLLER_RESET_EVENT         0
 #define CI_HDRC_CONTROLLER_STOPPED_EVENT       1