commit | 3b7f4fa427d1926d28d09aa9ecb4bc6e66256c9e | [log] [tgz] |
---|---|---|
author | Payne Yang <pyang4@lenovo.com> | Fri Jan 17 10:48:59 2020 +0800 |
committer | Payne Yang <pyang4@lenovo.com> | Fri Jan 17 10:54:11 2020 +0800 |
tree | fb7da7d52965e95cc45af5d37fe9cb85d78411e1 | |
parent | 43dd2d8a025ca9f3df4dd58dd7e4ecf6fa1b6634 [diff] |
Enable restart for gpio monitor 1. Additional restart service setting to avoid GPIO service stop as it is crashed. - Restart=no + Restart=always + RestartSec=5 Tested: It has been tested on system with openbmc Signed-off-by: Payne Yang <pyang4@lenovo.com> Change-Id: Idd332dda4b2c8391fd9c2ba1844a1c69b55b8e76
This daemon accepts a command line parameter for monitoring single gpio line and take action if requested. This implementation uses GPIO keys and only supports monitoring single GPIO line, for multiple lines, user has to run this daemon seperately for each gpio line.
This daemon accepts command line parameter as a well-defined GPIO configuration file in json format to monitor list of gpios from config file and take action defined in config based on gpio state change. It uses libgpiod library.
New implementation (phosphor-multi-gpio-monitor) provides multiple gpio line monitoring in single instance of phosphor-multi-gpio-monitor running. It is very easy to add list of gpios into JSON config file and it also supports of GPIO line by name defined in kernel.
There is a phosphor-multi-gpio-monitor.json file that defines details of GPIOs which is required to be monitored. This file can be replaced with a platform specific configuration file via bbappend.
Following are fields in json file
[ { "Name": "PowerButton", "LineName": "POWER_BUTTON", "GpioNum": 34, "ChipId": "gpiochip0", "EventMon": "BOTH", "Continue": true }, { "Name": "PowerGood", "LineName": "PS_PWROK", "EventMon": "FALLING", "Continue": false }, { "Name": "SystemReset", "GpioNum": 46, "ChipId": "0" } ]