From c74c331d1e373ed52d9eb8297f5fa69c8d0170d1 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 31 Jul 2004 13:00:59 +0000 Subject: [PATCH] Patch by Kris Van Hees: Here is a small patch that fixes the setting of limits on the temp2 sensors in the MTP008 chip. The code (embarassingly written by myself when I wrote the MTP008 chip driver a long time ago) would always update the hyst and max limits of the first temp sensor, even when you tried to set it for the 2nd or 3rd sensors. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2649 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/mtp008.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kernel/chips/mtp008.c b/kernel/chips/mtp008.c index 9003a8c4..a5cc62ad 100644 --- a/kernel/chips/mtp008.c +++ b/kernel/chips/mtp008.c @@ -1,7 +1,7 @@ /* mtp008.c - Part of lm_sensors, Linux kernel modules for hardware monitoring - Copyright (c) 2001 Kris Van Hees + Copyright (C) 2001, 2004 Kris Van Hees This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -337,9 +337,9 @@ static ctl_table mtp008_dir_table_template[] = {MTP008_SYSCTL_TEMP1, "temp1", NULL, 0, 0644, NULL, &i2c_proc_real, &i2c_sysctl_real, NULL, &mtp008_temp}, {MTP008_SYSCTL_TEMP2, "temp2", NULL, 0, 0644, NULL, - &i2c_proc_real, &i2c_sysctl_real, NULL, &mtp008_temp_add}, + &i2c_proc_real, &i2c_sysctl_real, NULL, &mtp008_temp_add}, {MTP008_SYSCTL_TEMP3, "temp3", NULL, 0, 0644, NULL, - &i2c_proc_real, &i2c_sysctl_real, NULL, &mtp008_temp_add}, + &i2c_proc_real, &i2c_sysctl_real, NULL, &mtp008_temp_add}, {MTP008_SYSCTL_VID, "vid", NULL, 0, 0444, NULL, &i2c_proc_real, &i2c_sysctl_real, NULL, &mtp008_vid}, {MTP008_SYSCTL_FAN_DIV, "fan_div", NULL, 0, 0644, NULL, @@ -809,12 +809,14 @@ void mtp008_temp_add(struct i2c_client *client, int operation, int ctl_name, if(data->sens[nr - 3] != VOLTAGE) { if (*nrels_mag >= 1) { data->in_max[nr] = TEMP_TO_REG(results[0]); - mtp008_write_value(client, MTP008_REG_TEMP_MAX, + mtp008_write_value(client, + MTP008_REG_IN_MAX(nr), data->in_max[nr]); } if (*nrels_mag >= 2) { data->in_min[nr] = TEMP_TO_REG(results[1]); - mtp008_write_value(client, MTP008_REG_TEMP_MIN, + mtp008_write_value(client, + MTP008_REG_IN_MIN(nr), data->in_min[nr]); } }