Re: [PATCH] hwmon: (nct6683) Make pwmN_auto_channels_temp of NCT6687D-R writable

From: Guenter Roeck

Date: Tue Nov 17 2026 - 01:22:34 EST


On 11/16/26 15:26, Tomasz Bojanowski wrote:
Allow selecting the temperature used by a fan curve on MSI boards with
an NCT6687D-R (customer ID 0x20d), in manual and in automatic mode.

On an MSI MAG B850M MORTAR WIFI, the BIOS setup offers four temperature
sources for the fans: CPU Core, System, MOS and Chipset A. Reading the EC
before and after selecting them shows that each sets a single bit in the
lowest byte of the fan's source register, the bit of the monitoring
channel of temp1, temp2, temp3 and temp4 respectively, and that nothing
else in the fan curve registers changes. The other bytes were never seen
in use, and how the EC would combine several bits is not known, so only
a single temperature reported by the driver on the first eight monitoring
channels can be selected; other values return -EINVAL. The range can be
extended if a board needs it.

The attribute is writable if, when the driver is loaded, the curve uses
one such temperature. Before each write the driver checks that this is
still the case and returns -EIO otherwise, so that it does not overwrite
a source which could not be selected again.


Why -EIO (I/O error) ? I could imagine -EBUSY or maybe -EINVAL, but I don't
see why this could be considered to be be an I/O error.

Guenter