diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-22 20:13:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-22 20:13:16 -0500 |
commit | 4a508dd259f5995b8d31c576b894263f5947d654 (patch) | |
tree | 8a08cb56d3b7781dd056f04e8a225af4e7e63220 /drivers | |
parent | c6ad121784b13760935b3374adcec2268ee31b99 (diff) | |
parent | a5a595cc36bbbe16f6a3f0e6968f94a0604bfd28 (diff) |
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 cb527ede1bf6ff2008a025606f25344b8ed7b4ac 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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 35 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-stu300.c | 2 |
2 files changed, 35 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index b605ff3a1fa0..829a2a1029f7 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -847,11 +847,15 @@ complete: | |||
847 | dev_err(dev->dev, "Arbitration lost\n"); | 847 | dev_err(dev->dev, "Arbitration lost\n"); |
848 | err |= OMAP_I2C_STAT_AL; | 848 | err |= OMAP_I2C_STAT_AL; |
849 | } | 849 | } |
850 | /* | ||
851 | * ProDB0017052: Clear ARDY bit twice | ||
852 | */ | ||
850 | if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | | 853 | if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | |
851 | OMAP_I2C_STAT_AL)) { | 854 | OMAP_I2C_STAT_AL)) { |
852 | omap_i2c_ack_stat(dev, stat & | 855 | omap_i2c_ack_stat(dev, stat & |
853 | (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR | | 856 | (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR | |
854 | OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR)); | 857 | OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR | |
858 | OMAP_I2C_STAT_ARDY)); | ||
855 | omap_i2c_complete_cmd(dev, err); | 859 | omap_i2c_complete_cmd(dev, err); |
856 | return IRQ_HANDLED; | 860 | return IRQ_HANDLED; |
857 | } | 861 | } |
@@ -1137,12 +1141,41 @@ omap_i2c_remove(struct platform_device *pdev) | |||
1137 | return 0; | 1141 | return 0; |
1138 | } | 1142 | } |
1139 | 1143 | ||
1144 | #ifdef CONFIG_SUSPEND | ||
1145 | static int omap_i2c_suspend(struct device *dev) | ||
1146 | { | ||
1147 | if (!pm_runtime_suspended(dev)) | ||
1148 | if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_suspend) | ||
1149 | dev->bus->pm->runtime_suspend(dev); | ||
1150 | |||
1151 | return 0; | ||
1152 | } | ||
1153 | |||
1154 | static int omap_i2c_resume(struct device *dev) | ||
1155 | { | ||
1156 | if (!pm_runtime_suspended(dev)) | ||
1157 | if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_resume) | ||
1158 | dev->bus->pm->runtime_resume(dev); | ||
1159 | |||
1160 | return 0; | ||
1161 | } | ||
1162 | |||
1163 | static struct dev_pm_ops omap_i2c_pm_ops = { | ||
1164 | .suspend = omap_i2c_suspend, | ||
1165 | .resume = omap_i2c_resume, | ||
1166 | }; | ||
1167 | #define OMAP_I2C_PM_OPS (&omap_i2c_pm_ops) | ||
1168 | #else | ||
1169 | #define OMAP_I2C_PM_OPS NULL | ||
1170 | #endif | ||
1171 | |||
1140 | static struct platform_driver omap_i2c_driver = { | 1172 | static struct platform_driver omap_i2c_driver = { |
1141 | .probe = omap_i2c_probe, | 1173 | .probe = omap_i2c_probe, |
1142 | .remove = omap_i2c_remove, | 1174 | .remove = omap_i2c_remove, |
1143 | .driver = { | 1175 | .driver = { |
1144 | .name = "omap_i2c", | 1176 | .name = "omap_i2c", |
1145 | .owner = THIS_MODULE, | 1177 | .owner = THIS_MODULE, |
1178 | .pm = OMAP_I2C_PM_OPS, | ||
1146 | }, | 1179 | }, |
1147 | }; | 1180 | }; |
1148 | 1181 | ||
diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c index 495be451d326..266135ddf7fa 100644 --- a/drivers/i2c/busses/i2c-stu300.c +++ b/drivers/i2c/busses/i2c-stu300.c | |||
@@ -942,7 +942,7 @@ stu300_probe(struct platform_device *pdev) | |||
942 | adap->owner = THIS_MODULE; | 942 | adap->owner = THIS_MODULE; |
943 | /* DDC class but actually often used for more generic I2C */ | 943 | /* DDC class but actually often used for more generic I2C */ |
944 | adap->class = I2C_CLASS_DDC; | 944 | adap->class = I2C_CLASS_DDC; |
945 | strncpy(adap->name, "ST Microelectronics DDC I2C adapter", | 945 | strlcpy(adap->name, "ST Microelectronics DDC I2C adapter", |
946 | sizeof(adap->name)); | 946 | sizeof(adap->name)); |
947 | adap->nr = bus_nr; | 947 | adap->nr = bus_nr; |
948 | adap->algo = &stu300_algo; | 948 | adap->algo = &stu300_algo; |