History log of /openbmc/phosphor-buttons/ (Results 1 – 25 of 98)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
33eb550012-Nov-2025 Colin Huang <colin.huang2@amd.com>

fix reset button not working

meson: fix reset-button-do-warm-reboot not work
button_handler: fix hostNumStr is empty when reset button pressed.

tested: A reset button press works to reset the syste

fix reset button not working

meson: fix reset-button-do-warm-reboot not work
button_handler: fix hostNumStr is empty when reset button pressed.

tested: A reset button press works to reset the system.
A power button press work to power system without process restart.

Test Log:
Confirmed multi-instance power button DBus object paths use PowerN
format, and the multi-action mapping correctly triggers chassis1
power-cycle for the tested press duration.

1) Verify DBus object paths are normalized (no zero-padding)
```
root@bmc:~# busctl tree xyz.openbmc_project.Chassis.Buttons
└─ /xyz
└─ /xyz/openbmc_project
└─ /xyz/openbmc_project/Chassis
└─ /xyz/openbmc_project/Chassis/Buttons
├─ /xyz/openbmc_project/Chassis/Buttons/HostSelector
├─ /xyz/openbmc_project/Chassis/Buttons/Power1
├─ /xyz/openbmc_project/Chassis/Buttons/Power2
├─ /xyz/openbmc_project/Chassis/Buttons/Power3
├─ /xyz/openbmc_project/Chassis/Buttons/Power4
├─ /xyz/openbmc_project/Chassis/Buttons/Power5
├─ /xyz/openbmc_project/Chassis/Buttons/Power6
├─ /xyz/openbmc_project/Chassis/Buttons/Power7
└─ /xyz/openbmc_project/Chassis/Buttons/Power8
```

2) POWER_BUTTON multi-action policy configuration (reference)
```
root@bmc:~# cat /etc/default/obmc/gpio/gpio_defs.json
{
"gpio_definitions": [
{
"name": "POWER_BUTTON1",
"pin": "Q0",
"direction": "both",
"multi-action": [
{
"duration": 0,
"action": "chassis-on"
},
{
"duration": 4000,
"action": "chassis-cycle"
},
{
"duration": 8000,
"action": "chassis-off"
}
]
},
...
```

3) Trigger a synthetic Released signal and confirm the expected
chassis transition
```
root@bmc:~# date && busctl emit \
> /xyz/openbmc_project/Chassis/Buttons/Power01 \
> xyz.openbmc_project.Chassis.Buttons.Power \
> Released \
> t 5089675
Wed Dec 17 18:56:22 PST 2025
```
Observed in journalctl:
```
Dec 17 18:56:22 bmc phosphor-chassis-state-manager[709]:
Change to Chassis1 Requested Power State:
xyz.openbmc_project.State.Chassis.Transition.PowerCycle
Dec 17 18:56:22 bmc systemd[1]: Starting Chassis Power Cycle: 1...
Dec 17 18:56:22 bmc chassis-powercycle[4739]:
Execute chassis1 AC power cycle
Dec 17 18:56:22 bmc chassis-powercycle[4752]:
o "/xyz/openbmc_project/logging/entry/10762"
Dec 17 18:56:22 bmc chassis-powercycle[4739]:
Starting chassis1 AC power cycle
Dec 17 18:56:22 bmc chassis-powercycle[4739]:
Do 12V cycle disable i3c hub
Dec 17 18:56:22 bmc chassis-powercycle[4739]: Slot1 on i3c hub 0.
Dec 17 18:56:22 bmc chassis-powercycle[4739]: Unlock i3c hub register.
Dec 17 18:56:22 bmc chassis-powercycle[4739]: Disable slot1 i3c port.
Dec 17 18:56:22 bmc chassis-powercycle[4762]: 0xE
Dec 17 18:56:22 bmc chassis-powercycle[4739]: Lock i3c hub register.
...
```

Change-Id: Ifea143860e4173d10c2386fa13509a0f935a1b21
Signed-off-by: Colin Huang <colin.huang2@amd.com>
Signed-off-by: Liora Guo <liora.guo.wiwynn@gmail.com>

