changed Makefile and profiles, added patches for kernel 2.6.24
[openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1328-.patch
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
4 Subject: [PATCH]
5
6 ---
7  drivers/video/display/jbt6k74.c |   68 ++++++++++++++-------------------------
8  1 files changed, 24 insertions(+), 44 deletions(-)
9
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)
15         return rc ? -EIO : 0;
16  }
17  
18 -int jbt6k74_display_onoff(struct jbt_info *jbt, int on)
19 -{
20 -       if (on)
21 -               return jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
22 -       else
23 -               return jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_OFF);
24 -}
25 -EXPORT_SYMBOL_GPL(jbt6k74_display_onoff);
26 -
27  static int standby_to_sleep(struct jbt_info *jbt)
28  {
29 -    static int once = 0;
30 -    if (!once++) {
31 -        int rc;
32 -
33 -        /* three times command zero */
34 -        rc = jbt_reg_write_nodata(jbt, 0x00);
35 -        mdelay(1);
36 -        rc |= jbt_reg_write_nodata(jbt, 0x00);
37 -        mdelay(1);
38 -        rc |= jbt_reg_write_nodata(jbt, 0x00);
39 -        mdelay(1);
40 -
41 -        /* deep standby out */
42 -        rc |= jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x17);
43 -
44 -        return rc ? -EIO : 0;
45 -    }
46 -    else 
47 -        return 0;
48 +       int rc;
49 +
50 +       /* three times command zero */
51 +       rc = jbt_reg_write_nodata(jbt, 0x00);
52 +       mdelay(1);
53 +       rc |= jbt_reg_write_nodata(jbt, 0x00);
54 +       mdelay(1);
55 +       rc |= jbt_reg_write_nodata(jbt, 0x00);
56 +       mdelay(1);
57 +
58 +       /* deep standby out */
59 +       rc |= jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x17);
60 +
61 +       return rc ? -EIO : 0;
62  }
63  
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);
67  
68         /* Turn on display */
69 -       rc |= jbt6k74_display_onoff(jbt, 1);
70 +       rc |= jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
71  
72         return rc ? -EIO : 0;
73  }
74 @@ -335,7 +321,7 @@ static int sleep_to_qvga_normal(struct jbt_info *jbt)
75         rc |= jbt_init_regs(jbt, 1);
76  
77         /* Turn on display */
78 -       rc |= jbt6k74_display_onoff(jbt, 1);
79 +       rc |= jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
80  
81         return rc ? -EIO : 0;
82  }
83 @@ -344,8 +330,7 @@ static int normal_to_sleep(struct jbt_info *jbt)
84  {
85         int rc;
86  
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);
92  
93 @@ -354,11 +339,7 @@ static int normal_to_sleep(struct jbt_info *jbt)
94  
95  static int sleep_to_standby(struct jbt_info *jbt)
96  {
97 -#if 0
98         return jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x00);
99 -#else
100 -    return 0;
101 -#endif
102  }
103  
104  /* frontend function */
105 @@ -576,11 +557,10 @@ static int fb_notifier_callback(struct notifier_block *self,
106         switch (fb_blank) {
107         case FB_BLANK_UNBLANK:
108                 dev_info(&jbt->spi_dev->dev, "**** jbt6k74 unblank\n");
109 +               jbt6k74_enter_state(jbt, JBT_STATE_NORMAL);
110                 break;
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); */
115                 break;
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);*/
123                 break;
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);
130                 break;
131         }
132  
133 @@ -692,13 +673,12 @@ static int jbt_suspend(struct spi_device *spi, pm_message_t state)
134  
135         /* Save mode for resume */
136         jbt->last_state = jbt->state;
137 -
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);
142  
143         jbt->have_resumed = 0;
144  
145 -/*     (jbt6k74_pdata->reset)(0, 0); */
146 -
147         dev_info(&spi->dev, "**** jbt6k74 suspend end\n");
148  
149         return 0;
150 -- 
151 1.5.6.5
152