How to pass a label as an overlay parameter?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Is it possible to pass a label to a device tree overlay as a parameter,
to control where the overlay is inserted in the tree?

I am attempting to use the ledtrig-gpio module[1], which works by
inserting an extra field in an LED definition:

  led_act: led-act {
          label = "ACT";
          gpios = <&gio_aon 9 GPIO_ACTIVE_LOW>;
          default-state = "off";
          linux,default-trigger = "mmc0";  // change to "gpio"
          trigger-sources = <&gpio 0 0>;   // new field added
  };

While I can successfully write an overlay that does these two things
(adds the extra trigger-sources line, and sets the trigger to "gpio")
my problem is that I am not sure how to tell the overlay where to
insert itself.

I am trying to write a generic overlay, such that it accepts parameters
for both the trigger-sources value, as well as the LED structure where
this value should be inserted.

The problem is that it seems you have to use a label (e.g. "led_act" in
the above example) as the insertion point for the overlay, however I am
not sure how to specify this as an overlay parameter.  This is because
the user of the overlay may want to insert the code for led_pwr,
led_act, or one of the nodes added by the led-gpio overlay, so there is
no fixed label or path for the insertion point.

As an aside, I am also wondering how one might link up this LED trigger
with say a USB keyboard, where the LED devices are not created until
much later in the boot process.  In this case the trigger would have to
be associated with an LED device in userspace, but the module doesn't
seem to be set up to create LED triggers in isolation that aren't
pre-attached to LEDs.

However for now, is it possible to specify the label or LED DT node as
a parameter to an overlay?  I read the documentation at [2] but it
doesn't seem to list these as parameter types, and I am not sure if it
can be done as a string parameter.

Many thanks,
Adam.
(Please CC, not subscribed)

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/leds/trigger/ledtrig-gpio.c?id=4a11dbf04f31c71eb458c062129e95b7aa308464
[2]: https://github.com/raspberrypi/documentation/blob/develop/documentation/asciidoc/computers/configuration/device-tree.adoc




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux