aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:09:47 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:09:47 +0000
commit11c78492dc87877aaf1220b6b855e4a9363ca932 (patch)
tree5ea1eae6f5e568ac339a712a55b29b743b837ab7 /drivers
parentf8d84454949a5669abccf0b9c524f46380050c7f (diff)
fix-glamo-mci-relationship-with-pcf50633-suspend-resume.patch
After protecting pcf50633 read and write primitives against operation after suspend or before resume (by blowing a stack_trace()) I saw glamo-mci was trying to use pcf50633 at these bad times on its own suspend and resume. Since that part was already done via platform callback, I added an export in pcf50633 that tells you if it is ready or busy, and used it to defer (resume power on case) or ignore (suspend power off case, since pcf50633 already did it) the mci power call. Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/chips/pcf50633.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
index c148ea7191e..82ee2f0bf16 100644
--- a/drivers/i2c/chips/pcf50633.c
+++ b/drivers/i2c/chips/pcf50633.c
@@ -2230,6 +2230,20 @@ static int pcf50633_suspend(struct device *dev, pm_message_t state)
return 0;
}
+
+int pcf50633_ready(struct pcf50633_data *pcf)
+{
+ if (!pcf)
+ return -EBUSY;
+
+ if (pcf->have_been_suspended)
+ return -EBUSY;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(pcf50633_ready);
+
+
/*
* if backlight resume is selected to be deferred by platform, then it
* can call this to finally reset backlight status (after LCM is resumed