commit | b6779846d6c14bfafaa5afdc7326788fd7f54774 | [log] [tgz] |
---|---|---|
author | Jayashree Dhanapal <jayashree-d@hcl.com> | Fri Oct 07 13:34:16 2022 +0530 |
committer | Alexander Hansen <alexander.hansen@9elements.com> | Thu Jul 18 11:53:47 2024 +0200 |
tree | 19048145585710febadff85e8005e269f3dbd98e | |
parent | e48bf95d1a64c3a2e08e47afeb05af7a5ffc0b8a [diff] |
Create a new Dbus interface for LED A new Dbus API method is created in the phosphor-led-sysfs repository under xyz.openbmc_project.Led.Sysfs.Internal interface name to add or remove the LED, which will be coming from each udev LED event to create the LED dbus path. xyz.openbmc_project.Led.Sysfs.Internal interface .AddLED method .RemoveLED method This Dbus API method is added to support the multihost physical LEDs design. https://gerrit.openbmc.org/c/openbmc/docs/+/55230 Also support a executable for LED DBUS API method Added a new executable for LED DBUS API method to communicate between udev and application. Executable will call Dbus API method to pass LED name as argument from udev, after the primary service started. Tested : Tested the dbus method is invoked for each LED udev event in Facebook YosemiteV2 platform. Signed-off-by: Jayashree Dhanapal <jayashree-d@hcl.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I3fa6c3caa130b2b71ebc9fe8d69541c029f516ab Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
This project exposes physical LEDs on dbus.
Say we have 'identify' LED in our system, which may be declared in devicetree.
leds { compatible = "gpio-leds"; identify { gpios = <&gpio ASPEED_GPIO(S, 6) GPIO_ACTIVE_HIGH>; }; };
We can start the program
./phosphor-ledcontroller --path /sys/class/leds/identify
which will expose following dbus objects:
busctl tree xyz.openbmc_project.LED.Controller.identify `- /xyz `- /xyz/openbmc_project `- /xyz/openbmc_project/led `- /xyz/openbmc_project/led/physical `- /xyz/openbmc_project/led/physical/identify busctl introspect xyz.openbmc_project.LED.Controller.identify /xyz/openbmc_project/led/physical/identify NAME TYPE SIGNATURE RESULT/VALUE FLAGS ... xyz.openbmc_project.Led.Physical interface - - - .Color property s "xyz.openbmc_project.Led.Physical.Pal... emits-change writable .DutyOn property y 50 emits-change writable .Period property q 1000 emits-change writable .State property s "xyz.openbmc_project.Led.Physical.Act... emits-change writable
In the above output, the usual org.freedesktop.* interfaces have been removed to keep it readable.
Query the LED State
busctl get-property xyz.openbmc_project.LED.Controller.identify \ /xyz/openbmc_project/led/physical/identify \ xyz.openbmc_project.Led.Physical State \ s "xyz.openbmc_project.Led.Physical.Action.Off"
Set the LED State
busctl set-property xyz.openbmc_project.LED.Controller.identify \ /xyz/openbmc_project/led/physical/identify \ xyz.openbmc_project.Led.Physical State s \ "xyz.openbmc_project.Led.Physical.Action.Off"
meson setup build cd build ninja