From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacek Anaszewski Subject: Re: [PATCH 1/4] dt-bindings: leds: document property for LED triggers Date: Mon, 6 Mar 2017 20:59:54 +0100 Message-ID: <41dac3a5-39fb-5740-106a-980b3107fac0@gmail.com> References: <20170228120452.10043-1-zajec5@gmail.com> <290ed068-2518-50ef-4d02-394bef8b7ee9@gmail.com> <28982a47-20b5-f90b-c1d8-b470e4019a08@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Sender: linux-leds-owner@vger.kernel.org To: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Richard Purdie , linux-leds@vger.kernel.org Cc: Rob Herring , Mark Rutland , devicetree@vger.kernel.org List-Id: devicetree@vger.kernel.org On 03/06/2017 07:16 AM, Rafał Miłecki wrote: > 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. Indeed, it seems to be not needed for this approach. I'm OK with this design. -- Best regards, Jacek Anaszewski