From db27a071832953ce39ee129e195c37bb99f9f052 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 30 Jan 2004 20:57:38 +0000 Subject: [PATCH] Support 2.6 gl518sm driver. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2250 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/chips.c | 6 +++--- lib/proc.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/chips.c b/lib/chips.c index f0bd68be..10e60296 100644 --- a/lib/chips.c +++ b/lib/chips.c @@ -419,7 +419,7 @@ static sensors_chip_feature max1617a_features[] = static sensors_chip_feature gl518_features[] = { { SENSORS_GL518_VDD, "vdd", NOMAP,NOMAP, - R, GL518_SYSCTL_VDD, VALUE(3), 2 }, + R, GL518_SYSCTL_VDD, VALUE(3), 2, "in0", 3 }, { SENSORS_GL518_VIN1, "vin1", NOMAP,NOMAP, R, GL518_SYSCTL_VIN1, VALUE(3), 2 }, @@ -430,7 +430,7 @@ static sensors_chip_feature gl518_features[] = R, GL518_SYSCTL_VIN3, VALUE(3), 2 }, { SENSORS_GL518_VDD_MIN, "vdd_min", SENSORS_GL518_VDD, SENSORS_GL518_VDD, RW, - GL518_SYSCTL_VDD, VALUE(1), 2 }, + GL518_SYSCTL_VDD, VALUE(1), 2 , "in_min0", 3 }, { SENSORS_GL518_VIN1_MIN, "vin1_min", SENSORS_GL518_VIN1, SENSORS_GL518_VIN1, RW, GL518_SYSCTL_VIN1, VALUE(1), 2 }, @@ -442,7 +442,7 @@ static sensors_chip_feature gl518_features[] = GL518_SYSCTL_VIN3, VALUE(1), 2 }, { SENSORS_GL518_VDD_MAX, "vdd_max", SENSORS_GL518_VDD, SENSORS_GL518_VDD, RW, - GL518_SYSCTL_VDD, VALUE(2), 2 }, + GL518_SYSCTL_VDD, VALUE(2), 2 , "in_max0", 3 }, { SENSORS_GL518_VIN1_MAX, "vin1_max", SENSORS_GL518_VIN1, SENSORS_GL518_VIN1, RW, GL518_SYSCTL_VIN1, VALUE(2), 2 }, diff --git a/lib/proc.c b/lib/proc.c index 4907a353..0f6d09aa 100644 --- a/lib/proc.c +++ b/lib/proc.c @@ -427,6 +427,9 @@ int sensors_write_proc(sensors_chip_name name, int feature, double value) in%d_max -> in_max%d in%d_min -> in_min%d in%d -> in_input%d + vin%d_max -> in_max%d + vin%d_min -> in_min%d + vin%d -> in_input%d temp%d_over -> temp_max%d temp%d_hyst -> temp_hyst%d temp%d_max -> temp_max%d @@ -530,6 +533,22 @@ int getsysname(const sensors_chip_feature *feature, char *sysname, int *sysmag) return 0; } + if(sscanf(name, "vin%d_mi%c%c", &num, &last, &check) == 2 && last == 'n') { + sprintf(sysname, "in_min%d", num); + *sysmag = INMAG; + return 0; + } + if(sscanf(name, "vin%d_ma%c%c", &num, &last, &check) == 2 && last == 'x') { + sprintf(sysname, "in_max%d", num); + *sysmag = INMAG; + return 0; + } + if(sscanf(name, "vin%d%c", &num, &check) == 1) { + sprintf(sysname, "in_input%d", num); + *sysmag = INMAG; + return 0; + } + if(sscanf(name, "pwm%d%c", &num, &check) == 1) { strcpy(sysname, name); *sysmag = 0;