mirror of
https://github.com/Fred78290/nct6687d.git
synced 2025-07-23 07:03:04 +02:00
Fix restoring automatic fan mode on module unload
nct6687_restore_fan_control() could only restore manual fan control, but not the automatic one due to the way it applied previous state of the bit.
This commit is contained in:
@@ -819,7 +819,8 @@ static void nct6687_restore_fan_control(struct nct6687_data *data, int index)
|
||||
if (data->_restoreDefaultFanControlRequired[index])
|
||||
{
|
||||
u8 mode = nct6687_read(data, NCT6687_REG_FAN_CTRL_MODE(index));
|
||||
mode = (u8)(mode & ~data->_initialFanControlMode[index]);
|
||||
u8 bitMask = 0x01 << index;
|
||||
mode = (u8)((mode & ~bitMask) | data->_initialFanControlMode[index]);
|
||||
|
||||
nct6687_write(data, NCT6687_REG_FAN_CTRL_MODE(index), mode);
|
||||
|
||||
|
Reference in New Issue
Block a user