pseq: Rename GPIO struct used for pgood status
In the phosphor-power-sequencer application, the Rail class has an
optional GPIO that provides the pgood status of the rail.
Currently the GPIO information is stored in a struct named 'GPIO'. This
structure is specific to reading the pgood status of a rail using a GPIO
on the power sequencer device.
A future commit will be creating a new GPIO class that represents an
arbitrary GPIO in the system. This class will support requesting,
reading, writing, and releasing the GPIO.
To avoid a name conflict, rename the struct to PgoodGPIO, which more
clearly represents its purpose.
Tested: Ran automated tests
Change-Id: Ie13d1c77faa96faf6839e77a84d1499f7c239148
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/phosphor-power-sequencer/test/pmbus_driver_device_tests.cpp b/phosphor-power-sequencer/test/pmbus_driver_device_tests.cpp
index 979a459..8820182 100644
--- a/phosphor-power-sequencer/test/pmbus_driver_device_tests.cpp
+++ b/phosphor-power-sequencer/test/pmbus_driver_device_tests.cpp
@@ -73,7 +73,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{true};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
return std::make_unique<Rail>(name, presence, page, isPowerSupplyRail,
checkStatusVout, compareVoltageToLimit,
gpio);
diff --git a/phosphor-power-sequencer/test/rail_tests.cpp b/phosphor-power-sequencer/test/rail_tests.cpp
index 1351f93..a9eac1b 100644
--- a/phosphor-power-sequencer/test/rail_tests.cpp
+++ b/phosphor-power-sequencer/test/rail_tests.cpp
@@ -32,18 +32,18 @@
using ::testing::Return;
using ::testing::Throw;
-TEST(GPIOTests, Initialization)
+TEST(PgoodGPIOTests, Initialization)
{
// Default initialization
{
- GPIO gpio;
+ PgoodGPIO gpio;
EXPECT_EQ(gpio.line, 0);
EXPECT_FALSE(gpio.activeLow);
}
// Explicit initialization
{
- GPIO gpio{48, true};
+ PgoodGPIO gpio{48, true};
EXPECT_EQ(gpio.line, 48);
EXPECT_TRUE(gpio.activeLow);
}
@@ -59,7 +59,7 @@
bool isPowerSupplyRail{true};
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
Rail rail{name,
presence,
page,
@@ -86,7 +86,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{true};
bool compareVoltageToLimit{true};
- std::optional<GPIO> gpio{GPIO(60, true)};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO(60, true)};
Rail rail{name,
presence,
page,
@@ -118,7 +118,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{true};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
EXPECT_THROW((Rail{name, presence, page, isPowerSupplyRail,
checkStatusVout, compareVoltageToLimit, gpio}),
std::invalid_argument);
@@ -132,7 +132,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
bool compareVoltageToLimit{true};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
EXPECT_THROW((Rail{name, presence, page, isPowerSupplyRail,
checkStatusVout, compareVoltageToLimit, gpio}),
std::invalid_argument);
@@ -147,7 +147,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
Rail rail{name,
presence,
page,
@@ -166,7 +166,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
// Test where presence has no value
{
@@ -206,7 +206,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
// Test where page has no value
{
@@ -244,7 +244,7 @@
bool isPowerSupplyRail{true};
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
Rail rail{name,
presence,
page,
@@ -264,7 +264,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
Rail rail{name,
presence,
page,
@@ -284,7 +284,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
bool compareVoltageToLimit{true};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
Rail rail{name,
presence,
page,
@@ -307,7 +307,7 @@
// Test where gpio has no value
{
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
Rail rail{name,
presence,
page,
@@ -320,7 +320,7 @@
// Test where gpio has a value
{
- std::optional<GPIO> gpio{GPIO(12, false)};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO(12, false)};
Rail rail{name,
presence,
page,
@@ -341,7 +341,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
// Test where inventory path not specified; always returns true
{
@@ -441,7 +441,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
// Test where page was not specified: Throws exception
{
@@ -524,7 +524,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
// Test where page was not specified: Throws exception
{
@@ -607,7 +607,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
// Test where page was not specified: Throws exception
{
@@ -690,7 +690,7 @@
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
// Test where page was not specified: Throws exception
{
@@ -779,7 +779,7 @@
bool checkStatusVout{true};
bool compareVoltageToLimit{true};
bool activeLow{true};
- std::optional<GPIO> gpio{GPIO(3, activeLow)};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO(3, activeLow)};
Rail rail{name,
presence,
page,
@@ -901,7 +901,7 @@
std::optional<uint8_t> page{3};
bool isPowerSupplyRail{false};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
// Test where presence check defined: Rail is not present
{
@@ -1114,7 +1114,7 @@
"/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu2"};
std::optional<uint8_t> page{3};
bool activeLow{false};
- std::optional<GPIO> gpio{GPIO(3, activeLow)};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO(3, activeLow)};
Rail rail{name,
presence,
page,
@@ -1143,7 +1143,7 @@
"/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu2"};
std::optional<uint8_t> page{3};
bool activeLow{false};
- std::optional<GPIO> gpio{GPIO(3, activeLow)};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO(3, activeLow)};
Rail rail{name,
presence,
page,
@@ -1170,7 +1170,7 @@
{
std::optional<std::string> presence{};
std::optional<uint8_t> page{3};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
Rail rail{name,
presence,
page,
@@ -1196,7 +1196,7 @@
std::optional<std::string> presence{};
std::optional<uint8_t> page{};
bool activeLow{false};
- std::optional<GPIO> gpio{GPIO(3, activeLow)};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO(3, activeLow)};
Rail rail{name,
presence,
page,
@@ -1223,7 +1223,7 @@
std::optional<std::string> presence{};
std::optional<uint8_t> page{};
bool activeLow{false};
- std::optional<GPIO> gpio{GPIO(3, activeLow)};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO(3, activeLow)};
Rail rail{name,
presence,
page,
@@ -1259,7 +1259,7 @@
std::optional<std::string> presence{};
std::optional<uint8_t> page{2};
bool activeLow{true};
- std::optional<GPIO> gpio{GPIO(3, activeLow)};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO(3, activeLow)};
Rail rail{name,
presence,
page,
@@ -1298,7 +1298,7 @@
std::optional<std::string> presence{};
std::optional<uint8_t> page{};
bool activeLow{false};
- std::optional<GPIO> gpio{GPIO(6, activeLow)};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO(6, activeLow)};
Rail rail{name,
presence,
page,
@@ -1333,7 +1333,7 @@
std::optional<uint8_t> page{2};
bool isPowerSupplyRail{false};
bool checkStatusVout{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
// Test where presence check defined: Rail is not present
{
diff --git a/phosphor-power-sequencer/test/standard_device_tests.cpp b/phosphor-power-sequencer/test/standard_device_tests.cpp
index bbeb459..ea1830d 100644
--- a/phosphor-power-sequencer/test/standard_device_tests.cpp
+++ b/phosphor-power-sequencer/test/standard_device_tests.cpp
@@ -98,7 +98,7 @@
std::optional<uint8_t> page{pageNum};
bool checkStatusVout{true};
bool compareVoltageToLimit{false};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
return std::make_unique<Rail>(name, presence, page, isPowerSupplyRail,
checkStatusVout, compareVoltageToLimit, gpio);
}
@@ -120,7 +120,7 @@
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
bool activeLow{false};
- std::optional<GPIO> gpio{GPIO{gpioLine, activeLow}};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO{gpioLine, activeLow}};
return std::make_unique<Rail>(name, presence, page, isPowerSupplyRail,
checkStatusVout, compareVoltageToLimit, gpio);
}
@@ -141,7 +141,7 @@
std::optional<uint8_t> page{pageNum};
bool checkStatusVout{false};
bool compareVoltageToLimit{true};
- std::optional<GPIO> gpio{};
+ std::optional<PgoodGPIO> gpio{};
return std::make_unique<Rail>(name, presence, page, isPowerSupplyRail,
checkStatusVout, compareVoltageToLimit, gpio);
}
diff --git a/phosphor-power-sequencer/test/ucd90160_device_tests.cpp b/phosphor-power-sequencer/test/ucd90160_device_tests.cpp
index e0bfa64..4227055 100644
--- a/phosphor-power-sequencer/test/ucd90160_device_tests.cpp
+++ b/phosphor-power-sequencer/test/ucd90160_device_tests.cpp
@@ -53,7 +53,7 @@
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
bool activeLow{false};
- std::optional<GPIO> gpio{GPIO{gpioLine, activeLow}};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO{gpioLine, activeLow}};
return std::make_unique<Rail>(name, presence, page, isPowerSupplyRail,
checkStatusVout, compareVoltageToLimit, gpio);
}
diff --git a/phosphor-power-sequencer/test/ucd90320_device_tests.cpp b/phosphor-power-sequencer/test/ucd90320_device_tests.cpp
index b42dae5..d334832 100644
--- a/phosphor-power-sequencer/test/ucd90320_device_tests.cpp
+++ b/phosphor-power-sequencer/test/ucd90320_device_tests.cpp
@@ -53,7 +53,7 @@
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
bool activeLow{false};
- std::optional<GPIO> gpio{GPIO{gpioLine, activeLow}};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO{gpioLine, activeLow}};
return std::make_unique<Rail>(name, presence, page, isPowerSupplyRail,
checkStatusVout, compareVoltageToLimit, gpio);
}
diff --git a/phosphor-power-sequencer/test/ucd90x_device_tests.cpp b/phosphor-power-sequencer/test/ucd90x_device_tests.cpp
index 9d9423e..08571c1 100644
--- a/phosphor-power-sequencer/test/ucd90x_device_tests.cpp
+++ b/phosphor-power-sequencer/test/ucd90x_device_tests.cpp
@@ -55,7 +55,7 @@
bool checkStatusVout{false};
bool compareVoltageToLimit{false};
bool activeLow{false};
- std::optional<GPIO> gpio{GPIO{gpioLine, activeLow}};
+ std::optional<PgoodGPIO> gpio{PgoodGPIO{gpioLine, activeLow}};
return std::make_unique<Rail>(name, presence, page, isPowerSupplyRail,
checkStatusVout, compareVoltageToLimit, gpio);
}