Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ebffa6b authored by Zhiwu Song's avatar Zhiwu Song Committed by Wolfram Sang
Browse files

i2c: sirf: support reverse direction of address



if users set I2C_M_REV_DIR_ADDR, revert the direction of address.

Signed-off-by: default avatarZhiwu Song <Zhiwu.Song@csr.com>
Signed-off-by: default avatarRongjun Ying <rongjun.ying@csr.com>
Signed-off-by: default avatarBarry Song <Baohua.Song@csr.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 4602bf16
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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++));
}