Populate AllowedPowerModes
AllowedPowerModes is a new dbus property that will be used by Redfish to
publish the supported modes.
'''
busctl -l introspect org.open_power.OCC.Control /xyz/openbmc_project/control/host0/power_mode
...
xyz.openbmc_project.Control.Power.Mode interface - - -
.AllowedPowerModes property as 3 "xyz.openbmc_project.Control.Power.Mode.PowerMode.MaximumPerformance" "xyz.openbmc_project.Control.Power.Mode.PowerMode.PowerSaving" "xyz.openbmc_project.Control.Power.Mode.PowerMode.Static" const
.PowerMode property s "xyz.openbmc_project.Control.Power.Mode.PowerMode.MaximumPerformance" emits-change writable
.SafeMode property b false emits-change
'''
Change-Id: I67ab6c2f8545c327dd7ab437f892ad5796a194c5
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
diff --git a/powermode.hpp b/powermode.hpp
index 5363c2c..9a191f7 100644
--- a/powermode.hpp
+++ b/powermode.hpp
@@ -281,6 +281,12 @@
event(event)
#endif
{
+ using Mode =
+ sdbusplus::xyz::openbmc_project::Control::Power::server::Mode;
+ ModeInterface::allowedPowerModes({Mode::PowerMode::Static,
+ Mode::PowerMode::MaximumPerformance,
+ Mode::PowerMode::PowerSaving});
+
// restore Power Mode to DBus
SysPwrMode currentMode;
uint16_t oemModeData = 0;