From e5ee8c4b0394e736c3bc419cc138ae3bb3329dbc Mon Sep 17 00:00:00 2001 From: "Mark M. Hoffman" Date: Thu, 12 Aug 2004 22:21:25 +0000 Subject: [PATCH] bugfix: smart tach handling was not quite finished git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2659 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/lm93.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/chips/lm93.c b/kernel/chips/lm93.c index 83c87678..e1d44aee 100644 --- a/kernel/chips/lm93.c +++ b/kernel/chips/lm93.c @@ -1211,14 +1211,20 @@ void lm93_fan_smart_tach(struct i2c_client *client, int operation, int ctl_name, if (0 <= results[0] && results[0] <= 2) { /* insert the new mapping and write it out */ + data->sf_tach_to_pwm = lm93_read_byte(client, + LM93_REG_SF_TACH_TO_PWM); data->sf_tach_to_pwm &= ~0x3 << nr * 2; data->sf_tach_to_pwm |= results[0] << nr * 2; lm93_write_byte(client, LM93_REG_SF_TACH_TO_PWM, data->sf_tach_to_pwm); /* insert the enable bit and write it out */ - data->sfc2 &= ~1 << nr; - data->sfc2 |= 1 << nr; + data->sfc2 = lm93_read_byte(client, + LM93_REG_SFC2); + if (results[0]) + data->sfc2 |= 1 << nr; + else + data->sfc2 &= ~1 << nr; lm93_write_byte(client, LM93_REG_SFC2, data->sfc2); }