diff --git a/doc/chips/gl518sm b/doc/chips/gl518sm index a0766395..67b0ba19 100644 --- a/doc/chips/gl518sm +++ b/doc/chips/gl518sm @@ -40,7 +40,8 @@ Module Parameters Description ----------- -IMPORTANT: in0, in1, and in2 values (+5, +3, and +12) CANNOT be read +IMPORTANT: For the revision 0x00 chip, the + in0, in1, and in2 values (+5, +3, and +12) CANNOT be read unless you use the slow 'iterate' method. Limits will still work even when iterate=0. See below. This is a limitation of the chip, not the driver. @@ -96,14 +97,22 @@ will do no harm, but will return 'old' values. Iteration Code -------------- -You can select between three modes to read the vin0-2 inputs with +IMPORTANT: For the revision 0x00 chip only, +you may select between three modes to read the vin0-2 inputs with the following lines in /etc/sensors.conf: - set iterate 0 Don't read vin0-vin2 inputs. + set iterate 0 Don't read in0-in2 inputs. set iterate 1 Run the iteration loop, this takes up to 10 seconds. set iterate 2 Show the results of the last iteration loop, and start a new loop to run in the background. +You may also set the iteration type with +'echo n > /proc/sys/dev/sensors/gl518sm-i2c-x-y/iterate'. + +If you have a rev 0x80 chip, the in0-in2 inputs are readable. +In this case, 'iterate' will be read-only and the read value is 3. + + Chip Features ------------- diff --git a/kernel/chips/gl518sm.c b/kernel/chips/gl518sm.c index e5d576ff..d225200e 100644 --- a/kernel/chips/gl518sm.c +++ b/kernel/chips/gl518sm.c @@ -366,11 +366,10 @@ static int gl518_detect(struct i2c_adapter *adapter, int address, } } + type_name = "gl518sm"; if (kind == gl518sm_r00) { - type_name = "gl518sm"; client_name = "GL518SM Revision 0x00 chip"; } else if (kind == gl518sm_r80) { - type_name = "gl518sm"; client_name = "GL518SM Revision 0x80 chip"; } else { #ifdef DEBUG @@ -414,7 +413,10 @@ static int gl518_detect(struct i2c_adapter *adapter, int address, data->sysctl_id = i; /* Initialize the GL518SM chip */ - data->iterate = 0; + if (kind == gl518sm_r00) + data->iterate = 0; + else + data->iterate = 3; data->iterate_lock = 0; data->quit_thread = 0; data->thread = NULL; @@ -1046,7 +1048,8 @@ void gl518_iterate(struct i2c_client *client, int operation, int ctl_name, else if (operation == SENSORS_PROC_REAL_READ) { results[0] = data->iterate; *nrels_mag = 1; - } else if (operation == SENSORS_PROC_REAL_WRITE) { + } else if (operation == SENSORS_PROC_REAL_WRITE && + data->type == gl518sm_r00 ) { if ((*nrels_mag >= 1) && (data->iterate != results[0])) { data->iterate = results[0]; for (i = 0; i < 4; i++) { diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index cee557ca..9554a8a9 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -999,7 +999,9 @@ void print_gl518(const sensors_chip_name *name) int alarms,beeps,valid; int is_r00; - is_r00 = !strcmp(name->prefix,"gl518sm-r00"); + cur = 0.0; + sensors_get_feature(*name,SENSORS_GL518_ITERATE,&cur); + is_r00 = ((int) (cur + 0.5)) != 3; if (!sensors_get_feature(*name,SENSORS_GL518_ALARMS,&cur)) alarms = cur + 0.5; else {