commit | c78e23d6a61c863a57a516e6cbc197b59260c723 | [log] [tgz] |
---|---|---|
author | George Liu <liuxiwei@inspur.com> | Thu Aug 10 15:49:07 2023 +0800 |
committer | George Liu <liuxiwei@inspur.com> | Thu Aug 10 15:59:03 2023 +0800 |
tree | af70b5e1de7727ccbfe01980163284cad3cb0e50 | |
parent | 69e9930aa2012ff5f3016fa602e3cca6978fdb02 [diff] |
phosphor-gpio-presence: Add expected method for CLI11 The Phosph-gpio-presence@.service template has a --drivers and --extra-ifaces which can be empty in some configurations[1]. systemd will end up launching the process with an extra empty argument. CLI11 will fail unless we give an explicit "--drivers=<value> or --extra-ifaces=<value>". Add the expected method to --drivers and --extra-ifaces to limit the number of incoming parameters for parameters. Observed in hardware testing: ``` --drivers: 1 required TEXT missing Run with --help for more information. ``` [1] https://github.com/openbmc/openbmc/blob/master/meta-facebook/meta-bletchley/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/presence-sled1.conf Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Iab8da95d88843652e657933656d9121b43311655
phosphor-gpio-monitor
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.
phosphor-multi-gpio-monitor
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": "FALLING", "Target": "PowerButtonDown.service", "Continue": true }, { "Name": "PowerGood", "LineName": "PS_PWROK", "EventMon": "BOTH", "Targets": { "FALLING": ["PowerGoodFalling.service", "PowerOff.service"], "RISING": ["PowerGoodRising.service", "PowerOn.service"] }, "Continue": false }, { "Name": "SystemReset", "GpioNum": 46, "ChipId": "0" } ]