Thread (5 messages) 5 messages, 3 authors, 12d ago

Re: [PATCH v3] hwmon: (lm75) Add support for Nuvoton NCT7715

From: Sheng-Yuan Huang <hidden>
Date: 2026-09-15 06:33:29
Also in: linux-hwmon, sashiko-reviews

[off-list ref] 於 2026年9月15日週二 下午1:28寫道:
quoted
+     [nct7715] = {
+             .config_reg_16bits = true,
+             .set_mask = 0x8060,     /* 12-bit mode, 4 samples / second */
+             .clr_mask = 1 << 7,     /* no one-shot mode */
[Severity: Medium]
Will this leave bit 14 unchanged if it was previously set by a bootloader or
left over from a warm reboot?

During driver probe, lm75_generic_probe() calls lm75_write_config() to
initialize LM75_REG_CONF. The regmap update mask used is:
clr_mask | set_mask | LM75_SHUTDOWN

For nct7715, set_mask is 0x8060 and clr_mask is 0x0080. Bit 14 (0x4000) is
missing from both masks. Because of this, regmap_update_bits() will
silently ignore the 0 in bit 14 of set_mask and preserve its prior value
from the hardware configuration register.

If bit 14 remains set, can the sensor operate at 8 Hz instead of the
intended 4 Hz, leading to a mismatch between the hardware state and the
driver state which expects and reports a 250ms interval?

Should 0x4000 be included in clr_mask to ensure the hardware is properly
initialized to 4 samples / second?

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260915052021.6959-1-syhuang3@nuvoton.com?part=1
I will update the patch in v4 to include bit 14 in the NCT7715 clear
mask, ensuring that the default conversion rate is initialized to 4 Hz.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help