Skip to contentSkip to conversation

PATCH: f71882fg: Fix auto_channels_temp temp numbering

lm-sensors Applied Hans de Goede 2 participants 2 messages Dec 15, 2008 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

Hi Jean,

Adjust auto_channels_temp show and store functions for different numbering of temps between f8000 and other supported models.

Regards,

Hans

Adjust auto_channels_temp show and store functions for different numbering of temps between f8000 and other supported models.

drivers/hwmon/f71882fg.c renamed from drivers/hwmon/f71882fg.c.14-applied +8 -4
@@ -1610,8 +1610,9 @@
 	int result;
 	struct f71882fg_data *data = f71882fg_update_device(dev);
 	int nr = to_sensor_dev_attr_2(devattr)->index;
+	int temp_start = (data->type == f8000) ? 0 : 1;
 
-	result = 1 << ((data->pwm_auto_point_mapping[nr] & 3) - 1);
+	result = 1 << ((data->pwm_auto_point_mapping[nr] & 3) - temp_start);
 
 	return sprintf(buf, "%d\n", result);
 }
@@ -1622,20 +1623,23 @@
 {
 	struct f71882fg_data *data = dev_get_drvdata(dev);
 	int nr = to_sensor_dev_attr_2(devattr)->index;
+	int temp_start = (data->type == f8000) ? 0 : 1;
 	long val = simple_strtol(buf, NULL, 10);
+
 	switch (val) {
 	case 1:
-		val = 1;
+		val = 0;
 		break;
 	case 2:
-		val = 2;
+		val = 1;
 		break;
 	case 4:
-		val = 3;
+		val = 2;
 		break;
 	default:
 		return -EINVAL;
 	}
+	val += temp_start;
 	mutex_lock(&data->update_lock);
 	data->pwm_auto_point_mapping[nr] =
 		f71882fg_read8(data, F71882FG_REG_POINT_MAPPING(nr));

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Applied
#1 lore raw

Re: [lm-sensors] PATCH: f71882fg: Fix auto_channels_temp temp

Quoted 6 lines · Hans de Goede

Hi Jean,

Adjust auto_channels_temp show and store functions for different numbering of temps between f8000 and other supported models.

Applied, thanks.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors