diff options
author | Alexander Shishkin <alexander.shishkin@linux.intel.com> | 2012-05-11 10:25:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-11 19:54:54 -0400 |
commit | 758fc9860c19eceb56e5886a5225db623c521971 (patch) | |
tree | 81ecd0a568d9b484b6149d65dfa8cbce279620fe /drivers/usb | |
parent | f7daaa2d6e84f7be1e302d7bcba4f5f11567eddb (diff) |
usb: chipidea: use common definition for USBMODE bits
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/chipidea/bits.h | 8 | ||||
-rw-r--r-- | drivers/usb/chipidea/core.c | 6 | ||||
-rw-r--r-- | drivers/usb/chipidea/udc.c | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h index 62c35af1a5af..44b3e254b6a5 100644 --- a/drivers/usb/chipidea/bits.h +++ b/drivers/usb/chipidea/bits.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef __DRIVERS_USB_CHIPIDEA_BITS_H | 13 | #ifndef __DRIVERS_USB_CHIPIDEA_BITS_H |
14 | #define __DRIVERS_USB_CHIPIDEA_BITS_H | 14 | #define __DRIVERS_USB_CHIPIDEA_BITS_H |
15 | 15 | ||
16 | #include <linux/usb/ehci_def.h> | ||
17 | |||
16 | /* HCCPARAMS */ | 18 | /* HCCPARAMS */ |
17 | #define HCCPARAMS_LEN BIT(17) | 19 | #define HCCPARAMS_LEN BIT(17) |
18 | 20 | ||
@@ -70,11 +72,9 @@ | |||
70 | 72 | ||
71 | /* USBMODE */ | 73 | /* USBMODE */ |
72 | #define USBMODE_CM (0x03UL << 0) | 74 | #define USBMODE_CM (0x03UL << 0) |
73 | #define USBMODE_CM_IDLE (0x00UL << 0) | 75 | #define USBMODE_CM_DC (0x02UL << 0) |
74 | #define USBMODE_CM_DEVICE (0x02UL << 0) | ||
75 | #define USBMODE_CM_HOST (0x03UL << 0) | ||
76 | #define USBMODE_SLOM BIT(3) | 76 | #define USBMODE_SLOM BIT(3) |
77 | #define USBMODE_SDIS BIT(4) | 77 | #define USBMODE_CI_SDIS BIT(4) |
78 | 78 | ||
79 | /* ENDPTCTRL */ | 79 | /* ENDPTCTRL */ |
80 | #define ENDPTCTRL_RXS BIT(0) | 80 | #define ENDPTCTRL_RXS BIT(0) |
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 52a1b45431d3..3d48c9be6923 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
@@ -231,15 +231,15 @@ int hw_device_reset(struct ci13xxx *ci) | |||
231 | CI13XXX_CONTROLLER_RESET_EVENT); | 231 | CI13XXX_CONTROLLER_RESET_EVENT); |
232 | 232 | ||
233 | if (ci->udc_driver->flags & CI13XXX_DISABLE_STREAMING) | 233 | if (ci->udc_driver->flags & CI13XXX_DISABLE_STREAMING) |
234 | hw_write(ci, OP_USBMODE, USBMODE_SDIS, USBMODE_SDIS); | 234 | hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); |
235 | 235 | ||
236 | /* USBMODE should be configured step by step */ | 236 | /* USBMODE should be configured step by step */ |
237 | hw_write(ci, OP_USBMODE, USBMODE_CM, USBMODE_CM_IDLE); | 237 | hw_write(ci, OP_USBMODE, USBMODE_CM, USBMODE_CM_IDLE); |
238 | hw_write(ci, OP_USBMODE, USBMODE_CM, USBMODE_CM_DEVICE); | 238 | hw_write(ci, OP_USBMODE, USBMODE_CM, USBMODE_CM_DC); |
239 | /* HW >= 2.3 */ | 239 | /* HW >= 2.3 */ |
240 | hw_write(ci, OP_USBMODE, USBMODE_SLOM, USBMODE_SLOM); | 240 | hw_write(ci, OP_USBMODE, USBMODE_SLOM, USBMODE_SLOM); |
241 | 241 | ||
242 | if (hw_read(ci, OP_USBMODE, USBMODE_CM) != USBMODE_CM_DEVICE) { | 242 | if (hw_read(ci, OP_USBMODE, USBMODE_CM) != USBMODE_CM_DC) { |
243 | pr_err("cannot enter in device mode"); | 243 | pr_err("cannot enter in device mode"); |
244 | pr_err("lpm = %i", ci->hw_bank.lpm); | 244 | pr_err("lpm = %i", ci->hw_bank.lpm); |
245 | return -ENODEV; | 245 | return -ENODEV; |
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index bdb034420fc6..290946d618d8 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
@@ -1606,7 +1606,7 @@ static irqreturn_t udc_irq(struct ci13xxx *udc) | |||
1606 | 1606 | ||
1607 | if (udc->udc_driver->flags & CI13XXX_REGS_SHARED) { | 1607 | if (udc->udc_driver->flags & CI13XXX_REGS_SHARED) { |
1608 | if (hw_read(udc, OP_USBMODE, USBMODE_CM) != | 1608 | if (hw_read(udc, OP_USBMODE, USBMODE_CM) != |
1609 | USBMODE_CM_DEVICE) { | 1609 | USBMODE_CM_DC) { |
1610 | spin_unlock(&udc->lock); | 1610 | spin_unlock(&udc->lock); |
1611 | return IRQ_NONE; | 1611 | return IRQ_NONE; |
1612 | } | 1612 | } |