Lines Matching +full:needs +full:- +full:double +full:- +full:reset
56 bindDevice.append("-"); in PowerSupply()
69 // GPIOs are in use by the kernel, meaning it is using gpio-keys. in PowerSupply()
70 // So, I should rely on phosphor-gpio-presence to update D-Bus, and in PowerSupply()
73 // Setup the functions to call when the D-Bus inventory path for the in PowerSupply()
79 [this](auto& msg) { this->inventoryChanged(msg); }); in PowerSupply()
85 [this](auto& msg) { this->inventoryAdded(msg); }); in PowerSupply()
175 std::format("D-Bus property {} access failure exception", in updatePresence()
187 if (presenceGPIO->read() > 0) in updatePresenceGPIO()
217 pmbusIntf->findHwmonDir(); in updatePresenceGPIO()
479 // IBM MFR_SPECIFIC[7] is 12V Current-Share fault. in determineMFRFault()
554 --acFault; in analyzeVinUVFault()
573 statusWord = pmbusIntf->read(STATUS_WORD, Type::Debug, in analyze()
575 // Read worked, reset the fail count. in analyze()
580 statusInput = pmbusIntf->read(STATUS_INPUT, Type::Debug); in analyze()
584 statusMFR = pmbusIntf->read(STATUS_MFR, Type::Debug); in analyze()
586 statusCML = pmbusIntf->read(STATUS_CML, Type::Debug); in analyze()
587 auto status0Vout = pmbusIntf->insertPageNum(STATUS_VOUT, 0); in analyze()
588 statusVout = pmbusIntf->read(status0Vout, Type::Debug); in analyze()
589 statusIout = pmbusIntf->read(STATUS_IOUT, Type::Debug); in analyze()
590 statusFans12 = pmbusIntf->read(STATUS_FANS_1_2, Type::Debug); in analyze()
592 pmbusIntf->read(STATUS_TEMPERATURE, Type::Debug); in analyze()
652 --acFault; in analyze()
661 double actualInputVoltageOld = actualInputVoltage; in analyze()
683 // fault(s), re-check faults on next call. in analyze()
686 else if (std::abs(actualInputVoltageOld - actualInputVoltage) > in analyze()
724 pmbusIntf->writeBinary(ON_OFF_CONFIG, configData, in onOffConfig()
741 // The fault bits in STAUTS_INPUT roll-up to STATUS_WORD. Clearing those in clearVinUVFault()
749 pmbusIntf->read("in1_lcrit_alarm", phosphor::pmbus::Type::Hwmon)); in clearVinUVFault()
754 pmbusIntf->read("curr1_crit_alarm", phosphor::pmbus::Type::Hwmon)); in clearVinUVFault()
780 pmbusIntf->read("in1_input", phosphor::pmbus::Type::Hwmon)); in clearFaults()
802 if (std::get<bool>(valPropMap->second)) in inventoryChanged()
809 pmbusIntf->findHwmonDir(); in inventoryChanged()
840 auto property = properties->second.find(PRESENT_PROP); in inventoryAdded()
841 if (property != properties->second.end()) in inventoryAdded()
843 present = std::get<bool>(property->second); in inventoryAdded()
866 vpdValue = pmbusIntf->readString(vpdName, type); in readVPDValue()
872 // TODO - ibm918 in readVPDValue()
873 // https://github.com/openbmc/docs/blob/master/designs/vpd-collection.md in readVPDValue()
907 // 1-byte, per command. It was later expanded to 2-bytes per command, then in updateInventory()
908 // up to 8-bytes per command. The device driver only reads up to 2 bytes per in updateInventory()
909 // command, but combines all three of the 2-byte reads, or all 4 of the in updateInventory()
910 // 1-byte reads into one string. So, the maximum size expected is 6 bytes. in updateInventory()
935 // TODO: non-IBM inventory updates? in updateInventory()
987 inventoryPath.substr(inventoryPath.size() - 1, 1), nullptr, 0); in updateInventory()
1054 pmbusIntf->readString(MFR_POUT_MAX, Type::HwmonDeviceDebug); in getMaxPowerOut()
1098 peakInputPowerSensor->functional(true, true); in setupInputPowerPeakSensor()
1099 peakInputPowerSensor->available(true, true); in setupInputPowerPeakSensor()
1100 peakInputPowerSensor->value(0, true); in setupInputPowerPeakSensor()
1101 peakInputPowerSensor->unit( in setupInputPowerPeakSensor()
1106 peakInputPowerSensor->associations(associations, true); in setupInputPowerPeakSensor()
1108 peakInputPowerSensor->emit_object_added(); in setupInputPowerPeakSensor()
1115 peakInputPowerSensor->value(std::numeric_limits<double>::quiet_NaN()); in setSensorsNotAvailable()
1116 peakInputPowerSensor->available(false); in setSensorsNotAvailable()
1140 data = pmbusIntf->readBinary(INPUT_HISTORY, in monitorPeakInputPowerSensor()
1145 peakInputPowerSensor->value(std::numeric_limits<double>::quiet_NaN()); in monitorPeakInputPowerSensor()
1146 peakInputPowerSensor->functional(false); in monitorPeakInputPowerSensor()
1156 peakInputPowerSensor->value(std::numeric_limits<double>::quiet_NaN()); in monitorPeakInputPowerSensor()
1157 peakInputPowerSensor->functional(false); in monitorPeakInputPowerSensor()
1168 peakInputPowerSensor->value(peakPower); in monitorPeakInputPowerSensor()
1169 peakInputPowerSensor->functional(true); in monitorPeakInputPowerSensor()
1170 peakInputPowerSensor->available(true); in monitorPeakInputPowerSensor()
1173 void PowerSupply::getInputVoltage(double& actualInputVoltage, in getInputVoltage()
1186 auto inputVoltageStr = pmbusIntf->readString(READ_VIN, Type::Hwmon); in getInputVoltage()
1225 // Check if the health rollup needs to change based on the in checkAvailability()
1238 inputVoltageRatingIface->value(0); in setInputVoltageRating()
1239 inputVoltageRatingIface.reset(); in setInputVoltageRating()
1244 double inputVoltageValue{}; in setInputVoltageRating()
1258 inputVoltageRatingIface->unit(SensorInterface::Unit::Volts, true); in setInputVoltageRating()
1259 inputVoltageRatingIface->value(static_cast<double>(inputVoltageRating), in setInputVoltageRating()
1262 inputVoltageRatingIface->emit_object_added(); in setInputVoltageRating()
1266 inputVoltageRatingIface->value(static_cast<double>(inputVoltageRating)); in setInputVoltageRating()
1291 double PowerSupply::linearToInteger(uint16_t data) in linearToInteger()
1302 exponent = (exponent + 1) * -1; in linearToInteger()
1310 mantissa = (mantissa + 1) * -1; in linearToInteger()
1313 auto value = static_cast<double>(mantissa) * pow(2, exponent); in linearToInteger()