Commit 4a508dd2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-2639-rc4/i2c-fixes' of git://git.fluff.org/bjdooks/linux

* 'for-2639-rc4/i2c-fixes' of git://git.fluff.org/bjdooks/linux:
  i2c-omap: fixup commit cb527ede whitespace
  i2c-omap: Double clear of ARDY status in IRQ handler
  i2c-omap: fix build for !CONFIG_SUSPEND
  i2c-omap: fix static suspend vs. runtime suspend
  i2c-stu300: make sure adapter-name is terminated
parents c6ad1217 a5a595cc
...@@ -847,11 +847,15 @@ omap_i2c_isr(int this_irq, void *dev_id) ...@@ -847,11 +847,15 @@ omap_i2c_isr(int this_irq, void *dev_id)
dev_err(dev->dev, "Arbitration lost\n"); dev_err(dev->dev, "Arbitration lost\n");
err |= OMAP_I2C_STAT_AL; err |= OMAP_I2C_STAT_AL;
} }
/*
* ProDB0017052: Clear ARDY bit twice
*/
if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |
OMAP_I2C_STAT_AL)) { OMAP_I2C_STAT_AL)) {
omap_i2c_ack_stat(dev, stat & omap_i2c_ack_stat(dev, stat &
(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR | (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR)); OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR |
OMAP_I2C_STAT_ARDY));
omap_i2c_complete_cmd(dev, err); omap_i2c_complete_cmd(dev, err);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -1137,12 +1141,41 @@ omap_i2c_remove(struct platform_device *pdev) ...@@ -1137,12 +1141,41 @@ omap_i2c_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_SUSPEND
static int omap_i2c_suspend(struct device *dev)
{
if (!pm_runtime_suspended(dev))
if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_suspend)
dev->bus->pm->runtime_suspend(dev);
return 0;
}
static int omap_i2c_resume(struct device *dev)
{
if (!pm_runtime_suspended(dev))
if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_resume)
dev->bus->pm->runtime_resume(dev);
return 0;
}
static struct dev_pm_ops omap_i2c_pm_ops = {
.suspend = omap_i2c_suspend,
.resume = omap_i2c_resume,
};
#define OMAP_I2C_PM_OPS (&omap_i2c_pm_ops)
#else
#define OMAP_I2C_PM_OPS NULL
#endif
static struct platform_driver omap_i2c_driver = { static struct platform_driver omap_i2c_driver = {
.probe = omap_i2c_probe, .probe = omap_i2c_probe,
.remove = omap_i2c_remove, .remove = omap_i2c_remove,
.driver = { .driver = {
.name = "omap_i2c", .name = "omap_i2c",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = OMAP_I2C_PM_OPS,
}, },
}; };
......
...@@ -942,7 +942,7 @@ stu300_probe(struct platform_device *pdev) ...@@ -942,7 +942,7 @@ stu300_probe(struct platform_device *pdev)
adap->owner = THIS_MODULE; adap->owner = THIS_MODULE;
/* DDC class but actually often used for more generic I2C */ /* DDC class but actually often used for more generic I2C */
adap->class = I2C_CLASS_DDC; adap->class = I2C_CLASS_DDC;
strncpy(adap->name, "ST Microelectronics DDC I2C adapter", strlcpy(adap->name, "ST Microelectronics DDC I2C adapter",
sizeof(adap->name)); sizeof(adap->name));
adap->nr = bus_nr; adap->nr = bus_nr;
adap->algo = &stu300_algo; adap->algo = &stu300_algo;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment