From: Zhiwu Song Date: Tue, 13 Aug 2013 09:11:30 +0000 (+0800) Subject: i2c: sirf: support reverse direction of address X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5ebffa6b5e0c43edbdd41e5bc53137547a1378cb;p=linux-beck.git i2c: sirf: support reverse direction of address if users set I2C_M_REV_DIR_ADDR, revert the direction of address. Signed-off-by: Zhiwu Song Signed-off-by: Rongjun Ying Signed-off-by: Barry Song Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c index 3b5fd3854522..30ae3780b7bf 100644 --- a/drivers/i2c/busses/i2c-sirf.c +++ b/drivers/i2c/busses/i2c-sirf.c @@ -194,6 +194,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++)); }