Index: linux-2.6.24/arch/arm/mach-s3c2440/mach-g500.c
===================================================================
--- linux-2.6.24.orig/arch/arm/mach-s3c2440/mach-g500.c	2008-02-21 09:10:17.000000000 +0100
+++ linux-2.6.24/arch/arm/mach-s3c2440/mach-g500.c	2008-02-21 09:10:23.000000000 +0100
@@ -30,10 +30,12 @@
 #include <asm/arch/regs-irq.h>
 #include <asm/arch/regs-gpio.h>
 #include <asm/arch/fb.h>
+#include <asm/arch/lcd.h>
 #include <asm/arch/ts.h>
 #include <asm/arch/mmc.h>
 
 #include <asm/plat-s3c/regs-serial.h>
+#include <asm/plat-s3c/regs-timer.h>
 #include <asm/plat-s3c/nand.h>
 #include <asm/plat-s3c24xx/clock.h>
 #include <asm/plat-s3c24xx/devs.h>
@@ -283,6 +285,68 @@
 	}
 };
 
+static void g500_backlight_power(int on)
+{
+	s3c2410_gpio_setpin(S3C2410_GPB0, 0);
+	s3c2410_gpio_pullup(S3C2410_GPB0, 0);
+
+	s3c2410_gpio_cfgpin(S3C2410_GPB0,
+			(on) ? S3C2410_GPB0_TOUT0 : S3C2410_GPB0_OUTP);
+}
+
+static void g500_lcd_power(int on)
+{
+	s3c2410_gpio_setpin(S3C2410_GPC0, on);
+}
+
+static void g500_set_brightness(int tcmpb0)
+{
+	unsigned long tcfg0;
+	unsigned long tcfg1;
+	unsigned long tcon;
+
+	/* configure power on/off */
+	g500_backlight_power(tcmpb0 ? 1 : 0);
+
+
+	tcfg0=readl(S3C2410_TCFG0);
+	tcfg1=readl(S3C2410_TCFG1);
+
+	tcfg0 &= ~S3C2410_TCFG_PRESCALER0_MASK;
+	tcfg0 |= 0x18;
+
+	tcfg1 &= ~S3C2410_TCFG1_MUX0_MASK;
+	tcfg1 |= S3C2410_TCFG1_MUX0_DIV2;
+
+	writel(tcfg0, S3C2410_TCFG0);
+	writel(tcfg1, S3C2410_TCFG1);
+	writel(0x31, S3C2410_TCNTB(0));
+
+	tcon = readl(S3C2410_TCON);
+	tcon &= ~0x0F;
+	tcon |= S3C2410_TCON_T0RELOAD;
+	tcon |= S3C2410_TCON_T0MANUALUPD;
+
+	writel(tcon, S3C2410_TCON);
+	writel(0x31, S3C2410_TCNTB(0));
+	writel(tcmpb0, S3C2410_TCMPB(0));
+
+	/* start the timer running */
+	tcon |= S3C2410_TCON_T0START;
+	tcon &= ~S3C2410_TCON_T0MANUALUPD;
+	writel(tcon, S3C2410_TCON);
+}
+
+static struct s3c2410_bl_mach_info g500_bl_cfg __initdata = {
+
+	.backlight_max          = 0x2c,
+	.backlight_default      = 0x16,
+	.backlight_power	= g500_backlight_power,
+	.set_brightness		= g500_set_brightness,
+	.backlight_power	= g500_backlight_power,
+	.lcd_power		= g500_lcd_power
+};
+
 static struct platform_device *g500_devices[] __initdata = {
 	&s3c_device_rtc,
 	&s3c_device_usb,
@@ -294,6 +358,7 @@
 	&s3c_device_usbgadget,
 	&s3c_device_ts,
 	&s3c_device_sdi,
+	&s3c_device_bl,
 };
 
 static void __init g500_map_io(void)
@@ -313,6 +378,7 @@
 	s3c_device_sdi.dev.platform_data = &g500_mmc_cfg;
   platform_device_register(&g500_button_device);
 	platform_device_register(&g500_gpio_leds);
+	set_s3c2410bl_info(&g500_bl_cfg);
 
 	s3c2410_pm_init();
 

