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/ucd90320_device_tests.cpp b/phosphor-power-sequencer/test/ucd90320_device_tests.cpp
index 182a410..b42dae5 100644
--- a/phosphor-power-sequencer/test/ucd90320_device_tests.cpp
+++ b/phosphor-power-sequencer/test/ucd90320_device_tests.cpp
@@ -64,14 +64,23 @@
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));
- UCD90320Device device{bus, address, std::move(rails), services};
+ UCD90320Device device{bus,
+ address,
+ powerControlGPIOName,
+ powerGoodGPIOName,
+ std::move(rails),
+ services};
EXPECT_EQ(device.getName(), "UCD90320");
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");
@@ -142,9 +151,16 @@
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));
- UCD90320Device device{bus, address, std::move(rails), services};
+ UCD90320Device device{bus,
+ address,
+ powerControlGPIOName,
+ powerGoodGPIOName,
+ std::move(rails),
+ services};
MockPMBus& pmbus = static_cast<MockPMBus&>(device.getPMBusInterface());
EXPECT_CALL(pmbus, getPath(Type::Hwmon))
@@ -230,9 +246,16 @@
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));
- UCD90320Device device{bus, address, std::move(rails), services};
+ UCD90320Device device{bus,
+ address,
+ powerControlGPIOName,
+ powerGoodGPIOName,
+ std::move(rails),
+ services};
MockPMBus& pmbus = static_cast<MockPMBus&>(device.getPMBusInterface());
EXPECT_CALL(pmbus, getPath(Type::Hwmon))