glamo_fb: make Xglamo workaround conditional
authorNelson Castillo <arhuaco@freaks-unidos.net>
Tue, 21 Apr 2009 16:18:43 +0000 (11:18 -0500)
committerNelson Castillo <arhuaco@freaks-unidos.net>
Tue, 21 Apr 2009 16:20:34 +0000 (11:20 -0500)
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 <arhuaco@freaks-unidos.net>
arch/arm/configs/gta02_micro_defconfig
arch/arm/configs/gta02_moredrivers_defconfig
arch/arm/configs/gta02_packaging_defconfig
drivers/mfd/glamo/Kconfig
drivers/mfd/glamo/glamo-fb.c

index b81e96d..ae30c4b 100644 (file)
@@ -707,6 +707,7 @@ CONFIG_PCF50633_GPIO=y
 # CONFIG_MFD_PCF50606 is not set
 CONFIG_MFD_GLAMO=y
 CONFIG_MFD_GLAMO_FB=y
+CONFIG_MFD_GLAMO_FB_XGLAMO_WORKAROUND=y
 CONFIG_MFD_GLAMO_SPI_GPIO=y
 CONFIG_MFD_GLAMO_SPI_FB=y
 CONFIG_MFD_GLAMO_MCI=y
index a664520..1dbbbf6 100644 (file)
@@ -1280,6 +1280,7 @@ CONFIG_PCF50633_GPIO=y
 # CONFIG_MFD_PCF50606 is not set
 CONFIG_MFD_GLAMO=y
 CONFIG_MFD_GLAMO_FB=y
+CONFIG_MFD_GLAMO_FB_XGLAMO_WORKAROUND=y
 CONFIG_MFD_GLAMO_SPI_GPIO=y
 CONFIG_MFD_GLAMO_SPI_FB=y
 CONFIG_MFD_GLAMO_MCI=y
index b2bdae8..237fd95 100644 (file)
@@ -1283,6 +1283,7 @@ CONFIG_PCF50633_GPIO=y
 # CONFIG_MFD_PCF50606 is not set
 CONFIG_MFD_GLAMO=y
 CONFIG_MFD_GLAMO_FB=y
+CONFIG_MFD_GLAMO_FB_XGLAMO_WORKAROUND=y
 CONFIG_MFD_GLAMO_SPI_GPIO=y
 CONFIG_MFD_GLAMO_SPI_FB=y
 CONFIG_MFD_GLAMO_MCI=y
index d2ab370..60d29c9 100644 (file)
@@ -22,6 +22,16 @@ config MFD_GLAMO_FB
 
          If unsure, say N.
 
+config MFD_GLAMO_FB_XGLAMO_WORKAROUND
+       bool "Smedia Glamo 336x/337x Xglamo rotation workaround"
+       depends on MFD_GLAMO_FB
+       help
+         This is a workaround for a Xglamo bug. This should be fixed
+         in Xglamo and not in kernel space.
+
+         If unsure, say N.
+
+
 config MFD_GLAMO_SPI_GPIO
        tristate "Glamo GPIO SPI bitbang support"
        depends on MFD_GLAMO
@@ -44,4 +54,4 @@ config MFD_GLAMO_MCI
          the S-Media GLAMO chip, as used in Openmoko
          neo1973 GTA-02.
 
-         If unsure, say N.
\ No newline at end of file
+         If unsure, say N.
index 914eab4..1ebb87d 100644 (file)
@@ -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) {