ARM: tegra: Check regulator_enable return values
[linux-3.10.git] / arch / arm / mach-tegra / board-pluto.c
index 12e4ebb..54ccf4b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-pluto.c
  *
- * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -35,8 +35,9 @@
 #include <linux/spi/rm31080a_ts.h>
 #include <linux/tegra_uart.h>
 #include <linux/memblock.h>
-#include <linux/spi-tegra.h>
+#include <linux/spi/spi-tegra.h>
 #include <linux/nfc/pn544.h>
+#include <linux/nfc/bcm2079x.h>
 #include <linux/rfkill-gpio.h>
 #include <linux/skbuff.h>
 #include <linux/ti_wilink_st.h>
 #include <linux/mfd/max8831.h>
 #include <linux/of_platform.h>
 #include <linux/a2220.h>
-#include <linux/edp.h>
 #include <linux/mfd/tlv320aic3262-registers.h>
 #include <linux/mfd/tlv320aic3xxx-core.h>
-
-#include <asm/hardware/gic.h>
+#include <linux/usb/tegra_usb_phy.h>
 
 #include <mach/clk.h>
-#include <mach/iomap.h>
 #include <mach/irqs.h>
 #include <mach/pinmux.h>
 #include <mach/pinmux-t11.h>
-#include <mach/iomap.h>
-#include <mach/io.h>
 #include <mach/io_dpd.h>
 #include <mach/i2s.h>
 #include <mach/isomgr.h>
 #include <mach/tegra_asoc_pdata.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <mach/usb_phy.h>
 #include <mach/gpio-tegra.h>
 #include <mach/tegra_fiq_debugger.h>
 #include <mach/tegra-bb-power.h>
-#include <mach/tegra_usb_modem_power.h>
 #include <mach/tegra_wakeup_monitor.h>
+#include <linux/platform_data/tegra_usb_modem_power.h>
+#include <mach/xusb.h>
 
 #include "board.h"
 #include "board-common.h"
+#include "board-touch.h"
 #include "board-touch-raydium.h"
 #include "clock.h"
 #include "board-pluto.h"
@@ -86,6 +83,8 @@
 #include "fuse.h"
 #include "pm.h"
 #include "common.h"
