hwmon: add support for GMT G760A fan speed PWM
Subsystems (2)
PATCH 1/1 hwmon: add support for GMT G760A fan speed PWM
This controller can be found on the D-Link DNS-323 for instance, where it is to be configured via static i2c_board_info in the board-specific mach-orion/dns323-setup.c
(therefore I'm also providing new-style driver model compatibility)
As this is my first attempt at writing a hwmon driver... please be patience with me if I didn't get it right :-)
Signed-off-by Herbert Valerio Riedel <[email protected]>
--- Documentation/hwmon/g760a | 38 +++++ drivers/hwmon/Kconfig | 10 ++ drivers/hwmon/Makefile | 1 + drivers/hwmon/g760a.c | 378 +++++++++++++++++++++++++++++++++++++++++++++ include/linux/i2c-id.h | 1 + 5 files changed, 428 insertions(+), 0 deletions(-) create mode 100644 Documentation/hwmon/g760a create mode 100644 drivers/hwmon/g760a.c
Documentation/hwmon/g760a new file +37 -0
@@ -0,0 +1,38 @@ +Kernel driver g760a +=========+ +Supported chips: + * Global Mixed-mode Technology Inc. G760A + Prefix: 'g760a' + Addresses scanned: I2C 0x3e + Datasheet: Publicly available at the GMT website + http://www.gmt.com.tw/datasheet/g760a.pdf + +Author: Herbert Valerio Riedel <[email protected]> + +Description +----------- + +The GMT G760A Fan Speed PWM Controller is connected directly to a fan +and performs closed-loop control of the fan speed. + +The fan speed is programmed by setting the period via 'pwm1' of two +consecutive speed pulses. The period is defined in terms of clock +cycle counts of an assumed 32kHz clock source. + +Setting a period of 255 stops the fan; setting the period to 0 sets +fan to maximum speed. + +The measured fan rotation speed returned via 'fan1_input' is derived +from the measured speed pulse period by assuming again a 32kHz clock +source and a 2 pulse-per-revolution fan. + +The 'alarms' file provides access to the two alarm bits provided by +the G760A chip's status register: Bit 0 is set when the actual fan +speed differs more than 20% with respect to the programmed fan speed; +bit 1 is set when fan speed is below 1920 rpm. + +The g760a driver will not update its values more frequently than every +other second; reading them more often will do no harm, but will return +'old' values. +
drivers/hwmon/Kconfig +10 -0
@@ -281,6 +281,16 @@ config SENSORS_FSCHMD This driver can also be built as a module. If so, the module will be called fschmd. +config SENSORS_G760A + tristate "GMT G760A" + depends on I2C + help + If you say yes here you get support for Global Mixed-mode + Technology Inc G760A fan speed pwm controller chips. + + This driver can also be built as a module. If so, the module + will be called g760a. + config SENSORS_GL518SM tristate "Genesys Logic GL518SM" depends on I2C
drivers/hwmon/Makefile +1 -0
@@ -35,6 +35,7 @@ obj-$(CONFIG_SENSORS_F75375S) += f75375s.o obj-$(CONFIG_SENSORS_FSCHER) += fscher.o obj-$(CONFIG_SENSORS_FSCHMD) += fschmd.o obj-$(CONFIG_SENSORS_FSCPOS) += fscpos.o +obj-$(CONFIG_SENSORS_G760A) += g760a.o obj-$(CONFIG_SENSORS_GL518SM) += gl518sm.o obj-$(CONFIG_SENSORS_GL520SM) += gl520sm.o obj-$(CONFIG_SENSORS_HDAPS) += hdaps.o
drivers/hwmon/g760a.c new file +378 -0
378 lines not on this page · raw message
include/linux/i2c-id.h +1 -0
@@ -163,6 +163,7 @@#define I2C_DRIVERID_FSCHER 1046#define I2C_DRIVERID_W83L785TS 1047#define I2C_DRIVERID_OV7670 1048/* Omnivision 7670 camera */ +#define I2C_DRIVERID_G760A 1049/* * ---- Adapter types ----------------------------------------------------
Signature · 7 lines
1.5.3.4 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors