aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/glamo/glamo-core.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@openmoko.org>2008-11-19 17:11:00 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:11:00 +0000
commitd6456697fa63719b245bf1cfe35b77e6ac7fe63c (patch)
tree35a38f50fe27499d0a24495e3b2e535df8a04715 /drivers/mfd/glamo/glamo-core.c
parent1736f7caf067fac336181f7e59ba3b7aae1d7a9f (diff)
glamo_fb: Implement screen blanking
This patch implements fb_blank() for the glamo-fb driver, which switches off the pixel clock (DCLK) for power saving. We currently delay the actual pixel clock switch until we enter FB_BLANK_POWERDOWN, since the backlight fade is slow and we don't want the user to see artefacts on the screen while the backlight is fading out. So since the X server first sends FB_BLANK_{V,H}SYNC_SUSPEND, we start the backlight fade here, and only once we get FB_BLANK_POWERDOWN the pixel clock is disabled. There are no measurements yet, but the power savings should be double, since there is no longer any generation of the high-frequency LCM signals, and there are no video-related SDRAM accesses anymore. Signed-off-by: Harald Welte <laforge@openmoko.org>
Diffstat (limited to 'drivers/mfd/glamo/glamo-core.c')
-rw-r--r--drivers/mfd/glamo/glamo-core.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c
index 0fea4f4ea0e..77e25a65a9b 100644
--- a/drivers/mfd/glamo/glamo-core.c
+++ b/drivers/mfd/glamo/glamo-core.c
@@ -526,6 +526,38 @@ int glamo_engine_disable(struct glamo_core *glamo, enum glamo_engine engine)
}
EXPORT_SYMBOL_GPL(glamo_engine_disable);
+static const u_int16_t engine_clock_regs[__NUM_GLAMO_ENGINES] = {
+ [GLAMO_ENGINE_LCD] = GLAMO_REG_CLOCK_LCD,
+ [GLAMO_ENGINE_MMC] = GLAMO_REG_CLOCK_MMC,
+ [GLAMO_ENGINE_ISP] = GLAMO_REG_CLOCK_ISP,
+ [GLAMO_ENGINE_JPEG] = GLAMO_REG_CLOCK_JPEG,
+ [GLAMO_ENGINE_3D] = GLAMO_REG_CLOCK_3D,
+ [GLAMO_ENGINE_2D] = GLAMO_REG_CLOCK_2D,
+ [GLAMO_ENGINE_MPEG_ENC] = GLAMO_REG_CLOCK_MPEG,
+ [GLAMO_ENGINE_MPEG_DEC] = GLAMO_REG_CLOCK_MPEG,
+};
+
+void glamo_engine_clkreg_set(struct glamo_core *glamo,
+ enum glamo_engine engine,
+ u_int16_t mask, u_int16_t val)
+{
+ reg_set_bit_mask(glamo, engine_clock_regs[engine], mask, val);
+}
+EXPORT_SYMBOL_GPL(glamo_engine_clkreg_set);
+
+u_int16_t glamo_engine_clkreg_get(struct glamo_core *glamo,
+ enum glamo_engine engine)
+{
+ u_int16_t val;
+
+ spin_lock(&glamo->lock);
+ val = __reg_read(glamo, engine_clock_regs[engine]);
+ spin_unlock(&glamo->lock);
+
+ return val;
+}
+EXPORT_SYMBOL_GPL(glamo_engine_clkreg_get);
+
struct glamo_script reset_regs[] = {
[GLAMO_ENGINE_LCD] = {
GLAMO_REG_CLOCK_LCD, GLAMO_CLOCK_LCD_RESET