aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/adt7473.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/adt7473.c')
-rw-r--r--drivers/hwmon/adt7473.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c
index ce4a7cb5a116..3a0b63136479 100644
--- a/drivers/hwmon/adt7473.c
+++ b/drivers/hwmon/adt7473.c
@@ -39,32 +39,20 @@ I2C_CLIENT_INSMOD_1(adt7473);
39#define ADT7473_REG_BASE_ADDR 0x20 39#define ADT7473_REG_BASE_ADDR 0x20
40 40
41#define ADT7473_REG_VOLT_BASE_ADDR 0x21 41#define ADT7473_REG_VOLT_BASE_ADDR 0x21
42#define ADT7473_REG_VOLT_MAX_ADDR 0x22
43#define ADT7473_REG_VOLT_MIN_BASE_ADDR 0x46 42#define ADT7473_REG_VOLT_MIN_BASE_ADDR 0x46
44#define ADT7473_REG_VOLT_MIN_MAX_ADDR 0x49
45 43
46#define ADT7473_REG_TEMP_BASE_ADDR 0x25 44#define ADT7473_REG_TEMP_BASE_ADDR 0x25
47#define ADT7473_REG_TEMP_MAX_ADDR 0x27
48#define ADT7473_REG_TEMP_LIMITS_BASE_ADDR 0x4E 45#define ADT7473_REG_TEMP_LIMITS_BASE_ADDR 0x4E
49#define ADT7473_REG_TEMP_LIMITS_MAX_ADDR 0x53
50#define ADT7473_REG_TEMP_TMIN_BASE_ADDR 0x67 46#define ADT7473_REG_TEMP_TMIN_BASE_ADDR 0x67
51#define ADT7473_REG_TEMP_TMIN_MAX_ADDR 0x69
52#define ADT7473_REG_TEMP_TMAX_BASE_ADDR 0x6A 47#define ADT7473_REG_TEMP_TMAX_BASE_ADDR 0x6A
53#define ADT7473_REG_TEMP_TMAX_MAX_ADDR 0x6C
54 48
55#define ADT7473_REG_FAN_BASE_ADDR 0x28 49#define ADT7473_REG_FAN_BASE_ADDR 0x28
56#define ADT7473_REG_FAN_MAX_ADDR 0x2F
57#define ADT7473_REG_FAN_MIN_BASE_ADDR 0x54 50#define ADT7473_REG_FAN_MIN_BASE_ADDR 0x54
58#define ADT7473_REG_FAN_MIN_MAX_ADDR 0x5B
59 51
60#define ADT7473_REG_PWM_BASE_ADDR 0x30 52#define ADT7473_REG_PWM_BASE_ADDR 0x30
61#define ADT7473_REG_PWM_MAX_ADDR 0x32
62#define ADT7473_REG_PWM_MIN_BASE_ADDR 0x64 53#define ADT7473_REG_PWM_MIN_BASE_ADDR 0x64
63#define ADT7473_REG_PWM_MIN_MAX_ADDR 0x66
64#define ADT7473_REG_PWM_MAX_BASE_ADDR 0x38 54#define ADT7473_REG_PWM_MAX_BASE_ADDR 0x38
65#define ADT7473_REG_PWM_MAX_MAX_ADDR 0x3A
66#define ADT7473_REG_PWM_BHVR_BASE_ADDR 0x5C 55#define ADT7473_REG_PWM_BHVR_BASE_ADDR 0x5C
67#define ADT7473_REG_PWM_BHVR_MAX_ADDR 0x5E
68#define ADT7473_PWM_BHVR_MASK 0xE0 56#define ADT7473_PWM_BHVR_MASK 0xE0
69#define ADT7473_PWM_BHVR_SHIFT 5 57#define ADT7473_PWM_BHVR_SHIFT 5
70 58
@@ -102,7 +90,6 @@ I2C_CLIENT_INSMOD_1(adt7473);
102#define ADT7473_FAN4_ALARM 0x20 90#define ADT7473_FAN4_ALARM 0x20
103#define ADT7473_R1T_SHORT 0x40 91#define ADT7473_R1T_SHORT 0x40
104#define ADT7473_R2T_SHORT 0x80 92#define ADT7473_R2T_SHORT 0x80
105#define ADT7473_REG_MAX_ADDR 0x80
106 93
107#define ALARM2(x) ((x) << 8) 94#define ALARM2(x) ((x) << 8)
108 95
@@ -583,10 +570,9 @@ static ssize_t set_max_duty_at_crit(struct device *dev,
583 struct i2c_client *client = to_i2c_client(dev); 570 struct i2c_client *client = to_i2c_client(dev);
584 struct adt7473_data *data = i2c_get_clientdata(client); 571 struct adt7473_data *data = i2c_get_clientdata(client);
585 int temp = simple_strtol(buf, NULL, 10); 572 int temp = simple_strtol(buf, NULL, 10);
586 temp = temp && 0xFF;
587 573
588 mutex_lock(&data->lock); 574 mutex_lock(&data->lock);
589 data->max_duty_at_overheat = temp; 575 data->max_duty_at_overheat = !!temp;
590 reg = i2c_smbus_read_byte_data(client, ADT7473_REG_CFG4); 576 reg = i2c_smbus_read_byte_data(client, ADT7473_REG_CFG4);
591 if (temp) 577 if (temp)
592 reg |= ADT7473_CFG4_MAX_DUTY_AT_OVT; 578 reg |= ADT7473_CFG4_MAX_DUTY_AT_OVT;