Message ID | 1376385091-30597-5-git-send-email-Baohua.Song@csr.com |
---|---|
State | Accepted |
Headers | show |
On Tue, Aug 13, 2013 at 05:11:30PM +0800, Barry Song wrote: > From: Zhiwu Song <Zhiwu.Song@csr.com> > > 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> Hmm, you are not advertising I2C_FUNC_PROTOCOL_MANGLING so users should not use it. Does the master allow to implement the rest of mangling, too?
2013/8/20 Wolfram Sang <wsa@the-dreams.de>: > On Tue, Aug 13, 2013 at 05:11:30PM +0800, Barry Song wrote: >> From: Zhiwu Song <Zhiwu.Song@csr.com> >> >> 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> > > Hmm, you are not advertising I2C_FUNC_PROTOCOL_MANGLING so users should > not use it. Wolfram, good comments. the old codes did miss I2C_FUNC_PROTOCOL_MANGLING which i will fix in v2. > Does the master allow to implement the rest of mangling, > too? > i think only I2C_M_REV_DIR_ADDR. i didn't hear I2C_M_NOSTART, I2C_M_IGNORE_NAK from hardware guys. -barry -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Hmm, you are not advertising I2C_FUNC_PROTOCOL_MANGLING so users should > > not use it. > > Wolfram, good comments. the old codes did miss > I2C_FUNC_PROTOCOL_MANGLING which i will fix in v2. > > > Does the master allow to implement the rest of mangling, > > too? > > > > i think only I2C_M_REV_DIR_ADDR. i didn't hear I2C_M_NOSTART, > I2C_M_IGNORE_NAK from hardware guys. Hmm, since the driver can't support all of MANGLING, it might be wise to not advertise it. I am undecided how to handle this generally. Until then, I'll accept this patch (and the series) as is.
2013/8/28 Wolfram Sang <wsa@the-dreams.de>: > >> > Hmm, you are not advertising I2C_FUNC_PROTOCOL_MANGLING so users should >> > not use it. >> >> Wolfram, good comments. the old codes did miss >> I2C_FUNC_PROTOCOL_MANGLING which i will fix in v2. >> >> > Does the master allow to implement the rest of mangling, >> > too? >> > >> >> i think only I2C_M_REV_DIR_ADDR. i didn't hear I2C_M_NOSTART, >> I2C_M_IGNORE_NAK from hardware guys. > > Hmm, since the driver can't support all of MANGLING, it might be wise to > not advertise it. I am undecided how to handle this generally. Until > then, I'll accept this patch (and the series) as is. ok, thanks Wolfram. then i will not have v2. > -barry -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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++)); }