diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-05-13 20:19:22 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-05-13 20:19:22 -0400 |
commit | 8b6ee04067310a6397476f05f06e52dabd8b0bb6 (patch) | |
tree | 022a153b777a9e38f49d46e4fb8f1e6747d4a5f4 /drivers/i2c | |
parent | b48d441a8ab8a89bd32a3a981a05b8a26905dfc7 (diff) | |
parent | 7c0482e3d055e5de056d3c693b821e39205b99ae (diff) |
Merge branch 'merge' into next
We want the irq fixes from the "merge" branch.
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-eg20t.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-mxs.c | 8 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-pnx.c | 3 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-tegra.c | 8 |
4 files changed, 15 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c index f086131cb1c7..c811289b61e2 100644 --- a/drivers/i2c/busses/i2c-eg20t.c +++ b/drivers/i2c/busses/i2c-eg20t.c | |||
@@ -324,7 +324,7 @@ static s32 pch_i2c_wait_for_xfer_complete(struct i2c_algo_pch_data *adap) | |||
324 | { | 324 | { |
325 | long ret; | 325 | long ret; |
326 | ret = wait_event_timeout(pch_event, | 326 | ret = wait_event_timeout(pch_event, |
327 | (adap->pch_event_flag != 0), msecs_to_jiffies(50)); | 327 | (adap->pch_event_flag != 0), msecs_to_jiffies(1000)); |
328 | 328 | ||
329 | if (ret == 0) { | 329 | if (ret == 0) { |
330 | pch_err(adap, "timeout: %x\n", adap->pch_event_flag); | 330 | pch_err(adap, "timeout: %x\n", adap->pch_event_flag); |
@@ -1063,6 +1063,6 @@ module_exit(pch_pci_exit); | |||
1063 | 1063 | ||
1064 | MODULE_DESCRIPTION("Intel EG20T PCH/LAPIS Semico ML7213/ML7223/ML7831 IOH I2C"); | 1064 | MODULE_DESCRIPTION("Intel EG20T PCH/LAPIS Semico ML7213/ML7223/ML7831 IOH I2C"); |
1065 | MODULE_LICENSE("GPL"); | 1065 | MODULE_LICENSE("GPL"); |
1066 | MODULE_AUTHOR("Tomoya MORINAGA. <tomoya-linux@dsn.lapis-semi.com>"); | 1066 | MODULE_AUTHOR("Tomoya MORINAGA. <tomoya.rohm@gmail.com>"); |
1067 | module_param(pch_i2c_speed, int, (S_IRUSR | S_IWUSR)); | 1067 | module_param(pch_i2c_speed, int, (S_IRUSR | S_IWUSR)); |
1068 | module_param(pch_clk, int, (S_IRUSR | S_IWUSR)); | 1068 | module_param(pch_clk, int, (S_IRUSR | S_IWUSR)); |
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index 3d471d56bf15..76b8af44f634 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c | |||
@@ -227,6 +227,7 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, | |||
227 | return -EINVAL; | 227 | return -EINVAL; |
228 | 228 | ||
229 | init_completion(&i2c->cmd_complete); | 229 | init_completion(&i2c->cmd_complete); |
230 | i2c->cmd_err = 0; | ||
230 | 231 | ||
231 | flags = stop ? MXS_I2C_CTRL0_POST_SEND_STOP : 0; | 232 | flags = stop ? MXS_I2C_CTRL0_POST_SEND_STOP : 0; |
232 | 233 | ||
@@ -252,6 +253,9 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, | |||
252 | 253 | ||
253 | if (i2c->cmd_err == -ENXIO) | 254 | if (i2c->cmd_err == -ENXIO) |
254 | mxs_i2c_reset(i2c); | 255 | mxs_i2c_reset(i2c); |
256 | else | ||
257 | writel(MXS_I2C_QUEUECTRL_QUEUE_RUN, | ||
258 | i2c->regs + MXS_I2C_QUEUECTRL_CLR); | ||
255 | 259 | ||
256 | dev_dbg(i2c->dev, "Done with err=%d\n", i2c->cmd_err); | 260 | dev_dbg(i2c->dev, "Done with err=%d\n", i2c->cmd_err); |
257 | 261 | ||
@@ -299,8 +303,6 @@ static irqreturn_t mxs_i2c_isr(int this_irq, void *dev_id) | |||
299 | MXS_I2C_CTRL1_SLAVE_STOP_IRQ | MXS_I2C_CTRL1_SLAVE_IRQ)) | 303 | MXS_I2C_CTRL1_SLAVE_STOP_IRQ | MXS_I2C_CTRL1_SLAVE_IRQ)) |
300 | /* MXS_I2C_CTRL1_OVERSIZE_XFER_TERM_IRQ is only for slaves */ | 304 | /* MXS_I2C_CTRL1_OVERSIZE_XFER_TERM_IRQ is only for slaves */ |
301 | i2c->cmd_err = -EIO; | 305 | i2c->cmd_err = -EIO; |
302 | else | ||
303 | i2c->cmd_err = 0; | ||
304 | 306 | ||
305 | is_last_cmd = (readl(i2c->regs + MXS_I2C_QUEUESTAT) & | 307 | is_last_cmd = (readl(i2c->regs + MXS_I2C_QUEUESTAT) & |
306 | MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK) == 0; | 308 | MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK) == 0; |
@@ -384,8 +386,6 @@ static int __devexit mxs_i2c_remove(struct platform_device *pdev) | |||
384 | if (ret) | 386 | if (ret) |
385 | return -EBUSY; | 387 | return -EBUSY; |
386 | 388 | ||
387 | writel(MXS_I2C_QUEUECTRL_QUEUE_RUN, | ||
388 | i2c->regs + MXS_I2C_QUEUECTRL_CLR); | ||
389 | writel(MXS_I2C_CTRL0_SFTRST, i2c->regs + MXS_I2C_CTRL0_SET); | 389 | writel(MXS_I2C_CTRL0_SFTRST, i2c->regs + MXS_I2C_CTRL0_SET); |
390 | 390 | ||
391 | platform_set_drvdata(pdev, NULL); | 391 | platform_set_drvdata(pdev, NULL); |
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c index 04be9f82e14b..eb8ad538c79f 100644 --- a/drivers/i2c/busses/i2c-pnx.c +++ b/drivers/i2c/busses/i2c-pnx.c | |||
@@ -546,8 +546,7 @@ static int i2c_pnx_controller_suspend(struct platform_device *pdev, | |||
546 | { | 546 | { |
547 | struct i2c_pnx_algo_data *alg_data = platform_get_drvdata(pdev); | 547 | struct i2c_pnx_algo_data *alg_data = platform_get_drvdata(pdev); |
548 | 548 | ||
549 | /* FIXME: shouldn't this be clk_disable? */ | 549 | clk_disable(alg_data->clk); |
550 | clk_enable(alg_data->clk); | ||
551 | 550 | ||
552 | return 0; | 551 | return 0; |
553 | } | 552 | } |
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index e978635e60f0..55e5ea62ccee 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c | |||
@@ -516,6 +516,14 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, | |||
516 | if (likely(i2c_dev->msg_err == I2C_ERR_NONE)) | 516 | if (likely(i2c_dev->msg_err == I2C_ERR_NONE)) |
517 | return 0; | 517 | return 0; |
518 | 518 | ||
519 | /* | ||
520 | * NACK interrupt is generated before the I2C controller generates the | ||
521 | * STOP condition on the bus. So wait for 2 clock periods before resetting | ||
522 | * the controller so that STOP condition has been delivered properly. | ||
523 | */ | ||
524 | if (i2c_dev->msg_err == I2C_ERR_NO_ACK) | ||
525 | udelay(DIV_ROUND_UP(2 * 1000000, i2c_dev->bus_clk_rate)); | ||
526 | |||
519 | tegra_i2c_init(i2c_dev); | 527 | tegra_i2c_init(i2c_dev); |
520 | if (i2c_dev->msg_err == I2C_ERR_NO_ACK) { | 528 | if (i2c_dev->msg_err == I2C_ERR_NO_ACK) { |
521 | if (msg->flags & I2C_M_IGNORE_NAK) | 529 | if (msg->flags & I2C_M_IGNORE_NAK) |