aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_throttling.c
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2010-12-06 02:04:15 -0500
committerLen Brown <len.brown@intel.com>2010-12-14 00:02:26 -0500
commitcef6e8a3790d6bdc305496629c357a56001d59a6 (patch)
tree53b7b6a66a221694e366bdd4d6468723dc200f6c /drivers/acpi/processor_throttling.c
parentcf7d7e5a1980d1116ee152d25dac382b112b9c17 (diff)
ACPI processor: remove processor throttling control procfs I/F
Remove deprecated ACPI process procfs I/F for throttling control. This is because the t-state control should only be done in kernel, when system is in a overheating state. Now users can only change the processor t-state indirectly, by poking the cooling device sysfs I/F of the processor. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/processor_throttling.c')
-rw-r--r--drivers/acpi/processor_throttling.c114
1 files changed, 0 insertions, 114 deletions
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index ff3632717c51..4a0eec5dd24a 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -32,10 +32,6 @@
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/sched.h> 33#include <linux/sched.h>
34#include <linux/cpufreq.h> 34#include <linux/cpufreq.h>
35#ifdef CONFIG_ACPI_PROCFS
36#include <linux/proc_fs.h>
37#include <linux/seq_file.h>
38#endif
39 35
40#include <asm/io.h> 36#include <asm/io.h>
41#include <asm/uaccess.h> 37#include <asm/uaccess.h>
@@ -1216,113 +1212,3 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
1216 return result; 1212 return result;
1217} 1213}
1218 1214
1219#ifdef CONFIG_ACPI_PROCFS
1220/* proc interface */
1221static int acpi_processor_throttling_seq_show(struct seq_file *seq,
1222 void *offset)
1223{
1224 struct acpi_processor *pr = seq->private;
1225 int i = 0;
1226 int result = 0;
1227
1228 if (!pr)
1229 goto end;
1230
1231 if (!(pr->throttling.state_count > 0)) {
1232 seq_puts(seq, "<not supported>\n");
1233 goto end;
1234 }
1235
1236 result = acpi_processor_get_throttling(pr);
1237
1238 if (result) {
1239 seq_puts(seq,
1240 "Could not determine current throttling state.\n");
1241 goto end;
1242 }
1243
1244 seq_printf(seq, "state count: %d\n"
1245 "active state: T%d\n"
1246 "state available: T%d to T%d\n",
1247 pr->throttling.state_count, pr->throttling.state,
1248 pr->throttling_platform_limit,
1249 pr->throttling.state_count - 1);
1250
1251 seq_puts(seq, "states:\n");
1252 if (pr->throttling.acpi_processor_get_throttling ==
1253 acpi_processor_get_throttling_fadt) {
1254 for (i = 0; i < pr->throttling.state_count; i++)
1255 seq_printf(seq, " %cT%d: %02d%%\n",
1256 (i == pr->throttling.state ? '*' : ' '), i,
1257 (pr->throttling.states[i].performance ? pr->
1258 throttling.states[i].performance / 10 : 0));
1259 } else {
1260 for (i = 0; i < pr->throttling.state_count; i++)
1261 seq_printf(seq, " %cT%d: %02d%%\n",
1262 (i == pr->throttling.state ? '*' : ' '), i,
1263 (int)pr->throttling.states_tss[i].
1264 freqpercentage);
1265 }
1266
1267 end:
1268 return 0;
1269}
1270
1271static int acpi_processor_throttling_open_fs(struct inode *inode,
1272 struct file *file)
1273{
1274 return single_open(file, acpi_processor_throttling_seq_show,
1275 PDE(inode)->data);
1276}
1277
1278static ssize_t acpi_processor_write_throttling(struct file *file,
1279 const char __user * buffer,
1280 size_t count, loff_t * data)
1281{
1282 int result = 0;
1283 struct seq_file *m = file->private_data;
1284 struct acpi_processor *pr = m->private;
1285 char state_string[5] = "";
1286 char *charp = NULL;
1287 size_t state_val = 0;
1288 char tmpbuf[5] = "";
1289
1290 if (!pr || (count > sizeof(state_string) - 1))
1291 return -EINVAL;
1292
1293 if (copy_from_user(state_string, buffer, count))
1294 return -EFAULT;
1295
1296 state_string[count] = '\0';
1297 if ((count > 0) && (state_string[count-1] == '\n'))
1298 state_string[count-1] = '\0';
1299
1300 charp = state_string;
1301 if ((state_string[0] == 't') || (state_string[0] == 'T'))
1302 charp++;
1303
1304 state_val = simple_strtoul(charp, NULL, 0);
1305 if (state_val >= pr->throttling.state_count)
1306 return -EINVAL;
1307
1308 snprintf(tmpbuf, 5, "%zu", state_val);
1309
1310 if (strcmp(tmpbuf, charp) != 0)
1311 return -EINVAL;
1312
1313 result = acpi_processor_set_throttling(pr, state_val, false);
1314 if (result)
1315 return result;
1316
1317 return count;
1318}
1319
1320const struct file_operations acpi_processor_throttling_fops = {
1321 .owner = THIS_MODULE,
1322 .open = acpi_processor_throttling_open_fs,
1323 .read = seq_read,
1324 .write = acpi_processor_write_throttling,
1325 .llseek = seq_lseek,
1326 .release = single_release,
1327};
1328#endif