Merge tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm...
[linux-2.6.git] / arch / arm / mach-omap2 / board-rx51-peripherals.c
index 0c9e0f2..f120997 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/input/matrix_keypad.h>
 #include <linux/spi/spi.h>
 #include <linux/wl12xx.h>
+#include <linux/spi/tsc2005.h>
 #include <linux/i2c.h>
 #include <linux/i2c/twl.h>
 #include <linux/clk.h>
 #include <linux/gpio_keys.h>
 #include <linux/mmc/host.h>
 #include <linux/power/isp1704_charger.h>
+#include <asm/system_info.h>
 
 #include <plat/mcspi.h>
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/dma.h>
 #include <plat/gpmc.h>
 #include <plat/onenand.h>
@@ -58,6 +60,9 @@
 
 #define RX51_USB_TRANSCEIVER_RST_GPIO  67
 
+#define RX51_TSC2005_RESET_GPIO         104
+#define RX51_TSC2005_IRQ_GPIO           100
+
 /* list all spi devices here */
 enum {
        RX51_SPI_WL1251,
@@ -66,6 +71,7 @@ enum {
 };
 
 static struct wl12xx_platform_data wl1251_pdata;
+static struct tsc2005_platform_data tsc2005_pdata;
 
 #if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
 static struct tsl2563_platform_data rx51_tsl2563_platform_data = {
@@ -133,17 +139,14 @@ static struct lp5523_platform_data rx51_lp5523_platform_data = {
 
 static struct omap2_mcspi_device_config wl1251_mcspi_config = {
        .turbo_mode     = 0,
-       .single_channel = 1,
 };
 
 static struct omap2_mcspi_device_config mipid_mcspi_config = {
        .turbo_mode     = 0,
-       .single_channel = 1,
 };
 
 static struct omap2_mcspi_device_config tsc2005_mcspi_config = {
        .turbo_mode     = 0,
-       .single_channel = 1,
 };
 
 static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
@@ -167,10 +170,10 @@ static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
                .modalias               = "tsc2005",
                .bus_num                = 1,
                .chip_select            = 0,
-               /* .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),*/
+               .irq                    = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),
                .max_speed_hz           = 6000000,
                .controller_data        = &tsc2005_mcspi_config,
-               /* .platform_data = &tsc2005_config,*/
+               .platform_data          = &tsc2005_pdata,
        },
 };
 
@@ -193,7 +196,7 @@ static struct platform_device rx51_charger_device = {
 static void __init rx51_charger_init(void)
 {
        WARN_ON(gpio_request_one(RX51_USB_TRANSCEIVER_RST_GPIO,
-               GPIOF_OUT_INIT_LOW, "isp1704_reset"));
+               GPIOF_OUT_INIT_HIGH, "isp1704_reset"));
 
        platform_device_register(&rx51_charger_device);
 }
@@ -418,6 +421,10 @@ static struct regulator_consumer_supply rx51_vmmc1_supply[] = {
        REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
 };
 
+static struct regulator_consumer_supply rx51_vaux2_supply[] = {
+       REGULATOR_SUPPLY("vdds_csib", "omap3isp"),
+};
+
 static struct regulator_consumer_supply rx51_vaux3_supply[] = {
        REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
 };
@@ -479,6 +486,8 @@ static struct regulator_init_data rx51_vaux2 = {
                .valid_ops_mask         = REGULATOR_CHANGE_MODE
                                        | REGULATOR_CHANGE_STATUS,
        },
+       .num_consumer_supplies  = ARRAY_SIZE(rx51_vaux2_supply),
+       .consumer_supplies      = rx51_vaux2_supply,
 };
 
 /* VAUX3 - adds more power to VIO_18 rail */
@@ -864,11 +873,11 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = {
        .resource_config = twl4030_rconfig,
 };
 
-struct twl4030_codec_vibra_data rx51_vibra_data __initdata = {
+struct twl4030_vibra_data rx51_vibra_data __initdata = {
        .coexist        = 0,
 };
 
-struct twl4030_codec_data rx51_codec_data __initdata = {
+struct twl4030_audio_data rx51_audio_data __initdata = {
        .audio_mclk     = 26000000,
        .vibra          = &rx51_vibra_data,
 };
@@ -878,7 +887,7 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
        .gpio                   = &rx51_gpio_data,
        .keypad                 = &rx51_kp_data,
        .power                  = &rx51_t2scripts_data,
-       .codec                  = &rx51_codec_data,
+       .audio                  = &rx51_audio_data,
 
        .vaux1                  = &rx51_vaux1,
        .vaux2                  = &rx51_vaux2,
@@ -894,7 +903,6 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
 };
 
 static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata_or_module = {
-       .id                     = TPA6130A2,
        .power_gpio             = 98,
 };
 
@@ -935,6 +943,9 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
        },
 #endif
        {
+               I2C_BOARD_INFO("bq27200", 0x55),
+       },
+       {
                I2C_BOARD_INFO("tpa6130a2", 0x60),
                .platform_data = &rx51_tpa6130a2_data,
        }
@@ -1081,6 +1092,45 @@ error:
         */
 }
 
+static struct tsc2005_platform_data tsc2005_pdata = {
+       .ts_pressure_max        = 2048,
+       .ts_pressure_fudge      = 2,
+       .ts_x_max               = 4096,
+       .ts_x_fudge             = 4,
+       .ts_y_max               = 4096,
+       .ts_y_fudge             = 7,
+       .ts_x_plate_ohm         = 280,
+       .esd_timeout_ms         = 8000,
+};
+
+static struct gpio rx51_tsc2005_gpios[] __initdata = {
+       { RX51_TSC2005_IRQ_GPIO,   GPIOF_IN,            "tsc2005 IRQ"   },
+       { RX51_TSC2005_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "tsc2005 reset" },
+};
+
+static void rx51_tsc2005_set_reset(bool enable)
+{
+       gpio_set_value(RX51_TSC2005_RESET_GPIO, enable);
+}
+
+static void __init rx51_init_tsc2005(void)
+{
+       int r;
+
+       omap_mux_init_gpio(RX51_TSC2005_RESET_GPIO, OMAP_PIN_OUTPUT);
+       omap_mux_init_gpio(RX51_TSC2005_IRQ_GPIO, OMAP_PIN_INPUT_PULLUP);
+
+       r = gpio_request_array(rx51_tsc2005_gpios,
+                              ARRAY_SIZE(rx51_tsc2005_gpios));
+       if (r < 0) {
+               printk(KERN_ERR "tsc2005 board initialization failed\n");
+               tsc2005_pdata.esd_timeout_ms = 0;
+               return;
+       }
+
+       tsc2005_pdata.set_reset = rx51_tsc2005_set_reset;
+}
+
 void __init rx51_peripherals_init(void)
 {
        rx51_i2c_init();
@@ -1089,13 +1139,14 @@ void __init rx51_peripherals_init(void)
        board_smc91x_init();
        rx51_add_gpio_keys();
        rx51_init_wl1251();
+       rx51_init_tsc2005();
        rx51_init_si4713();
        spi_register_board_info(rx51_peripherals_spi_board_info,
                                ARRAY_SIZE(rx51_peripherals_spi_board_info));
 
        partition = omap_mux_get("core");
        if (partition)
-               omap2_hsmmc_init(mmc);
+               omap_hsmmc_init(mmc);
 
        rx51_charger_init();
 }