From bd4b7e8e84ab43a13a4620b001d52d373c2122b3 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Sat, 4 Apr 2009 14:15:48 -0400 Subject: Fixed the LCM driver state transition delay and pixel clock issue Space transition between sleep-in and sleep-out of at least 120 ms as mentionned in the spec. Also, made sure the LCM is moved into sleep state before the pixel clock is turned off. To do so, I've modified glamo-fb to send FB_BLANK_POWERDOWN before turning off the pixel clock. Also fixed various violation of coding style. This patch should reduce the risk of white screen. Signed-off-by: Nicolas Dufresne --- drivers/mfd/glamo/glamo-fb.c | 127 +++++++++++++++++++++++++------------------ 1 file changed, 74 insertions(+), 53 deletions(-) (limited to 'drivers/mfd/glamo/glamo-fb.c') diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c index 4eb81a508e5..5491dadbf8a 100644 --- a/drivers/mfd/glamo/glamo-fb.c +++ b/drivers/mfd/glamo/glamo-fb.c @@ -37,9 +37,9 @@ #include #include #include +#include +#include -#include -#include #include #ifdef CONFIG_PM @@ -76,6 +76,7 @@ struct glamofb_handle { u_int32_t pseudo_pal[16]; spinlock_t lock_cmd; int angle; /* Current rotation angle */ + int blank_mode; }; /* 'sibling' spi device for lcm init */ @@ -89,7 +90,7 @@ static int reg_read(struct glamofb_handle *glamo, { int i = 0; - for (i = 0; i != 2; i ++) + for (i = 0; i != 2; i++) nop(); return readw(glamo->base + reg); @@ -100,7 +101,7 @@ static void reg_write(struct glamofb_handle *glamo, { int i = 0; - for (i = 0; i != 2; i ++) + for (i = 0; i != 2; i++) nop(); writew(val, glamo->base + reg); @@ -141,7 +142,8 @@ static int glamofb_run_script(struct glamofb_handle *glamo, int i; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_run_script while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING glamofb_run_script while " "suspended\n"); return -EBUSY; } @@ -166,7 +168,8 @@ static int glamofb_check_var(struct fb_var_screeninfo *var, struct glamofb_handle *glamo = info->par; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_check_var while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING glamofb_check_var while " "suspended\n"); return -EBUSY; } @@ -263,32 +266,33 @@ static void __rotate_lcd(struct glamofb_handle *glamo, __u32 rotation) int glamo_rot; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING rotate_lcd while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING rotate_lcd while " "suspended\n"); return; } switch (rotation) { - case FB_ROTATE_UR: - glamo_rot = GLAMO_LCD_ROT_MODE_0; - glamo->angle = 0; - break; - case FB_ROTATE_CW: - glamo_rot = GLAMO_LCD_ROT_MODE_90; - glamo->angle = 90; - break; - case FB_ROTATE_UD: - glamo_rot = GLAMO_LCD_ROT_MODE_180; - glamo->angle = 180; - break; - case FB_ROTATE_CCW: - glamo_rot = GLAMO_LCD_ROT_MODE_270; - glamo->angle = 270; - break; - default: - glamo->angle = 0; - glamo_rot = GLAMO_LCD_ROT_MODE_0; - break; + case FB_ROTATE_UR: + glamo_rot = GLAMO_LCD_ROT_MODE_0; + glamo->angle = 0; + break; + case FB_ROTATE_CW: + glamo_rot = GLAMO_LCD_ROT_MODE_90; + glamo->angle = 90; + break; + case FB_ROTATE_UD: + glamo_rot = GLAMO_LCD_ROT_MODE_180; + glamo->angle = 180; + break; + case FB_ROTATE_CCW: + glamo_rot = GLAMO_LCD_ROT_MODE_270; + glamo->angle = 270; + break; + default: + glamo->angle = 0; + glamo_rot = GLAMO_LCD_ROT_MODE_0; + break; } reg_set_bit_mask(glamo, @@ -298,7 +302,7 @@ static void __rotate_lcd(struct glamofb_handle *glamo, __u32 rotation) reg_set_bit_mask(glamo, GLAMO_REG_LCD_MODE1, GLAMO_LCD_MODE1_ROTATE_EN, - (glamo_rot != GLAMO_LCD_ROT_MODE_0)? + (glamo_rot != GLAMO_LCD_ROT_MODE_0) ? GLAMO_LCD_MODE1_ROTATE_EN : 0); } @@ -313,7 +317,8 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, return; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_update_lcd_controller while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING glamofb_update_lcd_controller while " "suspended\n"); return; } @@ -331,10 +336,10 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, var->pixclock); if (glamo->angle == 90 || glamo->angle == 270) { - /* + /* * But if we are going back to portrait mode from here, - * we get inverted values from Xglamo - */ + * we get inverted values from Xglamo + */ if (!(var->rotate == FB_ROTATE_UR || var->rotate == FB_ROTATE_UD)) { width = var->yres; @@ -354,7 +359,8 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, /* We don't need to set xres and yres in this particular case * because Xglamo does it for us */ if (!(glamo->angle == 90 || glamo->angle == 270)) { - var->xres = width;var->yres = height; + var->xres = width; + var->yres = height; } var->xres_virtual = width; @@ -427,7 +433,8 @@ out_unlock: spin_unlock_irqrestore(&glamo->lock_cmd, flags); } -static int glamofb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) +static int glamofb_pan_display(struct fb_var_screeninfo *var, + struct fb_info *info) { struct glamofb_handle *glamo = info->par; u_int16_t page = var->yoffset / glamo->mach_info->yres.defval; @@ -442,7 +449,8 @@ static int glamofb_set_par(struct fb_info *info) struct fb_var_screeninfo *var = &info->var; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_set_par while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING glamofb_set_par while " "suspended\n"); return -EBUSY; } @@ -488,17 +496,29 @@ static int glamofb_blank(int blank_mode, struct fb_info *info) * we should already switch off pixel clock here */ break; case FB_BLANK_POWERDOWN: + /* Simulating FB_BLANK_NORMAL allow turning off backlight */ + if (gfb->blank_mode != FB_BLANK_NORMAL) + notify_blank(info, FB_BLANK_NORMAL); + + /* LCM need notification before pixel clock is stopped */ + notify_blank(info, blank_mode); + /* disable the pixel clock */ glamo_engine_clkreg_set(gcore, GLAMO_ENGINE_LCD, GLAMO_CLOCK_LCD_EN_DCLK, 0); + gfb->blank_mode = blank_mode; break; case FB_BLANK_UNBLANK: case FB_BLANK_NORMAL: - /* enable the pixel clock */ - glamo_engine_clkreg_set(gcore, GLAMO_ENGINE_LCD, + /* enable the pixel clock if off */ + if (gfb->blank_mode == FB_BLANK_POWERDOWN) + glamo_engine_clkreg_set(gcore, + GLAMO_ENGINE_LCD, GLAMO_CLOCK_LCD_EN_DCLK, GLAMO_CLOCK_LCD_EN_DCLK); + notify_blank(info, blank_mode); + gfb->blank_mode = blank_mode; break; } @@ -524,7 +544,8 @@ static int glamofb_setcolreg(unsigned regno, unsigned int val; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_set_par while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING glamofb_set_par while " "suspended\n"); return -EBUSY; } @@ -692,7 +713,8 @@ int glamofb_cmd_mode(struct glamofb_handle *gfb, int on) int timeout = 2000000; if (gfb->mach_info->glamo->suspending) { - dev_err(&gfb->mach_info->glamo->pdev->dev, "IGNORING glamofb_cmd_mode while " + dev_err(&gfb->mach_info->glamo->pdev->dev, + "IGNORING glamofb_cmd_mode while " "suspended\n"); return -EBUSY; } @@ -700,7 +722,7 @@ int glamofb_cmd_mode(struct glamofb_handle *gfb, int on) dev_dbg(gfb->dev, "glamofb_cmd_mode(gfb=%p, on=%d)\n", gfb, on); if (on) { dev_dbg(gfb->dev, "%s: waiting for cmdq empty: ", - __FUNCTION__); + __func__); while ((!glamofb_cmdq_empty(gfb)) && (timeout--)) /* yield() */; if (timeout < 0) { @@ -755,12 +777,13 @@ int glamofb_cmd_write(struct glamofb_handle *gfb, u_int16_t val) int timeout = 200000; if (gfb->mach_info->glamo->suspending) { - dev_err(&gfb->mach_info->glamo->pdev->dev, "IGNORING glamofb_cmd_write while " + dev_err(&gfb->mach_info->glamo->pdev->dev, + "IGNORING glamofb_cmd_write while " "suspended\n"); return -EBUSY; } - dev_dbg(gfb->dev, "%s: waiting for cmdq empty\n", __FUNCTION__); + dev_dbg(gfb->dev, "%s: waiting for cmdq empty\n", __func__); while ((!glamofb_cmdq_empty(gfb)) && (timeout--)) yield(); if (timeout < 0) { @@ -822,6 +845,7 @@ static int __init glamofb_probe(struct platform_device *pdev) glamofb->dev = &pdev->dev; glamofb->angle = 0; + glamofb->blank_mode = FB_BLANK_POWERDOWN; strcpy(fbinfo->fix.id, "SMedia Glamo"); @@ -976,38 +1000,35 @@ static int glamofb_suspend(struct platform_device *pdev, pm_message_t state) struct glamofb_handle *gfb = platform_get_drvdata(pdev); /* we need to stop anything touching our framebuffer */ -// fb_blank(gfb->fb, FB_BLANK_NORMAL); fb_set_suspend(gfb->fb, 1); /* seriously -- nobody is allowed to touch glamo memory when we * are suspended or we lock on nWAIT */ -// iounmap(gfb->fb->screen_base); + /* iounmap(gfb->fb->screen_base); */ return 0; } static int glamofb_resume(struct platform_device *pdev) { - struct glamofb_handle *glamofb = platform_get_drvdata(pdev); + struct glamofb_handle *gfb = platform_get_drvdata(pdev); struct glamofb_platform_data *mach_info = pdev->dev.platform_data; /* OK let's allow framebuffer ops again */ -// gfb->fb->screen_base = ioremap(gfb->fb_res->start, -// RESSIZE(gfb->fb_res)); + /* gfb->fb->screen_base = ioremap(gfb->fb_res->start, + RESSIZE(gfb->fb_res)); */ glamo_engine_enable(mach_info->glamo, GLAMO_ENGINE_LCD); glamo_engine_reset(mach_info->glamo, GLAMO_ENGINE_LCD); printk(KERN_ERR"spin_lock_init\n"); - spin_lock_init(&glamofb->lock_cmd); - glamofb_init_regs(glamofb); + spin_lock_init(&gfb->lock_cmd); + glamofb_init_regs(gfb); #ifdef CONFIG_MFD_GLAMO_HWACCEL - glamofb_cursor_onoff(glamofb, 1); + glamofb_cursor_onoff(gfb, 1); #endif - - fb_set_suspend(glamofb->fb, 0); -// fb_blank(gfb->fb, FB_BLANK_UNBLANK); + fb_set_suspend(gfb->fb, 0); return 0; } -- cgit v1.2.3 From aa2dbc74bed8cf60e591c654ba1882011b9a8ece Mon Sep 17 00:00:00 2001 From: Nelson Castillo Date: Sun, 19 Apr 2009 11:16:56 -0500 Subject: Revert "Fixed the LCM driver state transition delay and pixel clock issue" This reverts commit bd4b7e8e84ab43a13a4620b001d52d373c2122b3 which brought WSOD back for some devices. It was reported that the problem does not happen with Qi and it seem it is good news. See: https://docs.openmoko.org/trac/ticket/2274 Conflicts: drivers/video/display/jbt6k74.c --- drivers/mfd/glamo/glamo-fb.c | 127 ++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 74 deletions(-) (limited to 'drivers/mfd/glamo/glamo-fb.c') diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c index 5491dadbf8a..4eb81a508e5 100644 --- a/drivers/mfd/glamo/glamo-fb.c +++ b/drivers/mfd/glamo/glamo-fb.c @@ -37,9 +37,9 @@ #include #include #include -#include -#include +#include +#include #include #ifdef CONFIG_PM @@ -76,7 +76,6 @@ struct glamofb_handle { u_int32_t pseudo_pal[16]; spinlock_t lock_cmd; int angle; /* Current rotation angle */ - int blank_mode; }; /* 'sibling' spi device for lcm init */ @@ -90,7 +89,7 @@ static int reg_read(struct glamofb_handle *glamo, { int i = 0; - for (i = 0; i != 2; i++) + for (i = 0; i != 2; i ++) nop(); return readw(glamo->base + reg); @@ -101,7 +100,7 @@ static void reg_write(struct glamofb_handle *glamo, { int i = 0; - for (i = 0; i != 2; i++) + for (i = 0; i != 2; i ++) nop(); writew(val, glamo->base + reg); @@ -142,8 +141,7 @@ static int glamofb_run_script(struct glamofb_handle *glamo, int i; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, - "IGNORING glamofb_run_script while " + dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_run_script while " "suspended\n"); return -EBUSY; } @@ -168,8 +166,7 @@ static int glamofb_check_var(struct fb_var_screeninfo *var, struct glamofb_handle *glamo = info->par; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, - "IGNORING glamofb_check_var while " + dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_check_var while " "suspended\n"); return -EBUSY; } @@ -266,33 +263,32 @@ static void __rotate_lcd(struct glamofb_handle *glamo, __u32 rotation) int glamo_rot; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, - "IGNORING rotate_lcd while " + dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING rotate_lcd while " "suspended\n"); return; } switch (rotation) { - case FB_ROTATE_UR: - glamo_rot = GLAMO_LCD_ROT_MODE_0; - glamo->angle = 0; - break; - case FB_ROTATE_CW: - glamo_rot = GLAMO_LCD_ROT_MODE_90; - glamo->angle = 90; - break; - case FB_ROTATE_UD: - glamo_rot = GLAMO_LCD_ROT_MODE_180; - glamo->angle = 180; - break; - case FB_ROTATE_CCW: - glamo_rot = GLAMO_LCD_ROT_MODE_270; - glamo->angle = 270; - break; - default: - glamo->angle = 0; - glamo_rot = GLAMO_LCD_ROT_MODE_0; - break; + case FB_ROTATE_UR: + glamo_rot = GLAMO_LCD_ROT_MODE_0; + glamo->angle = 0; + break; + case FB_ROTATE_CW: + glamo_rot = GLAMO_LCD_ROT_MODE_90; + glamo->angle = 90; + break; + case FB_ROTATE_UD: + glamo_rot = GLAMO_LCD_ROT_MODE_180; + glamo->angle = 180; + break; + case FB_ROTATE_CCW: + glamo_rot = GLAMO_LCD_ROT_MODE_270; + glamo->angle = 270; + break; + default: + glamo->angle = 0; + glamo_rot = GLAMO_LCD_ROT_MODE_0; + break; } reg_set_bit_mask(glamo, @@ -302,7 +298,7 @@ static void __rotate_lcd(struct glamofb_handle *glamo, __u32 rotation) reg_set_bit_mask(glamo, GLAMO_REG_LCD_MODE1, GLAMO_LCD_MODE1_ROTATE_EN, - (glamo_rot != GLAMO_LCD_ROT_MODE_0) ? + (glamo_rot != GLAMO_LCD_ROT_MODE_0)? GLAMO_LCD_MODE1_ROTATE_EN : 0); } @@ -317,8 +313,7 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, return; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, - "IGNORING glamofb_update_lcd_controller while " + dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_update_lcd_controller while " "suspended\n"); return; } @@ -336,10 +331,10 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, var->pixclock); if (glamo->angle == 90 || glamo->angle == 270) { - /* + /* * But if we are going back to portrait mode from here, - * we get inverted values from Xglamo - */ + * we get inverted values from Xglamo + */ if (!(var->rotate == FB_ROTATE_UR || var->rotate == FB_ROTATE_UD)) { width = var->yres; @@ -359,8 +354,7 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, /* We don't need to set xres and yres in this particular case * because Xglamo does it for us */ if (!(glamo->angle == 90 || glamo->angle == 270)) { - var->xres = width; - var->yres = height; + var->xres = width;var->yres = height; } var->xres_virtual = width; @@ -433,8 +427,7 @@ out_unlock: spin_unlock_irqrestore(&glamo->lock_cmd, flags); } -static int glamofb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *info) +static int glamofb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { struct glamofb_handle *glamo = info->par; u_int16_t page = var->yoffset / glamo->mach_info->yres.defval; @@ -449,8 +442,7 @@ static int glamofb_set_par(struct fb_info *info) struct fb_var_screeninfo *var = &info->var; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, - "IGNORING glamofb_set_par while " + dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_set_par while " "suspended\n"); return -EBUSY; } @@ -496,29 +488,17 @@ static int glamofb_blank(int blank_mode, struct fb_info *info) * we should already switch off pixel clock here */ break; case FB_BLANK_POWERDOWN: - /* Simulating FB_BLANK_NORMAL allow turning off backlight */ - if (gfb->blank_mode != FB_BLANK_NORMAL) - notify_blank(info, FB_BLANK_NORMAL); - - /* LCM need notification before pixel clock is stopped */ - notify_blank(info, blank_mode); - /* disable the pixel clock */ glamo_engine_clkreg_set(gcore, GLAMO_ENGINE_LCD, GLAMO_CLOCK_LCD_EN_DCLK, 0); - gfb->blank_mode = blank_mode; break; case FB_BLANK_UNBLANK: case FB_BLANK_NORMAL: - /* enable the pixel clock if off */ - if (gfb->blank_mode == FB_BLANK_POWERDOWN) - glamo_engine_clkreg_set(gcore, - GLAMO_ENGINE_LCD, + /* enable the pixel clock */ + glamo_engine_clkreg_set(gcore, GLAMO_ENGINE_LCD, GLAMO_CLOCK_LCD_EN_DCLK, GLAMO_CLOCK_LCD_EN_DCLK); - notify_blank(info, blank_mode); - gfb->blank_mode = blank_mode; break; } @@ -544,8 +524,7 @@ static int glamofb_setcolreg(unsigned regno, unsigned int val; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, - "IGNORING glamofb_set_par while " + dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_set_par while " "suspended\n"); return -EBUSY; } @@ -713,8 +692,7 @@ int glamofb_cmd_mode(struct glamofb_handle *gfb, int on) int timeout = 2000000; if (gfb->mach_info->glamo->suspending) { - dev_err(&gfb->mach_info->glamo->pdev->dev, - "IGNORING glamofb_cmd_mode while " + dev_err(&gfb->mach_info->glamo->pdev->dev, "IGNORING glamofb_cmd_mode while " "suspended\n"); return -EBUSY; } @@ -722,7 +700,7 @@ int glamofb_cmd_mode(struct glamofb_handle *gfb, int on) dev_dbg(gfb->dev, "glamofb_cmd_mode(gfb=%p, on=%d)\n", gfb, on); if (on) { dev_dbg(gfb->dev, "%s: waiting for cmdq empty: ", - __func__); + __FUNCTION__); while ((!glamofb_cmdq_empty(gfb)) && (timeout--)) /* yield() */; if (timeout < 0) { @@ -777,13 +755,12 @@ int glamofb_cmd_write(struct glamofb_handle *gfb, u_int16_t val) int timeout = 200000; if (gfb->mach_info->glamo->suspending) { - dev_err(&gfb->mach_info->glamo->pdev->dev, - "IGNORING glamofb_cmd_write while " + dev_err(&gfb->mach_info->glamo->pdev->dev, "IGNORING glamofb_cmd_write while " "suspended\n"); return -EBUSY; } - dev_dbg(gfb->dev, "%s: waiting for cmdq empty\n", __func__); + dev_dbg(gfb->dev, "%s: waiting for cmdq empty\n", __FUNCTION__); while ((!glamofb_cmdq_empty(gfb)) && (timeout--)) yield(); if (timeout < 0) { @@ -845,7 +822,6 @@ static int __init glamofb_probe(struct platform_device *pdev) glamofb->dev = &pdev->dev; glamofb->angle = 0; - glamofb->blank_mode = FB_BLANK_POWERDOWN; strcpy(fbinfo->fix.id, "SMedia Glamo"); @@ -1000,35 +976,38 @@ static int glamofb_suspend(struct platform_device *pdev, pm_message_t state) struct glamofb_handle *gfb = platform_get_drvdata(pdev); /* we need to stop anything touching our framebuffer */ +// fb_blank(gfb->fb, FB_BLANK_NORMAL); fb_set_suspend(gfb->fb, 1); /* seriously -- nobody is allowed to touch glamo memory when we * are suspended or we lock on nWAIT */ - /* iounmap(gfb->fb->screen_base); */ +// iounmap(gfb->fb->screen_base); return 0; } static int glamofb_resume(struct platform_device *pdev) { - struct glamofb_handle *gfb = platform_get_drvdata(pdev); + struct glamofb_handle *glamofb = platform_get_drvdata(pdev); struct glamofb_platform_data *mach_info = pdev->dev.platform_data; /* OK let's allow framebuffer ops again */ - /* gfb->fb->screen_base = ioremap(gfb->fb_res->start, - RESSIZE(gfb->fb_res)); */ +// gfb->fb->screen_base = ioremap(gfb->fb_res->start, +// RESSIZE(gfb->fb_res)); glamo_engine_enable(mach_info->glamo, GLAMO_ENGINE_LCD); glamo_engine_reset(mach_info->glamo, GLAMO_ENGINE_LCD); printk(KERN_ERR"spin_lock_init\n"); - spin_lock_init(&gfb->lock_cmd); - glamofb_init_regs(gfb); + spin_lock_init(&glamofb->lock_cmd); + glamofb_init_regs(glamofb); #ifdef CONFIG_MFD_GLAMO_HWACCEL - glamofb_cursor_onoff(gfb, 1); + glamofb_cursor_onoff(glamofb, 1); #endif - fb_set_suspend(gfb->fb, 0); + + fb_set_suspend(glamofb->fb, 0); +// fb_blank(gfb->fb, FB_BLANK_UNBLANK); return 0; } -- cgit v1.2.3 From 08c73c0533ec33dba5676d1124634dd1654aef8b Mon Sep 17 00:00:00 2001 From: Nelson Castillo Date: Sun, 19 Apr 2009 14:41:33 -0500 Subject: Revert "Revert "Fixed the LCM driver state transition delay and pixel clock issue"" This reverts commit aa2dbc74bed8cf60e591c654ba1882011b9a8ece. Reverting the revert. Sorry for the noise. Check: http://lists.openmoko.org/pipermail/openmoko-kernel/2009-April/010023.html --- drivers/mfd/glamo/glamo-fb.c | 127 +++++++++++++++++++++++++------------------ 1 file changed, 74 insertions(+), 53 deletions(-) (limited to 'drivers/mfd/glamo/glamo-fb.c') diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c index 4eb81a508e5..5491dadbf8a 100644 --- a/drivers/mfd/glamo/glamo-fb.c +++ b/drivers/mfd/glamo/glamo-fb.c @@ -37,9 +37,9 @@ #include #include #include +#include +#include -#include -#include #include #ifdef CONFIG_PM @@ -76,6 +76,7 @@ struct glamofb_handle { u_int32_t pseudo_pal[16]; spinlock_t lock_cmd; int angle; /* Current rotation angle */ + int blank_mode; }; /* 'sibling' spi device for lcm init */ @@ -89,7 +90,7 @@ static int reg_read(struct glamofb_handle *glamo, { int i = 0; - for (i = 0; i != 2; i ++) + for (i = 0; i != 2; i++) nop(); return readw(glamo->base + reg); @@ -100,7 +101,7 @@ static void reg_write(struct glamofb_handle *glamo, { int i = 0; - for (i = 0; i != 2; i ++) + for (i = 0; i != 2; i++) nop(); writew(val, glamo->base + reg); @@ -141,7 +142,8 @@ static int glamofb_run_script(struct glamofb_handle *glamo, int i; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_run_script while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING glamofb_run_script while " "suspended\n"); return -EBUSY; } @@ -166,7 +168,8 @@ static int glamofb_check_var(struct fb_var_screeninfo *var, struct glamofb_handle *glamo = info->par; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_check_var while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING glamofb_check_var while " "suspended\n"); return -EBUSY; } @@ -263,32 +266,33 @@ static void __rotate_lcd(struct glamofb_handle *glamo, __u32 rotation) int glamo_rot; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING rotate_lcd while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING rotate_lcd while " "suspended\n"); return; } switch (rotation) { - case FB_ROTATE_UR: - glamo_rot = GLAMO_LCD_ROT_MODE_0; - glamo->angle = 0; - break; - case FB_ROTATE_CW: - glamo_rot = GLAMO_LCD_ROT_MODE_90; - glamo->angle = 90; - break; - case FB_ROTATE_UD: - glamo_rot = GLAMO_LCD_ROT_MODE_180; - glamo->angle = 180; - break; - case FB_ROTATE_CCW: - glamo_rot = GLAMO_LCD_ROT_MODE_270; - glamo->angle = 270; - break; - default: - glamo->angle = 0; - glamo_rot = GLAMO_LCD_ROT_MODE_0; - break; + case FB_ROTATE_UR: + glamo_rot = GLAMO_LCD_ROT_MODE_0; + glamo->angle = 0; + break; + case FB_ROTATE_CW: + glamo_rot = GLAMO_LCD_ROT_MODE_90; + glamo->angle = 90; + break; + case FB_ROTATE_UD: + glamo_rot = GLAMO_LCD_ROT_MODE_180; + glamo->angle = 180; + break; + case FB_ROTATE_CCW: + glamo_rot = GLAMO_LCD_ROT_MODE_270; + glamo->angle = 270; + break; + default: + glamo->angle = 0; + glamo_rot = GLAMO_LCD_ROT_MODE_0; + break; } reg_set_bit_mask(glamo, @@ -298,7 +302,7 @@ static void __rotate_lcd(struct glamofb_handle *glamo, __u32 rotation) reg_set_bit_mask(glamo, GLAMO_REG_LCD_MODE1, GLAMO_LCD_MODE1_ROTATE_EN, - (glamo_rot != GLAMO_LCD_ROT_MODE_0)? + (glamo_rot != GLAMO_LCD_ROT_MODE_0) ? GLAMO_LCD_MODE1_ROTATE_EN : 0); } @@ -313,7 +317,8 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, return; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_update_lcd_controller while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING glamofb_update_lcd_controller while " "suspended\n"); return; } @@ -331,10 +336,10 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, var->pixclock); if (glamo->angle == 90 || glamo->angle == 270) { - /* + /* * But if we are going back to portrait mode from here, - * we get inverted values from Xglamo - */ + * we get inverted values from Xglamo + */ if (!(var->rotate == FB_ROTATE_UR || var->rotate == FB_ROTATE_UD)) { width = var->yres; @@ -354,7 +359,8 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, /* We don't need to set xres and yres in this particular case * because Xglamo does it for us */ if (!(glamo->angle == 90 || glamo->angle == 270)) { - var->xres = width;var->yres = height; + var->xres = width; + var->yres = height; } var->xres_virtual = width; @@ -427,7 +433,8 @@ out_unlock: spin_unlock_irqrestore(&glamo->lock_cmd, flags); } -static int glamofb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) +static int glamofb_pan_display(struct fb_var_screeninfo *var, + struct fb_info *info) { struct glamofb_handle *glamo = info->par; u_int16_t page = var->yoffset / glamo->mach_info->yres.defval; @@ -442,7 +449,8 @@ static int glamofb_set_par(struct fb_info *info) struct fb_var_screeninfo *var = &info->var; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_set_par while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING glamofb_set_par while " "suspended\n"); return -EBUSY; } @@ -488,17 +496,29 @@ static int glamofb_blank(int blank_mode, struct fb_info *info) * we should already switch off pixel clock here */ break; case FB_BLANK_POWERDOWN: + /* Simulating FB_BLANK_NORMAL allow turning off backlight */ + if (gfb->blank_mode != FB_BLANK_NORMAL) + notify_blank(info, FB_BLANK_NORMAL); + + /* LCM need notification before pixel clock is stopped */ + notify_blank(info, blank_mode); + /* disable the pixel clock */ glamo_engine_clkreg_set(gcore, GLAMO_ENGINE_LCD, GLAMO_CLOCK_LCD_EN_DCLK, 0); + gfb->blank_mode = blank_mode; break; case FB_BLANK_UNBLANK: case FB_BLANK_NORMAL: - /* enable the pixel clock */ - glamo_engine_clkreg_set(gcore, GLAMO_ENGINE_LCD, + /* enable the pixel clock if off */ + if (gfb->blank_mode == FB_BLANK_POWERDOWN) + glamo_engine_clkreg_set(gcore, + GLAMO_ENGINE_LCD, GLAMO_CLOCK_LCD_EN_DCLK, GLAMO_CLOCK_LCD_EN_DCLK); + notify_blank(info, blank_mode); + gfb->blank_mode = blank_mode; break; } @@ -524,7 +544,8 @@ static int glamofb_setcolreg(unsigned regno, unsigned int val; if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, "IGNORING glamofb_set_par while " + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING glamofb_set_par while " "suspended\n"); return -EBUSY; } @@ -692,7 +713,8 @@ int glamofb_cmd_mode(struct glamofb_handle *gfb, int on) int timeout = 2000000; if (gfb->mach_info->glamo->suspending) { - dev_err(&gfb->mach_info->glamo->pdev->dev, "IGNORING glamofb_cmd_mode while " + dev_err(&gfb->mach_info->glamo->pdev->dev, + "IGNORING glamofb_cmd_mode while " "suspended\n"); return -EBUSY; } @@ -700,7 +722,7 @@ int glamofb_cmd_mode(struct glamofb_handle *gfb, int on) dev_dbg(gfb->dev, "glamofb_cmd_mode(gfb=%p, on=%d)\n", gfb, on); if (on) { dev_dbg(gfb->dev, "%s: waiting for cmdq empty: ", - __FUNCTION__); + __func__); while ((!glamofb_cmdq_empty(gfb)) && (timeout--)) /* yield() */; if (timeout < 0) { @@ -755,12 +777,13 @@ int glamofb_cmd_write(struct glamofb_handle *gfb, u_int16_t val) int timeout = 200000; if (gfb->mach_info->glamo->suspending) { - dev_err(&gfb->mach_info->glamo->pdev->dev, "IGNORING glamofb_cmd_write while " + dev_err(&gfb->mach_info->glamo->pdev->dev, + "IGNORING glamofb_cmd_write while " "suspended\n"); return -EBUSY; } - dev_dbg(gfb->dev, "%s: waiting for cmdq empty\n", __FUNCTION__); + dev_dbg(gfb->dev, "%s: waiting for cmdq empty\n", __func__); while ((!glamofb_cmdq_empty(gfb)) && (timeout--)) yield(); if (timeout < 0) { @@ -822,6 +845,7 @@ static int __init glamofb_probe(struct platform_device *pdev) glamofb->dev = &pdev->dev; glamofb->angle = 0; + glamofb->blank_mode = FB_BLANK_POWERDOWN; strcpy(fbinfo->fix.id, "SMedia Glamo"); @@ -976,38 +1000,35 @@ static int glamofb_suspend(struct platform_device *pdev, pm_message_t state) struct glamofb_handle *gfb = platform_get_drvdata(pdev); /* we need to stop anything touching our framebuffer */ -// fb_blank(gfb->fb, FB_BLANK_NORMAL); fb_set_suspend(gfb->fb, 1); /* seriously -- nobody is allowed to touch glamo memory when we * are suspended or we lock on nWAIT */ -// iounmap(gfb->fb->screen_base); + /* iounmap(gfb->fb->screen_base); */ return 0; } static int glamofb_resume(struct platform_device *pdev) { - struct glamofb_handle *glamofb = platform_get_drvdata(pdev); + struct glamofb_handle *gfb = platform_get_drvdata(pdev); struct glamofb_platform_data *mach_info = pdev->dev.platform_data; /* OK let's allow framebuffer ops again */ -// gfb->fb->screen_base = ioremap(gfb->fb_res->start, -// RESSIZE(gfb->fb_res)); + /* gfb->fb->screen_base = ioremap(gfb->fb_res->start, + RESSIZE(gfb->fb_res)); */ glamo_engine_enable(mach_info->glamo, GLAMO_ENGINE_LCD); glamo_engine_reset(mach_info->glamo, GLAMO_ENGINE_LCD); printk(KERN_ERR"spin_lock_init\n"); - spin_lock_init(&glamofb->lock_cmd); - glamofb_init_regs(glamofb); + spin_lock_init(&gfb->lock_cmd); + glamofb_init_regs(gfb); #ifdef CONFIG_MFD_GLAMO_HWACCEL - glamofb_cursor_onoff(glamofb, 1); + glamofb_cursor_onoff(gfb, 1); #endif - - fb_set_suspend(glamofb->fb, 0); -// fb_blank(gfb->fb, FB_BLANK_UNBLANK); + fb_set_suspend(gfb->fb, 0); return 0; } -- cgit v1.2.3 From 80f036923d92f1f1bc5435366e6af35905d9d927 Mon Sep 17 00:00:00 2001 From: Nelson Castillo Date: Mon, 20 Apr 2009 21:39:56 -0500 Subject: Make Xglamo workaround opt-out. Fixes #2255. To disable the workaround at run-time run: echo 0 > /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.9/glamo3362.0/glamo-fb.0/xglamo_hack I guess I should add a compile option now to completely disable the workaround but let's call this an enhancement and let's close the bug now. By default the workaround is enabled. Signed-off-by: Nelson Castillo Reported-by: Timo Juhani Lindfors --- drivers/mfd/glamo/glamo-fb.c | 171 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 144 insertions(+), 27 deletions(-) (limited to 'drivers/mfd/glamo/glamo-fb.c') diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c index 5491dadbf8a..43bb2359054 100644 --- a/drivers/mfd/glamo/glamo-fb.c +++ b/drivers/mfd/glamo/glamo-fb.c @@ -259,6 +259,7 @@ static void reg_set_bit_mask(struct glamofb_handle *glamo, #define GLAMO_LCD_HV_RETR_DISP_START_MASK 0x03FF #define GLAMO_LCD_HV_RETR_DISP_END_MASK 0x03FF +enum orientation {ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE}; /* the caller has to enxure lock_cmd is held and we are in cmd mode */ static void __rotate_lcd(struct glamofb_handle *glamo, __u32 rotation) @@ -306,34 +307,78 @@ static void __rotate_lcd(struct glamofb_handle *glamo, __u32 rotation) GLAMO_LCD_MODE1_ROTATE_EN : 0); } -static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, - struct fb_var_screeninfo *var) +static enum orientation get_orientation(struct fb_var_screeninfo *var) { - int sync, bp, disp, fp, total, pitch; - unsigned long flags; - int width, height; + if (var->xres <= var->yres) + return ORIENTATION_PORTRAIT; - if (!glamo || !var) - return; + return ORIENTATION_LANDSCAPE; +} - if (glamo->mach_info->glamo->suspending) { - dev_err(&glamo->mach_info->glamo->pdev->dev, - "IGNORING glamofb_update_lcd_controller while " - "suspended\n"); - return; +static int will_orientation_change(struct fb_var_screeninfo *var) +{ + enum orientation orient = get_orientation(var); + + switch (orient) { + case ORIENTATION_LANDSCAPE: + if (var->rotate == FB_ROTATE_UR || var->rotate == FB_ROTATE_UD) + return 1; + break; + case ORIENTATION_PORTRAIT: + if (var->rotate == FB_ROTATE_CW || var->rotate == FB_ROTATE_CCW) + return 1; + break; } + return 0; +} - dev_dbg(&glamo->mach_info->glamo->pdev->dev, - "glamofb_update_lcd_controller spin_lock_irqsave\n"); - spin_lock_irqsave(&glamo->lock_cmd, flags); +/* + * See https://docs.openmoko.org/trac/ticket/2255 + * We have a hack for some Xglamo bugs in kernel code. + * If someone fixes xglamo we can remove this hack. + * We might make xglamo_hack_enabled 0 by default in the future. + */ - if (glamofb_cmd_mode(glamo, 1)) - goto out_unlock; +static unsigned xglamo_hack_enabled = 1; - if (var->pixclock) - glamo_engine_reclock(glamo->mach_info->glamo, - GLAMO_ENGINE_LCD, - var->pixclock); +static ssize_t xglamo_hack_read(struct device *dev, + struct device_attribute *attr, char *buf) +{ + return sprintf(buf, "%d\n", xglamo_hack_enabled); +} + +static ssize_t xglamo_hack_write(struct device *dev, + struct device_attribute *attr, const char *buf, + size_t count) +{ + unsigned long val; + + if (!strict_strtoul(buf, 10, &val)) + xglamo_hack_enabled = !!val; + + return count; +} + +static DEVICE_ATTR(xglamo_hack, S_IWUSR | S_IRUGO, xglamo_hack_read, + xglamo_hack_write); + +static struct attribute *glamo_fb_sysfs_entries[] = { + &dev_attr_xglamo_hack.attr, + NULL +}; + +static struct attribute_group glamo_fb_attr_group = { + .name = NULL, + .attrs = glamo_fb_sysfs_entries, +}; + +/* This function implements the actual Xglamo hack. */ + +static void glamofb_update_lcd_controller_hack(struct glamofb_handle *glamo, + struct fb_var_screeninfo *var, + int *xres, int *yres, int *pitch) +{ + int width, height; if (glamo->angle == 90 || glamo->angle == 270) { /* @@ -365,23 +410,71 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, var->xres_virtual = width; var->yres_virtual = height * 2; - pitch = width * var->bits_per_pixel / 8; + *pitch = width * var->bits_per_pixel / 8; } else { var->xres = height; var->yres = width; var->xres_virtual = height * 2; var->yres_virtual = width; - pitch = height * var->bits_per_pixel / 8; + *pitch = height * var->bits_per_pixel / 8; + } + + *xres = width; + *yres = height; +} + +static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, + struct fb_var_screeninfo *var) +{ + int sync, bp, disp, fp, total, xres, yres, pitch; + int uninitialized_var(orientation_changing); + unsigned long flags; + + if (!glamo || !var) + return; + + if (glamo->mach_info->glamo->suspending) { + dev_err(&glamo->mach_info->glamo->pdev->dev, + "IGNORING glamofb_update_lcd_controller while " + "suspended\n"); + return; + } + + dev_dbg(&glamo->mach_info->glamo->pdev->dev, + "glamofb_update_lcd_controller spin_lock_irqsave\n"); + spin_lock_irqsave(&glamo->lock_cmd, flags); + + if (glamofb_cmd_mode(glamo, 1)) + goto out_unlock; + + if (var->pixclock) + glamo_engine_reclock(glamo->mach_info->glamo, + GLAMO_ENGINE_LCD, + var->pixclock); + + if (xglamo_hack_enabled) { + glamofb_update_lcd_controller_hack(glamo, var, &xres, &yres, + &pitch); + } else { + xres = var->xres; + yres = var->yres; + + orientation_changing = will_orientation_change(var); + /* Adjust the pitch according to new orientation to come. */ + if (will_orientation_change(var)) + pitch = var->yres * var->bits_per_pixel / 8; + else + pitch = var->xres * var->bits_per_pixel / 8; } reg_set_bit_mask(glamo, GLAMO_REG_LCD_WIDTH, GLAMO_LCD_WIDTH_MASK, - width); + xres); reg_set_bit_mask(glamo, GLAMO_REG_LCD_HEIGHT, GLAMO_LCD_HEIGHT_MASK, - height); + yres); reg_set_bit_mask(glamo, GLAMO_REG_LCD_PITCH, GLAMO_LCD_PITCH_MASK, @@ -390,11 +483,28 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, /* honour the rotation request */ __rotate_lcd(glamo, var->rotate); + if (!xglamo_hack_enabled) { + /* update the reported geometry of the framebuffer. */ + if (orientation_changing) { + var->xres_virtual = yres; + var->xres = yres; + var->xres_virtual *= 2; + var->yres_virtual = xres; + var->yres = xres; + } else { + var->xres_virtual = xres; + var->xres = xres; /* Unneeded. */ + var->yres_virtual = yres; + var->yres = yres; /* Unneeded. */ + var->yres_virtual *= 2; + } + } + /* update scannout timings */ sync = 0; bp = sync + var->hsync_len; disp = bp + var->left_margin; - fp = disp + width; + fp = disp + xres; total = fp + var->right_margin; reg_set_bit_mask(glamo, GLAMO_REG_LCD_HORIZ_TOTAL, @@ -411,7 +521,7 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, sync = 0; bp = sync + var->vsync_len; disp = bp + var->upper_margin; - fp = disp + height; + fp = disp + yres; total = fp + var->lower_margin; reg_set_bit_mask(glamo, GLAMO_REG_LCD_VERT_TOTAL, @@ -950,6 +1060,13 @@ static int __init glamofb_probe(struct platform_device *pdev) glamofb_cursor_onoff(glamofb, 1); #endif + /* sysfs */ + rc = sysfs_create_group(&pdev->dev.kobj, &glamo_fb_attr_group); + if (rc < 0) { + dev_err(&pdev->dev, "cannot create sysfs group\n"); + goto out_unmap_fb; + } + rc = register_framebuffer(fbinfo); if (rc < 0) { dev_err(&pdev->dev, "failed to register framebuffer\n"); -- cgit v1.2.3 From e360a2da41f5d1565424715f119d7290e9e6c073 Mon Sep 17 00:00:00 2001 From: Nelson Castillo Date: Tue, 21 Apr 2009 11:18:33 -0500 Subject: glamo_fb: Small cleanup ~ Cleanup of a redundant call I introduced before. ~ Removed useless assignation. Signed-off-by: Nelson Castillo --- drivers/mfd/glamo/glamo-fb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/mfd/glamo/glamo-fb.c') diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c index 43bb2359054..914eab43e55 100644 --- a/drivers/mfd/glamo/glamo-fb.c +++ b/drivers/mfd/glamo/glamo-fb.c @@ -461,7 +461,7 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, orientation_changing = will_orientation_change(var); /* Adjust the pitch according to new orientation to come. */ - if (will_orientation_change(var)) + if (orientation_changing) pitch = var->yres * var->bits_per_pixel / 8; else pitch = var->xres * var->bits_per_pixel / 8; @@ -493,9 +493,7 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, var->yres = xres; } else { var->xres_virtual = xres; - var->xres = xres; /* Unneeded. */ var->yres_virtual = yres; - var->yres = yres; /* Unneeded. */ var->yres_virtual *= 2; } } -- cgit v1.2.3 From 7a806d20b7709a2894a7e29896621964f0021c92 Mon Sep 17 00:00:00 2001 From: Nelson Castillo Date: Tue, 21 Apr 2009 11:18:43 -0500 Subject: glamo_fb: make Xglamo workaround conditional Distributions that use Xorg will not need the workaround at all and now they can disable it. Updated configurations to enable it by default. Signed-off-by: Nelson Castillo --- drivers/mfd/glamo/glamo-fb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/mfd/glamo/glamo-fb.c') diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c index 914eab43e55..1ebb87d1276 100644 --- a/drivers/mfd/glamo/glamo-fb.c +++ b/drivers/mfd/glamo/glamo-fb.c @@ -332,6 +332,8 @@ static int will_orientation_change(struct fb_var_screeninfo *var) return 0; } +#ifdef CONFIG_MFD_GLAMO_FB_XGLAMO_WORKAROUND + /* * See https://docs.openmoko.org/trac/ticket/2255 * We have a hack for some Xglamo bugs in kernel code. @@ -422,6 +424,14 @@ static void glamofb_update_lcd_controller_hack(struct glamofb_handle *glamo, *xres = width; *yres = height; } +#else +#define xglamo_hack_enabled 0 +static void glamofb_update_lcd_controller_hack(struct glamofb_handle *glamo, + struct fb_var_screeninfo *var, + int *xres, int *yres, int *pitch) +{ +} +#endif static void glamofb_update_lcd_controller(struct glamofb_handle *glamo, struct fb_var_screeninfo *var) @@ -1058,12 +1068,14 @@ static int __init glamofb_probe(struct platform_device *pdev) glamofb_cursor_onoff(glamofb, 1); #endif +#ifdef CONFIG_MFD_GLAMO_FB_XGLAMO_WORKAROUND /* sysfs */ rc = sysfs_create_group(&pdev->dev.kobj, &glamo_fb_attr_group); if (rc < 0) { dev_err(&pdev->dev, "cannot create sysfs group\n"); goto out_unmap_fb; } +#endif rc = register_framebuffer(fbinfo); if (rc < 0) { -- cgit v1.2.3