summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/video/olpc_dcon.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/video/olpc_dcon.c b/drivers/video/olpc_dcon.c
index a66b22261669..1e7d2c38cd6f 100644
--- a/drivers/video/olpc_dcon.c
+++ b/drivers/video/olpc_dcon.c
@@ -246,14 +246,8 @@ static int dcon_get_backlight(void)
return bl_val;
}
-static void dcon_set_backlight(int level)
+static void __dcon_set_backlight(int level)
{
- if (dcon_client == NULL)
- return;
-
- if (bl_val == (level & 0x0F))
- return;
-
bl_val = level & 0x0F;
dcon_write(DCON_REG_BRIGHT, bl_val);
@@ -269,6 +263,17 @@ static void dcon_set_backlight(int level)
}
}
+static void dcon_set_backlight(int level)
+{
+ if (dcon_client == NULL)
+ return;
+
+ if (bl_val == (level & 0x0F))
+ return;
+
+ __dcon_set_backlight(level);
+}
+
/* Set the output type to either color or mono */
static int dcon_set_output(int arg)
@@ -318,15 +323,17 @@ static void dcon_sleep(int state)
dcon_sleep_val = state;
}
else {
- /* Only re-enable the backlight if the backlight value is set */
- if (bl_val != 0)
- dcon_disp_mode |= MODE_BL_ENABLE;
-
if ((x=dcon_bus_stabilize(dcon_client, 1)))
printk(KERN_WARNING "olpc-dcon: unable to reinit dcon"
" hardware: %d!\n", x);
else
dcon_sleep_val = state;
+
+ /* There might be a bug wherein the backlight gets
+ * restored to full after sleep. Make sure it gets set
+ * just to be sure */
+
+ __dcon_set_backlight(bl_val);
}
/* We should turn off some stuff in the framebuffer - but what? */