diff options
Diffstat (limited to 'drivers/hwmon/f75375s.c')
-rw-r--r-- | drivers/hwmon/f75375s.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c index eedf574ab539..f609b5727ba9 100644 --- a/drivers/hwmon/f75375s.c +++ b/drivers/hwmon/f75375s.c | |||
@@ -172,7 +172,7 @@ static inline void f75375_write8(struct i2c_client *client, u8 reg, | |||
172 | static inline void f75375_write16(struct i2c_client *client, u8 reg, | 172 | static inline void f75375_write16(struct i2c_client *client, u8 reg, |
173 | u16 value) | 173 | u16 value) |
174 | { | 174 | { |
175 | int err = i2c_smbus_write_byte_data(client, reg, (value << 8)); | 175 | int err = i2c_smbus_write_byte_data(client, reg, (value >> 8)); |
176 | if (err) | 176 | if (err) |
177 | return; | 177 | return; |
178 | i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF)); | 178 | i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF)); |
@@ -200,9 +200,6 @@ static struct f75375_data *f75375_update_device(struct device *dev) | |||
200 | f75375_read16(client, F75375_REG_FAN_MIN(nr)); | 200 | f75375_read16(client, F75375_REG_FAN_MIN(nr)); |
201 | data->fan_target[nr] = | 201 | data->fan_target[nr] = |
202 | f75375_read16(client, F75375_REG_FAN_EXP(nr)); | 202 | f75375_read16(client, F75375_REG_FAN_EXP(nr)); |
203 | data->pwm[nr] = f75375_read8(client, | ||
204 | F75375_REG_FAN_PWM_DUTY(nr)); | ||
205 | |||
206 | } | 203 | } |
207 | for (nr = 0; nr < 4; nr++) { | 204 | for (nr = 0; nr < 4; nr++) { |
208 | data->in_max[nr] = | 205 | data->in_max[nr] = |
@@ -218,6 +215,8 @@ static struct f75375_data *f75375_update_device(struct device *dev) | |||
218 | if (time_after(jiffies, data->last_updated + 2 * HZ) | 215 | if (time_after(jiffies, data->last_updated + 2 * HZ) |
219 | || !data->valid) { | 216 | || !data->valid) { |
220 | for (nr = 0; nr < 2; nr++) { | 217 | for (nr = 0; nr < 2; nr++) { |
218 | data->pwm[nr] = f75375_read8(client, | ||
219 | F75375_REG_FAN_PWM_DUTY(nr)); | ||
221 | /* assign MSB, therefore shift it by 8 bits */ | 220 | /* assign MSB, therefore shift it by 8 bits */ |
222 | data->temp11[nr] = | 221 | data->temp11[nr] = |
223 | f75375_read8(client, F75375_REG_TEMP(nr)) << 8; | 222 | f75375_read8(client, F75375_REG_TEMP(nr)) << 8; |
@@ -369,7 +368,7 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) | |||
369 | fanmode |= (3 << FAN_CTRL_MODE(nr)); | 368 | fanmode |= (3 << FAN_CTRL_MODE(nr)); |
370 | break; | 369 | break; |
371 | case 2: /* AUTOMATIC*/ | 370 | case 2: /* AUTOMATIC*/ |
372 | fanmode |= (2 << FAN_CTRL_MODE(nr)); | 371 | fanmode |= (1 << FAN_CTRL_MODE(nr)); |
373 | break; | 372 | break; |
374 | case 3: /* fan speed */ | 373 | case 3: /* fan speed */ |
375 | break; | 374 | break; |
@@ -723,7 +722,7 @@ static void f75375_init(struct i2c_client *client, struct f75375_data *data, | |||
723 | if (data->kind == f75387) { | 722 | if (data->kind == f75387) { |
724 | bool manu, duty; | 723 | bool manu, duty; |
725 | 724 | ||
726 | if (!(conf & (1 << F75387_FAN_CTRL_LINEAR(nr)))) | 725 | if (!(mode & (1 << F75387_FAN_CTRL_LINEAR(nr)))) |
727 | data->pwm_mode[nr] = 1; | 726 | data->pwm_mode[nr] = 1; |
728 | 727 | ||
729 | manu = ((mode >> F75387_FAN_MANU_MODE(nr)) & 1); | 728 | manu = ((mode >> F75387_FAN_MANU_MODE(nr)) & 1); |