History log of /openbmc/phosphor-buttons/inc/ (Results 1 – 25 of 27)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
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 ...

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 ...

1a309f7704-Apr-2023 Matt Spinler <spinler@us.ibm.com>

Create a custom power button handler

IBM has specific requirements on how the power button must behave, which
are different than what the button handler currently does.

These requirements are:
If

Create a custom power button handler

IBM has specific requirements on how the power button must behave, which
are different than what the button handler currently does.

These requirements are:
If power is off:
- A button press will power on as long as the BMC is
in the ready state.

If power is on:
- A button press less than 4s won't do anything.
- At 4s, issue a host power off and start a 10s timer.
- If the button is released within that 10s and not pressed
again, continue with the host power off.
- If the button is released within that 10s and also
pressed again in that 10s, do a hard power (chassis)
off.
- If the button is pressed throughout that 10s
issue a hard power off.

Instead of trying to integrate this behavior into the main button
handler code using even more #ifdefs in various spots, this commit
creates the concept of custom power button handlers, and then implements
one. This makes it less likely it could subtly break when changes are
made to the default code.

A 'power-button-handler' meson option is used to select the handler,
where the default uses the current behavior. A
PowerButtonHandlerFactory then creates the appropriate instance of the
handler selected by that option. If a handler is found, then the
default matches/callbacks won't be done and the handler can deal with
them as it sees fit.

Handlers are derived from a PowerButtonHandler abstract base class that
has 2 pure virtual functions:
- void pressed();
- void released(uint64_t pressTimeMS);

It will register for the power button pressed/released signals and then
call these overridden functions appropriately.

This new handler is implemented in a HostThenChassisPowerOff class.

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

show more ...

ccd7db0509-Feb-2023 Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>

Support host selector using cpld definitions

Description:
- Support host selector using cpld definitions

Design:
- Because the current structure only supports config defined by GPIO
(Yosemite V2)

Support host selector using cpld definitions

Description:
- Support host selector using cpld definitions

Design:
- Because the current structure only supports config defined by GPIO
(Yosemite V2), but there are also have the system (Yosemite V3.5)
gets the host-selector's selection from CPLD.

- So this commit is to extend the current configuration to use CPLD
definitions. Also, support adding event io from the register file
which was exported from the CLD driver.

- For example with config json below:
{
"cpld_definitions": [
{
"name": "HOST_SELECTOR",
"i2c_address": 15,
"i2c_bus": 12,
"register_name": "uart-selection-debug-card",
"max_position": 4
}
]
}

