Skip to content

Commit 9d23450

Browse files
committed
Merge tag 'hwmon-for-v5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fixes from Guenter Roeck: - Fix read timeout problem in ina3221 driver - Fix wrong bitmask in nct7904 driver * tag 'hwmon-for-v5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (ina3221) Fix read timeout issue hwmon: (nct7904) Fix the incorrect value of vsen_mask & tcpu_mask & temp_mode in nct7904_data struct.
2 parents e935842 + 2ccb4f1 commit 9d23450

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

drivers/hwmon/ina3221.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static inline int ina3221_wait_for_data(struct ina3221_data *ina)
170170

171171
/* Polling the CVRF bit to make sure read data is ready */
172172
return regmap_field_read_poll_timeout(ina->fields[F_CVRF],
173-
cvrf, cvrf, wait, 100000);
173+
cvrf, cvrf, wait, wait * 2);
174174
}
175175

176176
static int ina3221_read_value(struct ina3221_data *ina, unsigned int reg,

drivers/hwmon/nct7904.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@
8282
#define FANCTL1_FMR_REG 0x00 /* Bank 3; 1 reg per channel */
8383
#define FANCTL1_OUT_REG 0x10 /* Bank 3; 1 reg per channel */
8484

85+
#define VOLT_MONITOR_MODE 0x0
86+
#define THERMAL_DIODE_MODE 0x1
87+
#define THERMISTOR_MODE 0x3
88+
8589
#define ENABLE_TSI BIT(1)
8690

8791
static const unsigned short normal_i2c[] = {
@@ -935,11 +939,16 @@ static int nct7904_probe(struct i2c_client *client,
935939
for (i = 0; i < 4; i++) {
936940
val = (ret >> (i * 2)) & 0x03;
937941
bit = (1 << i);
938-
if (val == 0) {
942+
if (val == VOLT_MONITOR_MODE) {
939943
data->tcpu_mask &= ~bit;
944+
} else if (val == THERMAL_DIODE_MODE && i < 2) {
945+
data->temp_mode |= bit;
946+
data->vsen_mask &= ~(0x06 << (i * 2));
947+
} else if (val == THERMISTOR_MODE) {
948+
data->vsen_mask &= ~(0x02 << (i * 2));
940949
} else {
941-
if (val == 0x1 || val == 0x2)
942-
data->temp_mode |= bit;
950+
/* Reserved */
951+
data->tcpu_mask &= ~bit;
943952
data->vsen_mask &= ~(0x06 << (i * 2));
944953
}
945954
}

0 commit comments

Comments
 (0)