asm58 for 2.10.0, linux 2.6.15
Subsystems (3)
attached are my latest patches to a 2.6.15 kernel and lm-sensors
2.10.0. these have been tested and refined on my asus p4b533-vm for
over a month. please consider these patches as candidates for
inclusion into the next release of lm-sensors. if i have committed
any grave injustices in my code, please let me know.
--
Rigel Freden
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: linux-2.6.15-asm58.patch.txt
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060227/0bf98dea/linux-2.6.15-asm58.patch-0001.txt
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lm_sensors-2.10.0-asm58.patch.txt
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060227/0bf98dea/lm_sensors-2.10.0-asm58.patch-0001.txt
Hi,
I finally took some time to look at this. It has taken me 100km in train ;) Please see attachment.
Regards
Rudolf
--
SYSGO | Real-Time Solutions | ELinOS Embedded Linux | http://www.sysgo.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: linux-2.6.15-asm58.patch.txt
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060320/5d83966a/linux-2.6.15-asm58.patch.txt
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lm_sensors-2.10.0-asm58.patch.txt
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060320/5d83966a/lm_sensors-2.10.0-asm58.patch.txt
thank you for the review; i believe i made every change you requested, except the sysfs attribute array and device file creation thing, which i'm too tired or coded out or just plain stupid to understand (perhaps my google-fu is weak tonight). attached are the resultant patches to kernel 2.6.16 and lm sensors 2.10.0. My former system instability turned out to be a power supply fan failure rather than my hwmon driver. now to install a i2c sensor on my psu heatsink... -------------- next part --------------
Documentation/hwmon/asm58 +41 -0
@@ -0,0 +1,42 @@ +Kernel driver asm58 +=========+ +Supported Chips: +* Asus ASM58 Mozart-2 +* Asus AS2K129R Mozart-2 +* Asus ??? Mozart-2 + All three seem to be the same save for exterior markings + Prefix: 'asm58' + Addresses scanned: I2C 0x77 + Datasheet: not available + + +Description +----------- + +This chip is discontinued and unsupported by the manufacturer. The driver was +developed with xmbmon205 source as a reference. It is found on +the following Asus mainboards: + P4B533-VM + P4S333 (in conjunction with another asus chip?) + P4S333-VM + Terminator P4 + +Registers: +temp: +temp1: 0x27 +temp2: 0x13 +fan: +fan 1: 0x28, divisor on register 0xA1 (bits 4-5) +fan 2: 0x29, divisor on register 0xA1 (bits 6-7) +voltage: +in0=r(0x20) +in1=r(0x22) +in2=r(0x23) +in3=r(0x24) +config, or bank register at 0x40 + +notes: + * there is another undocumented asus chip at i2c 0x77 on a different board + * there is reason to believe this chip implements a watchdog and perhaps other + features, probably fan control among them
drivers/hwmon/Kconfig +10 -0
@@ -89,6 +89,16 @@ This driver can also be built as a module. If so, the module will be called asb100. +config SENSORS_ASM58 + tristate "Asus Mozart-2" + depends on HWMON && I2C && EXPERIMENTAL + help + If you say yes here you get support for the ASM58 Mozart-2 sensor + chip found on some Asus mainboards. + + This driver can also be built as a module. If so, the module + will be called asm58. + config SENSORS_ATXP1 tristate "Attansic ATXP1 VID controller" depends on HWMON && I2C && EXPERIMENTAL
drivers/hwmon/Makefile +1 -0
@@ -16,6 +16,7 @@ obj-$(CONFIG_SENSORS_ADM1026) += adm1026.o obj-$(CONFIG_SENSORS_ADM1031) += adm1031.o obj-$(CONFIG_SENSORS_ADM9240) += adm9240.o +obj-$(CONFIG_SENSORS_ASM58) += asm58.o obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o obj-$(CONFIG_SENSORS_DS1621) += ds1621.o obj-$(CONFIG_SENSORS_F71805F) += f71805f.o
drivers/hwmon/asm58.c +328 -0
328 lines not on this page · raw message
include/linux/i2c-id.h +1 -0
@@ -151,6 +151,7 @@#define I2C_DRIVERID_ASB100 1043#define I2C_DRIVERID_FSCHER 1046#define I2C_DRIVERID_W83L785TS 1047 +#define I2C_DRIVERID_ASM58 1051/* * ---- Adapter types ----------------------------------------------------
-------------- next part --------------
CONTRIBUTORS +3 -0
@@ -100,3 +100,6 @@ Author of the max1619 chip driver. * Rudolf Marek <r.marek at sh.cvut.cz> Various fixes and support handling +* Rigel Freden <rigelf at users.sf.net> + Author of Mozart-2 driver +
README +1 -1
@@ -75,7 +75,7 @@ Analog Devices ADM1021, ADM1021A, ADM1022, ADM1023, ADM1024, ADM1025, ADM1026, ADM1027, ADM1030, ADM1031, ADM1032, ADM9240, ADT7461 and ADT7463 - Asus AS99127F, ASB100 Bach + Asus AS99127F, ASB100 Bach, Mozart-2 Dallas Semiconductor DS75, DS1621, DS1625, DS1775, and DS1780 Hewlett Packard Maxilife (several revisions including '99 NBA) Fintek F71805F/FG
doc/chips/SUMMARY +4 -0
@@ -89,6 +89,10 @@ asb100 asb100 4 7 3 1 yes no +asm58 + asm58 2 4 2 - yes no + as2k129r 2 4 2 - yes no + bmcsensors bmcsensors ? ? ? - no no
doc/chips/asm58 +17 -0
@@ -0,0 +1,17 @@ +Kernel driver 'asm58.ko' +============ + +Status: only monitoring functions implemented, other functionality unknown + 2.4 kernel version incomplete + +Supported chips: + * Asus asm58, as2k129r, there may be other mozart-2 chips + Prefix: 'asm58' + Addresses scanned: i2c 0x77 + Datasheet: unavailable, chip information gleaned from xmbmon 2,05 + +Description +----------- + +This driver conforms to well defined rules of the 2.6 series kernel for hwmon +chips (should work on at least kernel 2.6.10 and later, maybe others)
etc/sensors.conf.eg +15 -0
@@ -2527,3 +2527,18 @@ #set temp2_hyst 48 #set temp3_max 50 #set temp3_hyst 48 + +chip "asm58-*" +# this is the default config for the asus p4b533-vm mobo--will probably be fine +# for any but the p4s333 + label temp1 "CPU Temp" + label temp2 "M/B Temp" + label fan1 "CPU Fan" + label fan2 "Case Fan" + label in0 "VCore" + label in1 "V3.3" + label in2 "V5.0" + label in3 "V12.0" + + compute in2 ((6.8/10)+1)*@ , @/((6.8/10)+1) + compute in3 ((30/10)+1)*@ , @/((30/10)+1)
lib/chips.c +12 -0
@@ -5556,6 +5556,18 @@ { 0 } }; +static sensors_chip_feature asm58_features[]+{ + {SENSORS_ASM58_TEMP1,"temp1",NOMAP,NOMAP,R,NOSYSCTL,VALUE(3),3}, + {SENSORS_ASM58_TEMP2,"temp2",NOMAP,NOMAP,R,NOSYSCTL,VALUE(3),3}, + {SENSORS_ASM58_FAN1,"fan1",NOMAP,NOMAP,R,NOSYSCTL,VALUE(3),0}, + {SENSORS_ASM58_FAN2,"fan2",NOMAP,NOMAP,R,NOSYSCTL,VALUE(3),0}, + {SENSORS_ASM58_IN0,"in0",NOMAP,NOMAP,R,NOSYSCTL,VALUE(3),3}, + {SENSORS_ASM58_IN1,"in1",NOMAP,NOMAP,R,NOSYSCTL,VALUE(3),3}, + {SENSORS_ASM58_IN2,"in2",NOMAP,NOMAP,R,NOSYSCTL,VALUE(3),3}, + {SENSORS_ASM58_IN3,"in3",NOMAP,NOMAP,R,NOSYSCTL,VALUE(3),3} +}; + sensors_chip_features sensors_chip_features_list[] { { SENSORS_LM78_PREFIX, lm78_features },
@@ -5656,5 +5668,6 @@ { SENSORS_LM93_PREFIX, lm93_features }, { SENSORS_SMSC47B397_PREFIX, smsc47b397_features }, { SENSORS_F71805F_PREFIX, f71805f_features }, + { SENSORS_ASM58_PREFIX, asm58_features}, { 0 } };
lib/chips.h +13 -0
@@ -2105,4 +2105,17 @@#define SENSORS_F71805F_ALARMS_FAN 201#define SENSORS_F71805F_ALARMS_TEMP 202 + +/* asus mozart-2 all values read only */ + +#define SENSORS_ASM58_PREFIX "asm58" +#define SENSORS_ASM58_TEMP1 1 +#define SENSORS_ASM58_TEMP2 2 +#define SENSORS_ASM58_FAN1 3 +#define SENSORS_ASM58_FAN2 4 +#define SENSORS_ASM58_IN0 5 +#define SENSORS_ASM58_IN1 6 +#define SENSORS_ASM58_IN2 7 +#define SENSORS_ASM58_IN3 8 +#endif /* def LIB_SENSORS_CHIPS_H */
prog/detect/sensors-detect +3 -3
@@ -1108,19 +1108,19 @@ } , { name => "Asus ASM58 Mozart-2", - driver => "to-be-written", + driver => "asm58", i2c_addrs => [0x77], i2c_detect => sub { mozart_detect 0, @_}, } , { name => "Asus AS2K129R Mozart-2", - driver => "to-be-written", + driver => "asm58", i2c_addrs => [0x77], i2c_detect => sub { mozart_detect 1, @_}, } , { name => "Asus Mozart-2", - driver => "to-be-written", + driver => "asm58", i2c_addrs => [0x77], i2c_detect => sub { mozart_detect 2, @_}, } ,
prog/sensors/chips.c +51 -1
61 lines not on this page · raw message
prog/sensors/chips.h +1 -0
@@ -71,5 +71,6 @@extern void print_adm1031 (const sensors_chip_name *name);extern void print_smsc47b397 (const sensors_chip_name *name);extern void print_f71805f (const sensors_chip_name *name); +extern void print_asm58 (const sensors_chip_name *name);#endif /* def PROG_SENSORS_CHIPS_H */
prog/sensors/main.c +1 -0
@@ -414,6 +414,7 @@ { "lm93", print_lm93 }, { "smsc47b397", print_smsc47b397 }, { "f71805f", print_f71805f }, + { "asm58", print_asm58}, { NULL, NULL } };
Quoted 7 lines · Rigel Freden
thank you for the review; i believe i made every change you requested, except the sysfs attribute array and device file creation thing, which i'm too tired or coded out or just plain stupid to understand (perhaps my google-fu is weak tonight). attached are the resultant patches to kernel 2.6.16 and lm sensors 2.10.0. My former system instability turned out to be a power supply fan failure rather than my hwmon driver. now to install a i2c sensor on my psu heatsink...
Good.
Jean, care to take a look and eventualy accept it?
Rigel depending on the comments from Jean you will need to send the patch with the Signed-Off-By stuff + a classic descripotion what the patch does.
Regards
Rudolf