show more ...

fbd3bd5d09-Oct-2025 Liora Guo <liora.guo.wiwynn@gmail.com>

phosphor-buttons: Fix HostSelector mode logic

Task Description:
This task fixes a issue where power button handlers fail to register
in multi-power button systems when a HostSelector D-Bus object ex

phosphor-buttons: Fix HostSelector mode logic

Task Description:
This task fixes a issue where power button handlers fail to register
in multi-power button systems when a HostSelector D-Bus object exists
for OCP debug card support. The problem occurs because the existing
logic incorrectly assumes that any HostSelector object presence
indicates host selector button mode, preventing proper power button
signal registration in multi-power button configurations.

Motivation:
The current power button handler has two modes:
- Host Selector Button Mode (e.g., Yosemite V2):
Single power button with host selector switch for target host
handling, where hostSelectButtonMode = true
- Multi Power Button Mode (e.g., Yosemite V4):
Each slot/sled has its own power button, where
hostSelectButtonMode = false
However, when HostSelector D-Bus object exists solely for OCP
debug card support (not for power button functionality), the system
incorrectly enters host selector button mode, causing multi-power
button systems to fail registering powerReleased signals.
This results in non-functional power buttons across the platform.

Design:
- Virtual Button Flag: Added virtualButton flag to distinguish
between HostSelector objects used for actual power button control
versus those used for OCP debug card support. The flag is read from
the virtual_button field in the HOST_SELECTOR GPIO configuration.
- Corrected Mode Logic: Modified hostSelectButtonMode calculation
to isHostSelectorExists && !virtualButton, ensuring that
HostSelector objects marked as virtual buttons don't trigger
host selector button mode.
- Unified Signal Registration: Replaced separate single/multi power
button registration logic with a unified approach that dynamically
discovers and registers powerReleased signal handlers for all available
power button interfaces using D-Bus ObjectMapper's GetSubTreePaths.

Test Log(Tested on Yosemite V4):
```
root@bmc:~# cat /etc/default/obmc/gpio/gpio_defs.json | grep -i -E "POWER_BUTTON|HOST_SELECTOR|virtual_button"
"name": "POWER_BUTTON1",
"name": "POWER_BUTTON2",
"name": "POWER_BUTTON3",
"name": "POWER_BUTTON4",
"name": "POWER_BUTTON5",
"name": "POWER_BUTTON6",
"name": "POWER_BUTTON7",
"name": "POWER_BUTTON8",
"name": "HOST_SELECTOR",
"virtual_button": true,

root@bmc:~# systemctl status phosphor-button-handler.service
● phosphor-button-handler.service - Phosphor Button Handler
Loaded: loaded (/usr/lib/systemd/system/phosphor-button-handler.service; enabled; preset: enabled)
Active: active (running) since Wed 2025-11-05 03:09:06 PST; 7s ago
Invocation: 81fd455a960e4c6cb201712d71219cb2
Main PID: 9319 (button-handler)
Tasks: 1 (limit: 1961)
Memory: 324K (peak: 1M)
CPU: 65ms
CGroup: /system.slice/phosphor-button-handler.service
└─9319 /usr/bin/button-handler

Nov 05 03:09:06 bmc button-handler[9319]: hostSelectButtonMode: False
Nov 05 03:09:06 bmc button-handler[9319]: Starting power button handler
Nov 05 03:09:06 bmc button-handler[9319]: Registering power button handler for: /xyz/openbmc_project/Chassis/Buttons/Power01
Nov 05 03:09:06 bmc button-handler[9319]: Registering power button handler for: /xyz/openbmc_project/Chassis/Buttons/Power02
Nov 05 03:09:06 bmc button-handler[9319]: Registering power button handler for: /xyz/openbmc_project/Chassis/Buttons/Power03
Nov 05 03:09:06 bmc button-handler[9319]: Registering power button handler for: /xyz/openbmc_project/Chassis/Buttons/Power04
Nov 05 03:09:06 bmc button-handler[9319]: Registering power button handler for: /xyz/openbmc_project/Chassis/Buttons/Power05
Nov 05 03:09:06 bmc button-handler[9319]: Registering power button handler for: /xyz/openbmc_project/Chassis/Buttons/Power06
Nov 05 03:09:06 bmc button-handler[9319]: Registering power button handler for: /xyz/openbmc_project/Chassis/Buttons/Power07
Nov 05 03:09:06 bmc button-handler[9319]: Registering power button handler for: /xyz/openbmc_project/Chassis/Buttons/Power08

```
Change-Id: Iaf5a6a4fc93522633ac3caa31d63f86a32eb88f5
Signed-off-by: Liora Guo <liora.guo.wiwynn@gmail.com>

show more ...

60dc341d04-Nov-2025 Patrick Williams <patrick@stwcx.xyz>

use sdbusplus unpack syntax

Rather than defining a variable and then reading it from a message,
sdbusplus also supports directly unpack-ing from the message. Use
this syntax instead as it is more e

use sdbusplus unpack syntax

Rather than defining a variable and then reading it from a message,
sdbusplus also supports directly unpack-ing from the message. Use
this syntax instead as it is more efficient and succinct.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I37b8d2921b175f4050623935c0f4bffc0e448c70

show more ...

f075481718-Aug-2025 Matt Spinler <spinler@us.ibm.com>

Enable clang-tidy

Copy in the .clang-tidy from docs/style/cpp.

Change-Id: I944709835562b6599ebfaa5e3e851aa3e48d6630
Signed-off-by: Matt Spinler <spinler@us.ibm.com>

ea47dd4920-Aug-2025 Matt Spinler <spinler@us.ibm.com>

Don't need indexed button name if only 1 chassis

The commit '31ce375 Support multi power buttons with multi behaviors'
created an assumption that the power button name in gpio_defs.json would
always

Don't need indexed button name if only 1 chassis

The commit '31ce375 Support multi power buttons with multi behaviors'
created an assumption that the power button name in gpio_defs.json would
always have a chassis instance number appended to it, and would add an
indexed name as a button factory map key.

That means when ButtonFactor::createInstance() is called with a power
button name without an index, it would not create a PowerButton instance
and button presses wouldn't work.

Instead of changing all of the existing single chassis gpio_defs.json
files in openbmc/openbmc, instead change the factory registration
wrapper code to only register that button as a indexed one if the
provided meson option contains more than 1 chassis.

Tested:
A power button press works to power on the system again.

Fixes: 31ce375e7e71 ("Support multi power buttons with multi behaviors")
Change-Id: I15d02a811aae592adf36c3ac07afd0fc6c15450a
Signed-off-by: Matt Spinler <spinler@us.ibm.com>

show more ...

5f3c2e5b20-Jul-2025 LioraGuo-wiwynn <liora.guo.wiwynn@gmail.com>

hostSelector_switch: add support polling mode

Task Description:
Add support for polling mode to periodically sample the group GPIO
selector inputs and update the HostSelector interface’s Position
pr

hostSelector_switch: add support polling mode

Task Description:
Add support for polling mode to periodically sample the group GPIO
selector inputs and update the HostSelector interface’s Position
property on D-Bus.

Motivation:
-Some platforms expose the host-selector via a CPLD as GPIO inputs
without edge interrupts.
-Polling ensures all position changes are detected reliably.

Design:
- Enabled polling through the 'polling_mode' and 'polling_interval_ms'
options in JSON configuration.
- Introduced pollTimerHandler to periodically check GPIO states
and update the internal host selector position.

Tested:
journalctl -xeu xyz.openbmc_project.Chassis.Buttons.service -f
Jul 31 00:06:47 bmc buttons[629]: Start Phosphor buttons service...
Jul 31 00:06:47 bmc buttons[629]: Started polling mode: 2000ms
Jul 31 00:06:49 bmc buttons[629]: Host selector position updated to 0
Jul 31 00:06:53 bmc systemd[1]: Started Phosphor Buttons.

Jul 31 00:13:50 bmc buttons[629]: Host selector position updated to 1
Jul 31 00:13:52 bmc buttons[629]: Host selector position updated to 2
Jul 31 00:13:54 bmc buttons[629]: Host selector position updated to 3
Jul 31 00:14:00 bmc buttons[629]: Host selector position updated to 4
Jul 31 00:14:04 bmc buttons[629]: Host selector position updated to 5
Jul 31 00:14:10 bmc buttons[629]: Host selector position updated to 6
Jul 31 00:14:14 bmc buttons[629]: Host selector position updated to 7
Jul 31 00:14:16 bmc buttons[629]: Host selector position updated to 8
Jul 31 00:14:20 bmc buttons[629]: Host selector position updated to 0

Change-Id: I8b95d773191f1af03b747f9eeb33494da9878bc8
Signed-off-by: Liora Guo <liora.guo.wiwynn@gmail.com>

show more ...

8854325a22-Jul-2025 Liora Guo <liora.guo.wiwynn@gmail.com>

main: fix group_gpio_config parsing

Fix incorrect parsing of GPIO "pin"/"num" in group_gpio_config.

Motivation:
The code mistakenly accessed "pin"/"num" from the outer gpioConfig
object instead of

main: fix group_gpio_config parsing

Fix incorrect parsing of GPIO "pin"/"num" in group_gpio_config.

Motivation:
The code mistakenly accessed "pin"/"num" from the outer gpioConfig
object instead of from each config entry in group_gpio_config.
When "pin"/"num" only existed in the inner config, this led to
std::out_of_range exceptions at runtime.

Design:
Changed the parsing logic to read "pin"/"num" from each individual
config entry inside group_gpio_config instead of the parent object.

Change-Id: Ie479a336fae5e67c47c458e031a4cb2e9d8954cf
Signed-off-by: Liora Guo <liora.guo.wiwynn@gmail.com>

show more ...

09fbf7f809-Jul-2025 Patrick Williams <patrick@stwcx.xyz>

meson: use non-deprecated systemd packageconfig

Systemd's packageconfig file has both `systemdsystemunitdir` and
`systemd_system_unit_dir` defined. The non-underscore one appears
to be a deprecated

meson: use non-deprecated systemd packageconfig

Systemd's packageconfig file has both `systemdsystemunitdir` and
`systemd_system_unit_dir` defined. The non-underscore one appears
to be a deprecated alias[1]. Move to the non-deprecated /
underscore-separated variant.

[1]: https://github.com/systemd/systemd/commit/4908de44b0a0409f84a7cdc5641b114d6ce8ba03

Change-Id: Iec3e98ac817b29bae0c9810f8bed61a6ff229ac0
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

14c1e96428-Feb-2025 Tan Siewert <tan.siewert@hetzner.com>

readme: fix gpio config example

Commit eea8a4a5 renamed the group config key from `gpio_config` to
`group_gpio_config`. Reading a single GPIO pin is done within the
GPIO definition object.

When usi

readme: fix gpio config example

Commit eea8a4a5 renamed the group config key from `gpio_config` to
`group_gpio_config`. Reading a single GPIO pin is done within the
GPIO definition object.

When using the example, it'll result in a SIGABRT because it fallbacks
to the non-group parsing, expecting either a pin or num:

```
Start Phosphor buttons service...
terminate called after throwing an instance of 'nlohmann::json_abi_v3_11_3::detail::out_of_range'
what(): [json.exception.out_of_range.403] key 'num' not found
```

Tested: Start phosphor-buttons with the new example config does not
result in a SIGABRT.

Fixes: eea8a4a5 ("Fix parsing gpio config format issue")
Change-Id: I3b7ac1363b998ae3f996c78dda45628e707af95a
Signed-off-by: Tan Siewert <tan.siewert@hetzner.com>

show more ...

301edb9503-Mar-2025 Patrick Williams <patrick@stwcx.xyz>

