msm: arm: make nohlt readable

Make the debugfs node 'nohlt' readable.

It is a common use case to want to turn nohlt
on or off, but there is no way to see the current state.
Writing to nohlt increments or decrements its reference
counter, and does not absolutely set the state. By making
it readable, its current state can be checked so that
it can be determined if a write is needed to change the
state.

Change-Id: I08e327808299aef3e125f04bff8b6aad28d020cc
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
This commit is contained in:
Neil Leeder 2013-05-23 16:05:41 -04:00 committed by Stephen Boyd
parent d531233266
commit c200525d5c
2 changed files with 13 additions and 4 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2009, The Linux Foundation. All rights reserved.
/* Copyright (c) 2009, 2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -28,11 +28,20 @@ static int set_nohalt(void *data, u64 val)
return 0;
}
DEFINE_SIMPLE_ATTRIBUTE(nohalt_ops, NULL, set_nohalt, "%llu\n");
extern int cpu_idle_force_poll;
static int get_nohalt(void *data, u64 *val)
{
*val = (unsigned int)cpu_idle_force_poll;
return 0;
}
DEFINE_SIMPLE_ATTRIBUTE(nohalt_ops, get_nohalt, set_nohalt, "%llu\n");
static int __init init_hlt_debug(void)
{
debugfs_create_file("nohlt", 0200, NULL, NULL, &nohalt_ops);
debugfs_create_file("nohlt", 0600, NULL, NULL, &nohalt_ops);
return 0;
}

View file

@ -11,7 +11,7 @@
#include <trace/events/power.h>
static int __read_mostly cpu_idle_force_poll;
int __read_mostly cpu_idle_force_poll;
void cpu_idle_poll_ctrl(bool enable)
{