Blackfin: bf537-stamp/bf527-ezkit: move ASoC SPORT resources to boards file
[safe/jmp/linux-2.6] / arch / blackfin / mach-bf527 / boards / ezkit.c
index f93323d..3d32a35 100644 (file)
@@ -16,8 +16,9 @@
 #include <linux/i2c.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
-#include <linux/usb/sl811.h>
 #include <linux/usb/musb.h>
+#include <linux/leds.h>
+#include <linux/input.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
 #include <asm/reboot.h>
 /*
  * Name the Board for the /proc/cpuinfo
  */
+#ifdef CONFIG_BFIN527_EZKIT_V2
+const char bfin_board_name[] = "ADI BF527-EZKIT V2";
+#else
 const char bfin_board_name[] = "ADI BF527-EZKIT";
+#endif
 
 /*
  *  Driver needs to know address, irq and flag pin.
@@ -143,6 +148,33 @@ static struct platform_device bf52x_t350mcqb_device = {
 };
 #endif
 
+#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
+#include <asm/bfin-lq035q1.h>
+
+static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
+       .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
+       .ppi_mode = USE_RGB565_8_BIT_PPI,
+};
+
+static struct resource bfin_lq035q1_resources[] = {
+       {
+               .start = IRQ_PPI_ERROR,
+               .end = IRQ_PPI_ERROR,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device bfin_lq035q1_device = {
+       .name           = "bfin-lq035q1",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(bfin_lq035q1_resources),
+       .resource       = bfin_lq035q1_resources,
+       .dev            = {
+               .platform_data = &bfin_lq035q1_data,
+       },
+};
+#endif
+
 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
 static struct mtd_partition ezkit_partitions[] = {
        {
@@ -326,50 +358,6 @@ static struct platform_device dm9000_device = {
 };
 #endif
 
-#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
-static struct resource sl811_hcd_resources[] = {
-       {
-               .start = 0x20340000,
-               .end = 0x20340000,
-               .flags = IORESOURCE_MEM,
-       }, {
-               .start = 0x20340004,
-               .end = 0x20340004,
-               .flags = IORESOURCE_MEM,
-       }, {
-               .start = CONFIG_USB_SL811_BFIN_IRQ,
-               .end = CONFIG_USB_SL811_BFIN_IRQ,
-               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
-       },
-};
-
-#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
-void sl811_port_power(struct device *dev, int is_on)
-{
-       gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
-       gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
-}
-#endif
-
-static struct sl811_platform_data sl811_priv = {
-       .potpg = 10,
-       .power = 250,       /* == 500mA */
-#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
-       .port_power = &sl811_port_power,
-#endif
-};
-
-static struct platform_device sl811_hcd_device = {
-       .name = "sl811-hcd",
-       .id = 0,
-       .dev = {
-               .platform_data = &sl811_priv,
-       },
-       .num_resources = ARRAY_SIZE(sl811_hcd_resources),
-       .resource = sl811_hcd_resources,
-};
-#endif
-
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
 static struct platform_device bfin_mii_bus = {
        .name = "bfin_mii_bus",
@@ -488,8 +476,7 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {
        .median                 = 2,    /* do 8 measurements */
        .averaging              = 1,    /* take the average of 4 middle samples */
        .pen_down_acc_interval  = 255,  /* 9.4 ms */
-       .gpio_output            = 1,    /* configure AUX/VBAT/GPIO as GPIO output */
-       .gpio_default           = 1,    /* During initialization set GPIO = HIGH */
+       .gpio_export            = 0,    /* Export GPIO to gpiolib */
 };
 #endif
 
@@ -500,14 +487,6 @@ static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
 };
 #endif
 
-#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
-        && defined(CONFIG_SND_SOC_WM8731_SPI)
-static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
-       .enable_dma = 0,
-       .bits_per_word = 16,
-};
-#endif
-
 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
 static struct bfin5xx_spi_chip spidev_chip_info = {
        .enable_dma = 0,
@@ -515,6 +494,29 @@ static struct bfin5xx_spi_chip spidev_chip_info = {
 };
 #endif
 
+#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
+static struct platform_device bfin_i2s = {
+       .name = "bfin-i2s",
+       .id = CONFIG_SND_BF5XX_SPORT_NUM,
+       /* TODO: add platform data here */
+};
+#endif
+
+#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
+static struct platform_device bfin_tdm = {
+       .name = "bfin-tdm",
+       .id = CONFIG_SND_BF5XX_SPORT_NUM,
+       /* TODO: add platform data here */
+};
+#endif
+
+#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
+static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
+       .enable_dma     = 0,
+       .bits_per_word  = 8,
+};
+#endif
+
 static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #if defined(CONFIG_MTD_M25P80) \
        || defined(CONFIG_MTD_M25P80_MODULE)
@@ -586,17 +588,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .mode = SPI_CPHA | SPI_CPOL,
        },
 #endif
-#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
-        && defined(CONFIG_SND_SOC_WM8731_SPI)
-       {
-               .modalias       = "wm8731",
-               .max_speed_hz   = 3125000,     /* max spi clock (SCK) speed in HZ */
-               .bus_num        = 0,
-               .chip_select    = 5,
-               .controller_data = &spi_wm8731_chip_info,
-               .mode = SPI_MODE_0,
-       },
-#endif
 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
        {
                .modalias = "spidev",
@@ -606,6 +597,16 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .controller_data = &spidev_chip_info,
        },
 #endif
+#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
+       {
+               .modalias = "bfin-lq035q1-spi",
+               .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .chip_select = 7,
+               .controller_data = &lq035q1_spi_chip_info,
+               .mode = SPI_CPHA | SPI_CPOL,
+       },
+#endif
 };
 
 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
