summaryrefslogtreecommitdiff
path: root/scripts/const_structs.checkpatch
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2026-10-30 18:59:26 -0700
committerGuenter Roeck <linux@roeck-us.net>2026-11-02 07:00:05 -0800
commit3897309ede38d7f3ff34c4c4583b1dd345666988 (patch)
treeeb9aaa8989a403ff6be74698fafd2c97e5710258 /scripts/const_structs.checkpatch
parent4fc79634af8cdf734e0a633923ba4817e30d29ad (diff)
hwmon: (lm75) Fix setting polarity mask for chips with 16-bit config register
When probing a 16-bit compatible temperature sensor configured with the "ti,alert-polarity-active-high" device property, lm75_generic_probe() writes to a reserved bit instead of the alert polarity bit due to an incorrect bit shift in the 16-bit polarity mask. On 16-bit sensors, the polarity bit is physically located at bit 2 of the MSByte. When accessed via i2c_smbus_read_word_data() or i2c_smbus_write_word_data(), the SMBus protocol maps the first received byte (the physical MSByte) to the lower 8 bits of the integer representation. Consequently, the polarity bit is consistently mapped to bit 2, identically to 8-bit sensors. However, the LM75_ALERT_POLARITY_HIGH_16_BIT macro applies an 8-bit left shift, erroneously targeting bit 10. This causes the driver to silently corrupt a reserved bit in the configuration register while leaving the active-high alert polarity unconfigured, breaking the polarity feature. Use BIT(2) as polarity mask in the configuration register for all chips to fix the problem. Reported-by: Sashiko <sashiko-bot@kernel.org> Fixes: 1be4001d9b9b ("hwmon: (lm75) Support active-high alert polarity") Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions