コード例 #1
0
ファイル: SuperIOFamily.cpp プロジェクト: Beshuta/HWSensors
bool SuperIOMonitor::getLogicalDeviceAddress(UInt8 reg)
{
	address = listenPortWord(reg);
	
	if (address < 0x100 || (address & 0xF007) != 0)
		return false;
	
	IOSleep(250);
	
	if (address != listenPortWord(reg))
		return false;
	
	return true;
}
コード例 #2
0
ファイル: ITEIT87x.cpp プロジェクト: grahamovgibb/HWSensors
bool IT87x::probePort()
{	
	UInt16 id = listenPortWord(SUPERIO_CHIP_ID_REGISTER);
	
	if (id == 0 || id == 0xffff)
		return false;
	
	switch (id)
	{
		case IT8512F:
		case IT8712F:
		case IT8716F:
		case IT8718F:
		case IT8720F: 
		case IT8721F: 
		case IT8726F:
		case IT8728F:
		case IT8752F:
			model = id; 
			break; 
		default:
			WarningLog("found unsupported chip ID=0x%x", id);
			return false;
	}
	
	selectLogicalDevice(ITE_ENVIRONMENT_CONTROLLER_LDN);
	
	if (!getLogicalDeviceAddress())
		return false;
	
	bool* valid;
	
	UInt8 vendor = readByte(ITE_VENDOR_ID_REGISTER, valid);
	
	if (!valid || vendor != ITE_VENDOR_ID)
		return false;
	
	if ((readByte(ITE_CONFIGURATION_REGISTER, valid) & 0x10) == 0)
		return false;
	
	if (!valid)
		return false;
	
	return true;
}
コード例 #3
0
bool IT87x::probePort()
{	
	UInt16 id = listenPortWord(SUPERIO_CHIP_ID_REGISTER);
	
	if (id == 0 || id == 0xffff) {
    DebugLog("invalid super I/O chip ID=0x%x", id);
		return false;
  }
	hasSmartGuardian = false;
	switch (id)
	{
		case IT8512F:
		case IT8712F:
		case IT8716F:
		case IT8718F:
		case IT8720F: 
		case IT8721F: 
		case IT8726F:
		case IT8728F:
		case IT8752F:
    case IT8772E:
			model = id; 
			break; 
		default:
			DebugLog("found unsupported chip ID=0x%x", id);
			return false;
	}
  
	selectLogicalDevice(ITE_ENVIRONMENT_CONTROLLER_LDN);
  
  IOSleep(50);
	
	if (!getLogicalDeviceAddress()) {
    DebugLog("can't get monitoring LDN address");
		return false;
  }
  
	UInt8 vendor16 = readByte(address, ITE_VENDOR_ID_REGISTER);
	
	if (vendor16 != ITE_VENDOR_ID) {
    DebugLog("invalid vendor ID=0x%x", vendor16);
		return false;
  }
	
	if ((readByte(address, ITE_CONFIGURATION_REGISTER) & 0x10) == 0) {
    DebugLog("invalid configuration register value");
		return false;
  }
	
  if (id == IT8721F || id == IT8728F || id == IT8772E)
    voltageGain = 12;
  else
    voltageGain = 16;
  
  UInt8 version = readByte(address, ITE_VERSION_REGISTER) & 0x0F;
  
  if (id == IT8712F && version < 8)
    has16bitFanCounter = false;
  else
    has16bitFanCounter = true;
	
	return true;
}