History log of /openbmc/phosphor-hwmon/targets.hpp (Results 1 – 25 of 26)
Revision Date Author Comments
# 02e598ab 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: Iabfeec3ff53427c317ef9c0b5bf06326ab9a1e17
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 64129937 13-Feb-2024 Patrick Williams <patrick@stwcx.xyz>

prefer std::format over fmt

Since C++20, std::format has existed so prefer that. For the single
fmt::print call we can use stdplus::print until GCC supports the std
one.

Signed-off-by: Patrick Wil

prefer std::format over fmt

Since C++20, std::format has existed so prefer that. For the single
fmt::print call we can use stdplus::print until GCC supports the std
one.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I4c8af58966fb7330dee20fb13ae2ef11d8a823c7

show more ...


# e8771fd4 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: I267a17e007b99caed10aef060e7dd9a0bcc5fc2e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# ad6043f6 22-Jul-2022 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I86dfa77a53a306b0e868eeb82de30b270704c455

show more ...


# 6a391de4 08-Jul-2020 Matt Spinler <spinler@us.ibm.com>

Print the errno from a fail in the journal

When a file access fails, print the errno of the failure in the same
journal entry the filename is already printed.

Signed-off-by: Matt Spinler <spinler@u

Print the errno from a fail in the journal

When a file access fails, print the errno of the failure in the same
journal entry the filename is already printed.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I20d268f563cf1bbfa2a5f9780c02998d075f5275

show more ...


# 5e034afc 24-Jun-2020 Matt Spinler <spinler@us.ibm.com>

Print the failing filename in the journal msg

Instead of hiding the name of the file that had the failed access in the
journal metadata, put it in the journal message so debug is easier.

Uses the f

Print the failing filename in the journal msg

Instead of hiding the name of the file that had the failed access in the
journal metadata, put it in the journal message so debug is easier.

Uses the fmt library.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ice3958ffb576adf0b06ef7eab7d2fc03aa526819

show more ...


# 16805a6a 21-Jun-2019 Patrick Venture <venture@google.com>

mainloop: Make HwmonIO injectable dependency

HwmonIO was make into a interface object implementation. This patch
transitions mainloop to receive a pointer to this interface to allow for
injection t

mainloop: Make HwmonIO injectable dependency

HwmonIO was make into a interface object implementation. This patch
transitions mainloop to receive a pointer to this interface to allow for
injection testing.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Iaa470fafccb42c4d7fbabac0dc92f96c8075faf2

show more ...


# 6206723d 19-Jun-2019 Patrick Venture <venture@google.com>

rename Object type to InterfaceMap

Rename the Object type to InterfaceMap to give it a less opaque name.
The word object is somewhat overloaded.

Signed-off-by: Patrick Venture <venture@google.com>

rename Object type to InterfaceMap

Rename the Object type to InterfaceMap to give it a less opaque name.
The word object is somewhat overloaded.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ie1862450c15c8a8cecf7fcbec3552608d6a20cce

show more ...


# 9e997b4d 08-Mar-2019 Patrick Venture <venture@google.com>

use filesystem instead of experimental

Use filesystem now that it should be available instead of
experimental::filesystem.

Change-Id: I62838b343ce34f85a47661f1eaaff3c7e6338bbf
Signed-off-by: Patric

use filesystem instead of experimental

Use filesystem now that it should be available instead of
experimental::filesystem.

Change-Id: I62838b343ce34f85a47661f1eaaff3c7e6338bbf
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 685efa16 12-Oct-2018 Patrick Venture <venture@google.com>

cleanup: reduced scope of variables

Cppcheck CI tool identified many variables whose scope could be reduced.

Change-Id: I1478b5680adc560d08bc74ffc91929b1d19e24fa
Signed-off-by: Patrick Venture <ven

cleanup: reduced scope of variables

Cppcheck CI tool identified many variables whose scope could be reduced.

Change-Id: I1478b5680adc560d08bc74ffc91929b1d19e24fa
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 043d3230 31-Aug-2018 Patrick Venture <venture@google.com>

add .clang-format

Change-Id: I94ce26d595367e08d6fb3734535bcd855f1b1473
Signed-off-by: Patrick Venture <venture@google.com>


# 50552377 07-Jun-2018 Patrick Venture <venture@google.com>

hwmonio:: Add Interface base class and tests

Enable injecting hwmonio::HwmonIO mocks for testing.

Tested: Ran on quanta-q71l and saw all sensors exported to dbus as
expected with the expected value

hwmonio:: Add Interface base class and tests

Enable injecting hwmonio::HwmonIO mocks for testing.

Tested: Ran on quanta-q71l and saw all sensors exported to dbus as
expected with the expected values.

