[PATCH] fix hardcoded values in collie frontlight
authorPavel Machek <pavel@ucw.cz>
Sat, 25 Mar 2006 11:07:33 +0000 (03:07 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 25 Mar 2006 16:22:55 +0000 (08:22 -0800)
In frontlight support, we should really use values from flash-ROM instead
of hardcoding our own.  Cleanup includes.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Acked-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/video/backlight/locomolcd.c

index ada6e75eb048544688e1ca099f002dba1020175a..60831bb236851d305b391647039708afd5d004e0 100644 (file)
 
 #include <asm/hardware/locomo.h>
 #include <asm/irq.h>
+#include <asm/mach/sharpsl_param.h>
+#include <asm/mach-types.h>
 
-#ifdef CONFIG_SA1100_COLLIE
-#include <asm/arch/collie.h>
-#else
-#include <asm/arch/poodle.h>
-#endif
-
-extern void (*sa1100fb_lcd_power)(int on);
+#include "../../../arch/arm/mach-sa1100/generic.h"
 
 static struct locomo_dev *locomolcd_dev;
 
@@ -82,7 +78,7 @@ static void locomolcd_off(int comadj)
 
 void locomolcd_power(int on)
 {
-       int comadj = 118;
+       int comadj = sharpsl_param.comadj;
        unsigned long flags;
 
        local_irq_save(flags);
@@ -93,11 +89,12 @@ void locomolcd_power(int on)
        }
 
        /* read comadj */
-#ifdef CONFIG_MACH_POODLE
-       comadj = 118;
-#else
-       comadj = 128;
-#endif
+       if (comadj == -1) {
+               if (machine_is_poodle())
+                       comadj = 118;
+               if (machine_is_collie())
+                       comadj = 128;
+       }
 
        if (on)
                locomolcd_on(comadj);