usb: chipidea: use common definition for USBMODE bits
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Fri, 11 May 2012 14:25:53 +0000 (17:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 May 2012 23:54:54 +0000 (16:54 -0700)
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@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/bits.h
drivers/usb/chipidea/core.c
drivers/usb/chipidea/udc.c

index 62c35af1a5afafb5d21601f22bf8d2f6a307d9db..44b3e254b6a56ee3690060c18fb12b226d677901 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef __DRIVERS_USB_CHIPIDEA_BITS_H
 #define __DRIVERS_USB_CHIPIDEA_BITS_H
 
+#include <linux/usb/ehci_def.h>
+
 /* HCCPARAMS */
 #define HCCPARAMS_LEN         BIT(17)
 
 
 /* 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)
index 52a1b45431d3c0a9c284c2d8f6ec2ecd0563eab8..3d48c9be6923dc52a413168ced1db747681e17c4 100644 (file)
@@ -231,15 +231,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;
index bdb034420fc601682744603344bf5e146ebc414a..290946d618d834c5fdc4314af16a6a7c21efbf2c 100644 (file)
@@ -1606,7 +1606,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;
                }
This page took 0.030303 seconds and 5 git commands to generate.