pseq: Move bus/addr higher in class hierarchy
Update the PowerSequencerDevice class hierarchy within the
phosphor-power-sequencer application.
The I2C bus and address for the power sequencer device(s) in the system
are now defined in the JSON configuration file.
Move the I2C bus and address properties to the top of the
PowerSequencerDevice class hierarchy.
For sub-classes that already had these properties, order the constructor
parameters to match the order in the JSON.
Tested:
* Ran automated test cases
Change-Id: Ida6886cbc62a9c8abd3bed294f6ddcd1851ccd62
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/phosphor-power-sequencer/src/pmbus_driver_device.hpp b/phosphor-power-sequencer/src/pmbus_driver_device.hpp
index 6823907..9e77626 100644
--- a/phosphor-power-sequencer/src/pmbus_driver_device.hpp
+++ b/phosphor-power-sequencer/src/pmbus_driver_device.hpp
@@ -54,18 +54,18 @@
* Constructor.
*
* @param name Device name
- * @param rails Voltage rails that are enabled and monitored by this device
- * @param services System services like hardware presence and the journal
* @param bus I2C bus for the device
* @param address I2C address for the device
+ * @param rails Voltage rails that are enabled and monitored by this device
+ * @param services System services like hardware presence and the journal
* @param driverName Device driver name
* @param instance Chip instance number
*/
explicit PMBusDriverDevice(
- const std::string& name, std::vector<std::unique_ptr<Rail>> rails,
- Services& services, uint8_t bus, uint16_t address,
+ const std::string& name, uint8_t bus, uint16_t address,
+ std::vector<std::unique_ptr<Rail>> rails, Services& services,
const std::string& driverName = "", size_t instance = 0) :
- StandardDevice(name, std::move(rails)), bus{bus}, address{address},
+ StandardDevice(name, bus, address, std::move(rails)),
driverName{driverName}, instance{instance}
{
pmbusInterface =
@@ -73,26 +73,6 @@
}
/**
- * Returns the I2C bus for the device.
- *
- * @return I2C bus
- */
- uint8_t getBus() const
- {
- return bus;
- }
-
- /**
- * Returns the I2C address for the device.
- *
- * @return I2C address
- */
- uint16_t getAddress() const
- {
- return address;
- }
-
- /**
* Returns the device driver name.
*
* @return driver name
@@ -222,16 +202,6 @@
const std::string& fileName);
/**
- * I2C bus for the device.
- */
- uint8_t bus;
-
- /**
- * I2C address for the device.
- */
- uint16_t address;
-
- /**
* Device driver name.
*/
std::string driverName;