| commit | a7e2c1e5c1e94246ae55313fc361d30b0e1a6165 | [log] [tgz] |
|---|---|---|
| author | Matt Spinler <spinler@us.ibm.com> | Fri Feb 23 12:18:19 2018 -0600 |
| committer | Matt Spinler <spinler@us.ibm.com> | Mon Feb 26 11:43:15 2018 -0600 |
| tree | 02cd38c7c4c4d25d0610db811c611cd77e7589c2 | |
| parent | 7bd5fcf356d7ba99a3648ad4b905078806fe27ec [diff] |
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>
Exposes generic hwmon entries as DBus objects.
To build this package, do the following steps:
1. ./bootstrap.sh
2. ./configure ${CONFIGURE_FLAGS}
3. make
To full clean the repository again run `./bootstrap.sh clean`.
To enable the use of Linux features like cgroups prioritization and udev/systemd control, one instance of phosphor-hwmon is intended to be run per hwmon sysfs class instance. This requires an algorithm for selecting a stable, well-known D-Bus busname. The algorithm is <PREFIX>-<ID>.Hwmon<N> where PREFIX is an autoconf configurable prefix (BUSNAME_PREFIX, xyz.openbmc_project by default), ID is a std::hash of the /sys/devices path backing the hwmon class instance, and N is the implemented phosphor-hwmon D-Bus API version.