1 Index: linux-4.4.4/drivers/usb/chipidea/ci.h
2 ===================================================================
3 --- linux-4.4.4.orig/drivers/usb/chipidea/ci.h 2016-03-31 21:39:23.571126980 +0300
4 +++ linux-4.4.4/drivers/usb/chipidea/ci.h 2016-03-31 21:39:23.567126980 +0300
6 * @in_lpm: if the core in low power mode
7 * @wakeup_int: if wakeup interrupt occur
8 * @rev: The revision number for controller
9 + * @dp_always_pullup: keep dp always pullup at device mode
17 + bool dp_always_pullup;
20 static inline struct ci_role_driver *ci_role(struct ci_hdrc *ci)
21 Index: linux-4.4.4/drivers/usb/chipidea/core.c
22 ===================================================================
23 --- linux-4.4.4.orig/drivers/usb/chipidea/core.c 2016-03-31 21:39:23.571126980 +0300
24 +++ linux-4.4.4/drivers/usb/chipidea/core.c 2016-03-31 21:41:33.159130168 +0300
27 ci_hdrc_gadget_destroy(ci);
28 ci_hdrc_host_destroy(ci);
30 + if (!ci->dp_always_pullup && ci->roles[CI_ROLE_GADGET])
31 ci_hdrc_otg_destroy(ci);
35 ci->supports_runtime_pm = !!(ci->platdata->flags &
36 CI_HDRC_SUPPORTS_RUNTIME_PM);
38 + ci->dp_always_pullup = !!(ci->platdata->flags &
39 + CI_HDRC_DP_ALWAYS_PULLUP);
41 ret = hw_device_init(ci, base);
43 dev_err(dev, "can't initialize hardware\n");
48 - if (ci->is_otg && ci->roles[CI_ROLE_GADGET]) {
49 + if (!ci->dp_always_pullup && ci->roles[CI_ROLE_GADGET]) {
50 ret = ci_hdrc_otg_init(ci);
52 dev_err(dev, "init otg fails, ret = %d\n", ret);
53 Index: linux-4.4.4/drivers/usb/chipidea/otg.c
54 ===================================================================
55 --- linux-4.4.4.orig/drivers/usb/chipidea/otg.c 2016-03-31 21:39:23.571126980 +0300
56 +++ linux-4.4.4/drivers/usb/chipidea/otg.c 2016-03-31 21:39:23.567126980 +0300
59 void ci_handle_vbus_change(struct ci_hdrc *ci)
62 + if (ci->dp_always_pullup) {
63 + usb_gadget_vbus_connect(&ci->gadget);
67 if (hw_read_otgsc(ci, OTGSC_BSV))
68 usb_gadget_vbus_connect(&ci->gadget);
69 Index: linux-4.4.4/include/linux/usb/chipidea.h
70 ===================================================================
71 --- linux-4.4.4.orig/include/linux/usb/chipidea.h 2016-03-31 21:39:23.571126980 +0300
72 +++ linux-4.4.4/include/linux/usb/chipidea.h 2016-03-31 21:39:23.567126980 +0300
74 #define CI_HDRC_OVERRIDE_AHB_BURST BIT(9)
75 #define CI_HDRC_OVERRIDE_TX_BURST BIT(10)
76 #define CI_HDRC_OVERRIDE_RX_BURST BIT(11)
77 +#define CI_HDRC_DP_ALWAYS_PULLUP BIT(12)
78 enum usb_dr_mode dr_mode;
79 #define CI_HDRC_CONTROLLER_RESET_EVENT 0
80 #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1