2017-01-21 17:30:10 +00:00
|
|
|
--- a/drivers/usb/chipidea/ci.h
|
|
|
|
+++ b/drivers/usb/chipidea/ci.h
|
|
|
|
@@ -199,6 +199,7 @@ struct hw_bank {
|
2016-12-30 15:06:43 +00:00
|
|
|
* @in_lpm: if the core in low power mode
|
|
|
|
* @wakeup_int: if wakeup interrupt occur
|
|
|
|
* @rev: The revision number for controller
|
|
|
|
+ * @dp_always_pullup: keep dp always pullup at device mode
|
|
|
|
*/
|
|
|
|
struct ci_hdrc {
|
|
|
|
struct device *dev;
|
2017-01-21 17:30:10 +00:00
|
|
|
@@ -248,6 +249,7 @@ struct ci_hdrc {
|
2016-12-30 15:06:43 +00:00
|
|
|
bool in_lpm;
|
|
|
|
bool wakeup_int;
|
|
|
|
enum ci_revision rev;
|
|
|
|
+ bool dp_always_pullup;
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline struct ci_role_driver *ci_role(struct ci_hdrc *ci)
|
2017-01-21 17:30:10 +00:00
|
|
|
--- a/drivers/usb/chipidea/core.c
|
|
|
|
+++ b/drivers/usb/chipidea/core.c
|
2017-05-15 14:03:47 +00:00
|
|
|
@@ -851,7 +851,7 @@ static inline void ci_role_destroy(struc
|
2016-12-30 15:06:43 +00:00
|
|
|
{
|
|
|
|
ci_hdrc_gadget_destroy(ci);
|
|
|
|
ci_hdrc_host_destroy(ci);
|
|
|
|
- if (ci->is_otg)
|
|
|
|
+ if (!ci->dp_always_pullup && ci->roles[CI_ROLE_GADGET])
|
|
|
|
ci_hdrc_otg_destroy(ci);
|
|
|
|
}
|
|
|
|
|
2017-05-15 14:03:47 +00:00
|
|
|
@@ -902,6 +902,9 @@ static int ci_hdrc_probe(struct platform
|
2016-12-30 15:06:43 +00:00
|
|
|
ci->supports_runtime_pm = !!(ci->platdata->flags &
|
|
|
|
CI_HDRC_SUPPORTS_RUNTIME_PM);
|
|
|
|
|
|
|
|
+ ci->dp_always_pullup = !!(ci->platdata->flags &
|
|
|
|
+ CI_HDRC_DP_ALWAYS_PULLUP);
|
|
|
|
+
|
|
|
|
ret = hw_device_init(ci, base);
|
|
|
|
if (ret < 0) {
|
|
|
|
dev_err(dev, "can't initialize hardware\n");
|
2017-05-15 14:03:47 +00:00
|
|
|
@@ -967,7 +970,7 @@ static int ci_hdrc_probe(struct platform
|
2016-12-30 15:06:43 +00:00
|
|
|
goto deinit_phy;
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (ci->is_otg && ci->roles[CI_ROLE_GADGET]) {
|
|
|
|
+ if (!ci->dp_always_pullup && ci->roles[CI_ROLE_GADGET]) {
|
|
|
|
ret = ci_hdrc_otg_init(ci);
|
|
|
|
if (ret) {
|
|
|
|
dev_err(dev, "init otg fails, ret = %d\n", ret);
|
2017-01-21 17:30:10 +00:00
|
|
|
--- a/drivers/usb/chipidea/otg.c
|
|
|
|
+++ b/drivers/usb/chipidea/otg.c
|
2017-05-15 14:03:47 +00:00
|
|
|
@@ -131,8 +131,10 @@ enum ci_role ci_otg_role(struct ci_hdrc
|
2016-12-30 15:06:43 +00:00
|
|
|
|
|
|
|
void ci_handle_vbus_change(struct ci_hdrc *ci)
|
|
|
|
{
|
|
|
|
- if (!ci->is_otg)
|
|
|
|
+ if (ci->dp_always_pullup) {
|
|
|
|
+ usb_gadget_vbus_connect(&ci->gadget);
|
|
|
|
return;
|
|
|
|
+ }
|
|
|
|
|
2017-10-08 11:41:52 +00:00
|
|
|
if (hw_read_otgsc(ci, OTGSC_BSV) && !ci->vbus_active)
|
2016-12-30 15:06:43 +00:00
|
|
|
usb_gadget_vbus_connect(&ci->gadget);
|
2017-01-21 17:30:10 +00:00
|
|
|
--- a/include/linux/usb/chipidea.h
|
|
|
|
+++ b/include/linux/usb/chipidea.h
|
2017-05-15 14:03:47 +00:00
|
|
|
@@ -57,6 +57,7 @@ struct ci_hdrc_platform_data {
|
2016-12-30 15:06:43 +00:00
|
|
|
#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_DP_ALWAYS_PULLUP BIT(12)
|
|
|
|
enum usb_dr_mode dr_mode;
|
|
|
|
#define CI_HDRC_CONTROLLER_RESET_EVENT 0
|
|
|
|
#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
|