All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] PATCH: f71882fg: Fix auto_channels_temp temp numbering
Date: Mon, 15 Dec 2008 12:38:05 +0000	[thread overview]
Message-ID: <49464FAD.3030606@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 204 bytes --]

Hi Jean,

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

Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans

[-- Attachment #2: hwmon-f71882fg-15-fix-f8000-auto_channels_temp.patch --]
[-- Type: text/plain, Size: 1261 bytes --]

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

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
--- linux/drivers/hwmon/f71882fg.c.14-applied	2008-12-15 13:29:42.000000000 +0100
+++ linux/drivers/hwmon/f71882fg.c	2008-12-15 13:33:52.000000000 +0100
@@ -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));

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

             reply	other threads:[~2008-12-15 12:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-15 12:38 Hans de Goede [this message]
2008-12-15 16:17 ` [lm-sensors] PATCH: f71882fg: Fix auto_channels_temp temp Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49464FAD.3030606@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.