summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add PWM device node override option in RPM mode04-16-2019Raptor Engineering Development Team2019-05-101-0/+12
|
* Add new RAWPWM environment variable to set direct PWM mode independent of ↵Raptor Engineering Development Team2019-05-101-0/+9
| | | | _enable nodes
* Add frequency capability to hwmon publisherRaptor Engineering Development Team2019-04-192-1/+5
|
* Increase raw fan control steps to avoid fan huntingRaptor Engineering Development Team2019-04-191-1/+1
|
* Enable raw PWM control mode for systems without known fan typesRaptor Engineering Development Team2019-04-192-2/+33
|
* Use std::filesystem::path::relative_path()Matt Spinler2019-04-162-19/+6
| | | | | | | Use that function instead of making a relative path manually. Change-Id: I64908353295a10af09baa91bab5d1c3a0152e994 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* build: install into bin instead of sbinPatrick Venture2019-03-281-1/+1
| | | | | | | Installs into bin instead of sbin per guidelines. Change-Id: I298c17fb2bf6fcb6a949624f8bb2475f3878545f Signed-off-by: Patrick Venture <venture@google.com>
* build: enable valgrindPatrick Venture2019-03-212-0/+12
| | | | | | | Enable valgrind to check memory usage. Change-Id: I73ec2ee1a92e797ea9b78d6ea440f9ccdd2f49f3 Signed-off-by: Patrick Venture <venture@google.com>
* flip error and help message on failurePatrick Venture2019-03-211-2/+1
| | | | | | | Flip the error and help message on failure. Change-Id: Ib75d6df87a37411edd7283fdf7785e8d56e417ea Signed-off-by: Patrick Venture <venture@google.com>
* swap out getopts for cli11Patrick Venture2019-03-215-129/+26
| | | | | | | | | Swap out getopt for cli11 for parsing parameters. Tested: Verified on quanta-q71l-variant that phosphor-hwmon started as before. Change-Id: Ic0137432afd254b77133842b5d73a5bab1e415aa Signed-off-by: Patrick Venture <venture@google.com>
* build: enable code coveragePatrick Venture2019-03-195-7/+73
| | | | | | | | | Enable code coverage for the project. Valgrind not enabled in this step. Tested: Verified code coverage step now running. Change-Id: Ieb3606e5ad741fb0dd181f8da594c18258efa6bc Signed-off-by: Patrick Venture <venture@google.com>
* Don't std::filesystem::path::/= an absolute pathMatt Spinler2019-03-152-4/+16
| | | | | | | | | | | Unlike std::experimental::filesystem::path, with std::filesystem::path, the /= operator will turn an append of an absolute path (starts with a '/') into a '='. So, ensure the paths aren't absolute. Change-Id: Ie8fb9d056042e277415e8ea0eb29d094a2665611 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* use filesystem instead of experimentalPatrick Venture2019-03-116-18/+9
| | | | | | | | Use filesystem now that it should be available instead of experimental::filesystem. Change-Id: I62838b343ce34f85a47661f1eaaff3c7e6338bbf Signed-off-by: Patrick Venture <venture@google.com>
* test: rework gtest/gmock lookupPatrick Venture2019-03-062-22/+73
| | | | | | | Rework the gtest/gmock lookup based on openbmc/gpioplus. Change-Id: Ic53928e6f8b7a30e801976d62c910fe31bd4cc49 Signed-off-by: Patrick Venture <venture@google.com>
* test: rework to use Pair-wise comparisonPatrick Venture2019-03-061-19/+29
| | | | | | | Use Pair-wise comparison instead of straight equality check. Change-Id: I3aa567015bfbd81578275fc0edf1ef785fde7678 Signed-off-by: Patrick Venture <venture@google.com>
* Cleanup _gitignorePatrick Venture2019-03-061-16/+39
| | | | | | | Cleanup the .gitignore file, and add some new pieces for code coverage. Change-Id: I26c961956b07b51018c7edc50459bf2fe09541fc Signed-off-by: Patrick Venture <venture@google.com>
* build: pkg anti-pattern: use defaultsPatrick Venture2019-02-131-30/+5
| | | | | | | | Use the defaults in the pkg check where the default error message is sufficient to identify which package is missing. Change-Id: Iad7753b8e6a80307ad57a9a6dd2d442ec7fe0e67 Signed-off-by: Patrick Venture <venture@google.com>
* test: add adjustvalue testPatrick Venture2019-01-251-0/+35
| | | | | | | | Add a test that calls adjust value on a sensor value to verify it's processed as expected. Change-Id: Iff299efced680c730d7ba5bdeff71617446db042 Signed-off-by: Patrick Venture <venture@google.com>
* sensor: set scale to 0 in constructorPatrick Venture2019-01-251-1/+1
| | | | | | | | The _scale member will not be used without ::addValue() being called first, however, initialize it regardless to 0. Change-Id: I712e9192500a8a58db03bcbbaf0f0d736f1dfd23 Signed-off-by: Patrick Venture <venture@google.com>
* build: cleanup configure script PKG_CHECK_MODULESPatrick Venture2019-01-141-23/+98
| | | | | | | | | Cleanup the configure script package include lines. There isn't a set style for this yet, but this is an attempt to improve readability whereas it's often one long line per library. Change-Id: I9df8c9384b54bba30bb49193ee2dd6e532f99249 Signed-off-by: Patrick Venture <venture@google.com>
* sensor: add gpio handle test variationPatrick Venture2019-01-092-2/+47
| | | | | | | Add a sensor constructor test where the gpio handle is required. Change-Id: I05050fb71a6287183ca94f974e965e3f58de9499 Signed-off-by: Patrick Venture <venture@google.com>
* sensor: add underscore prefix to membersPatrick Venture2019-01-092-39/+41
| | | | | | | Add underscore prefix to members for sensor object. Change-Id: I5b59f9f45cc20bd700940bc3b0e5d2d4127b333d Signed-off-by: Patrick Venture <venture@google.com>
* test: add gpiohandle mock implPatrick Venture2019-01-025-6/+50
| | | | | | | Add gpio handle mock implementation for use in testing. Change-Id: I0fb2d1af4739ad700f62a4e7cbbe62db528bb93e Signed-off-by: Patrick Venture <venture@google.com>
* test: add tests for creating sensor objectsPatrick Venture2019-01-022-1/+65
| | | | | | | Add a variety of tests for different sensor constructor scenarios. Change-Id: I859a9473e3c80fb06b0ae15f0eeb8217ee390b11 Signed-off-by: Patrick Venture <venture@google.com>
* test: add environment mock implPatrick Venture2019-01-022-0/+71
| | | | | | | Add environment mock implementation for use in testing. Change-Id: I5a8efe994692a2e4436bf7f3c0155516d92b49c6 Signed-off-by: Patrick Venture <venture@google.com>
* SensorSet: add underscore prefix to membersPatrick Venture2019-01-022-4/+4
| | | | | | | Add underscore prefix to members for SensorSet object. Change-Id: Ibd6d5f2d18f3a730d847d09ffead3b752ef7dd4c Signed-off-by: Patrick Venture <venture@google.com>
* fan_speed: add underscore prefix to membersPatrick Venture2019-01-022-15/+15
| | | | | | | Add underscore prefix to members for fan_speed object. Change-Id: I9a3c444fe31ffc4f15e15eefc15dc652d3b209f1 Signed-off-by: Patrick Venture <venture@google.com>
* fan_pwm: add underscore prefix to membersPatrick Venture2019-01-022-9/+10
| | | | | | | Add underscore prefix to members for fan_pwm object. Change-Id: Ic90d20b6e3881e8b7efe08fde3a08607d7bc6a38 Signed-off-by: Patrick Venture <venture@google.com>
* hwmonio: add underscore prefix to membersPatrick Venture2019-01-022-5/+5
| | | | | | | Add underscore prefix to members for hwmonio object. Change-Id: Iab5aed5ddba3b1793bb16b0f1501a11ff95b7f35 Signed-off-by: Patrick Venture <venture@google.com>
* mainloop: add underscore prefix to membersPatrick Venture2019-01-022-42/+42
| | | | | | | | | | Most members of mainloop object have an underscore prefix. For consistency add this prefix to all members. The discussion within OpenBMC pertaining to prefixes and suffixes for member variables indicates there is latitude within a repository. Change-Id: Ifce915923b9b8c58a433f334d45e19143b7b734f Signed-off-by: Patrick Venture <venture@google.com>
* sensor: to enable testing receive hwmonio interface pointerPatrick Venture2018-12-193-10/+13
| | | | | | | | | The sensor objects all share a reference to the mainloop's ioAccess object. To enable testing, the sensor object needs to expect the base pointer to this object. Change-Id: I1d7f2841528776c8d4f1166e20874ddeb4b8554a Signed-off-by: Patrick Venture <venture@google.com>
* build: drop extra checkPatrick Venture2018-11-261-2/+1
| | | | | | | | Drop an extra check for a specific sdbusplus header file after checking for the library. Change-Id: If20864a1998434ae9de0689e324ddf7c6406777d Signed-off-by: Patrick Venture <venture@google.com>
* mainloop: Include <cassert>William A. Kennington III2018-11-061-0/+1
| | | | | | | | We are currently relying on sdbusplus implicitly including cassert for us. Since we use assert(), depend on the header providing it. Change-Id: Idb771e74d5c0d5bdb0d82455dfd9d2e1a8b6b6ef Signed-off-by: William A. Kennington III <wak@google.com>
* cleanup: add const to read-only iteratorsPatrick Venture2018-11-021-2/+2
| | | | | | | Add const to read-only iterators. Change-Id: I848ec6a9558781fc193e19efa63494ec0cea3f46 Signed-off-by: Patrick Venture <venture@google.com>
* timer: Remove in favor of sdeventplus/timerWilliam A. Kennington III2018-10-265-184/+9
| | | | | | | | Lets use the new standard event loop timer utility that comes with sdeventplus instead of the one copied from other projects. Change-Id: Ie7c8f462f2c0e2e05ce14da58b30a1f91acbf75d Signed-off-by: William A. Kennington III <wak@google.com>
* Make hwmon work with double or int64 interfaceJames Feist2018-10-225-20/+71
| | | | | | | | | | | | | | Deduce type based on interface using decltype and if it is double apply scale to the value. Tested-by: Noticed that on dbus using busctl and debug server that doubles were produced and scaled. Also verifed that hwmon still produced int64_t values when building with current phosphor-dbus-interfaces. Change-Id: I00e21d5ef0ea6cee0eb30baa0b39cde95e7f4a86 Signed-off-by: James Feist <james.feist@linux.intel.com>
* mainloop: Use sdeventplusWilliam A. Kennington III2018-10-184-11/+13
| | | | | | | Convert to using sdeventplus instead of sd_event directly. Change-Id: Ie8ee25c2d75ac4c56b88fb79f70eaa53c4f7b6e4 Signed-off-by: William A. Kennington III <wak@google.com>
* Remove old experimental includesWilliam A. Kennington III2018-10-185-17/+15
| | | | | | | | We are now using c++17 so we no longer need experimental optional and any. We can use the standard any and optional now. Change-Id: I88fcb4258c69ac5ad9766e2c65463c52a3b7f05f Signed-off-by: William A. Kennington III <wak@google.com>
* sysfs: transition to std::find_ifPatrick Venture2018-10-131-6/+8
| | | | | | | | [sysfs.cpp:228]: (style) Consider using std::find_if algorithm instead of a raw loop. Change-Id: Ie07ca5e32405fc7d27e85936377cec44291d3f94 Signed-off-by: Patrick Venture <venture@google.com>
* cleanup: reduced scope of variablesPatrick Venture2018-10-124-11/+12
| | | | | | | Cppcheck CI tool identified many variables whose scope could be reduced. Change-Id: I1478b5680adc560d08bc74ffc91929b1d19e24fa Signed-off-by: Patrick Venture <venture@google.com>
* Use gpioplus for specifying gpio gatingPatrick Venture2018-09-217-4/+145
| | | | | | | | | | | | | | | | | | | | | A GPIO can control whether a hwmon sensor is readable. This module allows one to specify whether a sensor is gated and by what GPIO. This is often the case for battery voltages, such that the battery isn't drained constantly by being left open. For each sensor where you need GPIO locking: GPIOCHIP_in1=0 GPIO_in1=53 such that GPIOCHIP is the gpiochip: /sys/bus/gpio/devices/gpiochip{id} such that GPIO is the line offset. the value used to unlock the sensor via gpio is 1 after 1 is written to the gpio, it pauses for 500ms Tested: Verified the failure case for invalid gpio fields. Verified correct behavior on two platforms. Change-Id: I2fa12848972075cad0e0f69c0bfa6382e15d4f50 Signed-off-by: Patrick Venture <venture@google.com>
* .gitignore: added unittest logging outputPatrick Venture2018-09-181-0/+5
| | | | | | | Added an ignore line for the unit-test generated output. Change-Id: Ib6c2d1e6b01a67b9c4cbdfd35c421a4ab5c6f632 Signed-off-by: Patrick Venture <venture@google.com>
* Build as c++17Patrick Venture2018-09-141-1/+1
| | | | | | | Set configure.ac to attempt to build with c++17. Change-Id: Ie09177e5de43bb1789befbb32678b802c1959bd2 Signed-off-by: Patrick Venture <venture@google.com>
* minor cleanup: remove unused c headerPatrick Venture2018-09-111-5/+6
| | | | | Change-Id: I562aad32f8b860fc954773428e6a929759c694d3 Signed-off-by: Patrick Venture <venture@google.com>
* clang-format: fix pointer alignment, sort usingPatrick Venture2018-09-042-10/+10
| | | | | Change-Id: Ia1b19aeba59b2f680b62ce3855e929b9ad77377a Signed-off-by: Patrick Venture <venture@google.com>
* hwmon: revert alignment change and fix-upPatrick Venture2018-09-041-4/+9
| | | | | | | Using clang-format off/on instead of INDENT-OFF/ON. Change-Id: If4ecec970cfc456f8461c42e03159df29b4e8542 Signed-off-by: Patrick Venture <venture@google.com>
* add .clang-formatPatrick Venture2018-08-3133-1141/+1023
| | | | | Change-Id: I94ce26d595367e08d6fb3734535bcd855f1b1473 Signed-off-by: Patrick Venture <venture@google.com>
* fan_pwm: Commit fan PWM value regardless of previous target.Kun Yi2018-06-271-34/+31
| | | | | | | | | | | | | | | Failure scenraio: set fan pwm => set fan auto => set fan pwm to the same value. DBus value would stay the same but the actual pwm value is already changed. Fix is to always commit the value to sysfs. Tested: Unit tests pass. Tested on hardware that setting DBus value on DBus always makes a pwm sysfs write. Change-Id: I8e2c22dd514543e10c9302c1adb0403ba6883a91 Signed-off-by: Kun Yi <kunyi731@gmail.com>
* update configure and test/Makefile.amPatrick Venture2018-06-272-6/+6
| | | | | | | | Update configure.ac and test/Makefile.am to properly handle newer googletest, per gerrit/11203. Change-Id: I13563216784389d0a32f802daf23d75658e0288e Signed-off-by: Patrick Venture <venture@google.com>
* Add SensorSet class doxygen commentsMatt Spinler2018-06-191-0/+38
| | | | | Change-Id: Ie484a7add85bef4098571432c9b760245cbee8b8 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
OpenPOWER on IntegriCloud