Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
[pandora-kernel.git] / arch / arm / mach-pxa / zylonite.c
index dbb5462..66b446c 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/pwm_backlight.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/hardware.h>
+#include <asm/arch/audio.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pxafb.h>
 #include <asm/arch/zylonite.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/pxa27x_keypad.h>
 
+#include "devices.h"
 #include "generic.h"
 
 #define MAX_SLOTS      3
 struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS];
 
-int gpio_backlight;
 int gpio_eth_irq;
 
 int wm9713_irq;
@@ -62,10 +64,20 @@ static struct platform_device smc91x_device = {
 };
 
 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
-static void zylonite_backlight_power(int on)
-{
-       gpio_set_value(gpio_backlight, on);
-}
+static struct platform_pwm_backlight_data zylonite_backlight_data = {
+       .pwm_id         = 3,
+       .max_brightness = 100,
+       .dft_brightness = 100,
+       .pwm_period_ns  = 10000,
+};
+
+static struct platform_device zylonite_backlight_device = {
+       .name           = "pwm-backlight",
+       .dev            = {
+               .parent = &pxa27x_device_pwm1.dev,
+               .platform_data  = &zylonite_backlight_data,
+       },
+};
 
 static struct pxafb_mode_info toshiba_ltm035a776c_mode = {
        .pixclock               = 110000,
@@ -97,9 +109,7 @@ static struct pxafb_mode_info toshiba_ltm04c380k_mode = {
 
 static struct pxafb_mach_info zylonite_toshiba_lcd_info = {
        .num_modes              = 1,
-       .lccr0                  = LCCR0_Act,
-       .lccr3                  = LCCR3_PCP,
-       .pxafb_backlight_power  = zylonite_backlight_power,
+       .lcd_conn               = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
 };
 
 static struct pxafb_mode_info sharp_ls037_modes[] = {
@@ -134,15 +144,12 @@ static struct pxafb_mode_info sharp_ls037_modes[] = {
 static struct pxafb_mach_info zylonite_sharp_lcd_info = {
        .modes                  = sharp_ls037_modes,
        .num_modes              = 2,
-       .lccr0                  = LCCR0_Act,
-       .lccr3                  = LCCR3_PCP | LCCR3_HSP | LCCR3_VSP,
-       .pxafb_backlight_power  = zylonite_backlight_power,
+       .lcd_conn               = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
 };
 
 static void __init zylonite_init_lcd(void)
 {
-       /* backlight GPIO: output, default on */
-       gpio_direction_output(gpio_backlight, 1);
+       platform_device_register(&zylonite_backlight_device);
 
        if (lcd_id & 0x20) {
                set_pxa_fb_info(&zylonite_sharp_lcd_info);
@@ -331,6 +338,7 @@ static void __init zylonite_init(void)
        smc91x_resources[1].end   = gpio_to_irq(gpio_eth_irq);
        platform_device_register(&smc91x_device);
 
+       pxa_set_ac97_info(NULL);
        zylonite_init_lcd();
        zylonite_init_mmc();
        zylonite_init_keypad();