ARM: tegra124: pm375: add board file support
Bibek Basu [Wed, 12 Feb 2014 11:15:24 +0000 (16:15 +0530)]
Add board file support for pm375 T124

Bug 1454434

Change-Id: Id028a1ba855064469ebf9c171c997b6a1688e176
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/366540
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

arch/arm/mach-tegra/board-ardbeg.c
arch/arm/mach-tegra/board-laguna-power.c
arch/arm/mach-tegra/tegra-board-id.h

index 2904189..4c2af4e 100644 (file)
@@ -404,6 +404,8 @@ static void ardbeg_audio_init(void)
                        board_info.board_id == BOARD_PM358 ||
                        board_info.board_id == BOARD_PM370 ||
                        board_info.board_id == BOARD_PM374 ||
+                       board_info.board_id == BOARD_PM375 ||
+                       board_info.board_id == BOARD_PM377 ||
                        board_info.board_id == BOARD_PM363) {
                /*Laguna*/
                ardbeg_audio_pdata_rt5639.gpio_hp_det = TEGRA_GPIO_HP_DET;
@@ -520,6 +522,10 @@ static void laguna_pcie_init(void)
                if (lane_owner == PCIE_LANES_X4_X1)
                        laguna_pcie_platform_data.gpio_x1_slot =
                                        PMU_TCA6416_GPIO(8);
+       } else if (board_info.board_id == BOARD_PM375) {
+               laguna_pcie_platform_data.port_status[1] = 1;
+               laguna_pcie_platform_data.gpio_hot_plug = TEGRA_GPIO_INVALID;
+               laguna_pcie_platform_data.gpio_wake = TEGRA_GPIO_INVALID;
        }
        tegra_pci_device.dev.platform_data = &laguna_pcie_platform_data;
        platform_device_register(&tegra_pci_device);
@@ -717,6 +723,8 @@ static void ardbeg_usb_init(void)
                        board_info.board_id == BOARD_PM358 ||
                        board_info.board_id == BOARD_PM370 ||
                        board_info.board_id == BOARD_PM374 ||
+                       board_info.board_id == BOARD_PM375 ||
+                       board_info.board_id == BOARD_PM377 ||
                        board_info.board_id == BOARD_PM363) {
                /* Laguna */
                /* Host cable is detected through AMS PMU Interrupt */
@@ -801,8 +809,10 @@ static void ardbeg_xusb_init(void)
 
        if (board_info.board_id == BOARD_PM359 ||
                        board_info.board_id == BOARD_PM358 ||
-                       board_info.board_id == BOARD_PM374 ||
                        board_info.board_id == BOARD_PM370 ||
+                       board_info.board_id == BOARD_PM374 ||
+                       board_info.board_id == BOARD_PM375 ||
+                       board_info.board_id == BOARD_PM377 ||
                        board_info.board_id == BOARD_PM363) {
                /* Laguna */
                pr_info("Laguna ERS. 0x%x\n", board_info.board_id);
@@ -1171,6 +1181,8 @@ static void __init ardbeg_sysedp_batmon_init(void)
                break;
        case BOARD_PM358:
        case BOARD_PM359:
+       case BOARD_PM375:
+       case BOARD_PM377:
        default:
                break;
        }
@@ -1196,6 +1208,8 @@ static void __init edp_init(void)
                        break;
        case BOARD_PM358:
        case BOARD_PM359:
+       case BOARD_PM375:
+       case BOARD_PM377:
                        laguna_edp_init();
                        break;
        default:
@@ -1276,6 +1290,8 @@ static void __init tegra_ardbeg_late_init(void)
        if (board_info.board_id == BOARD_PM359 ||
                        board_info.board_id == BOARD_PM358 ||
                        board_info.board_id == BOARD_PM363 ||
+                       board_info.board_id == BOARD_PM375 ||
+                       board_info.board_id == BOARD_PM377 ||
                        board_info.board_id == BOARD_E1782)
                ardbeg_sata_init();
        else
@@ -1283,6 +1299,8 @@ static void __init tegra_ardbeg_late_init(void)
        if (board_info.board_id == BOARD_PM359 ||
                        board_info.board_id == BOARD_PM358 ||
                        board_info.board_id == BOARD_PM370 ||
+                       board_info.board_id == BOARD_PM375 ||
+                       board_info.board_id == BOARD_PM377 ||
                        board_info.board_id == BOARD_PM363)
                laguna_regulator_init();
        else if (board_info.board_id == BOARD_PM374)
@@ -1294,7 +1312,9 @@ static void __init tegra_ardbeg_late_init(void)
        ardbeg_emc_init();
        edp_init();
        isomgr_init();
-       ardbeg_touch_init();
+       if ((board_info.board_id != BOARD_PM375) &&
+               (board_info.board_id != BOARD_PM377))
+               ardbeg_touch_init();
        ardbeg_panel_init();
        switch (board_info.board_id) {
        case BOARD_PM358:
@@ -1312,6 +1332,8 @@ static void __init tegra_ardbeg_late_init(void)
        }
        if (board_info.board_id == BOARD_PM359 ||
                        board_info.board_id == BOARD_PM358 ||
+                       board_info.board_id == BOARD_PM375 ||
+                       board_info.board_id == BOARD_PM377 ||
                        board_info.board_id == BOARD_PM363)
                laguna_pcie_init();
        else {
@@ -1325,7 +1347,9 @@ static void __init tegra_ardbeg_late_init(void)
        tegra_wdt_recovery_init();
 #endif
 
-       ardbeg_sensors_init();
+       if ((board_info.board_id != BOARD_PM375) &&
+               (board_info.board_id != BOARD_PM377))
+               ardbeg_sensors_init();
 
        ardbeg_soctherm_init();
 
index 2d95cb6..42dcede 100644 (file)
@@ -155,6 +155,9 @@ static struct regulator_consumer_supply as3722_sd4_supply[] = {
        REGULATOR_SUPPLY("avdd_sata_pll", NULL),
        REGULATOR_SUPPLY("avddio_usb", "tegra-xhci"),
        REGULATOR_SUPPLY("avdd_hdmi", "tegradc.1"),
+#ifdef CONFIG_TEGRA_HDMI_PRIMARY
+       REGULATOR_SUPPLY("avdd_hdmi", "tegradc.0"),
+#endif
 };
 
 static struct regulator_consumer_supply as3722_sd5_supply[] = {
@@ -398,8 +401,10 @@ static inline void fill_reg_map(void)
        struct board_info board_info;
 
        tegra_get_board_info(&board_info);
-       if ((board_info.board_id == BOARD_PM359) &&
-                               (board_info.major_revision == 'C'))
+       if ((board_info.board_id == BOARD_PM375) ||
+               (board_info.board_id == BOARD_PM377) ||
+               ((board_info.board_id == BOARD_PM359) &&
+                               (board_info.major_revision == 'C')))
                reg_init_value = 0x1e;
 
        for (i = 0; i < PMU_CPU_VDD_MAP_SIZE; i++) {
@@ -505,11 +510,13 @@ static struct regulator_consumer_supply fixed_reg_usb0_usb1_vbus_pm363_supply[]
 
 /* Gated by GPIO_PK6  in FAB B and further*/
 static struct regulator_consumer_supply fixed_reg_vdd_hdmi_5v0_supply[] = {
+       REGULATOR_SUPPLY("vdd_hdmi_5v0", "tegradc.0"),
        REGULATOR_SUPPLY("vdd_hdmi_5v0", "tegradc.1"),
 };
 
 /* Gated by GPIO_PH7  in FAB B and further*/
 static struct regulator_consumer_supply fixed_reg_vdd_hdmi_supply[] = {
+       REGULATOR_SUPPLY("avdd_hdmi_pll", "tegradc.0"),
        REGULATOR_SUPPLY("avdd_hdmi_pll", "tegradc.1"),
 };
 
@@ -617,6 +624,10 @@ static struct regulator_consumer_supply fixed_reg_vdd_cdc_1v2_aud_supply[] = {
        REGULATOR_SUPPLY("ldoen", "tegra-snd-rt5639.0"),
 };
 
+static struct regulator_consumer_supply
+fixed_reg_vdd_cdc_1v2_aud_pm375_supply[] = {
+       REGULATOR_SUPPLY("ldoen", "tegra-snd-rt5639.0"),
+};
 static struct regulator_consumer_supply fixed_reg_vdd_amp_shut_aud_supply[] = {
        REGULATOR_SUPPLY("epamp", "tegra-snd-rt5645.0"),
 };
@@ -742,6 +753,10 @@ FIXED_REG(21,      vdd_cdc_1v2_aud,        vdd_cdc_1v2_aud,        NULL,   0,
                0,      PMU_TCA6416_GPIO(2),    false,  true,   0,
                1200,   250000);
 
+FIXED_REG(21,  vdd_cdc_1v2_aud_pm375,  vdd_cdc_1v2_aud_pm375,  NULL,   0,
+               0,      TEGRA_GPIO_PR2, false,  true,   0,
+               1200,   250000);
+
 FIXED_REG(22,  vdd_amp_shut_aud,       vdd_amp_shut_aud,       NULL,   0,
                0,      PMU_TCA6416_GPIO(3),    false,  true,   0,
                1200,   0);
@@ -788,6 +803,12 @@ FIXED_REG(23,      vdd_dsi_mux,            vdd_dsi_mux,    NULL,   0,      0,
        ADD_FIXED_REG(usb2_vbus_pm363),         \
        ADD_FIXED_REG(usb0_usb1_vbus_pm363),
 
+#define BEAVER_PM375_FIXED_REG                 \
+       ADD_FIXED_REG(vdd_cdc_1v2_aud_pm375),   \
+       ADD_FIXED_REG(usb2_vbus_pm363),         \
+       ADD_FIXED_REG(usb0_usb1_vbus_pm363),
+
+
 /* Gpio switch regulator platform data for laguna pm358 ERS*/
 static struct platform_device *fixed_reg_devs_pm358[] = {
        LAGUNA_COMMON_FIXED_REG,
@@ -817,6 +838,12 @@ static struct platform_device *fixed_reg_devs_pm374[] = {
        LAGUNA_PM358_FIXED_REG
 };
 
+/* Gpio switch regulator platform data for BEAVER PM375 && PM377*/
+static struct platform_device *fixed_reg_devs_pm375[] = {
+       LAGUNA_COMMON_FIXED_REG,
+       BEAVER_PM375_FIXED_REG
+};
+
 static int __init laguna_fixed_regulator_init(void)
 {
        struct board_info board_info;
@@ -828,6 +855,10 @@ static int __init laguna_fixed_regulator_init(void)
        if (board_info.board_id == BOARD_PM374)
                return platform_add_devices(fixed_reg_devs_pm374,
                                ARRAY_SIZE(fixed_reg_devs_pm374));
+       else if ((board_info.board_id == BOARD_PM375) ||
+               (board_info.board_id == BOARD_PM377))
+               return platform_add_devices(fixed_reg_devs_pm375,
+                               ARRAY_SIZE(fixed_reg_devs_pm375));
        else if (board_info.board_id == BOARD_PM359)
                return platform_add_devices(fixed_reg_devs_pm359,
                                ARRAY_SIZE(fixed_reg_devs_pm359));
index 70eb5db..cdf176d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * tegra-board-id.h: Defines all boardid of Tegra.
  *
- * Copyright (c) 2012-2013, NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2012-2014, 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 as published by
@@ -51,6 +51,8 @@
 #define BOARD_PM363   0x016B
 #define BOARD_PM370   0x0172
 #define BOARD_PM374   0x0176
+#define BOARD_PM375   0x0177
+#define BOARD_PM377   0x0179
 #define BOARD_E2548   0x09F4
 #define BOARD_E2549   0x09F5
 #define BOARD_E1782   0x06F6