lkml.org 
[lkml]   [2013]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 25/75] i2c: designware: always clear interrupts before enabling them
    Date
    3.8.13.2 -stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Mika Westerberg <mika.westerberg@linux.intel.com>

    commit 2a2d95e9d6d29e726cc294b65391917ed2e32bf4 upstream.

    If the I2C bus is put to a low power state by an ACPI method it might pull
    the SDA line low (as its power is removed). Once the bus is put to full
    power state again, the SDA line is pulled back to high. This transition
    looks like a STOP condition from the controller point-of-view which sets
    STOP detected bit in its status register causing the driver to fail
    subsequent transfers.

    Fix this by always clearing all interrupts before we start a transfer.

    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
    [ kamal: backport to 3.8 ]
    Signed-off-by: Kamal Mostafa <kamal@canonical.com>
    ---
    drivers/i2c/busses/i2c-designware-core.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
    index 9a6aad8..bf8ce32 100644
    --- a/drivers/i2c/busses/i2c-designware-core.c
    +++ b/drivers/i2c/busses/i2c-designware-core.c
    @@ -361,7 +361,8 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
    /* Enable the adapter */
    dw_writel(dev, 1, DW_IC_ENABLE);

    - /* Enable interrupts */
    + /* Clear and enable interrupts */
    + i2c_dw_clear_int(dev);
    dw_writel(dev, DW_IC_INTR_DEFAULT_MASK, DW_IC_INTR_MASK);
    }

    --
    1.8.1.2


    \
     
     \ /
      Last update: 2013-06-04 20:21    [W:5.025 / U:0.324 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site