Lines Matching +full:phosphor +full:- +full:fan +full:- +full:presence
8 * http://www.apache.org/licenses/LICENSE-2.0
26 #include <phosphor-logging/lg2.hpp>
35 namespace phosphor namespace
37 namespace fan namespace
39 namespace presence namespace
58 using config = fan::JsonConfig; in start()
68 p->monitor(); in start()
83 using config = fan::JsonConfig; in sighupHandler()
92 p->monitor(); in sighupHandler()
107 // Set the expected number of fan entries in process()
108 // to be size of the list of fan json config entries in process()
109 // (Must be done to eliminate vector reallocation of fan references) in process()
117 … "Missing one of the required fan presence properties, which are: 'name, path, methods, rpolicy'"); in process()
119 "Missing required fan presence properties"); in process()
122 // Loop thru the configured methods of presence detection in process()
129 "Missing required fan presence method type for fan {FAN_NAME}", in process()
132 "Missing required fan presence method type"); in process()
134 // The method type of fan presence detection in process()
142 auto sensor = func->second(fans.size(), method.value()); in process()
151 "Invalid fan presence method type {METHOD_TYPE} for fan {FAN_NAME}", in process()
154 throw std::runtime_error("Invalid fan presence method type"); in process()
158 // Get the amount of time a fan must be not present before in process()
175 … "Missing address, driver_name, or bind_delay_ms in eeprom section for fan {FAN_NAME}", in process()
187 auto fan = in process() local
189 // Create a fan object in process()
190 fans.emplace_back(std::make_tuple(fan, std::move(sensors))); in process()
192 // Add fan presence policy in process()
209 if (std::any_of(_fans.begin(), _fans.end(), [](const auto& fan) { in process() argument
210 return std::get<std::optional<size_t>>(std::get<Fan>(fan)) != in process()
225 "Missing required fan presence policy type for fan {FAN_NAME}", in getPolicy()
226 "FAN_NAME", std::get<fanPolicyFanPos>(std::get<Fan>(fpolicy))); in getPolicy()
227 throw std::runtime_error("Missing required fan presence policy type"); in getPolicy()
230 // The redundancy policy type for fan presence detection in getPolicy()
238 return func->second(fpolicy, std::move(eepromDevice)); in getPolicy()
243 "Invalid fan presence policy type {RPOLICY_TYPE} for fan {FAN_NAME}", in getPolicy()
244 "FAN_NAME", std::get<fanPolicyFanPos>(std::get<Fan>(fpolicy)), in getPolicy()
246 throw std::runtime_error("Invalid fan presence methods policy type"); in getPolicy()
251 * Methods of fan presence detection function definitions
255 // Get a constructed presence sensor for fan presence detection by tach
261 "Missing required tach method property 'sensors' for fan index {FAN_ENTRY}", in getTach()
276 // Get a constructed presence sensor for fan presence detection by gpio
283 …"Missing one of the required gpio method properties for fan index {FAN_ENTRY}, which are: 'physpat… in getGpio()
317 "xyz.openbmc_project.Fan.Presence.Error.GPIODeviceUnavailable", in getGpio()
323 "Call to create an error log for presence-sensor failure failed: {ERROR}", in getGpio()
334 * Redundancy policies for fan presence detection function definitions
338 // Get an `Anyof` redundancy policy for the fan
340 const fanPolicy& fan, std::unique_ptr<EEPROMDevice> eepromDevice) in getAnyof() argument
343 for (auto& fanSensor : std::get<fanPolicySensorListPos>(fan)) in getAnyof()
348 return std::make_unique<AnyOf>(std::get<fanPolicyFanPos>(fan), pSensors, in getAnyof()
352 // Get a `Fallback` redundancy policy for the fan
354 const fanPolicy& fan, std::unique_ptr<EEPROMDevice> eepromDevice) in getFallback() argument
357 for (auto& fanSensor : std::get<fanPolicySensorListPos>(fan)) in getFallback()
363 return std::make_unique<Fallback>(std::get<fanPolicyFanPos>(fan), pSensors, in getFallback()
369 } // namespace presence
370 } // namespace fan
371 } // namespace phosphor