[PATCH v7 13/19] usb: chipidea: use common definition for USBMODE bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some of the bits of USBMODE register are defined in <usb/ehci_def.h>,
use them instead of having our own definitions.

Signed-off-by: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
---
 drivers/usb/chipidea/ci.h   |    7 +++----
 drivers/usb/chipidea/core.c |    6 +++---
 drivers/usb/chipidea/udc.c  |    2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
index e835e46..034cf51 100644
--- a/drivers/usb/chipidea/ci.h
+++ b/drivers/usb/chipidea/ci.h
@@ -17,6 +17,7 @@
 #define __DRIVERS_USB_CHIPIDEA_CI_H
 
 #include <linux/list.h>
+#include <linux/usb/ehci_def.h>
 #include <linux/usb/gadget.h>
 
 /******************************************************************************
@@ -287,11 +288,9 @@ enum ci13xxx_regs {
 
 /* USBMODE */
 #define USBMODE_CM            (0x03UL <<  0)
-#define    USBMODE_CM_IDLE    (0x00UL <<  0)
-#define    USBMODE_CM_DEVICE  (0x02UL <<  0)
-#define    USBMODE_CM_HOST    (0x03UL <<  0)
+#define    USBMODE_CM_DC      (0x02UL <<  0)
 #define USBMODE_SLOM          BIT(3)
-#define USBMODE_SDIS          BIT(4)
+#define USBMODE_CI_SDIS       BIT(4)
 
 /* ENDPTCTRL */
 #define ENDPTCTRL_RXS         BIT(0)
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index e163a25..7a61a28 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -203,15 +203,15 @@ int hw_device_reset(struct ci13xxx *ci)
 			CI13XXX_CONTROLLER_RESET_EVENT);
 
 	if (ci->udc_driver->flags & CI13XXX_DISABLE_STREAMING)
-		hw_write(ci, OP_USBMODE, USBMODE_SDIS, USBMODE_SDIS);
+		hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS);
 
 	/* USBMODE should be configured step by step */
 	hw_write(ci, OP_USBMODE, USBMODE_CM, USBMODE_CM_IDLE);
-	hw_write(ci, OP_USBMODE, USBMODE_CM, USBMODE_CM_DEVICE);
+	hw_write(ci, OP_USBMODE, USBMODE_CM, USBMODE_CM_DC);
 	/* HW >= 2.3 */
 	hw_write(ci, OP_USBMODE, USBMODE_SLOM, USBMODE_SLOM);
 
-	if (hw_read(ci, OP_USBMODE, USBMODE_CM) != USBMODE_CM_DEVICE) {
+	if (hw_read(ci, OP_USBMODE, USBMODE_CM) != USBMODE_CM_DC) {
 		pr_err("cannot enter in device mode");
 		pr_err("lpm = %i", ci->hw_bank.lpm);
 		return -ENODEV;
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 274e79d..705f1d5 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1673,7 +1673,7 @@ static irqreturn_t udc_irq(struct ci13xxx *udc)
 
 	if (udc->udc_driver->flags & CI13XXX_REGS_SHARED) {
 		if (hw_read(udc, OP_USBMODE, USBMODE_CM) !=
-				USBMODE_CM_DEVICE) {
+				USBMODE_CM_DC) {
 			spin_unlock(&udc->lock);
 			return IRQ_NONE;
 		}
-- 
1.7.10

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux