arm: tegra: enterprise: Enabling the PMU driver
nagesh Penumarty [Mon, 25 Apr 2011 11:43:32 +0000 (16:43 +0530)]
Adding the board file for power and
enabling the TI 6025 pmu driver.

Original-Change-Id: I4676223599877ca51d892b373bcae03778c25f57
Reviewed-on: http://git-master/r/28668
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Change-Id: I5ee27c2aa99075960b3255fb7a9dbae397e3b71d

Rebase-Id: R7fda12e3247fa1e7769198113e8c883a1c1b6e09

arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/board-enterprise-power.c [new file with mode: 0644]
arch/arm/mach-tegra/board-enterprise.c
arch/arm/mach-tegra/board-enterprise.h

index 149946f..d91ef7b 100644 (file)
@@ -110,3 +110,4 @@ obj-${CONFIG_MACH_TEGRA_ENTERPRISE}     += board-enterprise-panel.o
 obj-${CONFIG_MACH_TEGRA_ENTERPRISE}     += board-enterprise-pinmux.o
 obj-${CONFIG_MACH_TEGRA_ENTERPRISE}     += board-enterprise-sdhci.o
 obj-${CONFIG_MACH_TEGRA_ENTERPRISE}     += board-enterprise-memory.o
+obj-${CONFIG_MACH_TEGRA_ENTERPRISE}     += board-enterprise-power.o
diff --git a/arch/arm/mach-tegra/board-enterprise-power.c b/arch/arm/mach-tegra/board-enterprise-power.c
new file mode 100644 (file)
index 0000000..6be40dc
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * arch/arm/mach-tegra/board-enterprise-power.c
+ *
+ * Copyright (C) 2011 NVIDIA, Inc.
+ *
+ * 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
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA
+ */
+#include <linux/i2c.h>
+#include <linux/pda_power.h>
+#include <linux/platform_device.h>
+#include <linux/resource.h>
+#include <linux/regulator/machine.h>
+#include <linux/mfd/tps80031x.h>
+#include <linux/gpio.h>
+#include <mach/suspend.h>
+#include <linux/io.h>
+#include <linux/i2c/twl.h>
+
+#include <mach/iomap.h>
+#include <mach/irqs.h>
+#include <mach/pinmux.h>
+
+#include "gpio-names.h"
+#include "board-enterprise.h"
+#include "power.h"
+#include "wakeups-t3.h"
+
+#ifdef CONFIG_TWL4030_CORE
+static struct regulator_consumer_supply tps80031x_smps4_supply[] = {
+       REGULATOR_SUPPLY("avdd_dsi_csi", NULL),
+};
+
+static struct regulator_consumer_supply tps80031x_vio_supply[] = {
+       REGULATOR_SUPPLY("avdd_osc", NULL),
+       REGULATOR_SUPPLY("vddio_sys", NULL),
+       REGULATOR_SUPPLY("vddio_uart", NULL),
+       REGULATOR_SUPPLY("vddio_audio", NULL),
+       REGULATOR_SUPPLY("vddio_bb", NULL),
+       REGULATOR_SUPPLY("vddio_cam", NULL),
+       REGULATOR_SUPPLY("vddio_sdmmc1", NULL),
+};
+
+static struct regulator_consumer_supply tps80031x_smps3_supply[] = {
+       REGULATOR_SUPPLY("en_vddio_ddr_1v2", NULL),
+};
+
+
+static struct regulator_consumer_supply tps80031x_ldo2_supply[] = {
+       REGULATOR_SUPPLY("vdd_rtc", NULL),
+};
+
+static struct regulator_consumer_supply tps80031x_ldo6_supply[] = {
+       REGULATOR_SUPPLY("vddio_sdmmc3", NULL),
+};
+
+static struct regulator_consumer_supply tps80031x_ldousb_supply[] = {
+       REGULATOR_SUPPLY("avdd_hdmi_pll", NULL),
+};
+
+static struct regulator_consumer_supply tps80031x_ldo7_supply[] = {
+       REGULATOR_SUPPLY("avdd_plla_p_c_s", NULL),
+       REGULATOR_SUPPLY("avdd_pllm", NULL),
+       REGULATOR_SUPPLY("avdd_pllu_d", NULL),
+       REGULATOR_SUPPLY("avdd_pllx", NULL),
+};
+
+#define TPS_PDATA_INIT(_id, _minmv, _maxmv, _supply_reg, _always_on,   \
+       _boot_on, _apply_uv) \
+       {                                                               \
+               .constraints = {                                \
+                   .min_uV = (_minmv)*1000,            \
+                       .max_uV = (_maxmv)*1000,                \
+                       .valid_modes_mask = (REGULATOR_MODE_NORMAL |  \
+                                                    REGULATOR_MODE_STANDBY), \
+                       .valid_ops_mask = (REGULATOR_CHANGE_MODE |    \
+                                                  REGULATOR_CHANGE_STATUS |  \
+                                                  REGULATOR_CHANGE_VOLTAGE), \
+                       .always_on = _always_on,                \
+                       .boot_on = _boot_on,                    \
+                       .apply_uV = _apply_uv,                  \
+               },                                              \
+               .num_consumer_supplies =                        \
+                       ARRAY_SIZE(tps80031x_##_id##_supply),   \
+               .consumer_supplies = tps80031x_##_id##_supply,  \
+       }
+
+static struct regulator_init_data smps4_data = TPS_PDATA_INIT(smps4,    600, 2100, 0, 1, 1, 0);
+static struct regulator_init_data vio_data = TPS_PDATA_INIT(vio,    0, 1800, 0, 1, 1, 0);
+static struct regulator_init_data smps3_data = TPS_PDATA_INIT(smps3, 600, 2100, 0, 1, 1, 0);
+static struct regulator_init_data ldo2_data = TPS_PDATA_INIT(ldo2, 1000, 3300, 0, 1, 1, 0);
+static struct regulator_init_data ldo6_data = TPS_PDATA_INIT(ldo6, 1000, 3300, 0, 1, 1, 0);
+static struct regulator_init_data ldousb_data = TPS_PDATA_INIT(ldousb, 1000, 3300, 0, 1, 1, 0);
+static struct regulator_init_data ldo7_data = TPS_PDATA_INIT(ldo7, 1000, 3300, 0, 1, 1, 0);
+
+static struct twl4030_platform_data tps_platform = {
+    .smps4 = &smps4_data,
+    .vio = &vio_data,
+    .smps3 = &smps3_data,
+    .ldo2 = &ldo2_data,
+    .ldo6 = &ldo6_data,
+    .ldousb = &ldousb_data,
+    .ldo7 = &ldo7_data,
+};
+
+static struct i2c_board_info __initdata enterprise_regulators[] = {
+       {
+               I2C_BOARD_INFO("twl6025", 0x48),
+               .irq            = INT_EXTERNAL_PMU,
+               .platform_data  = &tps_platform,
+       },
+};
+
+int __init enterprise_regulator_init(void)
+{
+       i2c_register_board_info(4, enterprise_regulators, 1);
+       return 0;
+}
+#else
+int __init enterprise_regulator_init(void)
+{
+       return 0;
+}
+#endif
+
+static struct tegra_suspend_platform_data enterprise_suspend_data = {
+       .cpu_timer      = 2000,
+       .cpu_off_timer  = 0,
+       .suspend_mode   = TEGRA_SUSPEND_NONE,
+       .core_timer     = 0x7e7e,
+       .core_off_timer = 0,
+       .separate_req   = true,
+       .corereq_high   = false,
+       .sysclkreq_high = true,
+       .wake_enb       = 0,
+       .wake_high      = 0,
+       .wake_low       = 0,
+       .wake_any       = 0,
+};
+
+int __init enterprise_suspend_init(void)
+{
+       tegra_init_suspend(&enterprise_suspend_data);
+       return 0;
+
+}
index 97a30f0..50f6de2 100644 (file)
@@ -371,6 +371,7 @@ static void __init tegra_enterprise_init(void)
        enterprise_i2c_init();
        platform_add_devices(enterprise_devices, ARRAY_SIZE(enterprise_devices));
        enterprise_sdhci_init();
+       enterprise_regulator_init();
        enterprise_usb_init();
        enterprise_gps_init();
        enterprise_modem_init();
index 0911800..2bba282 100644 (file)
@@ -30,6 +30,7 @@ int enterprise_pinmux_init(void);
 int enterprise_panel_init(void);
 int touch_init(void);
 int enterprise_emc_init(void);
+int enterprise_regulator_init(void);
 
 /* Touchscreen GPIO addresses   */
 #ifdef CONFIG_TOUCHSCREEN_ATMEL_MT_T9