Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3354828ybc; Mon, 18 Nov 2019 13:57:19 -0800 (PST) X-Google-Smtp-Source: APXvYqzhd/XmkXTRSfUhRjEt4TICBwY0DRtZzuBfhhc7w2JjpuUJEIwY49THvB1hFoIMyoKbLDss X-Received: by 2002:a1c:a556:: with SMTP id o83mr1549928wme.165.1574114239359; Mon, 18 Nov 2019 13:57:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574114239; cv=none; d=google.com; s=arc-20160816; b=Ltam5qYQj/xhTUlikestdgSNPivK9vzJZpvQquaJOgP/lpyVkmRXXM3jAm8QzZVlii HAaLRCTLD5GntFwya6n4dTb2QnwpYGZAPctbM4AP65qUhoT51OT8FFgfCi3BP2MkwlbQ CTEdSSX9Rwj2Ac6DRHT0f/PmaPaNTdalxjcYQ2r/0YPf4rP8b5aFQfeoCJChbx7cHexT /LRqM8I1dsS3lVide/jwTxtIS17SbCWhpjy9/vjyPcgZOYZP4VhtWgBETdqf1HHtTz0O JsqNrK/VXwyOiMoY0o8hhtWC2rYsUdaPZsh6zp+APhBk6o2DUNC6SNCkZG0eAXAKZMig EJdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=nBdReiwfNdG1ZF5L1z3OLmO8W9Ht5rJykoy9uzz4vdw=; b=NBioBM7TBWC52yP+gOqY3tmY9flIxvaW30qx+u5uELDExbE314/wNbiEuM8ec7crUi 66hKE6BoG12cIG0wXFdSiZerTp0LSz+z53E22oUQ69TFZCRVmHg3Er1jm5Q1VJ9OvZVc p7xHoSw8vtMbaN6U0qLe40qwcQ/dDu+PUEPWY9We0L/+AcgloN0MdRdD0yG2IxHQJ1Oo qA02OlyqHRq0sejHeexKjXqiBt2RR3N9ji/eazSYgemeyBsaObqH9SYDMgeOBdskrrAC Feom+78ORBd2G4AJCNjqoSwvP56T0n/PhXjPQc1WbgHrDC3rRuKta5LtWn9DMHp2AEPp ebuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gYwLrHxG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g28si14674721edg.327.2019.11.18.13.56.55; Mon, 18 Nov 2019 13:57:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gYwLrHxG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727104AbfKRVzQ (ORCPT + 99 others); Mon, 18 Nov 2019 16:55:16 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39062 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726788AbfKRVzP (ORCPT ); Mon, 18 Nov 2019 16:55:15 -0500 Received: by mail-wr1-f67.google.com with SMTP id l7so21356765wrp.6; Mon, 18 Nov 2019 13:55:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=nBdReiwfNdG1ZF5L1z3OLmO8W9Ht5rJykoy9uzz4vdw=; b=gYwLrHxGUGXwCD6RxM7i+0YYCY0unPGu45F94zozvNvEDvHtWLLV0k1adw624d0/T3 jc1CSlTbloQ92b3wjZMI5tZ+ImIFnt45Bj3+86u379GqRiEjKrDX7h2qSGR3AVe+oX5g cWadgC6tze3TMg6MUltEEKQCd0jrrVyG65A9JhNfp0s0Rfn7eyfkBGwXh/HSYZ0hBP43 yH+ZX1ouAH31IJdMld3ym7pXwIeqplV8Ulgmx5ee+tORAQCQBuGnNwM1qAdO+m+uvTTb SnvXHOkY/rcViAlZvlCiOF7O41TBh+2X5gJlMwE3idDSeb3X1OJcO2ajSUemFnZpgQMw eYHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=nBdReiwfNdG1ZF5L1z3OLmO8W9Ht5rJykoy9uzz4vdw=; b=Y9pfqqyqgu7x2nz9EzMljDttLC7d2IxUN+D5V99u3in0yG0VGakqCjRYIkuZ9eFYNR vwbq6VUSioeu7/6w5JJ7GygykAh16hw67a+l/DUgXdoEBB5kUjWnB1/CA34XQh9AEbBS oRAU09VJF7HHa5RgeTxwHbR51JQ7Mo2R3hHbBII/6ULcZScUicgOySX+guHzZx6uYP3t W6lDaPWdURWT62syZNQ7nF7bSOMz3djd4Mz6nIPLTvDi2s5dTz4r2MOmU1p8koiQNKow 2SMmrwmJyF1rW2dt0NDqdTOoucfy+n/V3SBR7abxXLn+z26McXCq36iFiBPyaGg7eeqM 5NqQ== X-Gm-Message-State: APjAAAWOhAdMD9ym9boJpX1Mdsw/UCOwFPEBb6xBP3TKfkmey0JbR77x Yl2VyfXH5RYFExY3Bi2epNS2a62/ X-Received: by 2002:a5d:49cf:: with SMTP id t15mr33176605wrs.183.1574114111759; Mon, 18 Nov 2019 13:55:11 -0800 (PST) Received: from [192.168.1.19] (cji233.neoplus.adsl.tpnet.pl. [83.31.58.233]) by smtp.gmail.com with ESMTPSA id z2sm12649357wrs.89.2019.11.18.13.55.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Nov 2019 13:55:11 -0800 (PST) Subject: Re: [PATCH v5 15/16] leds: Add common LED binding parsing support to LED class/core To: Matti Vaittinen , mazziesaccount@gmail.com Cc: Lee Jones , Pavel Machek , Dan Murphy , Rob Herring , Mark Rutland , Liam Girdwood , Mark Brown , Jonathan Corbet , Michael Turquette , Stephen Boyd , Linus Walleij , Bartosz Golaszewski , Alessandro Zummo , Alexandre Belloni , Mauro Carvalho Chehab , Jeff Kirsher , Wolfram Sang , Marek Szyprowski , Heiner Kallweit , Nicholas Mc Guire , Phil Edworthy , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-rtc@vger.kernel.org References: <258b5c9934e2b31a5f433a7dbb908dfe5da3d30c.1574059625.git.matti.vaittinen@fi.rohmeurope.com> From: Jacek Anaszewski Autocrypt: addr=jacek.anaszewski@gmail.com; prefer-encrypt=mutual; keydata= xsFNBFWjfaEBEADd66EQbd6yd8YjG0kbEDT2QIkx8C7BqMXR8AdmA1OMApbfSvEZFT1D/ECR eWFBS8XtApKQx1xAs1j5z70k3zebk2eeNs5ahxi6vM4Qh89vBM46biSKeeX5fLcv7asmGb/a FnHPAfQaKFyG/Bj9V+//ef67hpjJWR3s74C6LZCFLcbZM0z/wTH+baA5Jwcnqr4h/ygosvhP X3gkRzJLSFYekmEv+WHieeKXLrJdsUPUvPJTZtvi3ELUxHNOZwX2oRJStWpmL2QGMwPokRNQ 29GvnueQdQrIl2ylhul6TSrClMrKZqOajDFng7TLgvNfyVZE8WQwmrkTrdzBLfu3kScjE14Q Volq8OtQpTsw5570D4plVKh2ahlhrwXdneSot0STk9Dh1grEB/Jfw8dknvqkdjALUrrM45eF FM4FS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95tZ0QW2BtIceG9/rbYlL57waSMPF49awvwLQX5RhWoF8mPS5LsBrXXK hmizIsn40tLbi2RtWjzDWgZYitqmmqijeCnDvISN4qJ/nCLO4DjiSGs59w5HR+l0nwePDhOC A4RYZqS1e2Clx1VSkDXFpL3egabcIsqK7CZ6a21r8lXVpo4RnMlQsmXZTnRx4SajFvX7PrRg /02C811fLfh2r5O5if8sKQ6BKKlHpuuioqfj/w9z3B0aQ71e4n1zNJBO1kcdznikPLAbr7jG gkBUXT1yJiwpTfRQr5y2Uo12IJsKxohnNFVYtK8X/R6S0deKPjrZWvAkllgIPcHjMi2Va8yw KTj/JgcpUO5KN906Pf7ywZISe7Kbcc/qnE0YjPPSqFOvoeZvHe6EZCMW9+xZsaipvlqpByQV UHnVg09K9YFvjUBsBPdC8ef6YwgfR9o6AnPmxl0oMUIXkCCC5c99fzJY/k8= Message-ID: <745e427d-819e-12d7-5c94-7a8d1a414956@gmail.com> Date: Mon, 18 Nov 2019 22:55:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <258b5c9934e2b31a5f433a7dbb908dfe5da3d30c.1574059625.git.matti.vaittinen@fi.rohmeurope.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Matti, Thank you for the patch. If your driver does not depend on it then please send is separately. Besides, we would require to convert many of current LED drivers to verify how the proposed parsing mechanism will work with them. I've been testing my LED name composition series using QEMU and stubbing things in drivers where necessary and I propose to use the same approach in this case. Best regards, Jacek Anaszewski On 11/18/19 8:03 AM, Matti Vaittinen wrote: > Qucik grep for 'for_each' or 'linux,default-trigger' or > 'default-state' under drivers/leds can tell quite a lot. It seems > multiple LED controller drivers implement the very similar looping > through the child nodes in order to locate the LED nodes and read > and support the common LED dt bindings. Implementing this same > stuff for all LED controllers gets old pretty fast. > > This commit adds support for locating the LED node (based on known > node names - or linux,led-compatible property) and handling of > few common LED properties. > > linux,default-trigger, > default-state (with the exception of keep), > > (in addition to already handled > function-enumerator, > function, > color > and label). > > Regarding the node look-up: If no init_data is given, then no > node-lookup is done and cdev name is used as such. > > If init_data is goven but no starting point for node lookup - then > (parent) device's own DT node is used. If no led-compatible is given, > then of_match is searched for. If neither led-compatible not of_match > is given then device's own node or passed starting point are used as > such. > > Signed-off-by: Matti Vaittinen > --- > > Changes from v4: > Fixed issues reported by Dan Carpenter and kbuild-bot. > (leftover kfree and uninitialized return value) > > drivers/leds/led-class.c | 88 ++++++++++++-- > drivers/leds/led-core.c | 246 +++++++++++++++++++++++++++++++-------- > include/linux/leds.h | 90 ++++++++++++-- > 3 files changed, 359 insertions(+), 65 deletions(-) > -- Best regards, Jacek Anaszewski