summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorZhiwu Song <Zhiwu.Song@csr.com>2013-08-13 17:11:30 +0800
committerWolfram Sang <wsa@the-dreams.de>2013-08-28 11:45:59 +0200
commit5ebffa6b5e0c43edbdd41e5bc53137547a1378cb (patch)
tree871b6afb80e48afc1d8e525e3d61b7023dbe4bdd /drivers/i2c
parent4602bf1642dbf8b573fc6c224850114565652b4d (diff)
downloadop-kernel-dev-5ebffa6b5e0c43edbdd41e5bc53137547a1378cb.zip
op-kernel-dev-5ebffa6b5e0c43edbdd41e5bc53137547a1378cb.tar.gz
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 <Zhiwu.Song@csr.com> Signed-off-by: Rongjun Ying <rongjun.ying@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-sirf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 3b5fd38..30ae378 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++));
}
OpenPOWER on IntegriCloud