#include <linux/input.h>
#include <linux/platform_data/tegra_usb.h>
#include <linux/spi/spi.h>
+#include <linux/spi/rm31080a_ts.h>
#include <linux/tegra_uart.h>
#include <linux/memblock.h>
#include <linux/spi-tegra.h>
#include <linux/i2c/at24.h>
#include <linux/mfd/max8831.h>
#include <linux/of_platform.h>
+#include <linux/a2220.h>
+#include <linux/edp.h>
#include <asm/hardware/gic.h>
#include <mach/iomap.h>
#include <mach/irqs.h>
#include <mach/pinmux.h>
-#include <mach/pinmux-tegra30.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/tegra_rt5640_pdata.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/edp.h>
+#include <mach/tegra-bb-power.h>
+#include <mach/tegra_usb_modem_power.h>
#include "board.h"
+#include "board-common.h"
+#include "board-touch-raydium.h"
#include "clock.h"
#include "board-pluto.h"
+#include "tegra-board-id.h"
#include "devices.h"
#include "gpio-names.h"
#include "fuse.h"
#include "pm.h"
#include "common.h"
+#ifdef CONFIG_BT_BLUESLEEP
static struct rfkill_gpio_platform_data pluto_bt_rfkill_pdata = {
.name = "bt_rfkill",
.shutdown_gpio = TEGRA_GPIO_PQ7,
+ .reset_gpio = TEGRA_GPIO_PQ6,
.type = RFKILL_TYPE_BLUETOOTH,
};
static noinline void __init pluto_setup_bt_rfkill(void)
{
- if ((tegra_get_commchip_id() == COMMCHIP_BROADCOM_BCM43241) ||
- (tegra_get_commchip_id() == COMMCHIP_DEFAULT))
- pluto_bt_rfkill_pdata.reset_gpio = TEGRA_GPIO_INVALID;
- else
- pluto_bt_rfkill_pdata.reset_gpio = TEGRA_GPIO_PU6;
platform_device_register(&pluto_bt_rfkill_device);
}
platform_device_register(&pluto_bluesleep_device);
return;
}
+#elif defined CONFIG_BLUEDROID_PM
+static struct resource pluto_bluedroid_pm_resources[] = {
+ [0] = {
+ .name = "shutdown_gpio",
+ .start = TEGRA_GPIO_PQ7,
+ .end = TEGRA_GPIO_PQ7,
+ .flags = IORESOURCE_IO,
+ },
+ [1] = {
+ .name = "host_wake",
+ .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
+ },
+ [2] = {
+ .name = "gpio_ext_wake",
+ .start = TEGRA_GPIO_PEE1,
+ .end = TEGRA_GPIO_PEE1,
+ .flags = IORESOURCE_IO,
+ },
+ [3] = {
+ .name = "gpio_host_wake",
+ .start = TEGRA_GPIO_PU6,
+ .end = TEGRA_GPIO_PU6,
+ .flags = IORESOURCE_IO,
+ },
+ [4] = {
+ .name = "reset_gpio",
+ .start = TEGRA_GPIO_PQ6,
+ .end = TEGRA_GPIO_PQ6,
+ .flags = IORESOURCE_IO,
+ },
+};
+
+static struct platform_device pluto_bluedroid_pm_device = {
+ .name = "bluedroid_pm",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(pluto_bluedroid_pm_resources),
+ .resource = pluto_bluedroid_pm_resources,
+};
+
+static noinline void __init pluto_setup_bluedroid_pm(void)
+{
+ pluto_bluedroid_pm_resources[1].start =
+ pluto_bluedroid_pm_resources[1].end =
+ gpio_to_irq(TEGRA_GPIO_PU6);
+ platform_device_register(&pluto_bluedroid_pm_device);
+}
+#endif
+
static __initdata struct tegra_clk_init_table pluto_clk_init_table[] = {
/* name parent rate enabled */
{ "pll_m", NULL, 0, false},
{ "hda", "pll_p", 108000000, false},
{ "hda2codec_2x", "pll_p", 48000000, false},
{ "pwm", "pll_p", 3187500, false},
- { "blink", "clk_32k", 32768, true},
{ "i2s1", "pll_a_out0", 0, false},
+ { "i2s2", "pll_a_out0", 0, false},
{ "i2s3", "pll_a_out0", 0, false},
{ "i2s4", "pll_a_out0", 0, false},
{ "spdif_out", "pll_a_out0", 0, false},
{ "dam0", "clk_m", 12000000, false},
{ "dam1", "clk_m", 12000000, false},
{ "dam2", "clk_m", 12000000, false},
+ { "audio0", "i2s0_sync", 0, false},
{ "audio1", "i2s1_sync", 0, false},
+ { "audio2", "i2s2_sync", 0, false},
{ "audio3", "i2s3_sync", 0, false},
+ { "audio4", "i2s4_sync", 0, false},
{ "vi_sensor", "pll_p", 150000000, false},
{ "cilab", "pll_p", 150000000, false},
{ "cilcd", "pll_p", 150000000, false},
{ "i2c3", "pll_p", 3200000, false},
{ "i2c4", "pll_p", 3200000, false},
{ "i2c5", "pll_p", 3200000, false},
+ { "extern3", "clk_m", 12000000, false},
{ NULL, NULL, 0, 0},
};
.arb_recovery = arb_lost_recovery,
};
-static struct led_info pluto_max8831_leds[] = {
- [MAX8831_ID_LED3] = {
- .name = "max8831:red:pluto",
- },
- [MAX8831_ID_LED4] = {
- .name = "max8831:green:pluto",
- },
- [MAX8831_ID_LED5] = {
- .name = "max8831:blue:pluto",
- },
- [MAX8831_BL_LEDS] = {
- .name = "pluto_display_bl",
- },
-};
-
-static struct max8831_subdev_info pluto_max8831_subdevs[] = {
- {
- .id = MAX8831_ID_LED3,
- .name = "max8831_led_bl",
- .platform_data = &pluto_max8831_leds[MAX8831_ID_LED3],
- .pdata_size = sizeof(pluto_max8831_leds[MAX8831_ID_LED3]),
- }, {
- .id = MAX8831_ID_LED4,
- .name = "max8831_led_bl",
- .platform_data = &pluto_max8831_leds[MAX8831_ID_LED4],
- .pdata_size = sizeof(pluto_max8831_leds[MAX8831_ID_LED4]),
- }, {
- .id = MAX8831_ID_LED5,
- .name = "max8831_led_bl",
- .platform_data = &pluto_max8831_leds[MAX8831_ID_LED5],
- .pdata_size = sizeof(pluto_max8831_leds[MAX8831_ID_LED5]),
- }, {
- .id = MAX8831_BL_LEDS,
- .name = "max8831_display_bl",
- .platform_data = &pluto_max8831_leds[MAX8831_BL_LEDS],
- .pdata_size = sizeof(pluto_max8831_leds[MAX8831_BL_LEDS]),
- },
-};
-
-static struct max8831_platform_data pluto_max8831 = {
- .num_subdevs = ARRAY_SIZE(pluto_max8831_subdevs),
- .subdevs = pluto_max8831_subdevs,
+static struct i2c_board_info __initdata cs42l73_board_info = {
+ I2C_BOARD_INFO("cs42l73", 0x4a),
};
-static struct i2c_board_info pluto_i2c_led_info = {
- .type = "max8831",
- .addr = 0x4d,
- .platform_data = &pluto_max8831,
+static struct i2c_board_info __initdata pluto_codec_a2220_info = {
+ I2C_BOARD_INFO("audience_a2220", 0x3E),
};
platform_device_register(&tegra_i2c_device3);
platform_device_register(&tegra_i2c_device2);
platform_device_register(&tegra_i2c_device1);
+
#else
tegra11_i2c_device1.dev.platform_data = &pluto_i2c1_platform_data;
tegra11_i2c_device2.dev.platform_data = &pluto_i2c2_platform_data;
tegra11_i2c_device4.dev.platform_data = &pluto_i2c4_platform_data;
tegra11_i2c_device5.dev.platform_data = &pluto_i2c5_platform_data;
- i2c_register_board_info(1, &pluto_i2c_led_info, 1);
-
platform_device_register(&tegra11_i2c_device5);
platform_device_register(&tegra11_i2c_device4);
platform_device_register(&tegra11_i2c_device3);
platform_device_register(&tegra11_i2c_device2);
platform_device_register(&tegra11_i2c_device1);
+
#endif
+
+ i2c_register_board_info(0, &pluto_codec_a2220_info, 1);
+ i2c_register_board_info(0, &cs42l73_board_info, 1);
}
static struct platform_device *pluto_uart_devices[] __initdata = {
{
int debug_port_id;
- debug_port_id = get_tegra_uart_debug_port_id();
+ debug_port_id = uart_console_debug_init(3);
if (debug_port_id < 0)
- debug_port_id = 3;
-
- switch (debug_port_id) {
- case 0:
- /* UARTA is the debug port. */
- pr_info("Selecting UARTA as the debug console\n");
- pluto_uart_devices[0] = &debug_uarta_device;
- debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
- debug_uart_port_base = ((struct plat_serial8250_port *)(
- debug_uarta_device.dev.platform_data))->mapbase;
- break;
-
- case 1:
- /* UARTB is the debug port. */
- pr_info("Selecting UARTB as the debug console\n");
- pluto_uart_devices[1] = &debug_uartb_device;
- debug_uart_clk = clk_get_sys("serial8250.0", "uartb");
- debug_uart_port_base = ((struct plat_serial8250_port *)(
- debug_uartb_device.dev.platform_data))->mapbase;
- break;
-
- case 2:
- /* UARTC is the debug port. */
- pr_info("Selecting UARTC as the debug console\n");
- pluto_uart_devices[2] = &debug_uartc_device;
- debug_uart_clk = clk_get_sys("serial8250.0", "uartc");
- debug_uart_port_base = ((struct plat_serial8250_port *)(
- debug_uartc_device.dev.platform_data))->mapbase;
- break;
-
- case 3:
- /* UARTD is the debug port. */
- pr_info("Selecting UARTD as the debug console\n");
- pluto_uart_devices[3] = &debug_uartd_device;
- debug_uart_clk = clk_get_sys("serial8250.0", "uartd");
- debug_uart_port_base = ((struct plat_serial8250_port *)(
- debug_uartd_device.dev.platform_data))->mapbase;
- break;
-
- default:
- pr_info("The debug console id %d is invalid, Assuming UARTA",
- debug_port_id);
- pluto_uart_devices[0] = &debug_uarta_device;
- debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
- debug_uart_port_base = ((struct plat_serial8250_port *)(
- debug_uarta_device.dev.platform_data))->mapbase;
- break;
- }
+ return;
+ pluto_uart_devices[debug_port_id] = uart_console_debug_device;
}
static void __init pluto_uart_init(void)
tegra_uartd_device.dev.platform_data = &pluto_uart_pdata;
/* Register low speed only if it is selected */
- if (!is_tegra_debug_uartport_hs()) {
+ if (!is_tegra_debug_uartport_hs())
uart_debug_init();
- /* Clock enable for the debug channel */
- if (!IS_ERR_OR_NULL(debug_uart_clk)) {
- pr_info("The debug console clock name is %s\n",
- debug_uart_clk->name);
- c = tegra_get_clock_by_name("pll_p");
- if (IS_ERR_OR_NULL(c))
- pr_err("Not getting the parent clock pll_p\n");
- else
- clk_set_parent(debug_uart_clk, c);
-
- clk_enable(debug_uart_clk);
- clk_set_rate(debug_uart_clk, clk_get_rate(c));
- } else {
- pr_err("Not getting the clock %s for debug console\n",
- debug_uart_clk->name);
- }
- }
platform_add_devices(pluto_uart_devices,
ARRAY_SIZE(pluto_uart_devices));
.num_resources = ARRAY_SIZE(tegra_rtc_resources),
};
-static struct tegra_rt5640_platform_data pluto_audio_pdata = {
+static struct tegra_asoc_platform_data pluto_audio_pdata = {
.gpio_spkr_en = TEGRA_GPIO_SPKR_EN,
.gpio_hp_det = TEGRA_GPIO_HP_DET,
.gpio_hp_mute = -1,
.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,
+ .i2s_param[HIFI_CODEC] = {
+ .audio_port_id = 1,
+ .is_i2s_master = 0,
+ .i2s_mode = TEGRA_DAIFMT_I2S,
+ .sample_size = 16,
+ .channels = 2,
+ },
+ .i2s_param[BASEBAND] = {
+ .audio_port_id = 2,
+ .is_i2s_master = 1,
+ .i2s_mode = TEGRA_DAIFMT_I2S,
+ .sample_size = 16,
+ .rate = 16000,
+ .channels = 2,
+ },
+ .i2s_param[BT_SCO] = {
+ .audio_port_id = 3,
+ .is_i2s_master = 1,
+ .i2s_mode = TEGRA_DAIFMT_DSP_A,
+ .sample_size = 16,
+ },
+ .i2s_param[VOICE_CODEC] = {
+ .audio_port_id = 0,
+ .is_i2s_master = 1,
+ .i2s_mode = TEGRA_DAIFMT_I2S,
+ .sample_size = 16,
+ .rate = 16000,
+ .channels = 2,
+ },
};
static struct platform_device pluto_audio_device = {
- .name = "tegra-snd-rt5640",
- .id = 0,
+ .name = "tegra-snd-cs42l73",
+ .id = 2,
.dev = {
.platform_data = &pluto_audio_pdata,
},
.id = -1,
};
+#ifdef CONFIG_MHI_NETDEV
+struct platform_device mhi_netdevice0 = {
+ .name = "mhi_net_device",
+ .id = 0,
+};
+#endif /* CONFIG_MHI_NETDEV */
+
static struct platform_device *pluto_devices[] __initdata = {
&tegra_pmu_device,
&tegra_rtc_device,
#endif
&tegra_camera,
#if defined(CONFIG_CRYPTO_DEV_TEGRA_SE)
- &tegra_se_device,
+ &tegra11_se_device,
#endif
&tegra_ahub_device,
+ &tegra_dam_device0,
+ &tegra_dam_device1,
+ &tegra_dam_device2,
+ &tegra_i2s_device0,
+ &tegra_i2s_device1,
+ &tegra_i2s_device2,
+ &tegra_i2s_device3,
+ &tegra_i2s_device4,
+ &tegra_spdif_device,
+ &spdif_dit_device,
+ &bluetooth_dit_device,
+ &baseband_dit_device,
&pluto_audio_device,
&tegra_hda_device,
#if defined(CONFIG_CRYPTO_DEV_TEGRA_AES)
&tegra_aes_device,
#endif
+#ifdef CONFIG_MHI_NETDEV
+ &mhi_netdevice0, /* MHI netdevice */
+#endif /* CONFIG_MHI_NETDEV */
};
-#ifdef CONFIG_ARCH_TEGRA_11x_SOC
-static struct tegra_usb_platform_data tegra_ehci2_hsic_smsc_hub_pdata = {
+#ifdef CONFIG_USB_SUPPORT
+static struct tegra_usb_platform_data tegra_ehci3_hsic_smsc_hub_pdata = {
.port_otg = false,
.has_hostpc = true,
- .unaligned_dma_buf_supported = true,
+ .unaligned_dma_buf_supported = false,
.phy_intf = TEGRA_USB_PHY_INTF_HSIC,
.op_mode = TEGRA_USB_OPMODE_HOST,
.u_data.host = {
.power_off_on_suspend = true,
},
};
-#endif
static struct tegra_usb_platform_data tegra_udc_pdata = {
.port_otg = true,
.has_hostpc = true,
+ .builtin_host_disabled = true,
.phy_intf = TEGRA_USB_PHY_INTF_UTMI,
.op_mode = TEGRA_USB_OPMODE_DEVICE,
.u_data.dev = {
static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
.port_otg = true,
.has_hostpc = true,
- .unaligned_dma_buf_supported = true,
+ .builtin_host_disabled = true,
+ .unaligned_dma_buf_supported = false,
.phy_intf = TEGRA_USB_PHY_INTF_UTMI,
.op_mode = TEGRA_USB_OPMODE_HOST,
.u_data.host = {
.vbus_gpio = -1,
- .hot_plug = true,
+ .hot_plug = false,
.remote_wakeup_supported = true,
.power_off_on_suspend = true,
},
.ehci_pdata = &tegra_ehci1_utmi_pdata,
};
-#if CONFIG_USB_SUPPORT
-static void pluto_usb_init(void)
-{
- tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
- platform_device_register(&tegra_otg_device);
+static struct regulator *baseband_reg;
+static struct gpio modem_gpios[] = { /* i500 modem */
+ {MDM_RST, GPIOF_OUT_INIT_LOW, "MODEM RESET"},
+};
- /* Setup the udc platform data */
- tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
+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,
+};
+
+static struct tegra_usb_platform_data tegra_ehci2_hsic_baseband_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 = false,
+ .power_off_on_suspend = false,
+ },
+};
#ifdef CONFIG_ARCH_TEGRA_11x_SOC
- tegra_ehci2_device.dev.platform_data =
- &tegra_ehci2_hsic_smsc_hub_pdata;
- platform_device_register(&tegra_ehci2_device);
+static struct tegra_usb_platform_data tegra_ehci3_hsic_baseband2_pdata = {
+#else
+static struct tegra_usb_platform_data tegra_ehci2_hsic_baseband2_pdata = {
#endif
+ .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 = false,
+ .power_off_on_suspend = false,
+ },
+ .ops = &baseband2_plat_ops,
+};
+
+#ifdef CONFIG_TEGRA_BB_OEM1
+static struct tegra_usb_platform_data tegra_hsic_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 struct platform_device *
+tegra_usb_hsic_host_register(struct platform_device *ehci_dev)
+{
+ struct platform_device *pdev;
+ int val;
+
+ pdev = platform_device_alloc(ehci_dev->name, ehci_dev->id);
+ if (!pdev)
+ return NULL;
+
+ val = platform_device_add_resources(pdev, ehci_dev->resource,
+ ehci_dev->num_resources);
+ if (val)
+ goto error;
+
+ pdev->dev.dma_mask = ehci_dev->dev.dma_mask;
+ pdev->dev.coherent_dma_mask = ehci_dev->dev.coherent_dma_mask;
+
+ val = platform_device_add_data(pdev, &tegra_hsic_pdata,
+ sizeof(struct tegra_usb_platform_data));
+ if (val)
+ goto error;
+
+ val = platform_device_add(pdev);
+ if (val)
+ goto error;
+
+ return pdev;
+
+error:
+ pr_err("%s: failed to add the host contoller device\n", __func__);
+ platform_device_put(pdev);
+ return NULL;
}
-static void pluto_modem_init(void)
+static void tegra_usb_hsic_host_unregister(struct platform_device **platdev)
+{
+ struct platform_device *pdev = *platdev;
+
+ if (pdev && &pdev->dev) {
+ platform_device_unregister(pdev);
+ *platdev = NULL;
+ } else
+ pr_err("%s: no platform device\n", __func__);
+}
+
+static struct tegra_usb_phy_platform_ops oem1_hsic_pops;
+
+static union tegra_bb_gpio_id bb_gpio_oem1 = {
+ .oem1 = {
+ .reset = BB_OEM1_GPIO_RST,
+ .pwron = BB_OEM1_GPIO_ON,
+ .awr = BB_OEM1_GPIO_AWR,
+ .cwr = BB_OEM1_GPIO_CWR,
+ .spare = BB_OEM1_GPIO_SPARE,
+ .wdi = BB_OEM1_GPIO_WDI,
+ },
+};
+
+static struct tegra_bb_pdata bb_pdata_oem1 = {
+ .id = &bb_gpio_oem1,
+ .device = &tegra_ehci3_device,
+ .ehci_register = tegra_usb_hsic_host_register,
+ .ehci_unregister = tegra_usb_hsic_host_unregister,
+ .bb_id = TEGRA_BB_OEM1,
+};
+
+static struct platform_device tegra_bb_oem1 = {
+ .name = "tegra_baseband_power",
+ .id = -1,
+ .dev = {
+ .platform_data = &bb_pdata_oem1,
+ },
+};
+#endif
+
+static int baseband_init(void)
{
int ret;
- ret = gpio_request(TEGRA_GPIO_W_DISABLE, "w_disable_gpio");
- if (ret < 0)
- pr_err("%s: gpio_request failed for gpio %d\n",
- __func__, TEGRA_GPIO_W_DISABLE);
+ ret = gpio_request_array(modem_gpios, ARRAY_SIZE(modem_gpios));
+ if (ret) {
+ pr_warn("%s:gpio request failed\n", __func__);
+ return ret;
+ }
+
+ baseband_reg = regulator_get(NULL, "vdd_core_bb");
+ if (IS_ERR_OR_NULL(baseband_reg))
+ pr_warn("%s: baseband regulator get failed\n", __func__);
else
- gpio_direction_output(TEGRA_GPIO_W_DISABLE, 1);
+ regulator_enable(baseband_reg);
+ /* enable pull-down for MDM1_COLD_BOOT */
+ tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_ULPI_DATA4,
+ TEGRA_PUPD_PULL_DOWN);
- ret = gpio_request(TEGRA_GPIO_MODEM_RSVD1, "Port_V_PIN_0");
- if (ret < 0)
- pr_err("%s: gpio_request failed for gpio %d\n",
- __func__, TEGRA_GPIO_MODEM_RSVD1);
- else
- gpio_direction_input(TEGRA_GPIO_MODEM_RSVD1);
+ /* export GPIO for user space access through sysfs */
+ gpio_export(MDM_RST, false);
+ return 0;
+}
- ret = gpio_request(TEGRA_GPIO_MODEM_RSVD2, "Port_H_PIN_7");
- if (ret < 0)
- pr_err("%s: gpio_request failed for gpio %d\n",
- __func__, TEGRA_GPIO_MODEM_RSVD2);
- else
- gpio_direction_output(TEGRA_GPIO_MODEM_RSVD2, 1);
+static const struct tegra_modem_operations baseband_operations = {
+ .init = baseband_init,
+};
+
+static struct tegra_usb_modem_power_platform_data baseband_pdata = {
+ .ops = &baseband_operations,
+ .wake_gpio = -1,
+ .boot_gpio = MDM_COLDBOOT,
+ .boot_irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ .autosuspend_delay = 2000,
+ .short_autosuspend_delay = 50,
+ .tegra_ehci_device = &tegra_ehci2_device,
+ .tegra_ehci_pdata = &tegra_ehci2_hsic_baseband_pdata,
+};
+
+static struct platform_device icera_baseband_device = {
+ .name = "tegra_usb_modem_power",
+ .id = -1,
+ .dev = {
+ .platform_data = &baseband_pdata,
+ },
+};
+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);
+}
+
+static void baseband2_reset(void)
+{
+ /* Initiate power cycle on baseband sub system */
+ pr_info("%s\n", __func__);
+ gpio_set_value(MDM2_PWR_ON, 0);
+ mdelay(200);
+ gpio_set_value(MDM2_PWR_ON, 1);
+}
+
+static int baseband2_init(void)
+{
+ int ret;
+
+ 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);
+
+ /* export GPIO for user space access through sysfs */
+ gpio_export(MDM2_PWR_ON, false);
+
+ return 0;
+}
+
+static const struct tegra_modem_operations baseband2_operations = {
+ .init = baseband2_init,
+ .start = baseband2_start,
+ .reset = baseband2_reset,
+};
+
+static struct tegra_usb_modem_power_platform_data baseband2_pdata = {
+ .ops = &baseband2_operations,
+ .wake_gpio = MDM2_REQ2,
+ .wake_irq_flags = IRQF_TRIGGER_FALLING,
+ .boot_gpio = MDM2_COLDBOOT,
+ .boot_irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ .autosuspend_delay = 2000,
+ .short_autosuspend_delay = 50,
+#ifdef CONFIG_ARCH_TEGRA_11x_SOC
+ .tegra_ehci_device = &tegra_ehci3_device,
+ .tegra_ehci_pdata = &tegra_ehci3_hsic_baseband2_pdata,
+#else
+ .tegra_ehci_device = &tegra_ehci2_device,
+ .tegra_ehci_pdata = &tegra_ehci2_hsic_baseband2_pdata,
+#endif
+};
+
+static struct platform_device icera_baseband2_device = {
+ .name = "tegra_usb_modem_power",
+ .id = -1,
+ .dev = {
+ .platform_data = &baseband2_pdata,
+ },
+};
+
+static void pluto_usb_init(void)
+{
+ int modem_id = tegra_get_modem_id();
+
+ tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
+ platform_device_register(&tegra_otg_device);
+
+ /* Setup the udc platform data */
+ tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
+
+ if (!modem_id) {
+ tegra_ehci3_device.dev.platform_data =
+ &tegra_ehci3_hsic_smsc_hub_pdata;
+ platform_device_register(&tegra_ehci3_device);
+ }
+}
+
+static void pluto_modem_init(void)
+{
+ int modem_id = tegra_get_modem_id();
+ struct board_info board_info;
+
+ tegra_get_board_info(&board_info);
+ pr_info("%s: modem_id = %d\n", __func__, modem_id);
+
+ switch (modem_id) {
+ case TEGRA_BB_I500: /* on board i500 HSIC */
+ platform_device_register(&icera_baseband_device);
+ break;
+ case TEGRA_BB_I500SWD: /* i500 SWD HSIC */
+ platform_device_register(&icera_baseband2_device);
+ break;
+#ifdef CONFIG_TEGRA_BB_OEM1
+ case TEGRA_BB_OEM1: /* OEM1 HSIC */
+ if ((board_info.board_id == BOARD_E1575) ||
+ ((board_info.board_id == BOARD_E1580) &&
+ (board_info.fab >= BOARD_FAB_A03))) {
+ tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPIO_X1_AUD,
+ TEGRA_TRI_NORMAL);
+ bb_gpio_oem1.oem1.pwron = BB_OEM1_GPIO_ON_V;
+ }
+ tegra_hsic_pdata.ops = &oem1_hsic_pops;
+ tegra_ehci3_device.dev.platform_data
+ = &tegra_hsic_pdata;
+ platform_device_register(&tegra_bb_oem1);
+ break;
+#endif
+ default:
+ return;
+ }
}
#else
tegra_get_board_info(&board_info);
- pluto_audio_pdata.codec_name = "rt5640.4-001c";
- pluto_audio_pdata.codec_dai_name = "rt5640-aif1";
}
+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,
+};
+
+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));
+}
+
+static __initdata struct tegra_clk_init_table touch_clk_init_table[] = {
+ /* name parent rate enabled */
+ { "extern2", "pll_p", 41000000, false},
+ { "clk_out_2", "extern2", 40800000, false},
+ { NULL, NULL, 0, 0},
+};
+
+struct rm_spi_ts_platform_data rm31080ts_pluto_data = {
+ .gpio_reset = 0,
+ .config = 0,
+ .platform_id = RM_PLATFORM_P005,
+ .name_of_clock = "clk_out_2",
+};
+
+static struct tegra_spi_device_controller_data dev_cdata = {
+ .rx_clk_tap_delay = 0,
+ .tx_clk_tap_delay = 0,
+};
+
+struct spi_board_info rm31080a_pluto_spi_board[1] = {
+ {
+ .modalias = "rm_ts_spidev",
+ .bus_num = 3,
+ .chip_select = 2,
+ .max_speed_hz = 12 * 1000 * 1000,
+ .mode = SPI_MODE_0,
+ .controller_data = &dev_cdata,
+ .platform_data = &rm31080ts_pluto_data,
+ },
+};
+
+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));
+ return 0;
+}
+
+#ifdef CONFIG_EDP_FRAMEWORK
+static struct edp_manager battery_edp_manager = {
+ .name = "battery",
+ .imax = 3250
+};
+
+static void __init pluto_battery_edp_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);
+}
+#else
+static inline void pluto_battery_edp_init(void) {}
+#endif
+
static void __init tegra_pluto_init(void)
{
- tegra_battery_edp_init(2500);
+ pluto_battery_edp_init();
tegra_clk_init_from_table(pluto_clk_init_table);
tegra_soc_device_init("tegra_pluto");
tegra_enable_pinmux();
pluto_pinmux_init();
pluto_i2c_init();
+ pluto_spi_init();
pluto_usb_init();
pluto_uart_init();
pluto_audio_init();
pluto_sdhci_init();
pluto_regulator_init();
pluto_suspend_init();
+ pluto_touch_init();
pluto_emc_init();
+ pluto_edp_init();
pluto_panel_init();
+ pluto_pmon_init();
pluto_kbc_init();
+#ifdef CONFIG_BT_BLUESLEEP
pluto_setup_bluesleep();
pluto_setup_bt_rfkill();
+#elif defined CONFIG_BLUEDROID_PM
+ pluto_setup_bluedroid_pm();
+#endif
tegra_release_bootloader_fb();
pluto_modem_init();
#ifdef CONFIG_TEGRA_WDT_RECOVERY
#endif
pluto_sensors_init();
tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
+ pluto_soctherm_init();
}
static void __init pluto_ramconsole_reserve(unsigned long size)
static void __init tegra_pluto_reserve(void)
{
#if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
- /* support 1920X1200 with 24bpp */
- tegra_reserve(0, SZ_8M + SZ_1M, SZ_8M + SZ_1M);
+ /* for PANEL_5_SHARP_1080p: 1920*1080*4*2 = 16588800 bytes */
+ tegra_reserve(0, SZ_16M, SZ_4M);
#else
- tegra_reserve(SZ_128M, SZ_8M, SZ_8M);
+ tegra_reserve(SZ_128M, SZ_16M, SZ_4M);
#endif
pluto_ramconsole_reserve(SZ_1M);
}