pseq: Add named GPIO properties
Add the new named GPIO properties from the JSON config file to the
power sequencer device class hierarchy.
New JSON GPIO properties:
* power_control_gpio_name
* power_good_gpio_name
Power sequencer device class hierarchy:
* PowerSequencerDevice (power_sequencer_device.*)
* StandardDevice (standard_device.*)
* PMBusDriverDevice (pmbus_driver_device.*)
* UCD90xDevice (ucd90x_device.*)
* UCD90160Device (ucd90160_device.*)
* UCD90320Device (ucd90320_device.*)
Tested:
* Ran automated tests. All ran successfully.
Change-Id: Idcccee89eb09cb7d135f45aeb4f6dfe8299adf43
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/phosphor-power-sequencer/test/ucd90x_device_tests.cpp b/phosphor-power-sequencer/test/ucd90x_device_tests.cpp
index 5212d65..9d9423e 100644
--- a/phosphor-power-sequencer/test/ucd90x_device_tests.cpp
+++ b/phosphor-power-sequencer/test/ucd90x_device_tests.cpp
@@ -67,14 +67,24 @@
std::string name{"ucd90320"};
uint8_t bus{3};
uint16_t address{0x72};
+ std::string powerControlGPIOName{"power-chassis-control"};
+ std::string powerGoodGPIOName{"power-chassis-good"};
std::vector<std::unique_ptr<Rail>> rails;
rails.emplace_back(createRail("VDD", 5));
rails.emplace_back(createRail("VIO", 7));
- UCD90xDevice device{name, bus, address, std::move(rails), services};
+ UCD90xDevice device{name,
+ bus,
+ address,
+ powerControlGPIOName,
+ powerGoodGPIOName,
+ std::move(rails),
+ services};
EXPECT_EQ(device.getName(), name);
EXPECT_EQ(device.getBus(), bus);
EXPECT_EQ(device.getAddress(), address);
+ EXPECT_EQ(device.getPowerControlGPIOName(), powerControlGPIOName);
+ EXPECT_EQ(device.getPowerGoodGPIOName(), powerGoodGPIOName);
EXPECT_EQ(device.getRails().size(), 2);
EXPECT_EQ(device.getRails()[0]->getName(), "VDD");
EXPECT_EQ(device.getRails()[1]->getName(), "VIO");
@@ -92,8 +102,16 @@
std::string name{"ucd90320"};
uint8_t bus{3};
uint16_t address{0x72};
+ std::string powerControlGPIOName{"power-chassis-control"};
+ std::string powerGoodGPIOName{"power-chassis-good"};
std::vector<std::unique_ptr<Rail>> rails;
- UCD90xDevice device{name, bus, address, std::move(rails), services};
+ UCD90xDevice device{name,
+ bus,
+ address,
+ powerControlGPIOName,
+ powerGoodGPIOName,
+ std::move(rails),
+ services};
MockPMBus& pmbus = static_cast<MockPMBus&>(device.getPMBusInterface());
uint64_t mfrStatus{0x123456789abcull};
@@ -111,8 +129,16 @@
std::string name{"ucd90320"};
uint8_t bus{3};
uint16_t address{0x72};
+ std::string powerControlGPIOName{"power-chassis-control"};
+ std::string powerGoodGPIOName{"power-chassis-good"};
std::vector<std::unique_ptr<Rail>> rails;
- UCD90xDevice device{name, bus, address, std::move(rails), services};
+ UCD90xDevice device{name,
+ bus,
+ address,
+ powerControlGPIOName,
+ powerGoodGPIOName,
+ std::move(rails),
+ services};
MockPMBus& pmbus = static_cast<MockPMBus&>(device.getPMBusInterface());
EXPECT_CALL(pmbus, read("mfr_status", Type::HwmonDeviceDebug, true))
@@ -167,9 +193,17 @@
std::string name{"ucd90320"};
uint8_t bus{3};
uint16_t address{0x72};
+ std::string powerControlGPIOName{"power-chassis-control"};
+ std::string powerGoodGPIOName{"power-chassis-good"};
std::vector<std::unique_ptr<Rail>> rails;
rails.emplace_back(createRail("VDD", 2));
- UCD90xDevice device{name, bus, address, std::move(rails), services};
+ UCD90xDevice device{name,
+ bus,
+ address,
+ powerControlGPIOName,
+ powerGoodGPIOName,
+ std::move(rails),
+ services};
MockPMBus& pmbus = static_cast<MockPMBus&>(device.getPMBusInterface());
EXPECT_CALL(pmbus, getPath(Type::Hwmon))
@@ -221,9 +255,17 @@
std::string name{"ucd90320"};
uint8_t bus{3};
uint16_t address{0x72};
+ std::string powerControlGPIOName{"power-chassis-control"};
+ std::string powerGoodGPIOName{"power-chassis-good"};
std::vector<std::unique_ptr<Rail>> rails;
rails.emplace_back(createRail("VDD", 2));
- UCD90xDevice device{name, bus, address, std::move(rails), services};
+ UCD90xDevice device{name,
+ bus,
+ address,
+ powerControlGPIOName,
+ powerGoodGPIOName,
+ std::move(rails),
+ services};
MockPMBus& pmbus = static_cast<MockPMBus&>(device.getPMBusInterface());
EXPECT_CALL(pmbus, getPath(Type::Hwmon))