hwmon fixes for v5.4-rc6

Fix read timeout problem in ina3221 driver
 Fix wrong bitmask in nct7904 driver
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAl29mVIACgkQyx8mb86f
 mYFbfA/9FBuQKX05lNvk62zLVZSKY9KyReXflQKvV52tw5jy+gxtkuEmwoFPGYcQ
 6rLZfvGsWcRBBTSpdz6dW3k8xJoeVwF0lGWq8l2VlFN3v6cHFZv/6eASVP0jcGc3
 7j7H4Te96jAtJtWu1X0DEs/Z2ldw0I6oWdp4nqF2LjoKYSuAhR2Sozz1JvjhIA5k
 8BzqFfCanGrd/SRURD2v4uznmtKPN0MJW08nWY1/e2PwxGCe0y4QdAQ5gKq1+AUN
 tQ3AxZKmw0vlXH3ZFhQGfPzvKlZlTcx+r+wZ6BS+o0I0nekbHH2XgfnOXdRl76AJ
 e+5Xrc74smF79JM9g1L7e9RUsqA3/6ZEPp+XYVCITLRcWFjWHBOwM8t7zKUOq9Hw
 mTjRNSYqDDnSB1keUHGOAjPLJfeUncR3D8iYcmhUXtf/D7dkwmgwmR2vbzfFYNfr
 b251RgPVlyAc9BHdmcNv2GCHtRpR1ftxOHNIRsZsrrcSyVRQWx3gmD8fRGjhxSqy
 J7cePBheRo5PxtYKnTWetFSVPgfhMJliQMUCGwP0pJv/93kGjfSkp8uLxMtgaluR
 iJ4CBikQUHHYiZ12RNgdFznH/V7SBy5diNp7uFki+dj4XwXC0Mc8jHlKZrq5eTLk
 WBl2UAdCNU2qcjRml4NX8sd5X2oP+kA4LpvsCulBcGzWfEdbg6M=
 =1Elb
 -----END PGP SIGNATURE-----

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.
This commit is contained in:
Linus Torvalds 2019-11-02 11:28:59 -07:00
commit 9d23450575
2 changed files with 13 additions and 4 deletions

View File

@ -170,7 +170,7 @@ static inline int ina3221_wait_for_data(struct ina3221_data *ina)
/* Polling the CVRF bit to make sure read data is ready */ /* Polling the CVRF bit to make sure read data is ready */
return regmap_field_read_poll_timeout(ina->fields[F_CVRF], return regmap_field_read_poll_timeout(ina->fields[F_CVRF],
cvrf, cvrf, wait, 100000); cvrf, cvrf, wait, wait * 2);
} }
static int ina3221_read_value(struct ina3221_data *ina, unsigned int reg, static int ina3221_read_value(struct ina3221_data *ina, unsigned int reg,

View File

@ -82,6 +82,10 @@
#define FANCTL1_FMR_REG 0x00 /* Bank 3; 1 reg per channel */ #define FANCTL1_FMR_REG 0x00 /* Bank 3; 1 reg per channel */
#define FANCTL1_OUT_REG 0x10 /* Bank 3; 1 reg per channel */ #define FANCTL1_OUT_REG 0x10 /* Bank 3; 1 reg per channel */
#define VOLT_MONITOR_MODE 0x0
#define THERMAL_DIODE_MODE 0x1
#define THERMISTOR_MODE 0x3
#define ENABLE_TSI BIT(1) #define ENABLE_TSI BIT(1)
static const unsigned short normal_i2c[] = { static const unsigned short normal_i2c[] = {
@ -935,12 +939,17 @@ static int nct7904_probe(struct i2c_client *client,
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
val = (ret >> (i * 2)) & 0x03; val = (ret >> (i * 2)) & 0x03;
bit = (1 << i); bit = (1 << i);
if (val == 0) { if (val == VOLT_MONITOR_MODE) {
data->tcpu_mask &= ~bit; data->tcpu_mask &= ~bit;
} else { } else if (val == THERMAL_DIODE_MODE && i < 2) {
if (val == 0x1 || val == 0x2)
data->temp_mode |= bit; data->temp_mode |= bit;
data->vsen_mask &= ~(0x06 << (i * 2)); data->vsen_mask &= ~(0x06 << (i * 2));
} else if (val == THERMISTOR_MODE) {
data->vsen_mask &= ~(0x02 << (i * 2));
} else {
/* Reserved */
data->tcpu_mask &= ~bit;
data->vsen_mask &= ~(0x06 << (i * 2));
} }
} }