* [lm-sensors] PATCH: f71882fg: Fix auto_channels_temp temp numbering
@ 2008-12-15 12:38 Hans de Goede
2008-12-15 16:17 ` [lm-sensors] PATCH: f71882fg: Fix auto_channels_temp temp Jean Delvare
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2008-12-15 12:38 UTC (permalink / raw)
To: lm-sensors
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [lm-sensors] PATCH: f71882fg: Fix auto_channels_temp temp
2008-12-15 12:38 [lm-sensors] PATCH: f71882fg: Fix auto_channels_temp temp numbering Hans de Goede
@ 2008-12-15 16:17 ` Jean Delvare
0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2008-12-15 16:17 UTC (permalink / raw)
To: lm-sensors
On Mon, 15 Dec 2008 13:38:05 +0100, Hans de Goede wrote:
> 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>
Applied, thanks.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-15 16:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-15 12:38 [lm-sensors] PATCH: f71882fg: Fix auto_channels_temp temp numbering Hans de Goede
2008-12-15 16:17 ` [lm-sensors] PATCH: f71882fg: Fix auto_channels_temp temp Jean Delvare
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.