Change-Id: I35912bf2a733932d9e1e774ff53b0114ae16560b
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 5dc6fe7c 10-May-2018 Joseph Reynolds <jrey@us.ibm.com>

Use s.c_str() in log messages

Resolves openbmc/openbmc#2905

Tested: static_assert only

Change-Id: Iac42db5c4a63116959b8f5fb7b611106e36e51bf
Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>


# 75e56c67 20-Apr-2018 Patrick Venture <venture@google.com>

hwmonio: split IoAccess object out

Split out the hwmon io access object from the sysfs namespace
into its own.

Change-Id: I8d1a45630117d1d503d0d5fa6061163911b695e8
Signed-off-by: Patrick Venture <v

hwmonio: split IoAccess object out

Split out the hwmon io access object from the sysfs namespace
into its own.

Change-Id: I8d1a45630117d1d503d0d5fa6061163911b695e8
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# a24c8808 17-Apr-2018 Patrick Venture <venture@google.com>

move calls to cstdlib::getenv to env::getEnv

Wrapped the cstdlib::getenv() call into env::getEnv
so that it can be tested by mocking the env namespace,
by just dropping in test_env.cpp which impleme

move calls to cstdlib::getenv to env::getEnv

Wrapped the cstdlib::getenv() call into env::getEnv
so that it can be tested by mocking the env namespace,
by just dropping in test_env.cpp which implements those
methods and tying them a singleton upon which we can set
expectations.

Note: regardless of the approach taken to mock this, wrapping
this method is a good fix.

Change-Id: I65d22da08fc3dd76e6860f728c54e6c847ed07de
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 7a5285de 17-Apr-2018 Patrick Venture <venture@google.com>

move getEnv methods into env namespace

Move the getEnv(...) methods into the env namespace,
for consistency.

Change-Id: I4055d9456c17f8b20071cdee1b8e531c10fb0c7e
Signed-off-by: Patrick Venture <ven

move getEnv methods into env namespace

Move the getEnv(...) methods into the env namespace,
for consistency.

Change-Id: I4055d9456c17f8b20071cdee1b8e531c10fb0c7e
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 28f8e66d 26-Mar-2018 Matthew Barth <msbarth@us.ibm.com>

Check TARGET_MODE on target sensors

Move the TARGET_MODE config entry to be done on target specific sensors.

Tested:
Target sensors are still created for the mode given in TARGET_MODE

Change-I

Check TARGET_MODE on target sensors

Move the TARGET_MODE config entry to be done on target specific sensors.

Tested:
Target sensors are still created for the mode given in TARGET_MODE

Change-Id: I7731b73e14495360ccb5b8fb8ada59176e9125d3
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>

show more ...


# a7e2c1e5 23-Feb-2018 Matt Spinler <spinler@us.ibm.com>

Make it possible to choose the target interface

The current code will always try to add a FanSpeed
interface if an <X>_target sysfs file is present, and
a FanPwm interface if a pwm<X> file is presen

Make it possible to choose the target interface

The current code will always try to add a FanSpeed
interface if an <X>_target sysfs file is present, and
a FanPwm interface if a pwm<X> file is present.

For devices that have both types of files, it will
create both interfaces, and since each have a Target
property, it can cause REST calls which get these
properties to return the wrong one, as they can't
select the interface to use.

To fix this, allow a TARGET_MODE environment variable
to be specified to select which target to try to create,
either RPM or PWM. If TARGET_MODE isn't there, default
to the current behavior of creating an interface for
whichever sysfs file type is exposed, so the code doesn't
limit what is created.

Tested: Set TARGET_MODE to RPM and then PWM in the config
file, and ensure only the 1 interface is created.
Remove that entry from the config file, and ensure
it still works as it does today.

Change-Id: I2983e514c86c8d4fb785648520a913339daf6c8f
Signed-off-by: Matt Spinler <spinler@us.ibm.com>

show more ...


# a4bba96e 30-Jan-2018 Lei YU <mine260309@gmail.com>

Add pwm id as fan pwm target

The current code assumes fan and pwm has the same id.

This commit add the support to use pwmX as fan pwm target by
PWM_TARGET_ environment.

E.g.
PWM_TARGET_fan0 = "1"

Add pwm id as fan pwm target

The current code assumes fan and pwm has the same id.

This commit add the support to use pwmX as fan pwm target by
PWM_TARGET_ environment.

E.g.
PWM_TARGET_fan0 = "1"
PWM_TARGET_fan1 = "1"
PWM_TARGET_fan2 = "2"
PWM_TARGET_fan3 = "2"

The above config tells hwmon to set pwm1 for fan0/1's pwm target,
and set pwm2 for fan2/3's pwm target.

Change-Id: Ic1d850ca3d6d20274d905fa9004d7eba2718e9eb
Signed-off-by: Lei YU <mine260309@gmail.com>

