1 From fb42ce6724576fc173faf8abfb04aa2c36d213b7 Mon Sep 17 00:00:00 2001
2 From: Andy Green <agreen@pads.home.warmcat.com>
3 Date: Fri, 5 Dec 2008 11:03:59 +0000
7 drivers/video/display/jbt6k74.c | 68 ++++++++++++++-------------------------
8 1 files changed, 24 insertions(+), 44 deletions(-)
10 diff --git a/drivers/video/display/jbt6k74.c b/drivers/video/display/jbt6k74.c
11 index 0635823..b1b5b1e 100644
12 --- a/drivers/video/display/jbt6k74.c
13 +++ b/drivers/video/display/jbt6k74.c
14 @@ -252,36 +252,22 @@ static int jbt_init_regs(struct jbt_info *jbt, int qvga)
18 -int jbt6k74_display_onoff(struct jbt_info *jbt, int on)
21 - return jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
23 - return jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_OFF);
25 -EXPORT_SYMBOL_GPL(jbt6k74_display_onoff);
27 static int standby_to_sleep(struct jbt_info *jbt)
29 - static int once = 0;
33 - /* three times command zero */
34 - rc = jbt_reg_write_nodata(jbt, 0x00);
36 - rc |= jbt_reg_write_nodata(jbt, 0x00);
38 - rc |= jbt_reg_write_nodata(jbt, 0x00);
41 - /* deep standby out */
42 - rc |= jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x17);
44 - return rc ? -EIO : 0;
50 + /* three times command zero */
51 + rc = jbt_reg_write_nodata(jbt, 0x00);
53 + rc |= jbt_reg_write_nodata(jbt, 0x00);
55 + rc |= jbt_reg_write_nodata(jbt, 0x00);
58 + /* deep standby out */
59 + rc |= jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x17);
61 + return rc ? -EIO : 0;
64 static int sleep_to_normal(struct jbt_info *jbt)
65 @@ -307,7 +293,7 @@ static int sleep_to_normal(struct jbt_info *jbt)
66 rc |= jbt_init_regs(jbt, 0);
69 - rc |= jbt6k74_display_onoff(jbt, 1);
70 + rc |= jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
74 @@ -335,7 +321,7 @@ static int sleep_to_qvga_normal(struct jbt_info *jbt)
75 rc |= jbt_init_regs(jbt, 1);
78 - rc |= jbt6k74_display_onoff(jbt, 1);
79 + rc |= jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
83 @@ -344,8 +330,7 @@ static int normal_to_sleep(struct jbt_info *jbt)
87 - rc = jbt6k74_display_onoff(jbt, 0);
88 - rc |= jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_OFF);
89 + rc = jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_OFF);
90 rc |= jbt_reg_write16(jbt, JBT_REG_OUTPUT_CONTROL, 0x8002);
91 rc |= jbt_reg_write_nodata(jbt, JBT_REG_SLEEP_IN);
93 @@ -354,11 +339,7 @@ static int normal_to_sleep(struct jbt_info *jbt)
95 static int sleep_to_standby(struct jbt_info *jbt)
98 return jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x00);
104 /* frontend function */
105 @@ -576,11 +557,10 @@ static int fb_notifier_callback(struct notifier_block *self,
107 case FB_BLANK_UNBLANK:
108 dev_info(&jbt->spi_dev->dev, "**** jbt6k74 unblank\n");
109 + jbt6k74_enter_state(jbt, JBT_STATE_NORMAL);
111 case FB_BLANK_NORMAL:
112 dev_info(&jbt->spi_dev->dev, "**** jbt6k74 normal\n");
113 - /*jbt6k74_enter_state(jbt, JBT_STATE_NORMAL);
114 - jbt6k74_display_onoff(jbt, 1); */
116 case FB_BLANK_VSYNC_SUSPEND:
117 dev_info(&jbt->spi_dev->dev, "**** jbt6k74 vsync suspend\n");
118 @@ -591,11 +571,12 @@ static int fb_notifier_callback(struct notifier_block *self,
119 * a visible artefact (white screen) before the backlight
120 * is dimmed to a dark enough level */
121 /* jbt6k74_enter_state(jbt, JBT_STATE_SLEEP); */
122 - /*jbt6k74_display_onoff(jbt, 0);*/
124 case FB_BLANK_POWERDOWN:
125 dev_info(&jbt->spi_dev->dev, "**** jbt6k74 powerdown\n");
126 - /*jbt6k74_enter_state(jbt, JBT_STATE_DEEP_STANDBY);*/
127 + /* FIXME: deep standby causes WSOD on certain devices. We use
128 + * sleep as workaround */
129 + jbt6k74_enter_state(jbt, JBT_STATE_SLEEP);
133 @@ -692,13 +673,12 @@ static int jbt_suspend(struct spi_device *spi, pm_message_t state)
135 /* Save mode for resume */
136 jbt->last_state = jbt->state;
138 - jbt6k74_enter_state(jbt, JBT_STATE_DEEP_STANDBY);
139 + /* FIXME: deep standby causes WSOD on certain devices. We use
140 + * sleep as workaround */
141 + jbt6k74_enter_state(jbt, JBT_STATE_SLEEP);
143 jbt->have_resumed = 0;
145 -/* (jbt6k74_pdata->reset)(0, 0); */
147 dev_info(&spi->dev, "**** jbt6k74 suspend end\n");