Re: [PATCH 1/4] dt-bindings: leds: document property for LED triggers

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

 




On 03/01/2017 10:04 PM, Jacek Anaszewski wrote:
On 02/28/2017 10:51 PM, Rafał Miłecki wrote:
On 02/28/2017 10:38 PM, Jacek Anaszewski wrote:
I think that it would be simpler if we could initially see
a complete sample dts implementation containing all required DT
nodes. The example could contain timer trigger as well as usb-port
trigger specific bindings.

Please take a look at attached patch. I used it on Tenda AC9 with:

usb_trigger: usb-trigger {
    trigger-type = "usbport";
    ports = <&ohci_port1>, <&ehci_port1>;
};

usb {
    label = "bcm53xx:blue:usb";
    gpios = <&chipcommon 1 GPIO_ACTIVE_HIGH>;
    triggers = <&usb_trigger>;
};

OK, I got it, thanks.


I suppose that we should see DT nodes containing #list-cells
properties that define the quantity of phandle arguments.

It seems that this approach allows for defining a list of elements
with variable number of arguments, i.e. what you were initially
asking for.

Are you sure we need #list-cells? Can't we simply use
of_count_phandle_with_args(np, "triggers", NULL);
?

I'm not sure, I just read the function documentation :-)
I haven't verified nor have I used this API.

So we could use #list-cells to support something like:

usb {
	label = "bcm53xx:blue:usb";
	gpios = <&chipcommon 1 GPIO_ACTIVE_HIGH>;
	triggers = <&usb_trigger 1 2>, <&timer_trigger 3 4 5>;
};

but I don't see any need for this. Just specifying triggers like:
triggers = <&usb_trigger>, <&timer_trigger>, <&foo>;
should be always enough, especially with the new trigger nodes you suggested.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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