Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c200525d authored by Neil Leeder's avatar Neil Leeder Committed by Stephen Boyd
Browse files

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: default avatarNeil Leeder <nleeder@codeaurora.org>
parent d5312332
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
/* 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;
}
+1 −1
Original line number Diff line number Diff line
@@ -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)
{