diff options
author | Zoltan Herpai <wigyori@uid0.hu> | 2016-07-25 13:32:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-25 13:32:13 +0200 |
commit | 99ddb65eac90bd20ab08f76190bbfcc5d4676ae2 (patch) | |
tree | 251d1f973bbec130b3f67d761b97f4c103f94609 /target/linux/zynq/patches/112-add-support-for-vbus-control-with-phy.patch | |
parent | 3f40c83a32466603c4aea2625510aba6921b1a44 (diff) | |
parent | 2251e0a1639e1eb38928906b2130ea601ca0ddd8 (diff) | |
download | master-187ad058-99ddb65eac90bd20ab08f76190bbfcc5d4676ae2.tar.gz master-187ad058-99ddb65eac90bd20ab08f76190bbfcc5d4676ae2.tar.bz2 master-187ad058-99ddb65eac90bd20ab08f76190bbfcc5d4676ae2.zip |
Merge pull request #39 from qinfengling/zedboard
zynq: add usb support for Zedboard
Diffstat (limited to 'target/linux/zynq/patches/112-add-support-for-vbus-control-with-phy.patch')
-rw-r--r-- | target/linux/zynq/patches/112-add-support-for-vbus-control-with-phy.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/target/linux/zynq/patches/112-add-support-for-vbus-control-with-phy.patch b/target/linux/zynq/patches/112-add-support-for-vbus-control-with-phy.patch new file mode 100644 index 0000000000..5dca10032a --- /dev/null +++ b/target/linux/zynq/patches/112-add-support-for-vbus-control-with-phy.patch @@ -0,0 +1,62 @@ +--- a/drivers/usb/chipidea/ci_hdrc_usb2.c ++++ b/drivers/usb/chipidea/ci_hdrc_usb2.c +@@ -33,6 +33,7 @@ static const struct ci_hdrc_platform_dat + + static struct ci_hdrc_platform_data ci_zynq_pdata = { + .capoffset = DEF_CAPOFFSET, ++ .flags = CI_HDRC_PHY_VBUS_CONTROL, + }; + + static const struct of_device_id ci_hdrc_usb2_of_match[] = { +--- a/drivers/usb/chipidea/host.c ++++ b/drivers/usb/chipidea/host.c +@@ -66,6 +66,14 @@ static int ehci_ci_portpower(struct usb_ + } + } + ++ if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL && ++ ci->usb_phy && ci->usb_phy->set_vbus) { ++ if (enable) ++ ci->usb_phy->set_vbus(ci->usb_phy, 1); ++ else ++ ci->usb_phy->set_vbus(ci->usb_phy, 0); ++ } ++ + if (enable && (ci->platdata->phy_mode == USBPHY_INTERFACE_MODE_HSIC)) { + /* + * Marvell 28nm HSIC PHY requires forcing the port to HS mode. +--- a/drivers/usb/chipidea/otg_fsm.c ++++ b/drivers/usb/chipidea/otg_fsm.c +@@ -456,6 +456,11 @@ static void ci_otg_drv_vbus(struct otg_f + return; + } + } ++ ++ if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL && ++ ci->usb_phy && ci->usb_phy->set_vbus) ++ ci->usb_phy->set_vbus(ci->usb_phy, 1); ++ + /* Disable data pulse irq */ + hw_write_otgsc(ci, OTGSC_DPIE, 0); + +@@ -465,6 +470,10 @@ static void ci_otg_drv_vbus(struct otg_f + if (ci->platdata->reg_vbus) + regulator_disable(ci->platdata->reg_vbus); + ++ if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL && ++ ci->usb_phy && ci->usb_phy->set_vbus) ++ ci->usb_phy->set_vbus(ci->usb_phy, 0); ++ + fsm->a_bus_drop = 1; + fsm->a_bus_req = 0; + } +--- a/include/linux/usb/chipidea.h ++++ b/include/linux/usb/chipidea.h +@@ -55,6 +55,7 @@ struct ci_hdrc_platform_data { + #define CI_HDRC_OVERRIDE_AHB_BURST BIT(9) + #define CI_HDRC_OVERRIDE_TX_BURST BIT(10) + #define CI_HDRC_OVERRIDE_RX_BURST BIT(11) ++#define CI_HDRC_PHY_VBUS_CONTROL BIT(12) + enum usb_dr_mode dr_mode; + #define CI_HDRC_CONTROLLER_RESET_EVENT 0 + #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 |