show more ...


# 9331ab78 29-Jan-2018 Patrick Venture <venture@google.com>

Add fan pwm interface target

The current daemon only supports RPM-based fan control, whereas the
hwmon interface for PWM is often present. This implements the Fan
Control PWM dbus interface.

This

Add fan pwm interface target

The current daemon only supports RPM-based fan control, whereas the
hwmon interface for PWM is often present. This implements the Fan
Control PWM dbus interface.

This CL is not the complete solution, but if mixed with a follow-on CL
that does this, I think it'll be ideal. For instance, this assumes the
pwm number matches, whereas the other CL lets you specify the
corresponding PWM target for the fan.

Change-Id: I23aaa0619cdefba0a004ac0d26dc6b928e78f1e8
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# b4e6557f 17-Oct-2017 Matt Spinler <spinler@us.ibm.com>

Read fan target sysfs value on startup

When creating the object that represents the
Control.FanSpeed interface for a fan, read the
target fan speed out of sysfs and save it in
the object so it shows

Read fan target sysfs value on startup

When creating the object that represents the
Control.FanSpeed interface for a fan, read the
target fan speed out of sysfs and save it in
the object so it shows up in D-Bus immediately.

Previously the Target property would have a value
of zero until another application wrote it, leaving
a window where the D-Bus property wouldn't match
the underlying sysfs file value.

Change-Id: I08b149840c2cf731bc48f89118622fa63222600e
Signed-off-by: Matt Spinler <spinler@us.ibm.com>

show more ...


# 751043e9 29-Aug-2017 Brad Bishop <bradleyb@fuzziesquirrel.com>

Use hwmonio for attribute IO

Moves disparate error handling scenarios from the method doing the
IO to the call point.

Resolves openbmc/openbmc#2166

Change-Id: I3b6d2e175433dd8b2946ae60381901f2d7ca

Use hwmonio for attribute IO

Moves disparate error handling scenarios from the method doing the
IO to the call point.

Resolves openbmc/openbmc#2166

Change-Id: I3b6d2e175433dd8b2946ae60381901f2d7ca1798
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>

show more ...


# 1e6324fa 01-Jun-2017 Patrick Venture <venture@google.com>

Don't exit program on sysfs read failures.

We have an unreliable fan in one of the test systems and at present if
the sysfs entry is unavailable or returns failure, then the program will
exit. The

Don't exit program on sysfs read failures.

We have an unreliable fan in one of the test systems and at present if
the sysfs entry is unavailable or returns failure, then the program will
exit. The program could be serving many sensors, and any one failure
will cause it to exit. This is true not only when initially creating
the sensors, but also if any sensor read fails at run-time.

Testing: I verified the program logged the failures, which may not
be ideal if there is a buggy sensor, but, I also ran it and managed
to catch it where the sensor wasn't there initially and it cleanly
reported only the sensors that were responsive and didn't just exit.

There is certainly a case to be made for re-scanning periodically if the
sensor returns or there was a timing issue, and there is a separate bug
for that. This commit means only to make the program more robust on
failure.

Change-Id: I310a3e3c0e0ea86e439341a296b741ded18f46f2
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 0a8de645 11-May-2017 Matt Spinler <spinler@us.ibm.com>

Write pwmX_enable for fans that have a fanX_target

For fans that have a fanX_target hwmon sysfs attribute,
write the pwmX_enable on startup to put that fan into
RPM mode, which is safe to do because

Write pwmX_enable for fans that have a fanX_target

For fans that have a fanX_target hwmon sysfs attribute,
write the pwmX_enable on startup to put that fan into
RPM mode, which is safe to do because this application
requires that the target is written in RPMs. The write
will only occur if the pwm_enable file exists.

In the future, if fans with a target need to run in pwm
mode, this code will need to be updated to convert between
RPM and pwm anyway and the pwm_enable value can then
be different based on that.

Resolves openbmc/openbmc#1584

Change-Id: I4f6f3ac8d6651314367aaf5c51ac176220f1fba6
Signed-off-by: Matt Spinler <spinler@us.ibm.com>

show more ...


# 048ac87f 09-Mar-2017 Matthew Barth <msbarth@us.ibm.com>

Update hwmon fan target sysfs entries

Override the default FanSpeed.Target set implementation so when a target
value is written to the FanSpeed interface it is also updated in the
related fan target

Update hwmon fan target sysfs entries

Override the default FanSpeed.Target set implementation so when a target
value is written to the FanSpeed interface it is also updated in the
related fan target sysfs file. This sets a particular fan to the given
target speed.

Resolves openbmc/openbmc#962
Resolves openbmc/phosphor-hwmon#1

Change-Id: I867811737269b3f42d2a0dc15b37782a74f147b8
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>

show more ...


12