meson: reformat with meson formatter

Apply the `meson format` results.

Change-Id: I97d2b9f5aff45464f71e805baef7d7d4941a286c
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

2fadbcf024-Feb-2025 Vernon Mauery <vernon.mauery@gmail.com>

Update Vernon Mauery email

Change-Id: Ia2d5ad9a33afc93f226d3a23fcfc4f01245ac673
Signed-off-by: Vernon Mauery <vernon.mauery@gmail.com>

efe5092e01-Feb-2025 Patrick Williams <patrick@stwcx.xyz>

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: I9268183de7ea36e1830b7476d6a3782376c5d9ed
Signed-off-by: Patrick Williams <p

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: I9268183de7ea36e1830b7476d6a3782376c5d9ed
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

b20c603805-Feb-2025 Patrick Williams <patrick@stwcx.xyz>

Revert "clang-tidy: Customize Configuration"

This reverts commit d911ede756fa5c57768cc71c6fd1f1a9f44fe1e4.

This "global clang-tidy" was not approved at the project level and is
causing issues. The

Revert "clang-tidy: Customize Configuration"

This reverts commit d911ede756fa5c57768cc71c6fd1f1a9f44fe1e4.

This "global clang-tidy" was not approved at the project level and is
causing issues. These issues are because of wild-card directives that
were already called out in the "docs" review as inappropriate.
Reverting this commit for now to avoid bad signal from clang-tidy.

Change-Id: I3ab657abef251074d48a45e14e18cc4b71711c49
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


d911ede705-Dec-2024 Jayanth Othayoth <ojayanth@gmail.com>

clang-tidy: Customize Configuration

The .clang-tidy file has been updated to align with the recommended
clang-tidy categories for C++ projects in OpenBMC. All recommended
categories are enabled, and

clang-tidy: Customize Configuration

The .clang-tidy file has been updated to align with the recommended
clang-tidy categories for C++ projects in OpenBMC. All recommended
categories are enabled, and failing checks are disabled by prefixing
them with a '-'.

This approach allows to improve coverage by enabling failing checks
and making necessary code changes to fix failures over time.

Tested: Build and unit tests verified.

Change-Id: I54d5a061a1096f6fa5845b806245db9ffd3c2cc0
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>

show more ...

7fcddaf118-Dec-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-19

clang-format-19 isn't compatible with the clang-format-18 output, so we
need to reformat the code with the latest version. A few parameters
in clang-tidy have b

clang-format: re-format for clang-19

clang-format-19 isn't compatible with the clang-format-18 output, so we
need to reformat the code with the latest version. A few parameters
in clang-tidy have been deprecated, so adjust the style file
accordingly.

See Ie2f6eb3b043f2d655c9df806815afd7971fd0947 for updated style.
See I88192b41ab7a95599a90915013579608af7bc56f for clang-19 enablement.

Change-Id: Ib5b2949f5fc7f3aa152f4e7764d602fe46e061be
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

940083bd08-Dec-2024 Jayanth Othayoth <ojayanth@gmail.com>

clang-tidy: Fix override errors

The following errors were reported during the clang-tidy enablement
build due to overridden functions not being marked with the override
keyword. The proposed fix is

clang-tidy: Fix override errors

The following errors were reported during the clang-tidy enablement
build due to overridden functions not being marked with the override
keyword. The proposed fix is to add the override keyword where it
was missing.

'''
inc/serial_uart_mux.hpp:74:10: error: 'handleEvent' overrides a member function but is not marked 'override' [-Werror
'''

Tested: Verified Build and unit testing.

Change-Id: I999968f538650fb4eefd1702fffcbe49d97d5747
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>

show more ...

31ce375e08-Nov-2024 Rush Chen <rush.chen.wiwynn@gmail.com>

Support multi power buttons with multi behaviors

For supporting more-than-one power buttons behaviors,
add new matches and instances by following json config.

This change is for multiple slots inte

Support multi power buttons with multi behaviors

