diff options
author | Peter Chen <peter.chen@freescale.com> | 2013-08-14 05:44:09 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-14 15:37:19 -0400 |
commit | c344b518008ada3170349d1c06e8a30224400b29 (patch) | |
tree | 2f1f2c865f8ca6bf43e61ffadb5f7a83cacc480e /drivers/usb/chipidea | |
parent | 577b232fc9caba1b6f7a3bb9901c00b10e0ca1ba (diff) |
usb: chipidea: disable all interrupts and clear all interrupts status
During the initialization, it needs to disable all interrupts
enable bit as well as clear all interrupts status bits to avoid
exceptional interrupt.
Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea')
-rw-r--r-- | drivers/usb/chipidea/core.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index ab01e18bc2f8..e9cfd3193d65 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
@@ -199,6 +199,12 @@ static int hw_device_init(struct ci_hdrc *ci, void __iomem *base) | |||
199 | if (ci->hw_ep_max > ENDPT_MAX) | 199 | if (ci->hw_ep_max > ENDPT_MAX) |
200 | return -ENODEV; | 200 | return -ENODEV; |
201 | 201 | ||
202 | /* Disable all interrupts bits */ | ||
203 | hw_write(ci, OP_USBINTR, 0xffffffff, 0); | ||
204 | |||
205 | /* Clear all interrupts status bits*/ | ||
206 | hw_write(ci, OP_USBSTS, 0xffffffff, 0xffffffff); | ||
207 | |||
202 | dev_dbg(ci->dev, "ChipIdea HDRC found, lpm: %d; cap: %p op: %p\n", | 208 | dev_dbg(ci->dev, "ChipIdea HDRC found, lpm: %d; cap: %p op: %p\n", |
203 | ci->hw_bank.lpm, ci->hw_bank.cap, ci->hw_bank.op); | 209 | ci->hw_bank.lpm, ci->hw_bank.cap, ci->hw_bank.op); |
204 | 210 | ||
@@ -434,8 +440,11 @@ static void ci_get_otg_capable(struct ci_hdrc *ci) | |||
434 | ci->is_otg = (hw_read(ci, CAP_DCCPARAMS, | 440 | ci->is_otg = (hw_read(ci, CAP_DCCPARAMS, |
435 | DCCPARAMS_DC | DCCPARAMS_HC) | 441 | DCCPARAMS_DC | DCCPARAMS_HC) |
436 | == (DCCPARAMS_DC | DCCPARAMS_HC)); | 442 | == (DCCPARAMS_DC | DCCPARAMS_HC)); |
437 | if (ci->is_otg) | 443 | if (ci->is_otg) { |
438 | dev_dbg(ci->dev, "It is OTG capable controller\n"); | 444 | dev_dbg(ci->dev, "It is OTG capable controller\n"); |
445 | ci_disable_otg_interrupt(ci, OTGSC_INT_EN_BITS); | ||
446 | ci_clear_otg_interrupt(ci, OTGSC_INT_STATUS_BITS); | ||
447 | } | ||
439 | } | 448 | } |
440 | 449 | ||
441 | static int ci_hdrc_probe(struct platform_device *pdev) | 450 | static int ci_hdrc_probe(struct platform_device *pdev) |