Skip to content

Commit

Permalink
Merge pull request #166 from Lorys89/master
Browse files Browse the repository at this point in the history
added AM5 chipset fan reading support (NCT6799D)
  • Loading branch information
trulyspinach authored Sep 15, 2023
2 parents 8ca5022 + defec8c commit 673ba36
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
20 changes: 18 additions & 2 deletions AMDRyzenCPUPowerManagement/SuperIO/ISSuperIONCT67XXFamily.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ ISSuperIONCT67XXFamily::ISSuperIONCT67XXFamily(int psel, uint16_t addr, uint16_t
activeFansOnSystem = 7;
break;

case CHIP_NCT6799D:
activeFansOnSystem = 7;
break;

default:
activeFansOnSystem = 6;
break;
Expand Down Expand Up @@ -71,8 +75,13 @@ ISSuperIONCT67XXFamily* ISSuperIONCT67XXFamily::getDevice(uint16_t *chipIntel){
IOLog("NCT67XX chip identified\n");
break;

default:
case CHIP_NCT6799D:
found = true;
IOLog("NCT67XX chip identified\n");
break;

default:
IOLog("NCT67XX chip not identified\n");
break;
}

Expand Down Expand Up @@ -112,6 +121,13 @@ ISSuperIONCT67XXFamily* ISSuperIONCT67XXFamily::getDevice(uint16_t *chipIntel){
case CHIP_NCT6796DR:
case CHIP_NCT6797D:
case CHIP_NCT6798D:
conf = ISLPCPort::readByte(portSel, CHIP_IO_SPACE_LOCK);
if(conf & 0x10){
ISLPCPort::writeByte(portSel, CHIP_IO_SPACE_LOCK, conf & ~0x10);
}
break;

case CHIP_NCT6799D:
conf = ISLPCPort::readByte(portSel, CHIP_IO_SPACE_LOCK);
if(conf & 0x10){
ISLPCPort::writeByte(portSel, CHIP_IO_SPACE_LOCK, conf & ~0x10);
Expand Down Expand Up @@ -175,7 +191,7 @@ void ISSuperIONCT67XXFamily::updateFanRPMS(){
for (int i = 0; i < activeFansOnSystem; i++) {
int v = (int)readWord(kFAN_RPM_REGS[i]);
fanRPMs[i] = v;
// IOLog("fan %d: %d\n", i, (int)v);
//IOLog("fan %d: %d\n", i, (int)v);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#define CHIP_NCT6796DR 0xD42A
#define CHIP_NCT6797D 0xD451
#define CHIP_NCT6798D 0xD42B
#define CHIP_NCT6799D 0xD802

#define NCT67XX_MAX_NUMFAN 7

Expand Down

0 comments on commit 673ba36

Please sign in to comment.