For supporting more-than-one power buttons behaviors,
add new matches and instances by following json config.

This change is for multiple slots integrated on one chassis,
and each slot has button to control power status.

For example:
/xyz/openbmc_project/Chassis/Buttons/Power01 for button on slot1
/xyz/openbmc_project/Chassis/Buttons/Power02 for button on slot2

Moreover, support multi-level power control by json config,
chassis now can do action by corresponding pressing duration.

Tested:
Press buttons and check corresponding behaviors.

Change-Id: I7789f0367d5e846dd9e68f966ba0755fc916217a
Signed-off-by: Rush Chen <rush.chen.wiwynn@gmail.com>

show more ...

4c47d4c928-Oct-2024 Patrick Williams <patrick@stwcx.xyz>

README: fix JSON definition

A JSON blob wasn't formatting properly because it was invalid JSON.
Repair the JSON and reformat.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I048a221

README: fix JSON definition

A JSON blob wasn't formatting properly because it was invalid JSON.
Repair the JSON and reformat.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I048a221ed6e802e39aaf2a7d4d0d93eb97674ca5

show more ...

d36b6b1d16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: Ic25904c3a6dc2d09cc28cabff14e4ba4c8dc8397
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

010035ee17-Jun-2024 Manojkiran Eda <manojkiran.eda@gmail.com>

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://githu

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://github.com/codespell-project/codespell

Change-Id: I7ddcf61ed2d596171384fdb5f0fc1e2feb4240bf
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>

show more ...

971312ab12-Apr-2024 Patrick Williams <patrick@stwcx.xyz>

button: convert long-press time to std::chrono

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ia97dc229b43e32a30e4e57881628ab408896dcfb

3e30b7a612-Apr-2024 Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>

meson: simplify config data

Simplify the meson.build configuration data by removing a number of
entries, which never need to be configured, and move as static fields
in a config.hpp template.

Chang

meson: simplify config data

Simplify the meson.build configuration data by removing a number of
entries, which never need to be configured, and move as static fields
in a config.hpp template.

Change-Id: Idd9383c9c38eceb066a5d1e25a086db175aa06bf
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

15c60e2f12-Apr-2024 Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>

meson: switch config.h to config.hpp

Enable a transition of this file from C to C++ so that we
can use C++ constants instead of #defines in future commits.

Change-Id: I1149ebdaaeb99b7e7974ca846b9b0

meson: switch config.h to config.hpp

Enable a transition of this file from C to C++ so that we
can use C++ constants instead of #defines in future commits.

Change-Id: I1149ebdaaeb99b7e7974ca846b9b07a3399edea0
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

3610608c26-Feb-2024 Patrick Williams <patrick@stwcx.xyz>

lg2: use direct enum conversion

lg2 now has the ability to directly convert enums for which there is
not any other conversion. Leverage that to simplify the code.

Signed-off-by: Patrick Williams <

lg2: use direct enum conversion

lg2 now has the ability to directly convert enums for which there is
not any other conversion. Leverage that to simplify the code.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I22004dacf7171882d8219aa3dd09d87044da4db6

show more ...

cb418b0d16-Jan-2024 Jonico Eustaquio <jonico.eustaquio@fii-na.com>

Adding num key parsing

Currently there is only support for an alphanumeric references that is
decoded into a pin number. The "num" keyword supports using the pin
number directly (integer). The JSON

Adding num key parsing

Currently there is only support for an alphanumeric references that is
decoded into a pin number. The "num" keyword supports using the pin
number directly (integer). The JSON key field determines the parsing.

It matches the support for the "num" keyword for the gpio_defs.json
seen in skeleton/libobmc_intf. If added along with:

https://gerrit.openbmc.org/c/openbmc/skeleton/+/68883

then "num" could be used for systems that have numerically labeled GPIO
pins and have multiple GPIO banks.

Change-Id: Ibf3e432a36c60b650c7f245ee12e5af3a8359664
Signed-off-by: Jonico Eustaquio <jonico.eustaquio@fii-na.com>

show more ...

1234