[xburst] time.c: Timer enable registers are only 8bit width.
[openwrt.git] / target / linux / xburst / files-2.6.32 / arch / mips / jz4740 / board-qi_lb60.c
index 5d22e20..8004417 100644 (file)
 #include <linux/spi/spi_gpio.h>
 #include <linux/power_supply.h>
 #include <linux/power/jz4740-battery.h>
+#include <linux/power/gpio-charger.h>
 #include <linux/mmc/jz4740_mmc.h>
 
+#include "clock.h"
 
 /* NAND */
 static struct nand_ecclayout qi_lb60_ecclayout_1gb = {
@@ -117,7 +119,6 @@ static struct jz_nand_platform_data qi_lb60_nand_pdata = {
        .busy_gpio = 94,
 };
 
-
 /* Keyboard*/
 
 /* #define KEEP_UART_ALIVE
@@ -237,7 +238,7 @@ static struct fb_videomode qi_lb60_video_modes[] = {
                .name = "320x240",
                .xres = 320,
                .yres = 240,
-               .pixclock = 700000,
+               .refresh = 30,
                .left_margin = 140,
                .right_margin = 273,
                .upper_margin = 20,
@@ -256,6 +257,7 @@ static struct jz4740_fb_platform_data qi_lb60_fb_pdata = {
        .modes          = qi_lb60_video_modes,
        .bpp            = 24,
        .lcd_type       = JZ_LCD_TYPE_8BIT_SERIAL,
+       .pixclk_falling_edge = 1,
 };
 
 
@@ -285,14 +287,35 @@ static struct spi_board_info qi_lb60_spi_board_info[] = {
 };
 
 /* Battery */
-static struct jz_batt_info qi_lb60_battery_pdata = {
-       .dc_dect_gpio   = GPIO_DC_DETE_N,
-       .usb_dect_gpio  = GPIO_USB_DETE,
-       .charg_stat_gpio  = GPIO_CHARG_STAT_N,
-
-       .min_voltag     = 3600000,
-       .max_voltag     = 4200000,
-       .batt_tech      = POWER_SUPPLY_TECHNOLOGY_LIPO,
+static struct jz_battery_platform_data qi_lb60_battery_pdata = {
+       .gpio_charge = GPIO_CHARG_STAT_N,
+       .gpio_charge_active_low = 1,
+       .info = {
+               .name = "battery",
+               .technology = POWER_SUPPLY_TECHNOLOGY_LIPO,
+               .voltage_max_design = 4200000,
+               .voltage_min_design = 3600000,
+       },
+};
+
+static char *qi_lb60_batteries[] = {
+       "battery",
+};
+
+static struct gpio_charger_platform_data qi_lb60_charger_pdata = {
+       .name = "USB",
+       .type = POWER_SUPPLY_TYPE_USB,
+       .gpio = GPIO_USB_DETE,
+       .gpio_active_low = 1,
+       .batteries = qi_lb60_batteries,
+       .num_batteries = ARRAY_SIZE(qi_lb60_batteries),
+};
+
+static struct platform_device qi_lb60_charger_device = {
+       .name = "gpio-charger",
+       .dev = {
+               .platform_data = &qi_lb60_charger_pdata,
+       },
 };
 
 /* GPIO Key: power */
@@ -340,6 +363,7 @@ static struct platform_device *jz_platform_devices[] __initdata = {
        &jz4740_adc_device,
        &jz4740_battery_device,
        &qi_lb60_gpio_keys,
+       &qi_lb60_charger_device,
 };
 
 static void __init board_gpio_setup(void)
@@ -364,12 +388,18 @@ static int __init qi_lb60_init_platform_devices(void)
                                        ARRAY_SIZE(jz_platform_devices));
 
 }
+
+struct jz4740_clock_board_data jz4740_clock_bdata = {
+       .ext_rate = 12000000,
+       .rtc_rate = 32768,
+};
+
 extern int jz_gpiolib_init(void);
-extern int jz_init_clocks(unsigned long extal);
 
 static __init int board_avt2(char *str)
 {
        qi_lb60_mmc_pdata.card_detect_active_low = 1;
+       qi_lb60_mmc_pdata.power_active_low      = 1;
 
        return 1;
 }
@@ -381,8 +411,8 @@ static int __init qi_lb60_board_setup(void)
        printk("Qi Hardware JZ4740 QI_LB60 setup\n");
        if (jz_gpiolib_init())
                panic("Failed to initalize jz gpio\n");
-       jz_init_clocks(12000000);
 
+       jz4740_clock_init();
        board_gpio_setup();
 
        if (qi_lb60_init_platform_devices())
This page took 0.023848 seconds and 4 git commands to generate.