Skip to contentSkip to conversation

[PATCH} hwmon: (jc42) Properly detect TSE2004-compliant devices again

PATCH Applied Jean Delvare 2 participants 2 messages Oct 14, 2024 – Oct 15, 2024 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

Commit b3e992f69c23 ("hwmon: (jc42) Strengthen detect function") attempted to make the detect function more robust for TSE2004-compliant devices by checking capability bits which, according to the JEDEC 21-C specification, should always be set. Unfortunately, not all real-world implementations fully adhere to this specification, so this change caused a regression.

Stop testing bit 7 (EVSD) of the Capabilities register, as it was found to be 0 on one real-world device.

Also stop testing bits 0 (EVENT) and 2 (RANGE) as vendor datasheets (Renesas TSE2004GB2B0, ST STTS2004) suggest that they may not always be set either.

Message-ID: <[email protected]>

Fixes b3e992f69c23 ("hwmon: (jc42) Strengthen detect function")
---
 drivers/hwmon/jc42.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/jc42.c +1 -1
@@ -417,7 +417,7 @@ static int jc42_detect(struct i2c_client
 		return -ENODEV;
 
 	if ((devid & TSE2004_DEVID_MASK) == TSE2004_DEVID &&
-	    (cap & 0x00e7) != 0x00e7)
+	    (cap & 0x0062) != 0x0062)
 		return -ENODEV;
 
 	for (i = 0; i < ARRAY_SIZE(jc42_chips); i++) {
Signature · 2 lines
Jean Delvare
SUSE L3 Support
maintainer Applied
#1 lore raw
Quoted 10 lines · Jean Delvare

Commit b3e992f69c23 ("hwmon: (jc42) Strengthen detect function") attempted to make the detect function more robust for TSE2004-compliant devices by checking capability bits which, according to the JEDEC 21-C specification, should always be set. Unfortunately, not all real-world implementations fully adhere to this specification, so this change caused a regression.

Stop testing bit 7 (EVSD) of the Capabilities register, as it was found to be 0 on one real-world device.

Quoted 7 lines

Also stop testing bits 0 (EVENT) and 2 (RANGE) as vendor datasheets (Renesas TSE2004GB2B0, ST STTS2004) suggest that they may not always be set either.

Message-ID: <[email protected]>

Fixes b3e992f69c23 ("hwmon: (jc42) Strengthen detect function")

Applied.

Thanks!

Guenter