summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc2/core.h
diff options
context:
space:
mode:
authorVardan Mikayelyan <mvardan@synopsys.com>2016-11-15 06:16:58 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-11-18 14:54:49 +0300
commit1e6b98ebd458e63b9effda2feb696e36644d4eed (patch)
treea5c88400355805ce971fac4d03b1d9c82472407e /drivers/usb/dwc2/core.h
parent79c3b5bb8955b9353e56008000fede01932bada8 (diff)
downloadlinux-1e6b98ebd458e63b9effda2feb696e36644d4eed.tar.xz
usb: dwc2: gadget: Add IOT device IDs, configure core accordingly
Add new device IDs for IOT gadget. Done changes in probe to configure core accordingly depending on device ID value. Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc2/core.h')
-rw-r--r--drivers/usb/dwc2/core.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 5fa05a3ec318..067e24b7b4d6 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -950,6 +950,8 @@ struct dwc2_hsotg {
#define DWC2_CORE_REV_2_94a 0x4f54294a
#define DWC2_CORE_REV_3_00a 0x4f54300a
#define DWC2_CORE_REV_3_10a 0x4f54310a
+#define DWC2_FS_IOT_REV_1_00a 0x5531100a
+#define DWC2_HS_IOT_REV_1_00a 0x5532100a
#if IS_ENABLED(CONFIG_USB_DWC2_HOST) || IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
union dwc2_hcd_internal_flags {
@@ -1078,6 +1080,22 @@ enum dwc2_halt_status {
DWC2_HC_XFER_URB_DEQUEUE,
};
+/* Core version information */
+static inline bool dwc2_is_iot(struct dwc2_hsotg *hsotg)
+{
+ return (hsotg->hw_params.snpsid & 0xfff00000) == 0x55300000;
+}
+
+static inline bool dwc2_is_fs_iot(struct dwc2_hsotg *hsotg)
+{
+ return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55310000;
+}
+
+static inline bool dwc2_is_hs_iot(struct dwc2_hsotg *hsotg)
+{
+ return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55320000;
+}
+
/*
* The following functions support initialization of the core driver component
* and the DWC_otg controller