• Sonic Zhang's avatar
    i2c:i2c-bfin-twi: TWI fails to restart next transfer in high system load. · 28a377c7
    Sonic Zhang authored
    Current driver was developed based on BF537 0.2 HRM. In high system load, BUFRDERR error
    interrupt may be raised if XMTSERV interrupt of last TX byte is not served in time
    (set RSTART bit), which breaks restart tranfer as expected.
    
    "Buffer Read Error (BUFRDERR)" description in Blackfin HRM only applys to BF537
    rev. < 0.3. In later rev. and later announced Blackfin chips, such as BF527 and
    BF548, a new TWI master feature "Clock Stretching" is added into the TWI controller,
    BUFRDERR interrupt is not triggered after TX FIFO is empty.
    
    This patch sets RSTART bit at the beginning of the first transfer. The SCL and SDA
    is hold till XMTSERV interrupt of last TX byte is served. Restart transfer is not broken
    in high system load.
    Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
    
    [wsa: fixed spaces around operators]
    Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
    28a377c7
i2c-bfin-twi.c 20.3 KB