diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2018-07-17 10:03:42 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2018-07-17 10:03:42 +0200 |
commit | 08948b75939f72bd013699963cc7187f25197653 (patch) | |
tree | 5fea43325a7cc2d94620ebeacab31c9c505af281 /drivers/i2c/busses/i2c-tegra.c | |
parent | fb2896a77989314ea89d89c3bdfee93002a760c9 (diff) | |
parent | 9d3cce1e8b8561fed5f383d22a4d6949db4eadbe (diff) | |
download | linux-stable-08948b75939f72bd013699963cc7187f25197653.tar.gz linux-stable-08948b75939f72bd013699963cc7187f25197653.tar.bz2 linux-stable-08948b75939f72bd013699963cc7187f25197653.zip |
Merge tag 'v4.18-rc5' into i2c/for-4.19
Linux 4.18-rc5
Diffstat (limited to 'drivers/i2c/busses/i2c-tegra.c')
-rw-r--r-- | drivers/i2c/busses/i2c-tegra.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index edde464dfb72..60c8561fbe65 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -588,6 +588,14 @@ static int tegra_i2c_disable_packet_mode(struct tegra_i2c_dev *i2c_dev) { u32 cnfg; + /* + * NACK interrupt is generated before the I2C controller generates + * the STOP condition on the bus. So wait for 2 clock periods + * before disabling the controller so that the STOP condition has + * been delivered properly. + */ + udelay(DIV_ROUND_UP(2 * 1000000, i2c_dev->bus_clk_rate)); + cnfg = i2c_readl(i2c_dev, I2C_CNFG); if (cnfg & I2C_CNFG_PACKET_MODE_EN) i2c_writel(i2c_dev, cnfg & ~I2C_CNFG_PACKET_MODE_EN, I2C_CNFG); @@ -749,15 +757,6 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, if (likely(i2c_dev->msg_err == I2C_ERR_NONE)) return 0; - /* - * NACK interrupt is generated before the I2C controller generates - * the STOP condition on the bus. So wait for 2 clock periods - * before resetting the controller so that the STOP condition has - * been delivered properly. - */ - if (i2c_dev->msg_err == I2C_ERR_NO_ACK) - udelay(DIV_ROUND_UP(2 * 1000000, i2c_dev->bus_clk_rate)); - tegra_i2c_init(i2c_dev); if (i2c_dev->msg_err == I2C_ERR_NO_ACK) { if (msg->flags & I2C_M_IGNORE_NAK) |