• Haibo Chen's avatar
    i2c: imx: Add arbitration lost check · 639a26cf
    Haibo Chen authored
    According to the i.mx spec, for multimaster mode, if I2C is
    enabled when the bus is busy and asserts start, hardware inhibits
    the transmission, clears MSTA without signaling a stop, generate
    an interrupt, and set I2C_I2SR[IAL] to indicate a failed attempt
    to engage the bus, which means arbitration lost. In this case,
    we should first test I2C_I2SR[IAL], and clear this bit if it is
    set, and then I2C controller default to slave receive mode.
    
    This patch check the IAL bit every time before an I2c transmission.
    if IAL is set, clear it and make I2C controller to default mode.
    Signed-off-by: default avatarHaibo Chen <haibo.chen@freescale.com>
    Acked-by: default avatarFugang Duan <B38611@freescale.com>
    Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
    639a26cf
i2c-imx.c 22.8 KB