[RFC] streamlining jbt6k74 for upstream submission

Balaji Rao balajirrao at openmoko.org
Sun Jan 4 18:01:40 CET 2009


Hello all,

Here are some experimental changes that alter the suspend/resume and
VSYNC/HSYNC suspend of jbt6k74. This effort is mainly for streamlining
the driver for upstream submission.

I invite people who have had WSOD problems to please try this patch and
give me some feedback.

I've tested suspend/resume and resume seems a bit faster. I don't know
how can I test HSYNC/VSYNC suspend. Can anyone please point me to
userspace tools that I can use to test them ?

Thank you,
Balaji

diff --git a/drivers/video/display/jbt6k74.c b/drivers/video/display/jbt6k74.c
index a1d48dd..78f7b79 100644
--- a/drivers/video/display/jbt6k74.c
+++ b/drivers/video/display/jbt6k74.c
@@ -265,7 +265,12 @@ static int standby_to_sleep(struct jbt_info *jbt)
 	mdelay(1);
 
 	/* deep standby out */
-	rc |= jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x17);
+	rc |= jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x11);
+	mdelay(1);
+	rc = jbt_reg_write(jbt, JBT_REG_DISPLAY_MODE, 0x28);
+
+	/* (re)initialize register set */
+	rc |= jbt_init_regs(jbt, 0);
 
 	return rc ? -EIO : 0;
 }
@@ -286,15 +291,12 @@ static int sleep_to_normal(struct jbt_info *jbt)
 	/* Output control */
 	rc |= jbt_reg_write16(jbt, JBT_REG_OUTPUT_CONTROL, 0xfff9);
 
-	/* Sleep mode off */
-	rc |= jbt_reg_write_nodata(jbt, JBT_REG_SLEEP_OUT);
-
-	/* initialize register set */
-	rc |= jbt_init_regs(jbt, 0);
-
 	/* Turn on display */
 	rc |= jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
 
+	/* Sleep mode off */
+	rc |= jbt_reg_write_nodata(jbt, JBT_REG_SLEEP_OUT);
+
 	return rc ? -EIO : 0;
 }
 
@@ -314,15 +316,12 @@ static int sleep_to_qvga_normal(struct jbt_info *jbt)
 	/* Output control */
 	rc |= jbt_reg_write16(jbt, JBT_REG_OUTPUT_CONTROL, 0xfff9);
 
-	/* Sleep mode off */
-	rc |= jbt_reg_write_nodata(jbt, JBT_REG_SLEEP_OUT);
-
-	/* initialize register set for qvga*/
-	rc |= jbt_init_regs(jbt, 1);
-
 	/* Turn on display */
 	rc |= jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
 
+	/* Sleep mode off */
+	rc |= jbt_reg_write_nodata(jbt, JBT_REG_SLEEP_OUT);
+
 	return rc ? -EIO : 0;
 }
 
@@ -602,19 +601,20 @@ static int fb_notifier_callback(struct notifier_block *self,
 		break;
 	case FB_BLANK_VSYNC_SUSPEND:
 		dev_info(&jbt->spi_dev->dev, "**** jbt6k74 vsync suspend\n");
+		 jbt6k74_enter_state(jbt, JBT_STATE_SLEEP);
 		break;
 	case FB_BLANK_HSYNC_SUSPEND:
 		dev_info(&jbt->spi_dev->dev, "**** jbt6k74 hsync suspend\n");
 		/* FIXME: we disable SLEEP since it would result in
 		 * a visible artefact (white screen) before the backlight
 		 * is dimmed to a dark enough level */
-		/* jbt6k74_enter_state(jbt, JBT_STATE_SLEEP); */
+		 jbt6k74_enter_state(jbt, JBT_STATE_SLEEP);
 		break;
 	case FB_BLANK_POWERDOWN:
 		dev_info(&jbt->spi_dev->dev, "**** jbt6k74 powerdown\n");
 	/* FIXME: deep standby causes WSOD on certain devices. We use
 	 * sleep as workaround */
-		jbt6k74_enter_state(jbt, JBT_STATE_SLEEP);
+		jbt6k74_enter_state(jbt, JBT_STATE_DEEP_STANDBY);
 		break;
 	}
 
@@ -724,7 +724,7 @@ static int jbt_suspend(struct spi_device *spi, pm_message_t state)
 	jbt->last_state = jbt->state;
 	/* FIXME: deep standby causes WSOD on certain devices. We use
 	 * sleep as workaround */
-	jbt6k74_enter_state(jbt, JBT_STATE_SLEEP);
+	jbt6k74_enter_state(jbt, JBT_STATE_DEEP_STANDBY);
 
 	jbt->have_resumed = 0;
 
@@ -741,19 +741,6 @@ int jbt6k74_resume(struct spi_device *spi)
 
 	dev_info(&spi->dev, "**** jbt6k74 resume start\n");
 
-	/* hard reset the jbt6k74 */
-
-	(jbt6k74_pdata->reset)(0, 0);
-	mdelay(1);
-	(jbt6k74_pdata->reset)(0, 1);
-	mdelay(120);
-
-	rc = jbt_reg_write_nodata(jbt, 0x01);
-	if (rc < 0)
-		dev_err(&spi->dev, "cannot soft reset\n");
-
-	mdelay(120);
-
 	jbt->state = JBT_STATE_DEEP_STANDBY;
 	
 	switch (jbt->last_state) {



More information about the openmoko-kernel mailing list