From ee0fd78049c5a9fde3e2a2f159fa36f46bc40c37 Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Fri, 15 Dec 2000 00:17:27 +0000 Subject: [PATCH] (mds) fix writes to fan_div first value. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@947 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/mtp008.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel/chips/mtp008.c b/kernel/chips/mtp008.c index 5598a45d..90060bbd 100644 --- a/kernel/chips/mtp008.c +++ b/kernel/chips/mtp008.c @@ -955,17 +955,17 @@ void mtp008_fan_div(struct i2c_client *client, int operation, data->fan_div[2] = DIV_TO_REG(results[2]); val = mtp008_read_value(client, MTP008_REG_PIN_CTRL1); val = (val & 0x3f) | (data->fan_div[2] & 0x03) << 6; - mtp008_write_value(client, MTP008_REG_PIN_CTRL1, val); } - if (*nrels_mag >= 2) { - data->fan_div[1] = DIV_TO_REG(results[1]); + if (*nrels_mag >= 1) { val = mtp008_read_value(client, MTP008_REG_VID_FANDIV); - val = (val & 0x3f) | (data->fan_div[1] & 0x03) << 6; - } - if (*nrels_mag >= 2) { - val = (val & 0xcf) | (data->fan_div[1] & 0x03) << 4; - + if (*nrels_mag >= 2) { + data->fan_div[1] = DIV_TO_REG(results[1]); + val = (val & 0x3f) | + (data->fan_div[1] & 0x03) << 6; + } + data->fan_div[0] = DIV_TO_REG(results[0]); + val = (val & 0xcf) | (data->fan_div[0] & 0x03) << 4; mtp008_write_value(client, MTP008_REG_VID_FANDIV, val); } }