aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/thermal_hwmon.h
diff options
context:
space:
mode:
authorEduardo Valentin <eduardo.valentin@ti.com>2013-07-03 15:14:28 -0400
committerEduardo Valentin <eduardo.valentin@ti.com>2013-09-03 09:09:12 -0400
commit0dd88793aacd7c91b9724be7b618bb3f7c25befe (patch)
tree6bd7184103a59823c8f57174cdde7f3e7210de3a /drivers/thermal/thermal_hwmon.h
parent73b5b1d7c5f9348c0fe3a3e4ac5586207d830d54 (diff)
thermal: hwmon: move hwmon support to single file
In order to improve code organization, this patch moves the hwmon sysfs support to a file named thermal_hwmon. This helps to add extra support for hwmon without scrambling the code. In order to do this move, the hwmon list head is now using its own locking. Before, the list used the global thermal locking. Also, some minor changes in the code were required, as recommended by checkpatch.pl. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Diffstat (limited to 'drivers/thermal/thermal_hwmon.h')
-rw-r--r--drivers/thermal/thermal_hwmon.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_hwmon.h b/drivers/thermal/thermal_hwmon.h
new file mode 100644
index 000000000000..c798fdb2ae43
--- /dev/null
+++ b/drivers/thermal/thermal_hwmon.h
@@ -0,0 +1,49 @@
1/*
2 * thermal_hwmon.h - Generic Thermal Management hwmon support.
3 *
4 * Code based on Intel thermal_core.c. Copyrights of the original code:
5 * Copyright (C) 2008 Intel Corp
6 * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com>
7 * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com>
8 *
9 * Copyright (C) 2013 Texas Instruments
10 * Copyright (C) 2013 Eduardo Valentin <eduardo.valentin@ti.com>
11 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; version 2 of the License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25 *
26 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 */
28#ifndef __THERMAL_HWMON_H__
29#define __THERMAL_HWMON_H__
30
31#include <linux/thermal.h>
32
33#ifdef CONFIG_THERMAL_HWMON
34int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz);
35void thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz);
36#else
37static int
38thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
39{
40 return 0;
41}
42
43static void
44thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz)
45{
46}
47#endif
48
49#endif /* __THERMAL_HWMON_H__ */