possible issue with lcd suspend/resume

Sean McNeil sean at mcneil.com
Tue Jun 10 18:51:41 CEST 2008


I am uncertain if this is possible, but I haven't reproduced a problem 
with the lcd going permanently blank on me since this patch. Can a 
suspend/resume get called without an appropriate pairing?

Sean

diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
index 887d42f..c67147f 100644
--- a/drivers/i2c/chips/pcf50633.c
+++ b/drivers/i2c/chips/pcf50633.c
@@ -2183,6 +2183,11 @@ static int pcf50633_suspend(struct device *dev, pm_message_t state)
 
 	mutex_lock(&pcf->lock);
 
+	if (pcf->have_been_suspended) {
+		dev_err(&client->dev, "Suspend called when already suspended!");
+		goto done;
+	}
+
 	/* Save all registers that don't "survive" standby state */
 	pcf->standby_regs.ooctim2 = __reg_read(pcf, PCF50633_REG_OOCTIM2);
 	pcf->standby_regs.autoout = __reg_read(pcf, PCF50633_REG_AUTOOUT);
@@ -2236,6 +2241,7 @@ static int pcf50633_suspend(struct device *dev, pm_message_t state)
 
 	pcf->have_been_suspended = 1;
 
+done:
 	mutex_unlock(&pcf->lock);
 
 	return 0;





More information about the openmoko-kernel mailing list