[PATCH 2/2] glamo_fb: make Xglamo workaround conditional
Nelson Castillo
arhuaco at freaks-unidos.net
Tue Apr 21 18:18:43 CEST 2009
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 at freaks-unidos.net>
---
arch/arm/configs/gta02_micro_defconfig | 1 +
arch/arm/configs/gta02_moredrivers_defconfig | 1 +
arch/arm/configs/gta02_packaging_defconfig | 1 +
drivers/mfd/glamo/Kconfig | 12 +++++++++++-
drivers/mfd/glamo/glamo-fb.c | 12 ++++++++++++
5 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/arch/arm/configs/gta02_micro_defconfig b/arch/arm/configs/gta02_micro_defconfig
index b81e96d..ae30c4b 100644
--- a/arch/arm/configs/gta02_micro_defconfig
+++ b/arch/arm/configs/gta02_micro_defconfig
@@ -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
diff --git a/arch/arm/configs/gta02_moredrivers_defconfig b/arch/arm/configs/gta02_moredrivers_defconfig
index a664520..1dbbbf6 100644
--- a/arch/arm/configs/gta02_moredrivers_defconfig
+++ b/arch/arm/configs/gta02_moredrivers_defconfig
@@ -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
diff --git a/arch/arm/configs/gta02_packaging_defconfig b/arch/arm/configs/gta02_packaging_defconfig
index b2bdae8..237fd95 100644
--- a/arch/arm/configs/gta02_packaging_defconfig
+++ b/arch/arm/configs/gta02_packaging_defconfig
@@ -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
diff --git a/drivers/mfd/glamo/Kconfig b/drivers/mfd/glamo/Kconfig
index d2ab370..60d29c9 100644
--- a/drivers/mfd/glamo/Kconfig
+++ b/drivers/mfd/glamo/Kconfig
@@ -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.
diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c
index 914eab4..1ebb87d 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) {
More information about the openmoko-kernel
mailing list