From: Zhiwu Song <Zhiwu.Song@xxxxxxx> if users set I2C_M_REV_DIR_ADDR, revert the direction of address. Signed-off-by: Zhiwu Song <Zhiwu.Song@xxxxxxx> Signed-off-by: Rongjun Ying <rongjun.ying@xxxxxxx> Signed-off-by: Barry Song <Baohua.Song@xxxxxxx> --- drivers/i2c/busses/i2c-sirf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c index 746388f..d2b7913 100644 --- a/drivers/i2c/busses/i2c-sirf.c +++ b/drivers/i2c/busses/i2c-sirf.c @@ -195,6 +195,10 @@ static void i2c_sirfsoc_set_address(struct sirfsoc_i2c *siic, if (msg->flags & I2C_M_RD) addr |= 1; + /* Reverse direction bit */ + if (msg->flags & I2C_M_REV_DIR_ADDR) + addr ^= 1; + writel(addr, siic->base + SIRFSOC_I2C_CMD(siic->cmd_ptr++)); } -- 1.8.2.3 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html