Refactor: rename namespace witherspoon to phosphor
This repo now becomes phosphor-power, rename namespace witherspoon to
phosphor to make it generic.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Icb9f8a7c33065add99f2bf42ed55745a28fa0424
diff --git a/argument.hpp b/argument.hpp
index b6681d9..1fad60a 100644
--- a/argument.hpp
+++ b/argument.hpp
@@ -5,7 +5,7 @@
#include <map>
#include <string>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -63,4 +63,4 @@
};
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/device.hpp b/device.hpp
index 2513506..7acd132 100644
--- a/device.hpp
+++ b/device.hpp
@@ -3,7 +3,7 @@
#include <memory>
#include <string>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -82,4 +82,4 @@
};
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/device_monitor.hpp b/device_monitor.hpp
index 2d55af3..7960d1c 100644
--- a/device_monitor.hpp
+++ b/device_monitor.hpp
@@ -8,7 +8,7 @@
#include <sdeventplus/event.hpp>
#include <sdeventplus/utility/timer.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -79,4 +79,4 @@
};
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/file.hpp b/file.hpp
index d762012..1c9c887 100644
--- a/file.hpp
+++ b/file.hpp
@@ -1,7 +1,7 @@
#pragma once
#include <unistd.h>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -68,4 +68,4 @@
} // namespace util
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/gpio.cpp b/gpio.cpp
index 2dad86d..6adee9c 100644
--- a/gpio.cpp
+++ b/gpio.cpp
@@ -24,7 +24,7 @@
#include <phosphor-logging/log.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace gpio
{
@@ -93,7 +93,7 @@
// Make an ioctl call to request the GPIO line, which will
// return the descriptor to use to access it.
gpiohandle_request request{};
- strncpy(request.consumer_label, "witherspoon-pfault-analysis",
+ strncpy(request.consumer_label, "phosphor-power",
sizeof(request.consumer_label));
request.flags = (direction == Direction::input) ? GPIOHANDLE_REQUEST_INPUT
@@ -120,4 +120,4 @@
}
} // namespace gpio
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/gpio.hpp b/gpio.hpp
index 2742d4f..edb9b77 100644
--- a/gpio.hpp
+++ b/gpio.hpp
@@ -7,7 +7,7 @@
#include <string>
#include <type_traits>
-namespace witherspoon
+namespace phosphor
{
namespace gpio
{
@@ -114,4 +114,4 @@
};
} // namespace gpio
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/names_values.hpp b/names_values.hpp
index c33c507..962c65d 100644
--- a/names_values.hpp
+++ b/names_values.hpp
@@ -2,7 +2,7 @@
#include <sstream>
#include <string>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -107,4 +107,4 @@
} // namespace util
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/pmbus.cpp b/pmbus.cpp
index f755e99..b0de16d 100644
--- a/pmbus.cpp
+++ b/pmbus.cpp
@@ -22,7 +22,7 @@
#include <xyz/openbmc_project/Common/Device/error.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace pmbus
{
@@ -336,4 +336,4 @@
}
} // namespace pmbus
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/pmbus.hpp b/pmbus.hpp
index cb244fd..8f5d914 100644
--- a/pmbus.hpp
+++ b/pmbus.hpp
@@ -4,7 +4,7 @@
#include <string>
#include <vector>
-namespace witherspoon
+namespace phosphor
{
namespace pmbus
{
@@ -307,4 +307,4 @@
};
} // namespace pmbus
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-sequencer/argument.cpp b/power-sequencer/argument.cpp
index 5325256..7a60587 100644
--- a/power-sequencer/argument.cpp
+++ b/power-sequencer/argument.cpp
@@ -19,7 +19,7 @@
#include <iostream>
#include <iterator>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -87,4 +87,4 @@
const std::string ArgumentParser::emptyString = "";
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-sequencer/main.cpp b/power-sequencer/main.cpp
index 3e1ca52..aa9b772 100644
--- a/power-sequencer/main.cpp
+++ b/power-sequencer/main.cpp
@@ -23,7 +23,7 @@
#include <phosphor-logging/log.hpp>
#include <sdeventplus/event.hpp>
-using namespace witherspoon::power;
+using namespace phosphor::power;
using namespace phosphor::logging;
int main(int argc, char** argv)
diff --git a/power-sequencer/pgood_monitor.cpp b/power-sequencer/pgood_monitor.cpp
index fc593f0..c208c0a 100644
--- a/power-sequencer/pgood_monitor.cpp
+++ b/power-sequencer/pgood_monitor.cpp
@@ -23,7 +23,7 @@
#include <org/open_power/Witherspoon/Fault/error.hpp>
#include <phosphor-logging/log.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -125,4 +125,4 @@
}
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-sequencer/pgood_monitor.hpp b/power-sequencer/pgood_monitor.hpp
index 7dbabf9..8f9ba45 100644
--- a/power-sequencer/pgood_monitor.hpp
+++ b/power-sequencer/pgood_monitor.hpp
@@ -7,7 +7,7 @@
#include <sdbusplus/server.hpp>
#include <sdeventplus/event.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -42,7 +42,7 @@
* @param[in] e - event object
* @param[in] t - time to allow PGOOD to come up
*/
- PGOODMonitor(std::unique_ptr<witherspoon::power::Device>&& d,
+ PGOODMonitor(std::unique_ptr<phosphor::power::Device>&& d,
sdbusplus::bus::bus& b, const sdeventplus::Event& e,
std::chrono::milliseconds& t) :
DeviceMonitor(std::move(d), e, t),
@@ -107,4 +107,4 @@
};
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-sequencer/runtime_monitor.cpp b/power-sequencer/runtime_monitor.cpp
index fa9ecfe..9dd4550 100644
--- a/power-sequencer/runtime_monitor.cpp
+++ b/power-sequencer/runtime_monitor.cpp
@@ -23,7 +23,7 @@
#include <org/open_power/Witherspoon/Fault/error.hpp>
#include <phosphor-logging/log.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -65,4 +65,4 @@
}
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-sequencer/runtime_monitor.hpp b/power-sequencer/runtime_monitor.hpp
index 934aef1..5a6febc 100644
--- a/power-sequencer/runtime_monitor.hpp
+++ b/power-sequencer/runtime_monitor.hpp
@@ -7,7 +7,7 @@
#include <sdbusplus/server.hpp>
#include <sdeventplus/event.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -48,7 +48,7 @@
* @param[in] e - event object
* @param[in] i - poll interval
*/
- RuntimeMonitor(std::unique_ptr<witherspoon::power::Device>&& d,
+ RuntimeMonitor(std::unique_ptr<phosphor::power::Device>&& d,
sdbusplus::bus::bus& b, const sdeventplus::Event& e,
std::chrono::milliseconds& i) :
DeviceMonitor(std::move(d), e, i),
@@ -104,4 +104,4 @@
};
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-sequencer/templates/ucd90160_defs.mako.cpp b/power-sequencer/templates/ucd90160_defs.mako.cpp
index 1775158..c7a2db6 100644
--- a/power-sequencer/templates/ucd90160_defs.mako.cpp
+++ b/power-sequencer/templates/ucd90160_defs.mako.cpp
@@ -2,7 +2,7 @@
#include "ucd90160.hpp"
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -56,4 +56,4 @@
};
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-sequencer/types.hpp b/power-sequencer/types.hpp
index 7edfa59..53130fe 100644
--- a/power-sequencer/types.hpp
+++ b/power-sequencer/types.hpp
@@ -6,7 +6,7 @@
#include <tuple>
#include <vector>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -84,4 +84,4 @@
} // namespace ucd90160
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-sequencer/ucd90160.cpp b/power-sequencer/ucd90160.cpp
index d0d176c..eaaad56 100644
--- a/power-sequencer/ucd90160.cpp
+++ b/power-sequencer/ucd90160.cpp
@@ -26,7 +26,7 @@
#include <phosphor-logging/log.hpp>
#include <xyz/openbmc_project/Common/Device/error.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -507,4 +507,4 @@
}
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-sequencer/ucd90160.hpp b/power-sequencer/ucd90160.hpp
index 3169de6..8e17622 100644
--- a/power-sequencer/ucd90160.hpp
+++ b/power-sequencer/ucd90160.hpp
@@ -11,7 +11,7 @@
#include <sdbusplus/bus.hpp>
#include <vector>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -310,4 +310,4 @@
};
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-supply/argument.cpp b/power-supply/argument.cpp
index 342515c..7b671d8 100644
--- a/power-supply/argument.cpp
+++ b/power-supply/argument.cpp
@@ -20,7 +20,7 @@
#include <iostream>
#include <iterator>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -99,4 +99,4 @@
const std::string ArgumentParser::emptyString = "";
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-supply/average.hpp b/power-supply/average.hpp
index a61a436..5fdf0b8 100644
--- a/power-supply/average.hpp
+++ b/power-supply/average.hpp
@@ -2,7 +2,7 @@
#include <functional>
#include <org/open_power/Sensor/Aggregation/History/Average/server.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -51,4 +51,4 @@
} // namespace history
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-supply/main.cpp b/power-supply/main.cpp
index 93b4b77..ccb56e7 100644
--- a/power-supply/main.cpp
+++ b/power-supply/main.cpp
@@ -23,7 +23,7 @@
#include <phosphor-logging/log.hpp>
#include <sdeventplus/event.hpp>
-using namespace witherspoon::power;
+using namespace phosphor::power;
using namespace phosphor::logging;
int main(int argc, char* argv[])
diff --git a/power-supply/maximum.hpp b/power-supply/maximum.hpp
index d952d2b..68d3d03 100644
--- a/power-supply/maximum.hpp
+++ b/power-supply/maximum.hpp
@@ -2,7 +2,7 @@
#include <functional>
#include <org/open_power/Sensor/Aggregation/History/Maximum/server.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -51,4 +51,4 @@
} // namespace history
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-supply/power_supply.cpp b/power-supply/power_supply.cpp
index 0758d2a..0a5c9cc 100644
--- a/power-supply/power_supply.cpp
+++ b/power-supply/power_supply.cpp
@@ -29,7 +29,7 @@
#include <xyz/openbmc_project/Common/Device/error.hpp>
#include <xyz/openbmc_project/Software/Version/server.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -84,7 +84,7 @@
getAccessType();
using namespace sdbusplus::bus;
- using namespace witherspoon::pmbus;
+ using namespace phosphor::pmbus;
std::uint16_t statusWord = 0;
try
{
@@ -121,8 +121,8 @@
void PowerSupply::getAccessType()
{
- using namespace witherspoon::pmbus;
- using namespace witherspoon::power::util;
+ using namespace phosphor::pmbus;
+ using namespace phosphor::power::util;
fruJson = loadJSONFromFile(PSU_JSON_PATH);
if (fruJson == nullptr)
{
@@ -155,7 +155,7 @@
}
void PowerSupply::captureCmd(util::NamesValues& nv, const std::string& cmd,
- witherspoon::pmbus::Type type)
+ phosphor::pmbus::Type type)
{
if (pmbusIntf.exists(cmd, type))
{
@@ -174,7 +174,7 @@
void PowerSupply::analyze()
{
- using namespace witherspoon::pmbus;
+ using namespace phosphor::pmbus;
try
{
@@ -313,7 +313,7 @@
void PowerSupply::checkInputFault(const uint16_t statusWord)
{
- using namespace witherspoon::pmbus;
+ using namespace phosphor::pmbus;
if ((inputFault < FAULT_COUNT) &&
((statusWord & status_word::INPUT_FAULT_WARN) ||
@@ -382,7 +382,7 @@
void PowerSupply::checkPGOrUnitOffFault(const uint16_t statusWord)
{
- using namespace witherspoon::pmbus;
+ using namespace phosphor::pmbus;
if (powerOnFault < FAULT_COUNT)
{
@@ -428,7 +428,7 @@
void PowerSupply::checkCurrentOutOverCurrentFault(const uint16_t statusWord)
{
- using namespace witherspoon::pmbus;
+ using namespace phosphor::pmbus;
if (outputOCFault < FAULT_COUNT)
{
@@ -469,7 +469,7 @@
void PowerSupply::checkOutputOvervoltageFault(const uint16_t statusWord)
{
- using namespace witherspoon::pmbus;
+ using namespace phosphor::pmbus;
if (outputOVFault < FAULT_COUNT)
{
@@ -510,7 +510,7 @@
void PowerSupply::checkFanFault(const uint16_t statusWord)
{
- using namespace witherspoon::pmbus;
+ using namespace phosphor::pmbus;
if (fanFault < FAULT_COUNT)
{
@@ -549,7 +549,7 @@
void PowerSupply::checkTemperatureFault(const uint16_t statusWord)
{
- using namespace witherspoon::pmbus;
+ using namespace phosphor::pmbus;
// Due to how the PMBus core device driver sends a clear faults command
// the bit in STATUS_WORD will likely be cleared when we attempt to examine
@@ -674,7 +674,7 @@
void PowerSupply::updateInventory()
{
- using namespace witherspoon::pmbus;
+ using namespace phosphor::pmbus;
using namespace sdbusplus::message;
// Build the object map and send it to the inventory
@@ -769,7 +769,7 @@
void PowerSupply::syncHistory()
{
- using namespace witherspoon::gpio;
+ using namespace phosphor::gpio;
if (syncGPIODevPath.empty())
{
@@ -839,4 +839,4 @@
} // namespace psu
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-supply/power_supply.hpp b/power-supply/power_supply.hpp
index 0968a78..e292ca2 100644
--- a/power-supply/power_supply.hpp
+++ b/power-supply/power_supply.hpp
@@ -12,7 +12,7 @@
#include <sdeventplus/event.hpp>
#include <sdeventplus/utility/timer.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -107,7 +107,7 @@
* that a device driver monitors the PMBus interface to the power
* supplies.
*/
- witherspoon::pmbus::PMBus pmbusIntf;
+ phosphor::pmbus::PMBus pmbusIntf;
/**
* @brief D-Bus path to use for this power supply's inventory status.
@@ -265,7 +265,7 @@
/**
* @brief The type of the power supply inventory pmbus access.
*/
- witherspoon::pmbus::Type inventoryPMBusAccessType;
+ phosphor::pmbus::Type inventoryPMBusAccessType;
/**
* @brief The JSON from the parsed power supply FRU JSON File.
@@ -322,7 +322,7 @@
* @param[in] type - The type of file to read the command from.
*/
void captureCmd(util::NamesValues& nv, const std::string& cmd,
- witherspoon::pmbus::Type type);
+ phosphor::pmbus::Type type);
/**
* @brief Checks for input voltage faults and logs error if needed.
@@ -430,4 +430,4 @@
} // namespace psu
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-supply/record_manager.cpp b/power-supply/record_manager.cpp
index b585ba0..3ff655b 100644
--- a/power-supply/record_manager.cpp
+++ b/power-supply/record_manager.cpp
@@ -20,7 +20,7 @@
#include <chrono>
#include <phosphor-logging/log.hpp>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -183,4 +183,4 @@
} // namespace history
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-supply/record_manager.hpp b/power-supply/record_manager.hpp
index 7ebcc3f..244ab3e 100644
--- a/power-supply/record_manager.hpp
+++ b/power-supply/record_manager.hpp
@@ -4,7 +4,7 @@
#include <tuple>
#include <vector>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -196,4 +196,4 @@
} // namespace history
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/power-supply/test/test_records.cpp b/power-supply/test/test_records.cpp
index e500322..dbf5b06 100644
--- a/power-supply/test/test_records.cpp
+++ b/power-supply/test/test_records.cpp
@@ -20,7 +20,7 @@
#include <gtest/gtest.h>
-using namespace witherspoon::power::history;
+using namespace phosphor::power::history;
/**
* Test the linearToInteger function with different
diff --git a/test/nvtest.cpp b/test/nvtest.cpp
index a7a102b..bd02332 100644
--- a/test/nvtest.cpp
+++ b/test/nvtest.cpp
@@ -19,7 +19,7 @@
TEST(NamesValuesTest, TestValues)
{
- witherspoon::power::util::NamesValues nv;
+ phosphor::power::util::NamesValues nv;
std::string expected;
EXPECT_EQ(nv.get(), expected); // empty
diff --git a/utility.cpp b/utility.cpp
index 214d8a9..8fe02dc 100644
--- a/utility.cpp
+++ b/utility.cpp
@@ -17,7 +17,7 @@
#include <fstream>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -75,4 +75,4 @@
} // namespace util
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor
diff --git a/utility.hpp b/utility.hpp
index df66852..78b9425 100644
--- a/utility.hpp
+++ b/utility.hpp
@@ -6,7 +6,7 @@
#include <sdbusplus/bus.hpp>
#include <string>
-namespace witherspoon
+namespace phosphor
{
namespace power
{
@@ -116,4 +116,4 @@
} // namespace util
} // namespace power
-} // namespace witherspoon
+} // namespace phosphor