Skip to contentSkip to conversation

I2C hwmon: hwmon sysfs class

PATCH New Greg KH 1 participant 1 message Sep 5, 2005 Hardware monitoring

lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 I2C hwmon: hwmon sysfs class

[PATCH] I2C hwmon: hwmon sysfs class

This patch adds the sysfs class "hwmon" for use by hardware monitoring (sensors) chip drivers. It also fixes up the related Kconfig/Makefile bits.

---
commit 1236441f38b6a98caf4c7983e7efdecc2d1527b5
tree 496a7e86fc0da92812205e2783f41d3f860c362c
parent 8dd2d2ca7fafdedaebd1862e954fccaef212f1e1
author Mark M. Hoffman <[email protected]> Fri, 15 Jul 2005 21:38:08 -0400 committer Greg Kroah-Hartman <[email protected]> Mon, 05 Sep 2005 09:14:07 -0700

 drivers/hwmon/Kconfig  |    7 +++
 drivers/hwmon/Makefile |    2 +
 drivers/hwmon/hwmon.c  |   98 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/hwmon.h  |   24 ++++++++++++
 4 files changed, 130 insertions(+), 1 deletions(-)
drivers/hwmon/Kconfig +6 -1
@@ -12,7 +12,12 @@ config HWMON
 	  of a system. Most modern motherboards include such a device. It
 	  can include temperature sensors, voltage sensors, fan speed
 	  sensors and various additional features such as the ability to
-	  control the speed of the fans.
+	  control the speed of the fans.  If you want this support you
+	  should say Y here and also to the specific driver(s) for your
+	  sensors chip(s) below.
+
+	  This support can also be built as a module.  If so, the module
+	  will be called hwmon.
 
 config SENSORS_ADM1021
 	tristate "Analog Devices ADM1021 and compatibles"
drivers/hwmon/Makefile +2 -0
@@ -2,6 +2,8 @@
 # Makefile for sensor chip drivers.
 #
 
+obj-$(CONFIG_HWMON)		+= hwmon.o
+
 # asb100, then w83781d go first, as they can override other drivers' addresses.
 obj-$(CONFIG_SENSORS_ASB100)	+= asb100.o
 obj-$(CONFIG_SENSORS_W83627HF)	+= w83627hf.o
drivers/hwmon/hwmon.c new file +98 -0

98 lines not on this page · raw message

include/linux/hwmon.h new file +24 -0
new file mode 100644
@@ -0,0 +1,24 @@
+/*
+    hwmon.h - part of lm_sensors, Linux kernel modules for hardware monitoring
+
+    This file declares helper functions for the sysfs class "hwmon",
+    for use by sensors drivers.
+
+    Copyright (C) 2005 Mark M. Hoffman <[email protected]>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; version 2 of the License.
+*/
+
+#ifndef _HWMON_H_
+#define _HWMON_H_
+
+#include <linux/device.h>
+
+struct class_device *hwmon_device_register(struct device *dev);
+
+void hwmon_device_unregister(struct class_device *cdev);
+
+#endif
+