1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
From fb42ce6724576fc173faf8abfb04aa2c36d213b7 Mon Sep 17 00:00:00 2001
From: Andy Green <agreen@pads.home.warmcat.com>
Date: Fri, 5 Dec 2008 11:03:59 +0000
Subject: [PATCH]
---
drivers/video/display/jbt6k74.c | 68 ++++++++++++++-------------------------
1 files changed, 24 insertions(+), 44 deletions(-)
diff --git a/drivers/video/display/jbt6k74.c b/drivers/video/display/jbt6k74.c
index 0635823..b1b5b1e 100644
--- a/drivers/video/display/jbt6k74.c
+++ b/drivers/video/display/jbt6k74.c
@@ -252,36 +252,22 @@ static int jbt_init_regs(struct jbt_info *jbt, int qvga)
return rc ? -EIO : 0;
}
-int jbt6k74_display_onoff(struct jbt_info *jbt, int on)
-{
- if (on)
- return jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
- else
- return jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_OFF);
-}
-EXPORT_SYMBOL_GPL(jbt6k74_display_onoff);
-
static int standby_to_sleep(struct jbt_info *jbt)
{
- static int once = 0;
- if (!once++) {
- int rc;
-
- /* three times command zero */
- rc = jbt_reg_write_nodata(jbt, 0x00);
- mdelay(1);
- rc |= jbt_reg_write_nodata(jbt, 0x00);
- mdelay(1);
- rc |= jbt_reg_write_nodata(jbt, 0x00);
- mdelay(1);
-
- /* deep standby out */
- rc |= jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x17);
-
- return rc ? -EIO : 0;
- }
- else
- return 0;
+ int rc;
+
+ /* three times command zero */
+ rc = jbt_reg_write_nodata(jbt, 0x00);
+ mdelay(1);
+ rc |= jbt_reg_write_nodata(jbt, 0x00);
+ mdelay(1);
+ rc |= jbt_reg_write_nodata(jbt, 0x00);
+ mdelay(1);
+
+ /* deep standby out */
+ rc |= jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x17);
+
+ return rc ? -EIO : 0;
}
static int sleep_to_normal(struct jbt_info *jbt)
@@ -307,7 +293,7 @@ static int sleep_to_normal(struct jbt_info *jbt)
rc |= jbt_init_regs(jbt, 0);
/* Turn on display */
- rc |= jbt6k74_display_onoff(jbt, 1);
+ rc |= jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
return rc ? -EIO : 0;
}
@@ -335,7 +321,7 @@ static int sleep_to_qvga_normal(struct jbt_info *jbt)
rc |= jbt_init_regs(jbt, 1);
/* Turn on display */
- rc |= jbt6k74_display_onoff(jbt, 1);
+ rc |= jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
return rc ? -EIO : 0;
}
@@ -344,8 +330,7 @@ static int normal_to_sleep(struct jbt_info *jbt)
{
int rc;
- rc = jbt6k74_display_onoff(jbt, 0);
- rc |= jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_OFF);
+ rc = jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_OFF);
rc |= jbt_reg_write16(jbt, JBT_REG_OUTPUT_CONTROL, 0x8002);
rc |= jbt_reg_write_nodata(jbt, JBT_REG_SLEEP_IN);
@@ -354,11 +339,7 @@ static int normal_to_sleep(struct jbt_info *jbt)
static int sleep_to_standby(struct jbt_info *jbt)
{
-#if 0
return jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x00);
-#else
- return 0;
-#endif
}
/* frontend function */
@@ -576,11 +557,10 @@ static int fb_notifier_callback(struct notifier_block *self,
switch (fb_blank) {
case FB_BLANK_UNBLANK:
dev_info(&jbt->spi_dev->dev, "**** jbt6k74 unblank\n");
+ jbt6k74_enter_state(jbt, JBT_STATE_NORMAL);
break;
case FB_BLANK_NORMAL:
dev_info(&jbt->spi_dev->dev, "**** jbt6k74 normal\n");
- /*jbt6k74_enter_state(jbt, JBT_STATE_NORMAL);
- jbt6k74_display_onoff(jbt, 1); */
break;
case FB_BLANK_VSYNC_SUSPEND:
dev_info(&jbt->spi_dev->dev, "**** jbt6k74 vsync suspend\n");
@@ -591,11 +571,12 @@ static int fb_notifier_callback(struct notifier_block *self,
* a visible artefact (white screen) before the backlight
* is dimmed to a dark enough level */
/* jbt6k74_enter_state(jbt, JBT_STATE_SLEEP); */
- /*jbt6k74_display_onoff(jbt, 0);*/
break;
case FB_BLANK_POWERDOWN:
dev_info(&jbt->spi_dev->dev, "**** jbt6k74 powerdown\n");
- /*jbt6k74_enter_state(jbt, JBT_STATE_DEEP_STANDBY);*/
+ /* FIXME: deep standby causes WSOD on certain devices. We use
+ * sleep as workaround */
+ jbt6k74_enter_state(jbt, JBT_STATE_SLEEP);
break;
}
@@ -692,13 +673,12 @@ static int jbt_suspend(struct spi_device *spi, pm_message_t state)
/* Save mode for resume */
jbt->last_state = jbt->state;
-
- jbt6k74_enter_state(jbt, JBT_STATE_DEEP_STANDBY);
+ /* FIXME: deep standby causes WSOD on certain devices. We use
+ * sleep as workaround */
+ jbt6k74_enter_state(jbt, JBT_STATE_SLEEP);
jbt->have_resumed = 0;
-/* (jbt6k74_pdata->reset)(0, 0); */
-
dev_info(&spi->dev, "**** jbt6k74 suspend end\n");
return 0;
--
1.5.6.5
|