+#include "iomap.h"
+
 
 #ifdef CONFIG_BT_BLUESLEEP
 static struct rfkill_gpio_platform_data pluto_bt_rfkill_pdata = {
@@ -219,54 +218,60 @@ static __initdata struct tegra_clk_init_table pluto_clk_init_table[] = {
        { "i2c3",       "pll_p",        3200000,        false},
        { "i2c4",       "pll_p",        3200000,        false},
        { "i2c5",       "pll_p",        3200000,        false},
+       { "sbc1",       "pll_p",        25000000,       false},
+       { "sbc2",       "pll_p",        25000000,       false},
+       { "sbc3",       "pll_p",        25000000,       false},
+       { "sbc4",       "pll_p",        25000000,       false},
+       { "sbc5",       "pll_p",        25000000,       false},
+       { "sbc6",       "pll_p",        25000000,       false},
        { "extern3",    "clk_m",        12000000,       false},
+       { "dsia",       "pll_d2_out0",  0,              false},
        { NULL,         NULL,           0,              0},
 };
 
+static struct bcm2079x_platform_data nfc_pdata = {
+       .irq_gpio = TEGRA_GPIO_PW2,
+       .en_gpio = TEGRA_GPIO_PU4,
+       .wake_gpio = TEGRA_GPIO_PX7,
+       };
+
+static struct i2c_board_info __initdata pluto_i2c_bus3_board_info[] = {
+       {
+               I2C_BOARD_INFO("bcm2079x-i2c", 0x77),
+               .platform_data = &nfc_pdata,
+       },
+};
+
 static struct tegra_i2c_platform_data pluto_i2c1_platform_data = {
-       .adapter_nr     = 0,
-       .bus_count      = 1,
-       .bus_clk_rate   = { 100000, 0 },
-       .scl_gpio               = {TEGRA_GPIO_I2C1_SCL, 0},
-       .sda_gpio               = {TEGRA_GPIO_I2C1_SDA, 0},
-       .arb_recovery = arb_lost_recovery,
+       .bus_clk_rate   = 100000,
+       .scl_gpio       = TEGRA_GPIO_I2C1_SCL,
+       .sda_gpio       = TEGRA_GPIO_I2C1_SDA,
 };
 
 static struct tegra_i2c_platform_data pluto_i2c2_platform_data = {
-       .adapter_nr     = 1,
-       .bus_count      = 1,
-       .bus_clk_rate   = { 100000, 0 },
+       .bus_clk_rate   = 100000,
        .is_clkon_always = true,
-       .scl_gpio               = {TEGRA_GPIO_I2C2_SCL, 0},
-       .sda_gpio               = {TEGRA_GPIO_I2C2_SDA, 0},
-       .arb_recovery = arb_lost_recovery,
+       .scl_gpio       = TEGRA_GPIO_I2C2_SCL,
+       .sda_gpio       = TEGRA_GPIO_I2C2_SDA,
 };
 
 static struct tegra_i2c_platform_data pluto_i2c3_platform_data = {
-       .adapter_nr     = 2,
-       .bus_count      = 1,
-       .bus_clk_rate   = { 100000, 0 },
-       .scl_gpio               = {TEGRA_GPIO_I2C3_SCL, 0},
-       .sda_gpio               = {TEGRA_GPIO_I2C3_SDA, 0},
-       .arb_recovery = arb_lost_recovery,
+       .bus_clk_rate   = 400000,
+       .scl_gpio       = TEGRA_GPIO_I2C3_SCL,
+       .sda_gpio       = TEGRA_GPIO_I2C3_SDA,
 };
 
 static struct tegra_i2c_platform_data pluto_i2c4_platform_data = {
-       .adapter_nr     = 3,
-       .bus_count      = 1,
-       .bus_clk_rate   = { 10000, 0 },
-       .scl_gpio               = {TEGRA_GPIO_I2C4_SCL, 0},
-       .sda_gpio               = {TEGRA_GPIO_I2C4_SDA, 0},
-       .arb_recovery = arb_lost_recovery,
+       .bus_clk_rate   = 10000,
+       .scl_gpio       = TEGRA_GPIO_I2C4_SCL,
+       .sda_gpio       = TEGRA_GPIO_I2C4_SDA,
 };
 
 static struct tegra_i2c_platform_data pluto_i2c5_platform_data = {
-       .adapter_nr     = 4,
-       .bus_count      = 1,
-       .bus_clk_rate   = { 400000, 0 },
-       .scl_gpio               = {TEGRA_GPIO_I2C5_SCL, 0},
-       .sda_gpio               = {TEGRA_GPIO_I2C5_SDA, 0},
-       .arb_recovery = arb_lost_recovery,
+       .bus_clk_rate   = 400000,
+       .scl_gpio       = TEGRA_GPIO_I2C5_SCL,
+       .sda_gpio       = TEGRA_GPIO_I2C5_SDA,
+       .needs_cl_dvfs_clock = true,
 };
 
 static struct aic3262_gpio_setup aic3262_gpio[] = {
@@ -282,9 +287,10 @@ static struct aic3262_gpio_setup aic3262_gpio[] = {
                .in = 0,
                .value = AIC3262_GPIO2_FUNC_ADC_MOD_CLK_OUTPUT,
        },
-       /* GPIO 1 */
+       /* GPI1 */
        {
-               .used = 0,
+               .used = 1,
+               .in = 1,
        },
        /* GPI2 */
        {
@@ -297,8 +303,9 @@ static struct aic3262_gpio_setup aic3262_gpio[] = {
        },
        /* GPO1 */
        {
-               .used = 0,
-               .value = AIC3262_GPO1_FUNC_DISABLED,
+               .used = 1,
+               .in = 0,
+               .value = AIC3262_GPO1_FUNC_MSO_OUTPUT_FOR_SPI,
        },
 };
 static struct aic3xxx_pdata aic3262_codec_pdata = {
@@ -331,13 +338,18 @@ static void pluto_i2c_init(void)
 
        platform_device_register(&tegra11_i2c_device5);
        platform_device_register(&tegra11_i2c_device4);
+#ifndef CONFIG_OF
        platform_device_register(&tegra11_i2c_device3);
+#endif
        platform_device_register(&tegra11_i2c_device2);
        platform_device_register(&tegra11_i2c_device1);
 
        i2c_register_board_info(0, &pluto_codec_a2220_info, 1);
        i2c_register_board_info(0, &cs42l73_board_info, 1);
        i2c_register_board_info(0, &pluto_codec_aic326x_info, 1);
+       pluto_i2c_bus3_board_info[0].irq = gpio_to_irq(TEGRA_GPIO_PW2);
+       i2c_register_board_info(0, pluto_i2c_bus3_board_info, 1);
+       i2c_register_board_info(0, &pluto_codec_aic326x_info, 1);
 }
 
 static struct platform_device *pluto_uart_devices[] __initdata = {
@@ -425,6 +437,7 @@ static struct platform_device tegra_rtc_device = {
 static struct tegra_wakeup_monitor_platform_data
                        pluto_tegra_wakeup_monitor_pdata = {
        .wifi_wakeup_source     = 6,
+       .rtc_wakeup_source      = 18,
 };
 
 static struct platform_device pluto_tegra_wakeup_monitor_device = {
@@ -443,6 +456,8 @@ static struct tegra_asoc_platform_data pluto_audio_pdata = {
        .gpio_int_mic_en        = TEGRA_GPIO_INT_MIC_EN,
        .gpio_ext_mic_en        = TEGRA_GPIO_EXT_MIC_EN,
        .gpio_ldo1_en           = TEGRA_GPIO_LDO1_EN,
+       .edp_support            =  true,
+       .edp_states             = {1776, 888, 0},
        .i2s_param[HIFI_CODEC]  = {
                .audio_port_id  = 1,
                .is_i2s_master  = 0,
@@ -484,12 +499,15 @@ static struct tegra_asoc_platform_data pluto_aic3262_pdata = {
        .gpio_int_mic_en        = TEGRA_GPIO_INT_MIC_EN,
        .gpio_ext_mic_en        = TEGRA_GPIO_EXT_MIC_EN,
        .gpio_ldo1_en           = TEGRA_GPIO_LDO1_EN,
+       .edp_support            = true,
+       .edp_states             = {1776, 888, 0},
        .i2s_param[HIFI_CODEC]  = {
                .audio_port_id  = 1,
-               .is_i2s_master  = 1,
+               .is_i2s_master  = 0,
                .i2s_mode       = TEGRA_DAIFMT_I2S,
                .sample_size    = 16,
-               .channels       = 2,
+               .rate           = 48000,
+               .channels       = 2,
        },
        .i2s_param[BASEBAND]    = {
                .audio_port_id  = 2,
@@ -534,9 +552,20 @@ static struct platform_device pluto_audio_aic326x_device = {
        },
 };
 
-static struct platform_device tegra_camera = {
-       .name = "tegra_camera",
-       .id = -1,
+static struct tegra_spi_device_controller_data dev_bdata = {
+       .rx_clk_tap_delay = 0,
+       .tx_clk_tap_delay = 0,
+};
+static struct spi_board_info aic326x_spi_board_info[] = {
+       {
+               .modalias = "tlv320aic3xxx",
+               .bus_num = 3,
+               .chip_select = 0,
+               .max_speed_hz = 4*1000*1000,
+               .mode = SPI_MODE_1,
+               .controller_data = &dev_bdata,
+               .platform_data = &aic3262_codec_pdata,
+       },
 };
 
 #ifdef CONFIG_MHI_NETDEV
@@ -550,10 +579,12 @@ static struct platform_device *pluto_devices[] __initdata = {
        &tegra_pmu_device,
        &tegra_rtc_device,
        &tegra_udc_device,
+#if defined(CONFIG_TEGRA_WATCHDOG)
+       &tegra_wdt0_device,
+#endif
 #if defined(CONFIG_TEGRA_AVP)
        &tegra_avp_device,
 #endif
-       &tegra_camera,
 #if defined(CONFIG_CRYPTO_DEV_TEGRA_SE)
        &tegra11_se_device,
 #endif
@@ -585,18 +616,53 @@ static struct platform_device *pluto_devices[] __initdata = {
 };
 
 #ifdef CONFIG_USB_SUPPORT
-static struct tegra_usb_platform_data tegra_ehci3_hsic_xmm_pdata = {
-       .port_otg = false,
-       .has_hostpc = true,
-       .unaligned_dma_buf_supported = false,
-       .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
-       .op_mode        = TEGRA_USB_OPMODE_HOST,
-       .u_data.host = {
-               .vbus_gpio = -1,
-               .hot_plug = false,
-               .remote_wakeup_supported = true,
-               .power_off_on_suspend = true,
-       },
+
+static void pluto_usb_hsic_postsupend(void)
+{
+       pr_debug("%s\n", __func__);
+#ifdef CONFIG_TEGRA_BB_XMM_POWER
+       baseband_xmm_set_power_status(BBXMM_PS_L2);
+#endif
+}
+
+static void pluto_usb_hsic_preresume(void)
+{
+       pr_debug("%s\n", __func__);
+#ifdef CONFIG_TEGRA_BB_XMM_POWER
+       baseband_xmm_set_power_status(BBXMM_PS_L2TOL0);
+#endif
+}
+
+static void pluto_usb_hsic_post_resume(void)
+{
+       pr_debug("%s\n", __func__);
+#ifdef CONFIG_TEGRA_BB_XMM_POWER
+       baseband_xmm_set_power_status(BBXMM_PS_L0);
+#endif
+}
+
+static void pluto_usb_hsic_phy_power(void)
+{
+       pr_debug("%s\n", __func__);
+#ifdef CONFIG_TEGRA_BB_XMM_POWER
+       baseband_xmm_set_power_status(BBXMM_PS_L0);
+#endif
+}
+
+static void pluto_usb_hsic_post_phy_off(void)
+{
+       pr_debug("%s\n", __func__);
+#ifdef CONFIG_TEGRA_BB_XMM_POWER
+       baseband_xmm_set_power_status(BBXMM_PS_L2);
+#endif
+}
+
+static struct tegra_usb_phy_platform_ops oem2_plat_ops = {
+       .post_suspend = pluto_usb_hsic_postsupend,
+       .pre_resume = pluto_usb_hsic_preresume,
+       .port_power = pluto_usb_hsic_phy_power,
+       .post_resume = pluto_usb_hsic_post_resume,
+       .post_phy_off = pluto_usb_hsic_post_phy_off,
 };
 
 static struct tegra_usb_platform_data tegra_ehci3_hsic_smsc_hub_pdata = {
@@ -616,7 +682,8 @@ static struct tegra_usb_platform_data tegra_ehci3_hsic_smsc_hub_pdata = {
 static struct tegra_usb_platform_data tegra_udc_pdata = {
        .port_otg = true,
        .has_hostpc = true,
-       .builtin_host_disabled = true,
+       .id_det_type = TEGRA_USB_PMU_ID,
+       .unaligned_dma_buf_supported = false,
        .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
        .op_mode = TEGRA_USB_OPMODE_DEVICE,
        .u_data.dev = {
@@ -631,8 +698,8 @@ static struct tegra_usb_platform_data tegra_udc_pdata = {
                .idle_wait_delay = 17,
                .term_range_adj = 6,
                .xcvr_setup = 8,
-               .xcvr_lsfslew = 2,
-               .xcvr_lsrslew = 2,
+               .xcvr_lsfslew = 0,
+               .xcvr_lsrslew = 3,
                .xcvr_setup_offset = 0,
                .xcvr_use_fuses = 1,
        },
@@ -641,7 +708,7 @@ static struct tegra_usb_platform_data tegra_udc_pdata = {
 static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .port_otg = true,
        .has_hostpc = true,
-       .builtin_host_disabled = true,
+       .id_det_type = TEGRA_USB_PMU_ID,
        .unaligned_dma_buf_supported = false,
        .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
        .op_mode = TEGRA_USB_OPMODE_HOST,
@@ -657,8 +724,8 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
                .idle_wait_delay = 17,
                .term_range_adj = 6,
                .xcvr_setup = 15,
-               .xcvr_lsfslew = 2,
-               .xcvr_lsrslew = 2,
+               .xcvr_lsfslew = 0,
+               .xcvr_lsrslew = 3,
                .xcvr_setup_offset = 0,
                .xcvr_use_fuses = 1,
                .vbus_oc_map = 0x7,
@@ -668,6 +735,7 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
 static struct tegra_usb_otg_data tegra_otg_pdata = {
        .ehci_device = &tegra_ehci1_device,
        .ehci_pdata = &tegra_ehci1_utmi_pdata,
+       .id_extcon_dev_name = "MAX77665_MUIC_ID",
 };
 
 static struct regulator *baseband_reg;
@@ -677,17 +745,7 @@ static struct gpio modem_gpios[] = { /* i500 modem */
 
 static struct gpio modem2_gpios[] = {
        {MDM2_PWR_ON, GPIOF_OUT_INIT_LOW, "MODEM2 PWR ON"},
-       {MDM2_RST, GPIOF_DIR_OUT, "MODEM2 RESET"},
-       {MDM2_ACK2, GPIOF_OUT_INIT_HIGH, "MODEM2 ACK2"},
-       {MDM2_ACK1, GPIOF_OUT_INIT_LOW, "MODEM2 ACK1"},
-};
-
-static void baseband2_post_phy_on(void);
-static void baseband2_pre_phy_off(void);
-
-static struct tegra_usb_phy_platform_ops baseband2_plat_ops = {
-       .pre_phy_off = baseband2_pre_phy_off,
-       .post_phy_on = baseband2_post_phy_on,
+       {MDM2_RST, GPIOF_OUT_INIT_LOW, "MODEM2 RESET"},
 };
 
 static struct tegra_usb_platform_data tegra_ehci2_hsic_baseband_pdata = {
@@ -699,8 +757,8 @@ static struct tegra_usb_platform_data tegra_ehci2_hsic_baseband_pdata = {
        .u_data.host = {
                .vbus_gpio = -1,
                .hot_plug = false,
-               .remote_wakeup_supported = false,
-               .power_off_on_suspend = false,
+               .remote_wakeup_supported = true,
+               .power_off_on_suspend = true,
        },
 };
 
@@ -713,10 +771,9 @@ static struct tegra_usb_platform_data tegra_ehci3_hsic_baseband2_pdata = {
        .u_data.host = {
                .vbus_gpio = -1,
                .hot_plug = false,
-               .remote_wakeup_supported = false,
-               .power_off_on_suspend = false,
+               .remote_wakeup_supported = true,
+               .power_off_on_suspend = true,
        },
-       .ops = &baseband2_plat_ops,
 };
 
 static struct tegra_usb_platform_data tegra_hsic_pdata = {
@@ -819,10 +876,16 @@ static int baseband_init(void)
        }
 
        baseband_reg = regulator_get(NULL, "vdd_core_bb");
-       if (IS_ERR_OR_NULL(baseband_reg))
+       if (IS_ERR(baseband_reg))
                pr_warn("%s: baseband regulator get failed\n", __func__);
-       else
-               regulator_enable(baseband_reg);
+       else {
+               if (regulator_enable(baseband_reg) != 0)
+                       pr_warn("baseband regulator enable failed\n");
+       }
+
+       /* enable pull-up for MDM1 UART RX */
+       tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_GPIO_PU1,
+                                   TEGRA_PUPD_PULL_UP);
 
        /* enable pull-down for MDM1_COLD_BOOT */
        tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_ULPI_DATA4,
@@ -838,6 +901,17 @@ static const struct tegra_modem_operations baseband_operations = {
        .init = baseband_init,
 };
 
+#define MODEM_BOOT_EDP_MAX 0
+/* FIXME: get accurate boot current value */
+static unsigned int modem_boot_edp_states[] = { 1900, 0 };
+static struct edp_client modem_boot_edp_client = {
+       .name = "modem_boot",
+       .states = modem_boot_edp_states,
+       .num_states = ARRAY_SIZE(modem_boot_edp_states),
+       .e0_index = MODEM_BOOT_EDP_MAX,
+       .priority = EDP_MAX_PRIO,
+};
+
 static struct tegra_usb_modem_power_platform_data baseband_pdata = {
        .ops = &baseband_operations,
        .wake_gpio = -1,
@@ -847,6 +921,12 @@ static struct tegra_usb_modem_power_platform_data baseband_pdata = {
        .short_autosuspend_delay = 50,
        .tegra_ehci_device = &tegra_ehci2_device,
        .tegra_ehci_pdata = &tegra_ehci2_hsic_baseband_pdata,
+       .modem_boot_edp_client = &modem_boot_edp_client,
+       .edp_manager_name = "battery",
+       .i_breach_ppm = 500000,
+       /* FIXME: get useful adjperiods */
+       .i_thresh_3g_adjperiod = 10000,
+       .i_thresh_lte_adjperiod = 10000,
 };
 
 static struct platform_device icera_baseband_device = {
@@ -857,51 +937,37 @@ static struct platform_device icera_baseband_device = {
        },
 };
 
-static void baseband2_post_phy_on(void)
-{
-       /* set MDM2_ACK2 low */
-       gpio_set_value(MDM2_ACK2, 0);
-}
-
-static void baseband2_pre_phy_off(void)
-{
-       /* set MDM2_ACK2 high */
-       gpio_set_value(MDM2_ACK2, 1);
-}
-
 static void baseband2_start(void)
 {
-       /*
-        *  Leave baseband powered OFF.
-        *  User-space daemons will take care of powering it up.
-        */
        pr_info("%s\n", __func__);
-       gpio_set_value(MDM2_PWR_ON, 0);
+       gpio_set_value(MDM2_PWR_ON, 1);
 }
 
 static void baseband2_reset(void)
 {
        /* Initiate power cycle on baseband sub system */
        pr_info("%s\n", __func__);
-       gpio_set_value(MDM2_PWR_ON, 0);
+       gpio_set_value(MDM2_RST, 0);
        mdelay(200);
-       gpio_set_value(MDM2_PWR_ON, 1);
+       gpio_set_value(MDM2_RST, 1);
 }
 
 static int baseband2_init(void)
 {
        int ret;
 
+       tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPIO_X1_AUD, TEGRA_TRI_NORMAL);
+
        ret = gpio_request_array(modem2_gpios, ARRAY_SIZE(modem2_gpios));
        if (ret)
                return ret;
 
-       /* enable pull-up for MDM2_REQ2 */
-       tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_GPIO_PV1,
-                                   TEGRA_PUPD_PULL_UP);
+       /* enable pull-down for MDM2_COLD_BOOT */
+       tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_KB_ROW4,
+                                   TEGRA_PUPD_PULL_DOWN);
 
        /* export GPIO for user space access through sysfs */
-       gpio_export(MDM2_PWR_ON, false);
+       gpio_export(MDM2_RST, false);
 
        return 0;
 }
@@ -914,8 +980,7 @@ static const struct tegra_modem_operations baseband2_operations = {
 
 static struct tegra_usb_modem_power_platform_data baseband2_pdata = {
        .ops = &baseband2_operations,
-       .wake_gpio = MDM2_REQ2,
-       .wake_irq_flags = IRQF_TRIGGER_FALLING,
+       .wake_gpio = -1,
        .boot_gpio = MDM2_COLDBOOT,
        .boot_irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
        .autosuspend_delay = 2000,
@@ -1024,8 +1089,11 @@ static void pluto_modem_init(void)
                                = MDM2_PWR_ON_FOR_PLUTO_A02;
                }
                /* baseband-power.ko will register ehci3 device */
+               tegra_hsic_pdata.ops = &oem2_plat_ops;
+               tegra_hsic_pdata.u_data.host.remote_wakeup_supported = false;
+               tegra_hsic_pdata.u_data.host.power_off_on_suspend = false;
                tegra_ehci3_device.dev.platform_data =
-                                       &tegra_ehci3_hsic_xmm_pdata;
+                                       &tegra_hsic_pdata;
                tegra_baseband_xmm_power_data.hsic_register =
                                                &tegra_usb_hsic_host_register;
                tegra_baseband_xmm_power_data.hsic_unregister =
@@ -1054,7 +1122,7 @@ static void pluto_modem_init(void)
                        = pluto_aic3262_pdata.i2s_param[BASEBAND].channels
                        = 2;
                break;
-       case TEGRA_BB_HSIC_HUB: /* i500 SWD HSIC */
+       case TEGRA_BB_HSIC_HUB: /* HSIC hub */
                if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)) {
                        tegra_ehci3_device.dev.platform_data =
                                &tegra_ehci3_hsic_smsc_hub_pdata;
@@ -1066,9 +1134,23 @@ static void pluto_modem_init(void)
        }
 }
 
+static struct tegra_xusb_board_data xusb_bdata = {
+       .portmap = TEGRA_XUSB_SS_P0 | TEGRA_XUSB_USB2_P0,
+       /* ss_portmap[0:3] = SS0 map, ss_portmap[4:7] = SS1 map */
+       .ss_portmap = (TEGRA_XUSB_SS_PORT_MAP_USB2_P0 << 0),
+};
+
+static void pluto_xusb_init(void)
+{
+       int usb_port_owner_info = tegra_get_usb_port_owner_info();
+
+       if (usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)
+               tegra_xusb_init(&xusb_bdata);
+}
 #else
 static void pluto_usb_init(void) { }
 static void pluto_modem_init(void) { }
+static void pluto_xusb_init(void) { }
 #endif
 
 static void pluto_audio_init(void)
@@ -1077,54 +1159,37 @@ static void pluto_audio_init(void)
 
        tegra_get_board_info(&board_info);
 
+       spi_register_board_info(aic326x_spi_board_info,
+                                       ARRAY_SIZE(aic326x_spi_board_info));
 }
 
+#ifndef CONFIG_USE_OF
 static struct platform_device *pluto_spi_devices[] __initdata = {
         &tegra11_spi_device4,
 };
 
-struct spi_clk_parent spi_parent_clk_pluto[] = {
-        [0] = {.name = "pll_p"},
-#ifndef CONFIG_TEGRA_PLLM_RESTRICTED
-        [1] = {.name = "pll_m"},
-        [2] = {.name = "clk_m"},
-#else
-        [1] = {.name = "clk_m"},
-#endif
-};
-
 static struct tegra_spi_platform_data pluto_spi_pdata = {
-       .is_dma_based           = false,
-       .max_dma_buffer         = 16 * 1024,
-        .is_clkon_always        = false,
-        .max_rate               = 25000000,
+       .dma_req_sel            = 0,
+       .spi_max_frequency      = 25000000,
+       .clock_always_on        = false,
 };
 
 static void __init pluto_spi_init(void)
 {
-        int i;
-        struct clk *c;
         struct board_info board_info, display_board_info;
 
         tegra_get_board_info(&board_info);
         tegra_get_display_board_info(&display_board_info);
 
-        for (i = 0; i < ARRAY_SIZE(spi_parent_clk_pluto); ++i) {
-                c = tegra_get_clock_by_name(spi_parent_clk_pluto[i].name);
-                if (IS_ERR_OR_NULL(c)) {
-                        pr_err("Not able to get the clock for %s\n",
-                                                spi_parent_clk_pluto[i].name);
-                        continue;
-                }
-                spi_parent_clk_pluto[i].parent_clk = c;
-                spi_parent_clk_pluto[i].fixed_clk_rate = clk_get_rate(c);
-        }
-        pluto_spi_pdata.parent_clk_list = spi_parent_clk_pluto;
-        pluto_spi_pdata.parent_clk_count = ARRAY_SIZE(spi_parent_clk_pluto);
        tegra11_spi_device4.dev.platform_data = &pluto_spi_pdata;
         platform_add_devices(pluto_spi_devices,
                                 ARRAY_SIZE(pluto_spi_devices));
 }
+#else
+static void __init pluto_spi_init(void)
+{
+}
+#endif
 
 static __initdata struct tegra_clk_init_table touch_clk_init_table[] = {
        /* name         parent          rate            enabled */
@@ -1134,10 +1199,11 @@ static __initdata struct tegra_clk_init_table touch_clk_init_table[] = {
 };
 
 struct rm_spi_ts_platform_data rm31080ts_pluto_data = {
-       .gpio_reset = 0,
+       .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
        .config = 0,
        .platform_id = RM_PLATFORM_P005,
        .name_of_clock = "clk_out_2",
+       .name_of_clock_con = "extern2",
 };
 
 static struct tegra_spi_device_controller_data dev_cdata = {
@@ -1157,62 +1223,114 @@ struct spi_board_info rm31080a_pluto_spi_board[1] = {
         },
 };
 
+static struct synaptics_gpio_data synaptics_gpio_pluto_data = {
+       .attn_gpio = SYNAPTICS_ATTN_GPIO,
+       .attn_polarity = RMI_ATTN_ACTIVE_LOW,
+       .reset_gpio = SYNAPTICS_RESET_GPIO,
+};
+
+static struct rmi_device_platform_data synaptics_pluto_platformdata = {
+       .sensor_name   = "TM9999",
+       .attn_gpio     = SYNAPTICS_ATTN_GPIO,
+       .attn_polarity = RMI_ATTN_ACTIVE_LOW,
+       .gpio_data     = &synaptics_gpio_pluto_data,
+       .gpio_config   = synaptics_touchpad_gpio_setup,
+       .spi_data = {
+               .block_delay_us = 100,
+               .read_delay_us = 100,
+               .write_delay_us = 20,
+       },
+       .power_management = {
+               .nosleep = RMI_F01_NOSLEEP_OFF,
+       },
+       .f19_button_map = &synaptics_button_map,
+       .f54_direct_touch_report_size = 944,
+};
+
+static struct spi_board_info synaptics_9999_spi_board_pluto[] = {
+       {
+               .modalias = "rmi_spi",
+               .bus_num = 3,
+               .chip_select = 2,
+               .max_speed_hz = 8*1000*1000,
+               .mode = SPI_MODE_3,
+               .platform_data = &synaptics_pluto_platformdata,
+       },
+};
+
 static int __init pluto_touch_init(void)
 {
        tegra_clk_init_from_table(touch_clk_init_table);
-       clk_enable(tegra_get_clock_by_name("clk_out_2"));
-       mdelay(20);
-       rm31080a_pluto_spi_board[0].irq = gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
-       touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
-                               TOUCH_GPIO_RST_RAYDIUM_SPI,
-                               &rm31080ts_pluto_data,
-                               &rm31080a_pluto_spi_board[0],
-                               ARRAY_SIZE(rm31080a_pluto_spi_board));
+       if (tegra_get_touch_vendor_id() == RAYDIUM_TOUCH) {
+               pr_info("%s: initializing raydium\n", __func__);
+               rm31080a_pluto_spi_board[0].irq =
+                       gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
+               touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
+                                       TOUCH_GPIO_RST_RAYDIUM_SPI,
+                                       &rm31080ts_pluto_data,
+                                       &rm31080a_pluto_spi_board[0],
+                                       ARRAY_SIZE(rm31080a_pluto_spi_board));
+       } else {
+               pr_info("%s: initializing synaptics\n", __func__);
+               touch_init_synaptics(synaptics_9999_spi_board_pluto,
+                               ARRAY_SIZE(synaptics_9999_spi_board_pluto));
+       }
        return 0;
 }
 
-#ifdef CONFIG_EDP_FRAMEWORK
-static struct edp_manager battery_edp_manager = {
-       .name = "battery",
-       .imax = 3250
+#ifdef CONFIG_USE_OF
+struct of_dev_auxdata pluto_auxdata_lookup[] __initdata = {
+       OF_DEV_AUXDATA("nvidia,tegra114-apbdma", 0x6000a000, "tegra-dma", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000600, "sdhci-tegra.3",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000400, "sdhci-tegra.2",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-sdhci", 0x78000000, "sdhci-tegra.0",
+                               &pluto_tegra_sdhci_platform_data0),
+       OF_DEV_AUXDATA("nvidia,tegra114-camera", 0x0, "tegra_camera",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-host1x", TEGRA_HOST1X_BASE, "host1x",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-gr3d", TEGRA_GR3D_BASE, "gr3d",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-gr2d", TEGRA_GR2D_BASE, "gr2d",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-msenc", TEGRA_MSENC_BASE, "msenc",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-vi", TEGRA_VI_BASE, "vi",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-isp", TEGRA_ISP_BASE, "isp",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-tsec", TEGRA_TSEC_BASE, "tsec",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000c500, "tegra11-i2c.2",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000d400, "spi-tegra114.0",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000d600, "spi-tegra114.1",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000d800, "spi-tegra114.2",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000da00, "spi-tegra114.3",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000dc00, "spi-tegra114.4",
+                               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000de00, "spi-tegra114.5",
+                               NULL),
+       {}
 };
+#endif
 
-static void __init pluto_battery_edp_init(void)
+static void __init pluto_dtv_init(void)
 {
-       struct edp_governor *g;
-       int r;
-
-       r = edp_register_manager(&battery_edp_manager);
-       if (r)
-               goto err_ret;
-
-       /* start with priority governor */
-       g = edp_get_governor("priority");
-       if (!g) {
-               r = -EFAULT;
-               goto err_ret;
-       }
-
-       r = edp_set_governor(&battery_edp_manager, g);
-       if (r)
-               goto err_ret;
-
-       return;
-
-err_ret:
-       pr_err("Battery EDP init failed with error %d\n", r);
-       WARN_ON(1);
+       platform_device_register(&tegra_dtv_device);
 }
-#else
-static inline void pluto_battery_edp_init(void) {}
-#endif
 
 static void __init tegra_pluto_early_init(void)
 {
-       pluto_battery_edp_init();
+       pluto_sysedp_init();
        tegra_clk_init_from_table(pluto_clk_init_table);
-       tegra_clk_vefify_parents();
-       tegra_smmu_init();
+       tegra_clk_verify_parents();
        tegra_soc_device_init("tegra_pluto");
 }
 
@@ -1223,6 +1341,7 @@ static void __init tegra_pluto_late_init(void)
        pluto_i2c_init();
        pluto_spi_init();
        pluto_usb_init();
+       pluto_xusb_init();
        pluto_uart_init();
        pluto_audio_init();
        platform_add_devices(pluto_devices, ARRAY_SIZE(pluto_devices));
@@ -1230,6 +1349,7 @@ static void __init tegra_pluto_late_init(void)
        tegra_io_dpd_init();
        pluto_sdhci_init();
        pluto_regulator_init();
+       pluto_dtv_init();
        pluto_suspend_init();
        pluto_touch_init();
        pluto_emc_init();
@@ -1253,6 +1373,8 @@ static void __init tegra_pluto_late_init(void)
        tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
        pluto_soctherm_init();
        tegra_register_fuse();
+       pluto_sysedp_core_init();
+       pluto_sysedp_psydepl_init();
 }
 
 static void __init pluto_ramconsole_reserve(unsigned long size)
@@ -1265,7 +1387,8 @@ static void __init tegra_pluto_dt_init(void)
        tegra_pluto_early_init();
 
        of_platform_populate(NULL,
-               of_default_bus_match_table, NULL, NULL);
+               of_default_bus_match_table, pluto_auxdata_lookup,
+               &platform_bus);
 
        tegra_pluto_late_init();
 }
@@ -1293,8 +1416,7 @@ MACHINE_START(TEGRA_PLUTO, "tegra_pluto")
        .reserve        = tegra_pluto_reserve,
        .init_early     = tegra11x_init_early,
        .init_irq       = tegra_dt_init_irq,
-       .handle_irq     = gic_handle_irq,
-       .timer          = &tegra_timer,
+       .init_time      = tegra_init_timer,
        .init_machine   = tegra_pluto_dt_init,
        .restart        = tegra_assert_system_reset,
        .dt_compat      = pluto_dt_board_compat,