Esempio n. 1
0
bool SuperIOPlugin::addTemperatureSensors(OSDictionary *configuration)
{
    HWSensorsDebugLog("adding temperature sensors...");
        
    for (int i = 0; i < temperatureSensorsLimit(); i++) 
    {				
        char key[8];

        snprintf(key, 8, "TEMPIN%X", i);
        
        if (OSObject* node = configuration->getObject(key)) {
            for (int j = 0; j < FakeSMCTemperatureCount; j++) {
                if (addSensorFromConfigurationNode(node, FakeSMCTemperature[j].name, FakeSMCTemperature[j].key, FakeSMCTemperature[j].type, FakeSMCTemperature[j].size, kFakeSMCTemperatureSensor, i))
                    break;
            }
            
            if (gpuIndex < 0)
                gpuIndex = takeVacantGPUIndex();
                
            if (gpuIndex >= 0) {
                snprintf(key, 5, KEY_FORMAT_GPU_HEATSINK_TEMPERATURE, gpuIndex);
                if (!addSensorFromConfigurationNode(node, "GPU", key, TYPE_SP78, TYPE_SPXX_SIZE, kFakeSMCTemperatureSensor, i)) {
                    releaseGPUIndex(gpuIndex);
                    gpuIndex = -1;
                }
            }
        }
    }

    return true;
}
Esempio n. 2
0
bool SuperIOPlugin::addVoltageSensors(OSDictionary *configuration)
{
    HWSensorsDebugLog("adding voltage sensors...");
       
    for (int i = 0; i < voltageSensorsLimit(); i++)
    {				
        char key[5];
        
        snprintf(key, 5, "VIN%X", i);
        
        if (OSObject* node = configuration->getObject(key)) {
            for (int j = 0; j < FakeSMCVolatgeCount; j++) {
                if (addSensorFromConfigurationNode(node, FakeSMCVolatge[j].name, FakeSMCVolatge[j].key, FakeSMCVolatge[j].type, FakeSMCVolatge[j].size, kFakeSMCVoltageSensor, i))
                    break;
            }

            if (gpuIndex < 0)
                gpuIndex = takeVacantGPUIndex();
            
            if (gpuIndex >= 0) {
                snprintf(key, 5, KEY_FORMAT_GPU_VOLTAGE, gpuIndex);
                if (!addSensorFromConfigurationNode(node, "GPU", key, TYPE_FP2E, TYPE_FPXX_SIZE, kFakeSMCVoltageSensor, i)) {
                    releaseGPUIndex(gpuIndex);
                    gpuIndex = -1;
                }
            }
        }
    }

    return true;
}
Esempio n. 3
0
bool LPCSensors::addVoltageSensors(OSDictionary *configuration)
{
    HWSensorsDebugLog("adding voltage sensors...");

    for (int i = 0; i < voltageSensorsLimit(); i++)
    {
        char key[5];

        snprintf(key, 5, "VIN%X", i);

        if (OSObject* node = configuration->getObject(key)) {
            if (!addSensorFromNode(node, kFakeSMCCategoryVoltage, kFakeSMCVoltageSensor, i)) {
                
                if (checkConfigurationNode(configuration, "GPU Core")) {

                    if (gpuIndex < 0)
                        gpuIndex = takeVacantGPUIndex();
                    else
                        continue;

                    snprintf(key, 5, KEY_FORMAT_GPU_VOLTAGE, gpuIndex);

                    if (!addSensorFromConfigurationNode(node, key, TYPE_FP2E, TYPE_FPXX_SIZE, kFakeSMCVoltageSensor, i)) {
                        releaseGPUIndex(gpuIndex);
                        gpuIndex = -1;
                    }
                }
            }
        }
    }

    return true;
}
Esempio n. 4
0
bool LPCSensors::addTemperatureSensors(OSDictionary *configuration)
{
    HWSensorsDebugLog("adding temperature sensors...");

    for (int i = 0; i < temperatureSensorsLimit(); i++)
    {
        char key[8];

        snprintf(key, 8, "TEMPIN%X", i);

        if (OSObject* node = configuration->getObject(key)) {
            if (!addSensorFromNode(node, kFakeSMCCategoryTemperature, kFakeSMCTemperatureSensor, i)) {

                if (checkConfigurationNode(configuration, "GPU Die")) {

                    if (gpuIndex < 0)
                        gpuIndex = takeVacantGPUIndex();
                    else
                        continue;

                    snprintf(key, 5, KEY_FORMAT_GPU_DIODE_TEMPERATURE, gpuIndex);

                    if (!addSensorFromConfigurationNode(node, key, TYPE_SP78, TYPE_SPXX_SIZE, kFakeSMCTemperatureSensor, i)) {
                        releaseGPUIndex(gpuIndex);
                        gpuIndex = -1;
                    }
                }
            }
        }
    }

    return true;
}