Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5862286imu; Tue, 13 Nov 2018 12:58:12 -0800 (PST) X-Google-Smtp-Source: AJdET5ct25ERLUn6QSSrjEpKBJ3EgRmfwPe4PUG4XGEqkAXru4Aemr5WhuLcBYafG98B9mfAN0eu X-Received: by 2002:a62:7796:: with SMTP id s144-v6mr6840833pfc.159.1542142692611; Tue, 13 Nov 2018 12:58:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542142692; cv=none; d=google.com; s=arc-20160816; b=nBC0KsMexopkXQ2kQEoi8NIOXyUIcY/maekQ4tRdEv/CN6LDnhqV5kKdV3+b7gPz5Y qza0BU4aQjlJB97JY48ZNYrABozTu+W0aD+TR83sqGGH3Ks20JRnuAx5zpT0QybZhBS2 KSPw7HPHzEPQLj8FBnYf1iAJtYGzE0lst+qq6P4mWConeQDlSRWPVkNHuKoSsgpOJyyx Lw5otWRBtu8MqFFlTJpWHVRwPxoDsVGjK9gtFiuxH/J4iSlC7lUR8HAD9fdFdIZvr0bX ivXdBIWTpme4cTYuJmkfBlyGDMWKi8X147+aMcyo9MM6p0ph/9u1M2KGgDmtbSJesHwa XVjA== 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:from:references:cc:to:subject:dkim-signature; bh=iZc/1N8ULqlb+KEZMW+hKDFpHQZ+ic+440af96BInwA=; b=MsXAUgdjuqcXnmTzJ6DccIKWx5hdN+9xzUknD/dRKWlRHsDHFacc9cp9MxFEISwQ2T CTkL7daOPgpdksCIXVZWvKAnbnWuVgn+CQmnl+EV7KaZqnSNRxqyZgWXAmfTqhIlvNE+ RplqVZAfJtRjFFXHgqmdoZZukNqSQhvcAPwkB8WRc3JcWv5QFR1v2e7PTJxCfXcSsBlF KyxnyJbydJRZ9/A1kplyVm+rFGXMpBx8+V8IIU7kLu3IkvczUs7K5Q0ahPO7LpeZ/mPu +Mw4HLKj9t2l+VkZ58KadQG6rD2u//PPwSSSkPD4vX6aDM/ld5ayN0ZHnrY1AuF0+R9/ wZLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dKb5obM2; 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 q8-v6si21816902pgc.347.2018.11.13.12.57.52; Tue, 13 Nov 2018 12:58:12 -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=dKb5obM2; 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 S1727974AbeKNG5V (ORCPT + 99 others); Wed, 14 Nov 2018 01:57:21 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:37701 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725748AbeKNG5U (ORCPT ); Wed, 14 Nov 2018 01:57:20 -0500 Received: by mail-ed1-f65.google.com with SMTP id h15so6956159edb.4; Tue, 13 Nov 2018 12:57:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=iZc/1N8ULqlb+KEZMW+hKDFpHQZ+ic+440af96BInwA=; b=dKb5obM2DDp8ExjKWcibp/aROXRQ8CNvx8R/BarVq+SPk3yemwbTFcdUkO4ecJF9Px S83ubO/qXQ12NplRS0v6wHK6NpTan2wq8A4/4mERcBwN0nmACw076XNnIMc+G8RB2V0G cfmPe4lwFuj9jxoj9ASnoLBjKjJL+gUsn6pzrQoLvnmN723YkY9Cdaoz7ZihfQyyYQ8L My/fOZF6BaxnZiP/6ShixV+teB9QhE5IypRhh5J15eIvmQFnltRCTjlYnwvejizd8Hms bnSwcAH9Q4l6gqHH5JqNeXFfMUVlh7qXAg70xComgURS09S/tnj3ThnQaqJGGQLyo7f0 914g== 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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iZc/1N8ULqlb+KEZMW+hKDFpHQZ+ic+440af96BInwA=; b=G9MGAYgeBRsaBdXrR4QXeFil4v3T5NDqgcAtRoD09Od3sn9/htjxm13K5QDu/+XX2m oD9QeJy33V6srooV4oJcwK/X1TiW/sgEcW86hGWmy9+uCL5YmjLvH3j3Oiijh6SFma/a 3O6ChdDeSfFLOyUjOUmDqJVRqk1u1qpoOnLpEOtSR1otEqUqiX321sQpj4IxoaC7dD1b SK1vAwz8A1r+vTXL+CnSogR5TMCPj0rEQVxdOSRGIuQJg38cXM9cYVkMppVwGyKMWNl4 6UMetvOggQNkGBluKlz/yvCaH87ySG0XTw2ieIhOyc91e8gXdSdZ6aWi/1fOgQ289WfC uyVw== X-Gm-Message-State: AGRZ1gLnu6RIN/kMOVXhM2OI/4IqxD4HVwt0F/b1/J9JF69q+fXEzu8L LAT7cH0Q/dhuR2BMSVEoK8M= X-Received: by 2002:a50:90c6:: with SMTP id d6mr9211189eda.15.1542142644053; Tue, 13 Nov 2018 12:57:24 -0800 (PST) Received: from [192.168.1.18] (dma68.neoplus.adsl.tpnet.pl. [83.24.56.68]) by smtp.gmail.com with ESMTPSA id t10-v6sm2441673ejg.41.2018.11.13.12.57.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 12:57:23 -0800 (PST) Subject: Re: [PATCH 04/24] dt-bindings: leds: Add function and color properties To: Rob Herring Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, pavel@ucw.cz, Baolin Wang , Daniel Mack , Dan Murphy , Linus Walleij , Oleh Kravchenko , Sakari Ailus , Simon Shields , Xiaotong Lu References: <1541542052-10081-1-git-send-email-jacek.anaszewski@gmail.com> <1541542052-10081-5-git-send-email-jacek.anaszewski@gmail.com> <5bea0eb8.1c69fb81.6b921.80e6@mx.google.com> From: Jacek Anaszewski Message-ID: Date: Tue, 13 Nov 2018 21:57:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5bea0eb8.1c69fb81.6b921.80e6@mx.google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/12/2018 07:27 PM, Rob Herring wrote: > On Tue, Nov 06, 2018 at 11:07:12PM +0100, Jacek Anaszewski wrote: >> Introduce dedicated properties for conveying information about >> LED function and color. Mark old "label" property as deprecated. >> >> Signed-off-by: Jacek Anaszewski >> Cc: Baolin Wang >> Cc: Daniel Mack >> Cc: Dan Murphy >> Cc: Linus Walleij >> Cc: Oleh Kravchenko >> Cc: Sakari Ailus >> Cc: Simon Shields >> Cc: Xiaotong Lu >> --- >> Documentation/devicetree/bindings/leds/common.txt | 52 +++++++++++++++++++---- >> 1 file changed, 44 insertions(+), 8 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/leds/common.txt b/Documentation/devicetree/bindings/leds/common.txt >> index aa13998..3efc826 100644 >> --- a/Documentation/devicetree/bindings/leds/common.txt >> +++ b/Documentation/devicetree/bindings/leds/common.txt >> @@ -10,14 +10,20 @@ can influence the way of the LED device initialization, the LED components >> have to be tightly coupled with the LED device binding. They are represented >> by child nodes of the parent LED device binding. >> >> + >> Optional properties for child nodes: >> - led-sources : List of device current outputs the LED is connected to. The >> outputs are identified by the numbers that must be defined >> in the LED device binding documentation. >> +- function: LED functon. Use one of the LED_FUNCTION_* prefixed definitions >> + from the header include/dt-bindings/leds/functions.h. >> + If there is no matching LED_FUNCTION available, add a new one. >> +- color : Color of the LED. >> - label : The label for this LED. If omitted, the label is taken from the node >> name (excluding the unit address). It has to uniquely identify >> a device, i.e. no other LED class device can be assigned the same >> - label. >> + label. This property is deprecated - use 'function' and 'color' >> + properties instead. > > I don't know if I'd go as far a deprecating. > > One thing to consider is how we handle multiple of the same function? Do > we allow an index on function names? What if an index isn't meaningful > and we need "front" vs. "rear" for example? Maybe label is still needed > there. I believe that 'label' property with its old semantics must be preserved for backwards compatibility - it so far has been used inconsistently for conveying variations of devicename:color:function sections. If provided, then it's been taken as-is for LED class device name, or concatenated with the devicename hard-coded in the driver. Regarding the differentiation between the LEDs with functions of same kind - OK, I agree, we will need another section. What seems to fits the best is the reference to the device it is logically associated with. The question is whether the devicename should be provided in DT literally, or by phandle, and then retrieved in runtime, basing on the sysfs entry, like in case of input-leds bridge which for USB keyboard creates LEDs named e.g.: input5::capslock input5::numlock input5::scrolllock Probably we will have to allow for some flexibility in this regard, to allow for providing devicename literally like "rear", "front", or like above input case. -- Best regards, Jacek Anaszewski