summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2016-10-04 13:50:09 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-07 04:36:11 -0400
commite388707c39fd9b68f436f634491a4e2b213ef752 (patch)
tree4f3b93091f091c9487ba4cd4c34df9905d889452
parentbb85a507e21623891a9e2fb06d60ffc8f90bd246 (diff)
tegra186: pm: remove support to set suspend modes from debugfs
This patch removes the support to set system suspend modes - SC2, SC4, SC7 using the debugfs interface, as we only support SC7. Change-Id: Ie6585954ed31ce56b5b0ac1c5e5f02524ab71895 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/1231496 GVS: Gerrit_Virtual_Submit Reviewed-by: Krishna Sitaraman <ksitaraman@nvidia.com>
-rw-r--r--drivers/platform/tegra/pm-tegra186.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/drivers/platform/tegra/pm-tegra186.c b/drivers/platform/tegra/pm-tegra186.c
index ec2043ed3..a68e6bc51 100644
--- a/drivers/platform/tegra/pm-tegra186.c
+++ b/drivers/platform/tegra/pm-tegra186.c
@@ -22,15 +22,10 @@
22#include <linux/pm.h> 22#include <linux/pm.h>
23 23
24static struct dentry *debugfs_dir; 24static struct dentry *debugfs_dir;
25static u32 suspend_state;
26static u32 shutdown_state; 25static u32 shutdown_state;
27 26
28#define SMC_PM_FUNC 0x82FFFE00 27#define SMC_PM_FUNC 0x82FFFE00
29#define SMC_SET_SHUTDOWN_MODE 0x1 28#define SMC_SET_SHUTDOWN_MODE 0x1
30#define SMC_SET_SUSPEND_MODE 0x2
31#define SYSTEM_SUSPEND_STATE_SC2 2
32#define SYSTEM_SUSPEND_STATE_SC4 4
33#define SYSTEM_SUSPEND_STATE_SC7 7
34#define SYSTEM_SHUTDOWN_STATE_FULL_POWER_OFF 0 29#define SYSTEM_SHUTDOWN_STATE_FULL_POWER_OFF 0
35#define SYSTEM_SHUTDOWN_STATE_SC8 8 30#define SYSTEM_SHUTDOWN_STATE_SC8 8
36#define NR_SMC_REGS 6 31#define NR_SMC_REGS 6
@@ -72,20 +67,6 @@ static noinline notrace int __send_smc(u8 func, struct pm_regs *regs)
72}) 67})
73 68
74/** 69/**
75 * Specify state for SYSTEM_SUSPEND
76 *
77 * @suspend_state: Specific suspend state to set
78 *
79 */
80static int tegra_set_suspend_mode(u32 suspend_state)
81{
82 struct pm_regs regs;
83 regs.args[0] = suspend_state;
84 return send_smc(SMC_SET_SUSPEND_MODE, &regs);
85}
86EXPORT_SYMBOL(tegra_set_suspend_mode);
87
88/**
89 * Specify state for SYSTEM_SHUTDOWN 70 * Specify state for SYSTEM_SHUTDOWN
90 * 71 *
91 * @shutdown_state: Specific shutdown state to set 72 * @shutdown_state: Specific shutdown state to set
@@ -112,28 +93,6 @@ static int __init tegra186_pm_init(void)
112} 93}
113core_initcall(tegra186_pm_init); 94core_initcall(tegra186_pm_init);
114 95
115static int suspend_state_get(void *data, u64 *val)
116{
117 *val = suspend_state;
118 return 0;
119}
120
121static int suspend_state_set(void *data, u64 val)
122{
123 int ret;
124 if ((val >= SYSTEM_SUSPEND_STATE_SC2 && val <= SYSTEM_SUSPEND_STATE_SC4)
125 || val == SYSTEM_SUSPEND_STATE_SC7) {
126 suspend_state = val;
127 ret = tegra_set_suspend_mode(suspend_state);
128 }
129 else {
130 printk("Invalid Suspend State\n");
131 ret = -1;
132 }
133
134 return ret;
135}
136
137static int shutdown_state_get(void *data, u64 *val) 96static int shutdown_state_get(void *data, u64 *val)
138{ 97{
139 *val = shutdown_state; 98 *val = shutdown_state;
@@ -156,7 +115,6 @@ static int shutdown_state_set(void *data, u64 val)
156 return ret; 115 return ret;
157} 116}
158 117
159DEFINE_SIMPLE_ATTRIBUTE(suspend_state_fops, suspend_state_get, suspend_state_set, "%llu\n");
160DEFINE_SIMPLE_ATTRIBUTE(shutdown_state_fops, shutdown_state_get, shutdown_state_set, "%llu\n"); 118DEFINE_SIMPLE_ATTRIBUTE(shutdown_state_fops, shutdown_state_get, shutdown_state_set, "%llu\n");
161 119
162static int __init tegra18_suspend_debugfs_init(void) 120static int __init tegra18_suspend_debugfs_init(void)
@@ -167,11 +125,6 @@ static int __init tegra18_suspend_debugfs_init(void)
167 if (!system_state_debugfs) 125 if (!system_state_debugfs)
168 goto err_out; 126 goto err_out;
169 127
170 dfs_file = debugfs_create_file("suspend", 0644,
171 system_state_debugfs, NULL, &suspend_state_fops);
172 if (!dfs_file)
173 goto err_out;
174
175 dfs_file = debugfs_create_file("shutdown", 0644, 128 dfs_file = debugfs_create_file("shutdown", 0644,
176 system_state_debugfs, NULL, &shutdown_state_fops); 129 system_state_debugfs, NULL, &shutdown_state_fops);
177 if (!dfs_file) 130 if (!dfs_file)