diff options
-rw-r--r-- | drivers/usb/chipidea/core.c | 13 | ||||
-rw-r--r-- | include/linux/usb/chipidea.h | 5 |
2 files changed, 16 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index f620e3546eaf..7a2c217fb150 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
@@ -64,6 +64,7 @@ | |||
64 | #include <linux/of.h> | 64 | #include <linux/of.h> |
65 | #include <linux/phy.h> | 65 | #include <linux/phy.h> |
66 | #include <linux/regulator/consumer.h> | 66 | #include <linux/regulator/consumer.h> |
67 | #include <linux/usb/ehci_def.h> | ||
67 | 68 | ||
68 | #include "ci.h" | 69 | #include "ci.h" |
69 | #include "udc.h" | 70 | #include "udc.h" |
@@ -412,7 +413,17 @@ static int ci_usb_phy_init(struct ci_hdrc *ci) | |||
412 | */ | 413 | */ |
413 | void ci_platform_configure(struct ci_hdrc *ci) | 414 | void ci_platform_configure(struct ci_hdrc *ci) |
414 | { | 415 | { |
415 | if (ci->platdata->flags & CI_HDRC_DISABLE_STREAMING) | 416 | bool is_device_mode, is_host_mode; |
417 | |||
418 | is_device_mode = hw_read(ci, OP_USBMODE, USBMODE_CM) == USBMODE_CM_DC; | ||
419 | is_host_mode = hw_read(ci, OP_USBMODE, USBMODE_CM) == USBMODE_CM_HC; | ||
420 | |||
421 | if (is_device_mode && | ||
422 | (ci->platdata->flags & CI_HDRC_DISABLE_DEVICE_STREAMING)) | ||
423 | hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); | ||
424 | |||
425 | if (is_host_mode && | ||
426 | (ci->platdata->flags & CI_HDRC_DISABLE_HOST_STREAMING)) | ||
416 | hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); | 427 | hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); |
417 | 428 | ||
418 | if (ci->platdata->flags & CI_HDRC_FORCE_FULLSPEED) { | 429 | if (ci->platdata->flags & CI_HDRC_FORCE_FULLSPEED) { |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index 1c5d7763990a..4d34a8612e85 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
@@ -19,8 +19,11 @@ struct ci_hdrc_platform_data { | |||
19 | enum usb_phy_interface phy_mode; | 19 | enum usb_phy_interface phy_mode; |
20 | unsigned long flags; | 20 | unsigned long flags; |
21 | #define CI_HDRC_REGS_SHARED BIT(0) | 21 | #define CI_HDRC_REGS_SHARED BIT(0) |
22 | #define CI_HDRC_DISABLE_DEVICE_STREAMING BIT(1) | ||
22 | #define CI_HDRC_SUPPORTS_RUNTIME_PM BIT(2) | 23 | #define CI_HDRC_SUPPORTS_RUNTIME_PM BIT(2) |
23 | #define CI_HDRC_DISABLE_STREAMING BIT(3) | 24 | #define CI_HDRC_DISABLE_HOST_STREAMING BIT(3) |
25 | #define CI_HDRC_DISABLE_STREAMING (CI_HDRC_DISABLE_DEVICE_STREAMING | \ | ||
26 | CI_HDRC_DISABLE_HOST_STREAMING) | ||
24 | /* | 27 | /* |
25 | * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1, | 28 | * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1, |
26 | * but otg is not supported (no register otgsc). | 29 | * but otg is not supported (no register otgsc). |