Skip to contentSkip to conversation

hwmon: DNS323 rev C1 fan support

PATCH New Benjamin Herrenschmidt 1 participant 1 message May 17, 2010 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: DNS323 rev C1 fan support

The hardware only supports 3 settings: off, slow and fast.

In order to have a chance to work with existing fan control systems, we emulate a PWM device with the following mapping:

   0.. 15  off
  16..127  slow
 128..255  fast

---

Note: These numbers have been picked up pretty randomly and I haven't had a chance yet to check how fancontrol copes with them. However, at least we get reasonable "manual" control, and it should at least be able to pump the fans to full speed if the temperature is too high so we can always adjust the thresholds later on.

---
 drivers/hwmon/Kconfig       |   12 ++
 drivers/hwmon/Makefile      |    1 +
 drivers/hwmon/dns323c-fan.c |  237 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 250 insertions(+), 0 deletions(-)
 create mode 100644 drivers/hwmon/dns323c-fan.c
drivers/hwmon/Kconfig +12 -0
index 9be8e17..5f55735 100644
@@ -1087,6 +1087,18 @@ config SENSORS_MC13783_ADC
         help
           Support for the A/D converter on MC13783 PMIC.
 
+config SENSORS_DNS323C_FAN
+       tristate "D-Link DNS323 rev C1 Fan"
+       depends on MACH_DNS323
+       help
+         Support for the GPIO based fan control on the D-Link DNS323
+	 HW revision C1. This exposes a pseudo pwm device with the
+	 following values supported:
+
+	 	    0..15	: Fan off
+		   16..127	: Fan on low speed
+		  128..255	: Fan on high speed
+	 
 if ACPI
 
 comment "ACPI drivers"
drivers/hwmon/Makefile +1 -0
index 4aa1a3d..15bcdef 100644
@@ -100,6 +100,7 @@ obj-$(CONFIG_SENSORS_W83L785TS)	+= w83l785ts.o
 obj-$(CONFIG_SENSORS_W83L786NG)	+= w83l786ng.o
 obj-$(CONFIG_SENSORS_WM831X)	+= wm831x-hwmon.o
 obj-$(CONFIG_SENSORS_WM8350)	+= wm8350-hwmon.o
+obj-$(CONFIG_SENSORS_DNS323C_FAN)+= dns323c-fan.o
 
 ifeq ($(CONFIG_HWMON_DEBUG_CHIP),y)
 EXTRA_CFLAGS += -DDEBUG
drivers/hwmon/dns323c-fan.c new file +237 -0

237 lines not on this page · raw message