Dependency:
- CLD driver is required (link: https://lore.kernel.org/lkml/20230117094425.19004-1-Delphine_CC_Chiu@Wiwynn.com/)

Test Case:
- When ocp debug card uart button is pressed the position property on
dbus is correct.

Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Change-Id: I6746afa6d905bd3c681e2921c643b3cd4cb9944c

show more ...

0d038f5810-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

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

show more ...

395c764c18-Apr-2023 DelphineCCChiu <Delphine_CC_Chiu@wiwynn.com>

Remove power button long-press

So far, counting power button's pressing duration is supported.
There's no need to handle redundant case for button long-press.

Tested:
Press buttons and check corres

Remove power button long-press

So far, counting power button's pressing duration is supported.
There's no need to handle redundant case for button long-press.

Tested:
Press buttons and check corresponding behaviors.

Change-Id: I96d9160a10de6d4572148c55e2b7c2a9221d42e2
Signed-off-by: DelphineCCChiu <Delphine_CC_Chiu@wiwynn.com>

show more ...

e3b4e11f26-Nov-2022 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t

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

show more ...

d219fa3c19-Jul-2022 Naveen Moses <naveen.mosess@hcl.com>

Add serial uart mux interface class

1. This change adds the multi-host serial uart mux interface class.

In a multi-host system when the host position is changed,
then the serial uart mux is configu

Add serial uart mux interface class

1. This change adds the multi-host serial uart mux interface class.

In a multi-host system when the host position is changed,
then the serial uart mux is configured to enable the
respective host's serial console which is accessed via
OCP debug card.

2. Introduced two new methods in gpio.cpp
setGpioState - set state for gpio fd based on polarity
getGpiostate - get state for gpio fd based on polarity

3. Updated the readme file about details on the new gpio
configs

design : https://github.com/openbmc/docs/blob/master/designs/multihost-phosphor-buttons.md

Testing : This change is verified in yosemiteV2 platform.

Signed-off-by: Naveen Moses <naveen.mosess@hcl.com>
Change-Id: I861d70570650d7dfcab842a35bdcf63a9fdd3bd0

show more ...

a6d4e65d13-Apr-2022 Naveen Moses <naveen.mosess@hcl.com>

Add OCP debug card host selector button interface

A new button interface class definition is added for handling OCP
debug card host selector button events.
In case of the button release event, The h

Add OCP debug card host selector button interface

A new button interface class definition is added for handling OCP
debug card host selector button events.
In case of the button release event, The host selector property is
increased up to the max host position.

Design : https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/45544

Signed-off-by: Naveen Moses <naveen.mosess@hcl.com>
Change-Id: Iec8fabb00d1daa10f587981a9c77df8a62e3c373

show more ...

9a529a6922-Jul-2022 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t

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

show more ...

ab8dac5115-Jul-2022 Naveen Moses <naveen.mosess@hcl.com>

Rename handler methods to match dbus signal type

The button handler process has multiple handlers which monitors
for "Released" dbus signal but has handlers named "pressed".
Such handlers has been r

Rename handler methods to match dbus signal type

The button handler process has multiple handlers which monitors
for "Released" dbus signal but has handlers named "pressed".
Such handlers has been renamed to match the signal type.

Signed-off-by: Naveen Moses <naveen.mosess@hcl.com>
Change-Id: Iff77569259df620dba2b04ed64ffc029fd9dee46

show more ...

d6a1bae720-Jun-2022 George Liu <liuxiwei@inspur.com>

meson: Add meson build

The intent behind this commit is build obmc-phosphor-buttons with
meson, and then remove files related to cmake.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ie

meson: Add meson build

The intent behind this commit is build obmc-phosphor-buttons with
meson, and then remove files related to cmake.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Iedf8c49224032e016fed3471e6e41f6055b09065

show more ...

94afa4ba20-Jun-2022 George Liu <liuxiwei@inspur.com>

Fix cppcheck warnings

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I18be21d5141630a1da3d5e54740b54a9a06496d9

5b98f4db20-Jun-2022 George Liu <liuxiwei@inspur.com>

Update clang-format

Refer:https://github.com/openbmc/docs/blob/ac5d544553934f8083c61c5986a1420261bc8a4c/style/cpp/.clang-format

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I593ddf950

Update clang-format

Refer:https://github.com/openbmc/docs/blob/ac5d544553934f8083c61c5986a1420261bc8a4c/style/cpp/.clang-format

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I593ddf950d14009ab77251fd6d3f248214661765

show more ...

3bd1cfcb14-Feb-2022 Naveen Moses <naveen.mosess@hcl.com>

Add Host selector button interface

This change includes new button interface
for the host selector switch.

The button handler code is adapted to support
both single host and multiple host power co

Add Host selector button interface

This change includes new button interface
for the host selector switch.

The button handler code is adapted to support
both single host and multiple host power control
dbus events.

design : https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/45544

Signed-off-by: Naveen Moses <naveen.mosess@hcl.com>
Change-Id: Icbfb22baaee057fd255c3ab0cba129693b913a9d

show more ...

eea8a4a517-Feb-2022 Naveen Moses <naveen.mosess@hcl.com>

Fix parsing gpio config format issue

A recent change was submitted regarding addition of
new gpio config format to support group gpio config and
respective config parser change. This change caused
a

Fix parsing gpio config format issue

A recent change was submitted regarding addition of
new gpio config format to support group gpio config and
respective config parser change. This change caused
app crash for platforms using previous config format.

This is resolved with this fix by adding parser support for
both config formats.

Signed-off-by: Naveen Moses <naveen.mosess@hcl.com>
Change-Id: I891f22515cacc001e4b4690003849a05148c86c2

show more ...

a1af329f15-Dec-2021 Naveen Moses <naveen.mosess@hcl.com>

Add abstract factory to create button iface objects

A abstract factory class is implemented to return
the instance of button interface class based on the
button iface formfactor name provided as
pa

Add abstract factory to create button iface objects

A abstract factory class is implemented to return
the instance of button interface class based on the
button iface formfactor name provided as
parameter to the abstract factory createInstance
method.

Signed-off-by: Naveen Moses <naveen.mosess@hcl.com>
Change-Id: Ia791a2b6f52d09dd87da0e50a709fc72ac9d1bd7

show more ...

dd5495cf03-Dec-2021 Naveen Moses <naveen.mosess@hcl.com>

Enable group gpio configuration

This change adds support to configure single
as well as group gpio config using a single api(configGroupGpio()).
This change is introduced to support the button/input

Enable group gpio configuration

This change adds support to configure single
as well as group gpio config using a single api(configGroupGpio()).
This change is introduced to support the button/input
interfaces which has multiple gpios associated with them.

As an improvement reading of gpio def json file is
done once in main function rather than reading it
everytime before creating the button interface object.

Signed-off-by: Naveen Moses <naveen.mosess@hcl.com>
Change-Id: Ib73dda618c78fd2f14b5d3432fd04c9f4cd2dd9b

show more ...

69f9351226-Nov-2018 Matt Spinler <spinler@us.ibm.com>

button-handler: Add ID button actions

Creates a signal handler for the 'Released' signal.

The handler will toggle the 'Asserted' property in the
LED group defined by the configure file. The defaul

button-handler: Add ID button actions

Creates a signal handler for the 'Released' signal.

The handler will toggle the 'Asserted' property in the
LED group defined by the configure file. The default
group is 'enclosure_identify'. The effect of this is
the LEDs in the group will toggle on or off on each
button press.

Tested: Used the 'simPress' method on the ID button object.

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

show more ...

06a5bddf26-Nov-2018 Matt Spinler <spinler@us.ibm.com>

button-handler: Add reset button actions

Creates a signal handler for the 'Released' signal.

This will reboot the host if it is powered on. If the
system is off, it won't do anything.

As with the

button-handler: Add reset button actions

Creates a signal handler for the 'Released' signal.

This will reboot the host if it is powered on. If the
system is off, it won't do anything.

As with the other buttons, it only installs the watch if
the button object exists.

Tested: Used the 'simPress' method on the reset object
to trigger the signal.

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

show more ...

963c65f326-Nov-2018 Matt Spinler <spinler@us.ibm.com>

button-handler: Add power button actions

Create match handlers for the following power button signals:

1) 'Released'
* If the system is off, then power it on.
* If the system is on, then soft power

