blob: 94cbc4b2f576c148b226c8defc9d475212da2570 [file] [log] [blame]
Neil Leeder68d66ff2013-05-23 16:05:41 -04001/* Copyright (c) 2009, 2013, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13/*
14 * MSM architecture driver to control arm halt behavior
15 */
16
17#include <linux/module.h>
18#include <linux/debugfs.h>
19#include <linux/fs.h>
20#include <asm/system.h>
21
22static int set_nohalt(void *data, u64 val)
23{
24 if (val)
25 disable_hlt();
26 else
27 enable_hlt();
28 return 0;
29}
30
Neil Leeder68d66ff2013-05-23 16:05:41 -040031static int get_nohalt(void *data, u64 *val)
32{
33 *val = (unsigned int)get_hlt();
34
35 return 0;
36}
37
38DEFINE_SIMPLE_ATTRIBUTE(nohalt_ops, get_nohalt, set_nohalt, "%llu\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070039
40static int __init init_hlt_debug(void)
41{
Neil Leeder68d66ff2013-05-23 16:05:41 -040042 debugfs_create_file("nohlt", 0600, NULL, NULL, &nohalt_ops);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070043
44 return 0;
45}
46
47late_initcall(init_hlt_debug);