aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authormokopatches <mokopatches@openmoko.org>2008-11-19 17:03:14 +0000
committerwarmcat <andy@warmcat.com>2008-11-19 17:03:14 +0000
commit3622d39f2cb0a85ef890cc02c5d11a0c0a00978f (patch)
tree9e02bdb1f2c49812792200f872c311b5d67e4660 /drivers
parent3cc35ccda59077ca36958940084878e20b90aa13 (diff)
pcf50633-suspend-hacks.patch
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/chips/pcf50633.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
index 54880849000..0cf5e53a551 100644
--- a/drivers/i2c/chips/pcf50633.c
+++ b/drivers/i2c/chips/pcf50633.c
@@ -567,8 +567,26 @@ static void pcf50633_work(struct work_struct *work)
*/
ret = i2c_smbus_read_i2c_block_data(&pcf->client, PCF50633_REG_INT1, 5,
pcfirq);
- if (ret != 5)
- DEBUGP("Oh crap PMU IRQ register read failed %d\n", ret);
+ if (ret != 5) {
+ DEBUGP("Oh crap PMU IRQ register read failed -- "
+ "retrying later %d\n", ret);
+ /*
+ * this situation can happen during resume, just defer
+ * handling the interrupt until enough I2C is up we can
+ * actually talk to the PMU. We can't just ignore this
+ * because we are on a falling edge interrupt and our
+ * PMU interrupt source does not clear until we read these
+ * interrupt source registers.
+ */
+ if (!schedule_work(&pcf->work) && !pcf->working)
+ dev_dbg(&pcf->client.dev, "work item may be lost\n");
+
+ /* we don't put the device here, hold it for next time */
+ mutex_unlock(&pcf->working_lock);
+ /* don't spew, delaying whatever else is happening */
+ msleep(1);
+ return;
+ }
if (!pcf->coldplug_done) {
DEBUGP("PMU Coldplug init\n");