Skip to content

Commit

Permalink
usb: chipidea: need to mask INT_STATUS when write otgsc
Browse files Browse the repository at this point in the history
For otgsc, both enable bits and status bits are in it. So we need
to make sure the status bits are not be cleared when write enable
bits. It can fix one bug that we plug in/out Micro AB cable fast,
and sometimes, the IDIS will be cleared wrongly when handle last
ID interrupt (ID 0->1), so the current interrupt will not occur.

For stable tree: 3.12+

Cc: stable@vger.kernel.org
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Chen authored and Greg Kroah-Hartman committed Jan 13, 2014
1 parent cd0b42c commit 5332ff1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/usb/chipidea/otg.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Freescale Semiconductor, Inc.
* Copyright (C) 2013-2014 Freescale Semiconductor, Inc.
*
* Author: Peter Chen
*
Expand All @@ -19,12 +19,12 @@ static inline void ci_clear_otg_interrupt(struct ci_hdrc *ci, u32 bits)

static inline void ci_enable_otg_interrupt(struct ci_hdrc *ci, u32 bits)
{
hw_write(ci, OP_OTGSC, bits, bits);
hw_write(ci, OP_OTGSC, bits | OTGSC_INT_STATUS_BITS, bits);
}

static inline void ci_disable_otg_interrupt(struct ci_hdrc *ci, u32 bits)
{
hw_write(ci, OP_OTGSC, bits, 0);
hw_write(ci, OP_OTGSC, bits | OTGSC_INT_STATUS_BITS, 0);
}

int ci_hdrc_otg_init(struct ci_hdrc *ci);
Expand Down

0 comments on commit 5332ff1

Please sign in to comment.