Lines Matching +full:auto +full:- +full:string +full:- +full:detection

22 constexpr auto bindDelay = 1000;
28 sdbusplus::bus_t& bus, const std::string& invpath, std::uint8_t i2cbus, in PowerSupply()
29 std::uint16_t i2caddr, const std::string& driver, in PowerSupply()
30 const std::string& gpioLineName, std::function<bool()>&& callback) : in PowerSupply()
53 std::string addrStr = ss.str(); in PowerSupply()
54 std::string busStr = std::to_string(i2cbus); in PowerSupply()
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()
102 auto action = (present) ? "bind" : "unbind"; in bindOrUnbindDriver()
110 if (bindPath.string().find(driverName) != std::string::npos) in bindOrUnbindDriver()
132 path.string(), bindDevice) in bindOrUnbindDriver()
139 path.string(), bindDevice) in bindOrUnbindDriver()
156 auto err = errno; in bindOrUnbindDriver()
175 std::format("D-Bus property {} access failure exception", in updatePresence()
187 if (presenceGPIO->read() > 0) in updatePresenceGPIO()
209 auto invpath = inventoryPath.substr(strlen(INVENTORY_OBJ_PATH)); in updatePresenceGPIO()
217 pmbusIntf->findHwmonDir(); in updatePresenceGPIO()
453 if (bindPath.string().find(IBMCFFPS_DD_NAME) != std::string::npos) in determineMFRFault()
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()
580 statusInput = pmbusIntf->read(STATUS_INPUT, Type::Debug); in analyze()
581 if (bindPath.string().find(IBMCFFPS_DD_NAME) != in analyze()
582 std::string::npos) 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()
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()
731 // as desired, later fault detection and analysis code should 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()
794 std::string msgSensor; in inventoryChanged()
795 std::map<std::string, std::variant<uint32_t, bool>> msgData; in inventoryChanged()
799 auto valPropMap = msgData.find(PRESENT_PROP); in inventoryChanged()
802 if (std::get<bool>(valPropMap->second)) in inventoryChanged()
809 pmbusIntf->findHwmonDir(); in inventoryChanged()
832 std::map<std::string, std::map<std::string, std::variant<bool>>> in inventoryAdded()
837 auto properties = interfaces.find(INVENTORY_IFACE); in inventoryAdded()
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()
856 auto PowerSupply::readVPDValue(const std::string& vpdName, in readVPDValue()
860 std::string vpdValue; in readVPDValue()
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()
898 std::string pn; in updateInventory()
899 std::string fn; in updateInventory()
900 std::string header; in updateInventory()
901 std::string sn; in updateInventory()
904 const auto HEADER_SIZE = 6; in updateInventory()
905 const auto SERIAL_SIZE = 6; in updateInventory()
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()
911 // However, it is formatted by the driver as a hex string with two ASCII in updateInventory()
912 // characters per byte. So the maximum ASCII string size is 12. in updateInventory()
913 const auto IBMCFFPS_FW_VERSION_SIZE = 12; in updateInventory()
914 const auto ACBEL_FSG032_FW_VERSION_SIZE = 6; in updateInventory()
917 std::map<std::string, in updateInventory()
918 std::variant<std::string, std::vector<uint8_t>, bool>>; in updateInventory()
924 using InterfaceMap = std::map<std::string, PropertyMap>; in updateInventory()
935 // TODO: non-IBM inventory updates? in updateInventory()
973 std::string header_sn = header + sn; in updateInventory()
976 std::string description = "IBM PS"; in updateInventory()
987 inventoryPath.substr(inventoryPath.size() - 1, 1), nullptr, 0); in updateInventory()
992 std::string fl = "E"; in updateInventory()
1010 auto path = inventoryPath.substr(strlen(INVENTORY_OBJ_PATH)); in updateInventory()
1015 auto service = in updateInventory()
1024 auto method = in updateInventory()
1030 auto reply = bus.call(method); in updateInventory()
1035 std::string(e.what() + std::string(" PATH=") + inventoryPath) in updateInventory()
1042 auto PowerSupply::getMaxPowerOut() const in getMaxPowerOut()
1046 auto maxPowerOut = 0; in getMaxPowerOut()
1053 auto maxPowerOutStr = in getMaxPowerOut()
1054 pmbusIntf->readString(MFR_POUT_MAX, Type::HwmonDeviceDebug); in getMaxPowerOut()
1079 (bindPath.string().find(IBMCFFPS_DD_NAME) == std::string::npos)) in setupInputPowerPeakSensor()
1090 auto sensorPath = in setupInputPowerPeakSensor()
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()
1105 auto associations = getSensorAssociations(); 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()
1165 auto peak = static_cast<uint16_t>(data[4]) << 8 | data[3]; in monitorPeakInputPowerSensor()
1166 auto peakPower = linearToInteger(peak); in monitorPeakInputPowerSensor()
1168 peakInputPowerSensor->value(peakPower); in monitorPeakInputPowerSensor()
1169 peakInputPowerSensor->functional(true); in monitorPeakInputPowerSensor()
1170 peakInputPowerSensor->available(true); in monitorPeakInputPowerSensor()
1186 auto inputVoltageStr = pmbusIntf->readString(READ_VIN, Type::Hwmon); in getInputVoltage()
1222 auto invpath = inventoryPath.substr(strlen(INVENTORY_OBJ_PATH)); in checkAvailability()
1238 inputVoltageRatingIface->value(0); in setInputVoltageRating()
1250 auto path = std::format( 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()
1270 void PowerSupply::getPsuVpdFromDbus(const std::string& keyword, in getPsuVpdFromDbus()
1271 std::string& vpdStr) in getPsuVpdFromDbus()
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()
1323 auto chassis = getChassis(bus, inventoryPath); in getSensorAssociations()