mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-31 06:15:15 +00:00
Several small GL518SM fixes
* (module) VIN limits are now set to sane values (3V instead of 30V, which caused nasty overflows) * (module) VIN limits had min/max swapped in gl518_attach_adapter * (lib) TEMP_HYST used the VID sysctl instead of the TEMP sysctl, leading to bogus readings * (sensors) print n/a for gl518 not available readings. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@145 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -81,10 +81,10 @@
|
||||
#define GL518_INIT_FAN_MIN_2 3000
|
||||
|
||||
/* What are sane values for these?!? */
|
||||
#define GL518_INIT_VIN_1 3000
|
||||
#define GL518_INIT_VIN_2 3000
|
||||
#define GL518_INIT_VIN_3 3000
|
||||
#define GL518_INIT_VDD 3000
|
||||
#define GL518_INIT_VIN_1 300
|
||||
#define GL518_INIT_VIN_2 300
|
||||
#define GL518_INIT_VIN_3 300
|
||||
#define GL518_INIT_VDD 300
|
||||
|
||||
#define GL518_INIT_PERCENTAGE 10
|
||||
|
||||
@@ -304,17 +304,17 @@ int gl518_attach_adapter(struct i2c_adapter *adapter)
|
||||
(FAN_TO_REG(GL518_INIT_FAN_MIN_1,2) << 8) |
|
||||
FAN_TO_REG(GL518_INIT_FAN_MIN_2,2));
|
||||
gl518_write_value(new_client,GL518_REG_VIN1_LIMIT,
|
||||
(IN_TO_REG(GL518_INIT_VIN_MIN_1) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MAX_1));
|
||||
(IN_TO_REG(GL518_INIT_VIN_MAX_1) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MIN_1));
|
||||
gl518_write_value(new_client,GL518_REG_VIN2_LIMIT,
|
||||
(IN_TO_REG(GL518_INIT_VIN_MIN_2) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MAX_2));
|
||||
(IN_TO_REG(GL518_INIT_VIN_MAX_2) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MIN_2));
|
||||
gl518_write_value(new_client,GL518_REG_VIN3_LIMIT,
|
||||
(IN_TO_REG(GL518_INIT_VIN_MIN_3) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MAX_3));
|
||||
(IN_TO_REG(GL518_INIT_VIN_MAX_3) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MIN_3));
|
||||
gl518_write_value(new_client,GL518_REG_VDD_LIMIT,
|
||||
(IN_TO_REG(GL518_INIT_VDD_MIN) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VDD_MAX));
|
||||
(IN_TO_REG(GL518_INIT_VDD_MAX) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VDD_MIN));
|
||||
/* Clear status register (bit 5=1), start (bit6=1) */
|
||||
gl518_write_value(new_client,GL518_REG_CONF,0x24);
|
||||
gl518_write_value(new_client,GL518_REG_CONF,0x44);
|
||||
|
@@ -22,7 +22,7 @@ MODULE_DIR := lib
|
||||
|
||||
# The main and minor version of the library
|
||||
LIBMAINVER := 0
|
||||
LIBMINORVER := 0.0
|
||||
LIBMINORVER := 0.1
|
||||
LIBVER := $(LIBMAINVER).$(LIBMINORVER)
|
||||
|
||||
# The static lib name, the shared lib name, and the internal ('so') name of
|
||||
@@ -42,7 +42,7 @@ LIBCSOURCES := $(MODULE_DIR)/data.c $(MODULE_DIR)/general.c \
|
||||
LIBOTHEROBJECTS := $(MODULE_DIR)/conf-parse.o $(MODULE_DIR)/conf-lex.o
|
||||
LIBSHOBJECTS := $(LIBCSOURCES:.c=.lo) $(LIBOTHEROBJECTS:.o=.lo)
|
||||
LIBSTOBJECTS := $(LIBCSOURCES:.c=.ao) $(LIBOTHEROBJECTS:.o=.ao)
|
||||
LIBEXTRACLEAN := $(MODULE_DIR)/conf-parse.h
|
||||
LIBEXTRACLEAN := $(MODULE_DIR)/conf-parse.h $(MODULE_DIR)/libsensors.so*
|
||||
|
||||
LIBHEADERFILES := $(MODULE_DIR)/error.h $(MODULE_DIR)/sensors.h
|
||||
|
||||
@@ -88,4 +88,5 @@ clean-lib:
|
||||
$(RM) $(LIBTARGETS) $(LIBSHOBJECTS) $(LIBSTOBJECTS)
|
||||
$(RM) $(LIBSHOBJECTS:.lo=.ld) $(LIBSTOBJECTS:.ao=.ad)
|
||||
$(RM) $(LIBOTHEROBJECTS:.o=.c) $(LIBEXTRACLEAN)
|
||||
$(RM)
|
||||
clean :: clean-lib
|
||||
|
@@ -348,7 +348,7 @@ static sensors_chip_feature gl518r00_features[] =
|
||||
GL518_SYSCTL_TEMP, VALUE(2), 1 },
|
||||
{ SENSORS_GL518R00_TEMP_OVER, "temp_over", SENSORS_GL518R00_TEMP,
|
||||
SENSORS_GL518R00_TEMP, SENSORS_MODE_RW,
|
||||
GL518_SYSCTL_VDD, VALUE(1), 1 },
|
||||
GL518_SYSCTL_TEMP, VALUE(1), 1 },
|
||||
{ SENSORS_GL518R00_VID, "vid", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,
|
||||
SENSORS_MODE_R, GL518_SYSCTL_VID, VALUE(1), 0 },
|
||||
{ SENSORS_GL518R00_FAN1_DIV, "fan1_div", SENSORS_GL518R00_FAN1,
|
||||
|
@@ -244,7 +244,7 @@ void print_gl518(const sensors_chip_name *name)
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VDD_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VDD_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf(" (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
printf("(n/a) (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
min,max,alarms&GL518_ALARM_VDD?"ALARM":" ",
|
||||
beeps&GL518_ALARM_VDD?"(beep)":"");
|
||||
} else
|
||||
@@ -255,7 +255,7 @@ void print_gl518(const sensors_chip_name *name)
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN1_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN1_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf(" (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
printf("(n/a) (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
min,max,alarms&GL518_ALARM_VIN1?"ALARM":" ",
|
||||
beeps&GL518_ALARM_VIN1?"(beep)":"");
|
||||
} else
|
||||
@@ -265,7 +265,7 @@ void print_gl518(const sensors_chip_name *name)
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN2_MIN,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_VIN2_MAX,&max)) {
|
||||
print_label(label,10);
|
||||
printf(" (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
printf("(n/a) (min = %+6.2f V, max = %+6.2f V) %s %s\n",
|
||||
min,max,alarms&GL518_ALARM_VIN2?"ALARM":" ",
|
||||
beeps&GL518_ALARM_VIN2?"(beep)":"");
|
||||
} else
|
||||
@@ -345,8 +345,8 @@ void print_gl518(const sensors_chip_name *name)
|
||||
|
||||
if (!sensors_get_label(*name,SENSORS_GL518R00_TEMP,&label) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_TEMP,&cur) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_TEMP_HYST,&min) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_TEMP_OVER,&max)) {
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_TEMP_OVER,&max) &&
|
||||
!sensors_get_feature(*name,SENSORS_GL518R00_TEMP_HYST,&min)) {
|
||||
print_label(label,10);
|
||||
printf("%+3.0f C (limit = %+3.0f C, hysteris = %+3.0f C) %s %s\n",
|
||||
cur,max,min, alarms&GL518_ALARM_TEMP?"ALARM":" ",
|
||||
|
@@ -81,10 +81,10 @@
|
||||
#define GL518_INIT_FAN_MIN_2 3000
|
||||
|
||||
/* What are sane values for these?!? */
|
||||
#define GL518_INIT_VIN_1 3000
|
||||
#define GL518_INIT_VIN_2 3000
|
||||
#define GL518_INIT_VIN_3 3000
|
||||
#define GL518_INIT_VDD 3000
|
||||
#define GL518_INIT_VIN_1 300
|
||||
#define GL518_INIT_VIN_2 300
|
||||
#define GL518_INIT_VIN_3 300
|
||||
#define GL518_INIT_VDD 300
|
||||
|
||||
#define GL518_INIT_PERCENTAGE 10
|
||||
|
||||
@@ -304,17 +304,17 @@ int gl518_attach_adapter(struct i2c_adapter *adapter)
|
||||
(FAN_TO_REG(GL518_INIT_FAN_MIN_1,2) << 8) |
|
||||
FAN_TO_REG(GL518_INIT_FAN_MIN_2,2));
|
||||
gl518_write_value(new_client,GL518_REG_VIN1_LIMIT,
|
||||
(IN_TO_REG(GL518_INIT_VIN_MIN_1) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MAX_1));
|
||||
(IN_TO_REG(GL518_INIT_VIN_MAX_1) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MIN_1));
|
||||
gl518_write_value(new_client,GL518_REG_VIN2_LIMIT,
|
||||
(IN_TO_REG(GL518_INIT_VIN_MIN_2) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MAX_2));
|
||||
(IN_TO_REG(GL518_INIT_VIN_MAX_2) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MIN_2));
|
||||
gl518_write_value(new_client,GL518_REG_VIN3_LIMIT,
|
||||
(IN_TO_REG(GL518_INIT_VIN_MIN_3) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MAX_3));
|
||||
(IN_TO_REG(GL518_INIT_VIN_MAX_3) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VIN_MIN_3));
|
||||
gl518_write_value(new_client,GL518_REG_VDD_LIMIT,
|
||||
(IN_TO_REG(GL518_INIT_VDD_MIN) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VDD_MAX));
|
||||
(IN_TO_REG(GL518_INIT_VDD_MAX) << 8) |
|
||||
IN_TO_REG(GL518_INIT_VDD_MIN));
|
||||
/* Clear status register (bit 5=1), start (bit6=1) */
|
||||
gl518_write_value(new_client,GL518_REG_CONF,0x24);
|
||||
gl518_write_value(new_client,GL518_REG_CONF,0x44);
|
||||
|
Reference in New Issue
Block a user