#
92261f88 |
| 01-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I8bc99b559079b8454b11bff0be5ddfb6e55e71ba Signed-off-by: Patrick Williams <p
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I8bc99b559079b8454b11bff0be5ddfb6e55e71ba Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
757ad6a9 |
| 15-Dec-2024 |
Jayanth Othayoth <ojayanth@gmail.com> |
clang-tidy: Replace NULL with nullptr
Replaced all instances of NULL with nullptr to improve type safety and clarity, as nullptr is the modern C++ standard for null pointers.
Tested: Build verified
clang-tidy: Replace NULL with nullptr
Replaced all instances of NULL with nullptr to improve type safety and clarity, as nullptr is the modern C++ standard for null pointers.
Tested: Build verified
Change-Id: I426e95bee023cc673d936a0705f233becab23100 Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
show more ...
|
#
f5402197 |
| 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I7b90380845efee6bf6a1fe342a793d71aa9ff181 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
48781aef |
| 10-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: If66f68c96df4baf8dc07abf8729a3cb7657e932d Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
32453e9b |
| 15-Dec-2021 |
Brandon Wyman <bjwyman@gmail.com> |
psu-ng: Continue reading after readFail
Update the PMBus::read() function to allow for not creating journal trace and elog, but default to continuing to trace and elog, the previous behavior.
If we
psu-ng: Continue reading after readFail
Update the PMBus::read() function to allow for not creating journal trace and elog, but default to continuing to trace and elog, the previous behavior.
If we reach the limit of read failures that results in a communication error log, continue to read, but stop logging failures.
If communication restores, we may be able to detect what caused the read failure, or otherwise detect or clear new faults.
Change-Id: If59b86211ab54c31248ede78f8f117b607298923 Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
show more ...
|
#
c1d4de5e |
| 06-Oct-2021 |
Patrick Williams <patrick@stwcx.xyz> |
catch exceptions as const
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: If6aba71f482f75143e6d669763b8853db22318cf
|
#
6a3fd2c2 |
| 25-Aug-2020 |
Jay Meyer <jaymeyer@us.ibm.com> |
Enhance PSU tracing support - add device access info
Move file names for file errors to the journal message. Enhance usablility.
Logging messages for file errors contain the file names inside struc
Enhance PSU tracing support - add device access info
Move file names for file errors to the journal message. Enhance usablility.
Logging messages for file errors contain the file names inside structured entries rather than directly in the log message. This makes viewing errors more difficult than need be. Before this change, the journal report needed to be run with '-o verbose' to see the file names.
Tested: Ran unit tests. All successful Tested: * Changes to phosphor-power-supply/main.cpp were tested by running with the .json configuration file missing in either and both default locations. * Change to loadJSONFromFile() in utility.cpp for an invalid file was tested by giving invalid "psu_config.json" file to main program. * Empty file message was tested by changing main() to allow loadJSONFromFile() to be called it when the file did not exist. * Changes to other files were tested by running phosphor-power initialization and manipulating the code to force execution of various error paths. * Methods that are changed but were not directly called by phosphor-power initialization: PMBus::readBit(), PMBus::readBinary() and PMBus::write(). The changed log messages in these were tested by adding calls to them from PMBus::read() and then changing code to force execution through paths that created the log messages.
Signed-off-by: Jay Meyer <jaymeyer@us.ibm.com> Change-Id: I1f0c01716495ac7022d5234e9a8dfdab8195c186
show more ...
|
#
59a35793 |
| 04-Jun-2020 |
Brandon Wyman <bjwyman@gmail.com> |
psu-ng: Add code to set ON_OFF_CONFIG
Add code that sends the appropriate ON_OFF_CONFIG mask for the power supply power on operation.
Tested: Ran gtest using x86sdk Used simulator to change
psu-ng: Add code to set ON_OFF_CONFIG
Add code that sends the appropriate ON_OFF_CONFIG mask for the power supply power on operation.
Tested: Ran gtest using x86sdk Used simulator to change ON_OFF_CONFIG value, restarted service, verified ON_OFF_CONFIG changed. Used i2cget on hardware to change ON_OFF_CONFIG, restarted service, verified ON_OFF_CONFIG changed.
Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Change-Id: Ifd9d63fcd2e86a62b7358e08958b5e2dbd21db9f
show more ...
|
#
8d195771 |
| 27-Jan-2020 |
Brandon Wyman <bjwyman@gmail.com> |
Create PMBusBase class to allow for mocking
Derive the PMBus class from a new PMBusBase class to allow for the use of Google Mock for unit testing. Create an interface to PMBusBase in the phosphor-p
Create PMBusBase class to allow for mocking
Derive the PMBus class from a new PMBusBase class to allow for the use of Google Mock for unit testing. Create an interface to PMBusBase in the phosphor-power-supply code.
Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Change-Id: I6dd8d8a64bdece0d82478450ec83f1aefcae4c75
show more ...
|
#
d1bc4cec |
| 13-Dec-2019 |
Brandon Wyman <bjwyman@gmail.com> |
Update .clang-format to latest version from docs
Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Change-Id: Ie6e7f43e7554429704dca86b21320c90aed18791
|
#
ab093328 |
| 09-Oct-2019 |
Lei YU <mine260309@gmail.com> |
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> Ch
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
show more ...
|
#
9c7897ce |
| 28-Mar-2019 |
Brandon Wyman <bjwyman@gmail.com> |
Cleanup: Use filesystem instead of experimental
The GCC version bump in Yocto 2.6 allows for use of std::filesystem instead of std::experimental::filesystem.
Change-Id: Ibfd6c285bcbd6695e5cd4e3090f
Cleanup: Use filesystem instead of experimental
The GCC version bump in Yocto 2.6 allows for use of std::filesystem instead of std::experimental::filesystem.
Change-Id: Ibfd6c285bcbd6695e5cd4e3090ffa214fc861499 Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
show more ...
|
#
f0f02b9a |
| 25-Oct-2018 |
Matt Spinler <spinler@us.ibm.com> |
Start using .clang-format
Used the one from docs/style/cpp.
Change-Id: I3bdc2b353bf18a437266b362d8205b8463a9ce2b Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
#
fa23e330 |
| 18-Jan-2018 |
Matt Spinler <spinler@us.ibm.com> |
Add support to read binary PMBus data
PMBus::readBinary() can read a sysfs file that contains binary data and returns a vector of bytes representing that data.
Change-Id: I3c729f502e155b007b9ab22a4
Add support to read binary PMBus data
PMBus::readBinary() can read a sysfs file that contains binary data and returns a vector of bytes representing that data.
Change-Id: I3c729f502e155b007b9ab22a4eeefec437f150e1 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
#
fbae7b6c |
| 04-Jan-2018 |
Matt Spinler <spinler@us.ibm.com> |
Add readString PMBus function
This function will return the data read as an std::string.
Change-Id: Idd7afbd9b4c7e602fad3146d941f03366140948b Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
#
4dc4678e |
| 04-Jan-2018 |
Matt Spinler <spinler@us.ibm.com> |
Add PMBus device hwmon debug access type
This can be used to find a file in: /sys/kernel/debug/pmbus/hwmonX/<device type>
For example: /sys/kernel/debug/pmbus/hwmon3/cffps1
Change-Id: Ifd9ae3a58f9
Add PMBus device hwmon debug access type
This can be used to find a file in: /sys/kernel/debug/pmbus/hwmonX/<device type>
For example: /sys/kernel/debug/pmbus/hwmon3/cffps1
Change-Id: Ifd9ae3a58f9097c89ebf80e3e19a180962968f0f Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
#
ba05348f |
| 04-Jan-2018 |
Matt Spinler <spinler@us.ibm.com> |
Add function to get PMBus device name
This will be used in the future to find a path to certain sysfs files.
Change-Id: Ia919b2f954fddf7b97bd1c5025f7c54af942b318 Signed-off-by: Matt Spinler <spinle
Add function to get PMBus device name
This will be used in the future to find a path to certain sysfs files.
Change-Id: Ia919b2f954fddf7b97bd1c5025f7c54af942b318 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
#
ceacf941 |
| 05-Oct-2017 |
Matt Spinler <spinler@us.ibm.com> |
Use Common.Device.Error for device failures
The ReadFailure and WriteFailure errors are now available in Common.Device, and code will now use those instead of the ones in Sensor.Device and Control.D
Use Common.Device.Error for device failures
The ReadFailure and WriteFailure errors are now available in Common.Device, and code will now use those instead of the ones in Sensor.Device and Control.Device, which were meant for sensor errors.
Change-Id: Id15b56ab56f3ee4acee024941840a17b9f5bf9c6 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
#
3b7b38ba |
| 25-Sep-2017 |
Brandon Wyman <bjwyman@gmail.com> |
Add helper function to see if PMBus file exists
Due to some odd power supply behavior on some systems, certain PMBus files in sysfs end up missing. Adding in a helper function to avoid spurious trac
Add helper function to see if PMBus file exists
Due to some odd power supply behavior on some systems, certain PMBus files in sysfs end up missing. Adding in a helper function to avoid spurious tracing if an application so chooses to check for existence before trying to read one of those files. See openbmc/openbmc#2364 issue opened for this problem with the missing files.
Change-Id: Ib295beb7ff1733da6ecbcd6966b76b918ade7f54 Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
show more ...
|
#
aad73e92 |
| 16-Aug-2017 |
Brandon Wyman <bjwyman@gmail.com> |
Add check for hwmon directory existence
For the power supplies, if a power supply is not present, the hwmon subdirectory will not exist. Add in a check for directory existence to avoid a termination
Add check for hwmon directory existence
For the power supplies, if a power supply is not present, the hwmon subdirectory will not exist. Add in a check for directory existence to avoid a termination.
Change-Id: I6e19e381602c2ef619c1e27f5ceacbf92c300cee Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
show more ...
|
#
8f0d953f |
| 21-Aug-2017 |
Matt Spinler <spinler@us.ibm.com> |
Add device debug path to PMBus class
Some devices may also have files in /sys/kernel/debug/<device driver name>.<instance>, so adding a DeviceDebug path type to support that.
The device driver name
Add device debug path to PMBus class
Some devices may also have files in /sys/kernel/debug/<device driver name>.<instance>, so adding a DeviceDebug path type to support that.
The device driver name and chip instance number are then required to be passed in to the constructor.
Change-Id: I301d730a29ac7c2c39198e4eb7125aff70d727dc Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
#
f855e82a |
| 08-Aug-2017 |
Brandon Wyman <bjwyman@gmail.com> |
Add read() function to PMBus
Adding a read() function to PMBus to read one or more bytes of data. A number of errors will require data from the 2 byte STATUS_WORD command, 1 byte from STATUS_INPUT a
Add read() function to PMBus
Adding a read() function to PMBus to read one or more bytes of data. A number of errors will require data from the 2 byte STATUS_WORD command, 1 byte from STATUS_INPUT and various other commands, along with later functions that will require even more bytes of data.
Change-Id: I0433b36254565a124229a5bb884fbebd6ec536fc Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
show more ...
|
#
ff5f339c |
| 11-Aug-2017 |
Brandon Wyman <bjwyman@gmail.com> |
Add handling of /sys/kernel/debug/pmbus path
The STATUS_WORD, STATUS_INPUT, and other status command data will reside under the /sys/kernel/debug/pmbus path. Update PMBus class to handle that path t
Add handling of /sys/kernel/debug/pmbus path
The STATUS_WORD, STATUS_INPUT, and other status command data will reside under the /sys/kernel/debug/pmbus path. Update PMBus class to handle that path type.
Change-Id: I07c91b8c35cf1b6478068417eadd7820620fae42 Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
show more ...
|
#
57868bc5 |
| 03-Aug-2017 |
Matt Spinler <spinler@us.ibm.com> |
Add hwmon support to PMBus class
Add support to allow the class to handle accessing hwmon files even though the device path passed to the constructor wasn't a hwmon path.
This is useful because the
Add hwmon support to PMBus class
Add support to allow the class to handle accessing hwmon files even though the device path passed to the constructor wasn't a hwmon path.
This is useful because the users of this class have to access files in both locations.
For example: PMBus p(basePath);
p.write("myfile", 1, Type::Base) -> writes to basePath/myfile
p.write("myfile", 1, Type::Hwmon) -> writes to basePath/hwmon/hwmonN/myfile where hwmonN is the hwmon dir for the device
Change-Id: Ic66835dace2a9958310c9f4ee8cbcaae3669dd0f Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
#
015e3ade |
| 01-Aug-2017 |
Matt Spinler <spinler@us.ibm.com> |
Add PMBus class
This class provides the interfaces to read PMBus devices via sysfs files.
This commit provides 3 interfaces: 1) Write an integer (to provide: echo 1 > clear_faults) 2) Read a file
Add PMBus class
This class provides the interfaces to read PMBus devices via sysfs files.
This commit provides 3 interfaces: 1) Write an integer (to provide: echo 1 > clear_faults) 2) Read a file that represents a bit in a register. 3) Read a file that represents a bit in a register within a PMBus page (or in something that acts like a page).
Additional ones may be added in the future.
ReadFailure/WriteFailure exceptions will be thrown on errors.
Change-Id: I7ea166da00ddc558a9f25c07e6ad9a16714cc3b6 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|