button-handler: Add power button actions

Create match handlers for the following power button signals:

1) 'Released'
* If the system is off, then power it on.
* If the system is on, then soft power it off.

2) 'PressedLong' (Really means long press released)
* If the system is on, do an immediate power off.
* If the system is off, do nothing.

It only installs the match objects for these if the power button
object exists on D-Bus. This is done so that systems that don't
implement a certain button won't still have watches on their
signals.

Tested: Pushed buttons and watched the magic happen.

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

show more ...

fb35a32526-Nov-2018 Matt Spinler <spinler@us.ibm.com>

Add button-handler framework

This new application will listen for button press
signals generated by the xyz.openbmc_project.Chassis.Buttons
code and perform the necessary actions, like powering off

Add button-handler framework

This new application will listen for button press
signals generated by the xyz.openbmc_project.Chassis.Buttons
code and perform the necessary actions, like powering off
when the power button is pressed.

This first commit is just the framework, and all of the
functionality will follow.

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

show more ...

b3d86c9f15-Nov-2018 Matt Spinler <spinler@us.ibm.com>

Do dummy GPIO reads on startup

Do a read of all of the button GPIOs after they are configured
but before the sd_event handling has been set up to prevent
a spurious sd_event callback as soon as the

Do dummy GPIO reads on startup

Do a read of all of the button GPIOs after they are configured
but before the sd_event handling has been set up to prevent
a spurious sd_event callback as soon as the event loop starts.

Without these, a button released signal gets sent every time
the application starts.

Tested: Saw that the spurious callbacks went away.

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

show more ...

93894f6e05-Nov-2018 Matt Spinler <spinler@us.ibm.com>

Add long press support to the power button

If the power button has been pressed longer than
LONG_PRESS_TIME_MS, then issue the PressedLong signal
instead of the Released signal.

LONG_PRESS_TIME_MS

Add long press support to the power button

If the power button has been pressed longer than
LONG_PRESS_TIME_MS, then issue the PressedLong signal
instead of the Released signal.

LONG_PRESS_TIME_MS can be changed at compile time.

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

show more ...

8605bdff05-Nov-2018 Matt Spinler <spinler@us.ibm.com>

Only create buttons when their GPIOs are defined

Look in /etc/default/obmc/gpio/gpio_defs.json to see
if the GPIO for a button is defined, and only create
the button object if it is.

This is how a

Only create buttons when their GPIOs are defined

Look in /etc/default/obmc/gpio/gpio_defs.json to see
if the GPIO for a button is defined, and only create
the button object if it is.

This is how a system implementer can specify which
button objects are needed for their particular system.

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

show more ...

12