hwmon: DNS323 rev C1 fan support
PATCH 4/4 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 0 RPM input 16..127 slow 400 RPM input 128..255 fast 2000 RPM input
This provides something more/less working with fancontrol, though it does have a tendency to work by doing short bursts of "slow" speed every half a minute as it settles around my min temp. Not a big deal a specialized script could probably do better, or even tweaks to fancontrol config. At leats it should be safe, and appears to work well enough for me with fancontrol.
Signed-off-by Benjamin Herrenschmidt <[email protected]>
CC lm-sensors at lm-sensors.org
--- drivers/hwmon/Kconfig | 12 ++ drivers/hwmon/Makefile | 1 + drivers/hwmon/dns323c-fan.c | 271 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 284 insertions(+), 0 deletions(-) create mode 100644 drivers/hwmon/dns323c-fan.c
drivers/hwmon/Kconfig +12 -0
@@ -1118,6 +1118,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
@@ -103,6 +103,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 +271 -0
271 lines not on this page · raw message