@@ -824,6 +825,71 @@ static struct platform_device i2c_bfin_twi_device = {
 };
 #endif
 
+#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
+#include <linux/mfd/adp5520.h>
+
+       /*
+        *  ADP5520/5501 LEDs Data
+        */
+
+static struct led_info adp5520_leds[] = {
+       {
+               .name = "adp5520-led1",
+               .default_trigger = "none",
+               .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
+       },
+};
+
+static struct adp5520_leds_platform_data adp5520_leds_data = {
+       .num_leds = ARRAY_SIZE(adp5520_leds),
+       .leds = adp5520_leds,
+       .fade_in = ADP5520_FADE_T_600ms,
+       .fade_out = ADP5520_FADE_T_600ms,
+       .led_on_time = ADP5520_LED_ONT_600ms,
+};
+
+       /*
+        *  ADP5520 Keypad Data
+        */
+
+static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
+       [ADP5520_KEY(3, 3)]     = KEY_1,
+       [ADP5520_KEY(2, 3)]     = KEY_2,
+       [ADP5520_KEY(1, 3)]     = KEY_3,
+       [ADP5520_KEY(0, 3)]     = KEY_UP,
+       [ADP5520_KEY(3, 2)]     = KEY_4,
+       [ADP5520_KEY(2, 2)]     = KEY_5,
+       [ADP5520_KEY(1, 2)]     = KEY_6,
+       [ADP5520_KEY(0, 2)]     = KEY_DOWN,
+       [ADP5520_KEY(3, 1)]     = KEY_7,
+       [ADP5520_KEY(2, 1)]     = KEY_8,
+       [ADP5520_KEY(1, 1)]     = KEY_9,
+       [ADP5520_KEY(0, 1)]     = KEY_DOT,
+       [ADP5520_KEY(3, 0)]     = KEY_BACKSPACE,
+       [ADP5520_KEY(2, 0)]     = KEY_0,
+       [ADP5520_KEY(1, 0)]     = KEY_HELP,
+       [ADP5520_KEY(0, 0)]     = KEY_ENTER,
+};
+
+static struct adp5520_keys_platform_data adp5520_keys_data = {
+       .rows_en_mask   = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
+       .cols_en_mask   = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
+       .keymap         = adp5520_keymap,
+       .keymapsize     = ARRAY_SIZE(adp5520_keymap),
+       .repeat         = 0,
+};
+
+       /*
+        *  ADP5520/5501 Multifuction Device Init Data
+        */
+
+static struct adp5520_platform_data adp5520_pdev_data = {
+       .leds = &adp5520_leds_data,
+       .keys = &adp5520_keys_data,
+};
+
+#endif
+
 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
        {
@@ -841,6 +907,25 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
                I2C_BOARD_INFO("bfin-adv7393", 0x2B),
        },
 #endif
+#if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
+       {
+               I2C_BOARD_INFO("ad7879", 0x2C),
+               .irq = IRQ_PF8,
+               .platform_data = (void *)&bfin_ad7879_ts_info,
+       },
+#endif
+#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
+       {
+               I2C_BOARD_INFO("pmic-adp5520", 0x32),
+               .irq = IRQ_PF9,
+               .platform_data = (void *)&adp5520_pdev_data,
+       },
+#endif
+#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
+       {
+               I2C_BOARD_INFO("ssm2602", 0x1b),
+       },
+#endif
 };
 
 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
@@ -915,7 +1000,6 @@ static struct platform_device bfin_sport1_uart_device = {
 #endif
 
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
-#include <linux/input.h>
 #include <linux/gpio_keys.h>
 
 static struct gpio_keys_button bfin_gpio_keys_table[] = {
@@ -937,7 +1021,6 @@ static struct platform_device bfin_device_gpiokeys = {
 #endif
 
 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
-#include <linux/input.h>
 #include <asm/bfin_rotary.h>
 
 static struct bfin_rotary_platform_data bfin_rotary_data = {
@@ -1006,10 +1089,6 @@ static struct platform_device *stamp_devices[] __initdata = {
        &rtc_device,
 #endif
 
-#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
-       &sl811_hcd_device,
-#endif
-
 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
        &bfin_isp1760_device,
 #endif
@@ -1043,6 +1122,10 @@ static struct platform_device *stamp_devices[] __initdata = {
        &bf52x_t350mcqb_device,
 #endif
 
+#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
+       &bfin_lq035q1_device,
+#endif
+
 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
 #ifdef CONFIG_SERIAL_BFIN_UART0
        &bfin_uart0_device,
@@ -1085,6 +1168,14 @@ static struct platform_device *stamp_devices[] __initdata = {
 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
        &ezkit_flash_device,
 #endif
+
+#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
+       &bfin_i2s,
+#endif
+
+#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
+       &bfin_tdm,
+#endif
 };
 
 static int __init ezkit_init(void)
@@ -1099,6 +1190,33 @@ static int __init ezkit_init(void)
 
 arch_initcall(ezkit_init);
 
+static struct platform_device *ezkit_early_devices[] __initdata = {
+#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
+#ifdef CONFIG_SERIAL_BFIN_UART0
+       &bfin_uart0_device,
+#endif
+#ifdef CONFIG_SERIAL_BFIN_UART1
+       &bfin_uart1_device,
+#endif
+#endif
+
+#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
+#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
+       &bfin_sport0_uart_device,
+#endif
+#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
+       &bfin_sport1_uart_device,
+#endif
+#endif
+};
+
+void __init native_machine_early_platform_add_devices(void)
+{
+       printk(KERN_INFO "register early platform devices\n");
+       early_platform_add_devices(ezkit_early_devices,
+               ARRAY_SIZE(ezkit_early_devices));
+}
+
 void native_machine_restart(char *cmd)
 {
        /* workaround reboot hang when booting from SPI */