Lines Matching +full:bus +full:- +full:power
7 #include <phosphor-logging/lg2.hpp>
8 #include <xyz/openbmc_project/Chassis/Buttons/Power/server.hpp>
21 namespace sdbusRule = sdbusplus::bus::match::rules;
27 {"chassis-on", Chassis::Transition::On},
28 {"chassis-off", Chassis::Transition::Off},
29 {"chassis-cycle", Chassis::Transition::PowerCycle}};
33 constexpr auto powerButtonIface = "xyz.openbmc_project.Chassis.Buttons.Power";
52 Handler::Handler(sdbusplus::bus_t& bus) : bus(bus) in Handler() argument
54 /* So far, there are two modes for multi-host power control in Handler()
55 - host select button mode, e.g.: Yosemite V2 in Handler()
56 only one power button with host select switch, in Handler()
59 - multi power button mode, e.g.: Greatlakes in Handler()
60 each slot/sled has its own power button, in Handler()
72 if (gpioConfig.contains("multi-action")) in Handler()
75 const auto& multiActCfg = gpioConfig["multi-action"]; in Handler()
82 mapEntry[duration] = chassisPwrCtl->second; in Handler()
86 lg2::error("unknown power button action"); in Handler()
107 auto method = bus.new_method_call(mapperService, mapperObjPath, in Handler()
111 auto reply = bus.call(method); in Handler()
115 lg2::info("Starting power button handler"); in Handler()
119 PowerButtonProfileFactory::instance().createProfile(bus); in Handler()
121 // Fallback: register for all power buttons found in Handler()
126 lg2::debug("Registering power button handler for: {PATH}", in Handler()
128 std::unique_ptr<sdbusplus::bus::match_t> in Handler()
130 std::make_unique<sdbusplus::bus::match_t>( in Handler()
131 bus, in Handler()
146 lg2::error("Error creating power button handlers: '{ERROR_MESSAGE}'", in Handler()
155 idButtonReleased = std::make_unique<sdbusplus::bus::match_t>( in Handler()
156 bus, in Handler()
174 resetButtonReleased = std::make_unique<sdbusplus::bus::match_t>( in Handler()
175 bus, in Handler()
193 debugHSButtonReleased = std::make_unique<sdbusplus::bus::match_t>( in Handler()
194 bus, in Handler()
221 auto method = bus.new_method_call(mapperService, mapperObjPath, mapperIface, in getService()
226 auto result = bus.call(method); in getService()
230 return objectData.begin()->first; in getService()
249 auto method = bus.new_method_call( in getHostSelectorValue()
252 auto result = bus.call(method); in getHostSelectorValue()
269 auto method = bus.new_method_call(service.c_str(), hostObjectName.c_str(), in poweredOn()
272 auto result = bus.call(method); in poweredOn()
297 lg2::info("Multi-host system detected : {POSITION}", "POSITION", in handlePowerEvent()
302 // ignore power and reset button events if BMC is selected. in handlePowerEvent()
308 …"handlePowerEvent : BMC selected on multi-host system. ignoring power and reset button events..."); in handlePowerEvent()
317 for (const auto& iter : multiPwrBtnActConf[stoi(hostNumStr) - 1]) in handlePowerEvent()
341 lg2::info("handlePowerEvent : Handle power button press "); in handlePowerEvent()
352 hosts (1 to N) - host shutdown in handlePowerEvent()
353 bmc (0) - sled cycle in handlePowerEvent()
355 host(0) - host shutdown in handlePowerEvent()
369 "Power is off so ignoring long power button press"); in handlePowerEvent()
372 lg2::info("handlePowerEvent : handle long power button press"); in handlePowerEvent()
384 lg2::info("Power is off so ignoring reset button press"); in handlePowerEvent()
398 lg2::error("{EVENT} is invalid power event. skipping...", "EVENT", in handlePowerEvent()
405 auto method = bus.new_method_call(service.c_str(), objPathName.c_str(), in handlePowerEvent()
408 bus.call(method); in handlePowerEvent()
422 lg2::error("Failed power state change on a power button press: {ERROR}", in powerReleased()
437 lg2::error("Failed power state change on a reset button press: {ERROR}", in resetReleased()
458 auto method = bus.new_method_call(service.c_str(), groupPath.c_str(), in idReleased()
461 auto result = bus.call(method); in idReleased()
471 method = bus.new_method_call(service.c_str(), groupPath.c_str(), in idReleased()
475 result = bus.call(method); in idReleased()
497 bus.new_method_call(HSService.c_str(), HS_DBUS_OBJECT_NAME, in increaseHostSelectorPosition()
500 auto result = bus.call(method); in increaseHostSelectorPosition()
510 method = bus.new_method_call(HSService.c_str(), HS_DBUS_OBJECT_NAME, in increaseHostSelectorPosition()
515 result = bus.call(method); in increaseHostSelectorPosition()
533 "Failed power process debug host selector button press : {ERROR}", in debugHostSelectorReleased()