Skip to content

Commit

Permalink
i2c: sirf: support reverse direction of address
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zhiwu Song authored and Wolfram Sang committed Aug 28, 2013
1 parent 4602bf1 commit 5ebffa6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/i2c/busses/i2c-sirf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++));
}

Expand Down

0 comments on commit 5ebffa6

Please sign in to comment.