[Patch] jbt6k74: Resume into right mode

Stefan Schmidt stefan at openmoko.org
Sun Nov 4 17:50:57 CET 2007


Hello.

This patch fixes the resume behaviour. The driver always resumes into
VGA mode. This was fine before adding QVGA mode, but it breaks now.

This patch seaves the mode during suspend and resmues into the saved
mode.

Signed-off-by: Stefan Schmidt <stefan at openmoko.org>


Index: linux-2.6.22.5/drivers/spi/jbt6k74.c
===================================================================
--- linux-2.6.22.5.orig/drivers/spi/jbt6k74.c	2007-10-24 14:25:29.000000000 +0800
+++ linux-2.6.22.5/drivers/spi/jbt6k74.c	2007-10-24 16:19:50.000000000 +0800
@@ -116,7 +116,7 @@
 
 #define JBT_TX_BUF_SIZE
 struct jbt_info {
-	enum jbt_state state;
+	enum jbt_state state, last_state;
 	u_int16_t tx_buf[8];
 	struct spi_device *spi_dev;
 	u_int16_t reg_cache[0xEE];
@@ -592,6 +592,8 @@
 	switch (state.event) {
 	case PM_EVENT_SUSPEND:
 	case 3:
+		/* Save mode for resume */
+		jbt->last_state = jbt->state;
 		jbt6k74_enter_state(jbt, JBT_STATE_DEEP_STANDBY);
 		return 0;
 	default:
@@ -604,7 +606,7 @@
 	struct jbt_info *jbt = dev_get_drvdata(&spi->dev);
 	DEBUGP("entering\n");
 
-	jbt6k74_enter_state(jbt, JBT_STATE_NORMAL);
+	jbt6k74_enter_state(jbt, jbt->last_state);
 	jbt6k74_display_onoff(jbt, 1);
 
 	return 0;




More information about the openmoko-kernel mailing list