ARM: tegra: Add LP1 temp-based wakeup params
Daniel Solomon [Tue, 2 Apr 2013 22:55:44 +0000 (15:55 -0700)]
Add parameters to nct1008_pdata:
- suspend_ext_limit_hi/_lo: limits of allowed
temperature during suspend, outside of which an
interrupt is triggered
- suspend_with_wakeup: function pointer to check for
desired NCT suspend type. For Tegra, this function
returns true if suspend mode is LP1.

Currently this functionality is only added to Pluto.

Bug 1261915

Change-Id: I190721a42ee1e06961368f5c6f7274aa182fd49d
Signed-off-by: Daniel Solomon <daniels@nvidia.com>
Reviewed-on: http://git-master/r/216366
(cherry picked from commit 8edbfe81583505ff51687573088615e69d469585)
Reviewed-on: http://git-master/r/226449
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>

arch/arm/mach-tegra/board-pluto-sensors.c
arch/arm/mach-tegra/pm.c
arch/arm/mach-tegra/pm.h

index f075ac8..84ca663 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/input/max77665-haptic.h>
 #include <linux/power/max17042_battery.h>
 #include <linux/nct1008.h>
+#include <linux/io.h>
 #include <linux/interrupt.h>
 #include <mach/edp.h>
 #include <mach/gpio-tegra.h>
@@ -46,6 +47,7 @@
 #include "devices.h"
 #include "tegra-board-id.h"
 #include "dvfs.h"
+#include "pm.h"
 
 #define NTC_10K_TGAIN   0xE6A2
 #define NTC_10K_TOFF    0x2694
@@ -378,6 +380,12 @@ static struct nct1008_platform_data pluto_nct1008_pdata = {
                        .hysteresis = 5000,
                },
        },
+
+#ifdef CONFIG_TEGRA_LP1_LOW_COREVOLTAGE
+       .suspend_ext_limit_hi = 25000,
+       .suspend_ext_limit_lo = 20000,
+       .suspend_with_wakeup = tegra_is_lp1_suspend_mode,
+#endif
 };
 
 static struct i2c_board_info pluto_i2c4_nct1008_board_info[] = {
index ce195fa..6e0c943 100644 (file)
@@ -832,6 +832,13 @@ void tegra_mc_clk_finish(void)
        writel(0, pmc + PMC_SCRATCH41);
 }
 
+#ifdef CONFIG_TEGRA_LP1_LOW_COREVOLTAGE
+int tegra_is_lp1_suspend_mode(void)
+{
+       return (current_suspend_mode == TEGRA_SUSPEND_LP1);
+}
+#endif
+
 static int tegra_common_suspend(void)
 {
        void __iomem *mc = IO_ADDRESS(TEGRA_MC_BASE);
index d34df30..16ba8a4 100644 (file)
@@ -102,6 +102,9 @@ bool tegra_set_cpu_in_pd(int cpu);
 void tegra_mc_clk_prepare(void);
 void tegra_mc_clk_finish(void);
 int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags);
+#ifdef CONFIG_TEGRA_LP1_LOW_COREVOLTAGE
+int tegra_is_lp1_suspend_mode(void);
+#endif
 
 #ifdef CONFIG_ARCH_TEGRA_14x_SOC
 #define FLOW_CTRL_CLUSTER_CONTROL \