Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[pandora-kernel.git] / arch / arm / mach-omap2 / board-ldp.c
index ea9f049..f7d6038 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/spi/spi.h>
-#include <linux/spi/ads7846.h>
 #include <linux/regulator/machine.h>
 #include <linux/i2c/twl.h>
 #include <linux/io.h>
@@ -49,6 +48,7 @@
 #include "mux.h"
 #include "hsmmc.h"
 #include "control.h"
+#include "common-board-devices.h"
 
 #define LDP_SMSC911X_CS                1
 #define LDP_SMSC911X_GPIO      152
@@ -168,55 +168,6 @@ static struct platform_device ldp_gpio_keys_device = {
        },
 };
 
-static int ts_gpio;
-
-/**
- * @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq
- *
- * @return - void. If request gpio fails then Flag KERN_ERR.
- */
-static void ads7846_dev_init(void)
-{
-       if (gpio_request(ts_gpio, "ads7846 irq") < 0) {
-               printk(KERN_ERR "can't get ads746 pen down GPIO\n");
-               return;
-       }
-
-       gpio_direction_input(ts_gpio);
-       gpio_set_debounce(ts_gpio, 310);
-}
-
-static int ads7846_get_pendown_state(void)
-{
-       return !gpio_get_value(ts_gpio);
-}
-
-static struct ads7846_platform_data tsc2046_config __initdata = {
-       .get_pendown_state      = ads7846_get_pendown_state,
-       .keep_vref_on           = 1,
-};
-
-static struct omap2_mcspi_device_config tsc2046_mcspi_config = {
-       .turbo_mode     = 0,
-       .single_channel = 1,    /* 0: slave, 1: master */
-};
-
-static struct spi_board_info ldp_spi_board_info[] __initdata = {
-       [0] = {
-               /*
-                * TSC2046 operates at a max freqency of 2MHz, so
-                * operate slightly below at 1.5MHz
-                */
-               .modalias               = "ads7846",
-               .bus_num                = 1,
-               .chip_select            = 0,
-               .max_speed_hz           = 1500000,
-               .controller_data        = &tsc2046_mcspi_config,
-               .irq                    = 0,
-               .platform_data          = &tsc2046_config,
-       },
-};
-
 static struct omap_smsc911x_platform_data smsc911x_cfg = {
        .cs             = LDP_SMSC911X_CS,
        .gpio_irq       = LDP_SMSC911X_GPIO,
@@ -314,19 +265,9 @@ static struct twl4030_platform_data ldp_twldata = {
        .keypad         = &ldp_kp_twl4030_data,
 };
 
-static struct i2c_board_info __initdata ldp_i2c_boardinfo[] = {
-       {
-               I2C_BOARD_INFO("twl4030", 0x48),
-               .flags = I2C_CLIENT_WAKE,
-               .irq = INT_34XX_SYS_NIRQ,
-               .platform_data = &ldp_twldata,
-       },
-};
-
 static int __init omap_i2c_init(void)
 {
-       omap_register_i2c_bus(1, 2600, ldp_i2c_boardinfo,
-                       ARRAY_SIZE(ldp_i2c_boardinfo));
+       omap3_pmic_init("twl4030", &ldp_twldata);
        omap_register_i2c_bus(2, 400, NULL, 0);
        omap_register_i2c_bus(3, 400, NULL, 0);
        return 0;
@@ -353,12 +294,6 @@ static struct omap_board_mux board_mux[] __initdata = {
 };
 #endif
 
-static struct omap_musb_board_data musb_board_data = {
-       .interface_type         = MUSB_INTERFACE_ULPI,
-       .mode                   = MUSB_OTG,
-       .power                  = 100,
-};
-
 static struct mtd_partition ldp_nand_partitions[] = {
        /* All the partition sizes are listed in terms of NAND block size */
        {
@@ -399,13 +334,9 @@ static void __init omap_ldp_init(void)
        ldp_init_smsc911x();
        omap_i2c_init();
        platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
-       ts_gpio = 54;
-       ldp_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
-       spi_register_board_info(ldp_spi_board_info,
-                               ARRAY_SIZE(ldp_spi_board_info));
-       ads7846_dev_init();
+       omap_ads7846_init(1, 54, 310, NULL);
        omap_serial_init();
-       usb_musb_init(&musb_board_data);
+       usb_musb_init(NULL);
        board_nand_init(ldp_nand_partitions,
                ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);