From: Erik Gilling Date: Mon, 25 Apr 2011 21:32:26 +0000 (-0600) Subject: i2c: tegra: fix repeated start handling X-Git-Tag: firefly_0821_release~7613^2~1295^2^3~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2078cf3b2230cc2ee456e67d28dd9a869097e1ff;p=firefly-linux-kernel-4.4.55.git i2c: tegra: fix repeated start handling A repeated start should be used for all but the last msg in an xfer. The NOSTART flag is for skipping the START frame (addr/rw) Signed-off-by: Erik Gilling Signed-off-by: Stephen Warren Signed-off-by: Ben Dooks --- diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index c0b9aa7df0e2..6b69b7007f00 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -451,12 +451,12 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, packet_header = msg->addr << I2C_HEADER_SLAVE_ADDR_SHIFT; packet_header |= I2C_HEADER_IE_ENABLE; + if (!stop) + packet_header |= I2C_HEADER_REPEAT_START; if (msg->flags & I2C_M_TEN) packet_header |= I2C_HEADER_10BIT_ADDR; if (msg->flags & I2C_M_IGNORE_NAK) packet_header |= I2C_HEADER_CONT_ON_NAK; - if (msg->flags & I2C_M_NOSTART) - packet_header |= I2C_HEADER_REPEAT_START; if (msg->flags & I2C_M_RD) packet_header |= I2C_HEADER_READ; i2c_writel(i2c_dev, packet_header, I2C_TX_FIFO);