summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* build: pkg anti-pattern: use defaultsHEADmasterPatrick Venture2019-02-131-5/+5
| | | | | | | | Use the defaults in the pkg check where the default error message is sufficient to identify which package is missing. Change-Id: If3a19a3857645dc36d48b3d849d1d6a222a8cfbb Signed-off-by: Patrick Venture <venture@google.com>
* gpio: Fix missing cassertWilliam A. Kennington III2018-11-121-0/+1
| | | | | | | | This file is relying on assert() being transitively provided by sdbusplus. Fix the includes. Change-Id: Ia081478eb55a90bf5af541a4b16124dcfb224a13 Signed-off-by: William A. Kennington III <wak@google.com>
* Add clang-format to repoPatrick Venture2018-11-0119-678/+750
| | | | | | | Add clang-format to repo. Change-Id: I3f8704d80dd0bdde0706ab189c68cffe6d347995 Signed-off-by: Patrick Venture <venture@google.com>
* cleanup: use const reference passing stringPatrick Venture2018-10-141-1/+1
| | | | | | | | [presence/main.cpp:21]: (performance) Function parameter 'driverString' should be passed by const reference. Change-Id: I024e1622b03a3f2ac3487051bdd8f7e3b403639d Signed-off-by: Patrick Venture <venture@google.com>
* phosphor-gpio-monitor: use c++17Vernon Mauery2018-10-041-1/+1
| | | | | | | Update configure.ac to choose the c++17 standard Change-Id: Ie68586622ec8802ce1421dbbcfe8ec6a6f695df0 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Spelling fixesGunnar Mills2018-08-141-1/+1
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: Ic396413f5bc7d9fc45e1042870634ea13185ae03 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Use s.c_str() in log messagesJoseph Reynolds2018-05-302-2/+2
| | | | | | | | | Partly Resolves openbmc/openbmc 2905 Tested: static_assert only Change-Id: I16db5b66bf5a26558a2ed0c1617ef5466dadefea Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
* Add MAINTAINERS fileAndrew Jeffery2018-05-191-0/+45
| | | | | Change-Id: I15c1f6c0991927e51fa7c78bcb851ade8a8a3049 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* Make --continue as no_argumentLei YU2018-04-191-2/+2
| | | | | | | | | | | | This is an improvement for the previous commit, that make --continue option as no_argument. Tested: phosphor-gpio-monitor is able to run with or without --continue argument, and it it continues to run after key press with this argument. Change-Id: I6f9dc5423e19eace366e382a2408dd143a124915 Signed-off-by: Lei YU <mine260309@gmail.com>
* Add --continue argumentLei YU2018-04-125-9/+31
| | | | | | | | | | | | | | | | | | | | The monitor will exit when key is pressed. Add --continue argument and if it is set to "true", the monitor will continue after key is pressed. This is useful in cases to monitor a button presses. E.g. It can be used to monitor ID button and start a system unit everytime when the button is pressed. This argument is optional so it does not break the current code. Tested: With "--continue=true", the monitor does not exit when the key is pressed. Without the argument of if it is set to other strings, the monitor exits after the key is pressed. Change-Id: I4f2ca16d7b26e10397181c83c2c5947ed5ce091f Signed-off-by: Lei YU <mine260309@gmail.com>
* Spelling fixesGunnar Mills2018-04-082-2/+2
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: I726975922b185adefa65010ff60c391f143570ba Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Spelling fixesGunnar Mills2017-10-251-1/+1
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: I7d8bec30c823f0d73bbab748069edc6b1eb92ecc Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* gpio-presence: Pass drivers in to applicationMatt Spinler2017-09-082-2/+63
| | | | | | | | | With the optional --drivers argument, pass in the path/device pairs to bind/unbind. That string will be parsed, and then passed into the Presence class. Change-Id: I1ac0e005de673a679dcb45e93bcac35fddf24d01 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* gpio-presence: Add function to bind/unbind driversMatt Spinler2017-09-054-4/+90
| | | | | | | | | | | | | | | The cards that this app is doing presence detection for may have devices with drivers that need to be bound and unbound when the card is added and removed, respectively. The drivers to do this to will be passed into the app on startup (in a future commit). Then when presence detect changes the proper binds/unbinds will be done. This commit adds the code in the Presence class to do so. Change-Id: I32827e45b88ddb7586aba6b819cc591b49aa9c51 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fix test/Makefile.am formatGunnar Mills2017-07-281-6/+27
| | | | | Change-Id: I9448382ccddd0307d20ad52b0d1a5a108b092906 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Fix Makefile.am formatGunnar Mills2017-07-281-14/+16
| | | | | Change-Id: Ia1cd28328a95f8c9ab7672ee2eab200be7829631 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Refactor GPIO Monitor classGunnar Mills2017-07-286-139/+16
| | | | | | | | Refactor the GPIO Monitor class to use a common class, Evdev, to inherit from. Evdev does the basic libevdev handling. Change-Id: I427aa9720b0bbbea0284c0babcc03ece92e55f5e Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Refactor GPIO Presence classGunnar Mills2017-07-275-129/+212
| | | | | | | | | Refactor the GPIO Presence class to use a common class, Evdev, to inherit from. Evdev does the basic libevdev handling. A later commit moves monitor.hpp to this common class as well. Change-Id: I3c872680c88f8f400fefe3af49eb9b84c7491ceb Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Monitor for GPIO state changeGunnar Mills2017-07-263-3/+157
| | | | | | | | Use libevdev to monitor for GPIO state change and update item present accordingly. Change-Id: I1959a5ea09a7570c096b05d78a190394767a5ddd Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Update inventory item interfaceGunnar Mills2017-07-263-2/+141
| | | | | | | | Update the inventory item interface, setting Present and PrettyName. Change-Id: I6a0a8bd66a8427253706b2b1ee14dca919d0a809 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Read GPIO key on startupGunnar Mills2017-07-264-2/+153
| | | | | | | | | | | Create class Presence which will be responsible for determining and monitoring presence of inventory items and updating D-Bus accordingly. With this commit class Presence only reads the GPIO key on startup, more to come later. Change-Id: I647ae11d42a813a103e6d9d8922fd0f5b2155132 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add base support for GPIO presenceGunnar Mills2017-07-258-2/+185
| | | | | | | This is the starting code needed to build the application. Change-Id: I46112a222afbc057ac4fc4f8fb2b4c83822023df Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Fix incorrect initialization of evdevVishwanatha Subbanna2017-06-193-7/+11
| | | | | | | Fixes openbmc/openbmc#1799 Change-Id: I81662ede88d1a05db48686ec57aab969c8dea27a Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Fill in gpio-util functionalityMatt Spinler2017-05-304-0/+340
| | | | | | | | | Process the command line arguments to know which GPIO to set and what to set it to. Then create the GPIO object and call the appropriate functions on it. Change-Id: Ib8da78e5ae92e5ae0716901aa71243226668be10 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add GPIO classMatt Spinler2017-05-305-1/+231
| | | | | | | | | | | | | | | | This class is used for accessing a GPIO via the /dev/gpiochipX interface. It requests a GPIO line handle from the GPIO device to do the actual operation on. The GPIO number to use, for AST chips at least, is the actual GPIO number, such as GPIOA0 = 0 and GPIOA7 = 7. The class currently only supports writes. Change-Id: I1c2ae38c23c5db502d5f14bcf9aa2e35094f1e9b Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Create phosphor-gpio-util frameworkMatt Spinler2017-05-255-5/+34
| | | | | | | | | | | | This application can write GPIOs. Read support may be added in the future. Aside from just setting a GPIO low or high, it can also do: 0 -> <delay> -> 1 or 1 -> <delay> -> 0. All functionality will be added in future commits Change-Id: I2d3c761eb909ddce3952bfb3173ce271f03544ba Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Use libevdev for monitoring GPIO state changeVishwanatha Subbanna2017-04-275-29/+107
| | | | | Change-Id: I962af3034586f027e6ba74387dcda6ef0cf3672e Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add gitignoreVishwanatha Subbanna2017-04-271-0/+49
| | | | | Change-Id: If41f0e682c5bed72700b5340a758cdb28d1dafc4 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add gtest cases to test callback handlerVishwanatha Subbanna2017-04-274-2/+159
| | | | | Change-Id: If6c1e1616bcf73441648c8e0cb20017a4b218f70 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Call defined target when GPIO line is assertedVishwanatha Subbanna2017-04-275-6/+71
| | | | | Change-Id: Ia5445a8d6585acfec69783ba158c8d866d526e97 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add sd_event loop and callback handlerVishwanatha Subbanna2017-04-275-7/+106
| | | | | Change-Id: I032d1156be2b8082fdf347a60ec883a9bc0038ae Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Populate the file descriptor for the deviceVishwanatha Subbanna2017-04-266-2/+169
| | | | | | | | | | | On a GPIO chip, there could be many gpio lines and for each line, there would be a corresponding input device event file. To know the assertion state of a GPIO line, a descriptor is needed. This descriptor will later be plugged into sd_event so that the GPIO state changes can be caught and handled. Change-Id: Idc8c2b429688fea2a5124b96677085b1be48128b Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add code to accept command line argumentsVishwanatha Subbanna2017-04-266-0/+269
| | | | | | | | | Accepts command line arguments for path, interested GPIO transition and an optional systemd unit file to be called into when the GPIO transitions per expectation. Change-Id: I98d967d36cfbb768bc9d0dd04517575fa7e408fe Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Initial commitPatrick Williams2017-04-031-0/+201
OpenPOWER on IntegriCloud