Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3308010imu; Sun, 11 Nov 2018 12:04:23 -0800 (PST) X-Google-Smtp-Source: AJdET5fNbzYvxoCwukor++6zY4IbsK0wexEy4K4sVCfP+nn5s1xdf5QilP4WlvOetJ+8hjmdc9gs X-Received: by 2002:a63:5442:: with SMTP id e2-v6mr15138280pgm.316.1541966663813; Sun, 11 Nov 2018 12:04:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541966663; cv=none; d=google.com; s=arc-20160816; b=SYL5JH9a2xxjH8r7lKKZ/SgKABl7whyX2AZr4gOQArnYC1XDiZ1CFmjTZkLM/ztOWk nH2eX3crySuJHrPPjJuIiq9uLF4Ac8iXwjF0ZJKsUkq7VROBscLThYMIQj7lH4B+SReq k3t5ZtFsKyFX3XqRo41iNcuMHaqKu9NzoLHyAmLpmXiETFGCHRP4KO/Vz/NDRmy7hqBa lHasXTMtwr9rQ5XeV8QcD6oLBzdRfZTxiJm8IfJ3HRpJG8ptVOmM1PBh3CiWqM0xXCG6 32NTRri/DOVBJS81t8R0/GcXFm2HC9qwmu3Aux2C2NJGtFoWiqOXD6DewxnbPapjzwAE RwSQ== 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=Ey+s89R73pXXQMefmAI7L9aekd1JL/1Fa2/6Z+PWM7k=; b=H2oaNxchWWZBEHF5s7X2sT8f9WpAiIVEjkBtuTfMNnAoehdaWjzLg2HqVBOzhW9UBS ZXAU8XSDnov+t4XdhMBhsx316O2R3Z8vUgROoEzP2bJhPJwZw/F9SwCrNAMcKwAA0uLP E7MHYprjqstQfiMtMlDuHfZPvu+Qckmz4s1xkMxgSrCYZIWtCKOhUdk0gL1zZo1qWFRH 90jDrkFgzyIEhGM04Hy6c2FJyVlWLvYRDqAo7x1jCruxf9/xU00zgO6UMd9GmRBcQdix BVbdyxyuOZoBl/AwYp/53KqpTgKIcfYAbtbpt51mSMLHYFy8hrtQUeKs9UoAxMzmUE/V /fAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZA5Hm4sT; 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 a3-v6si14833233plp.323.2018.11.11.12.04.08; Sun, 11 Nov 2018 12:04:23 -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=ZA5Hm4sT; 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 S1729649AbeKLFwd (ORCPT + 99 others); Mon, 12 Nov 2018 00:52:33 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:41498 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726374AbeKLFwc (ORCPT ); Mon, 12 Nov 2018 00:52:32 -0500 Received: by mail-lf1-f68.google.com with SMTP id c16so4726515lfj.8; Sun, 11 Nov 2018 12:03:03 -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=Ey+s89R73pXXQMefmAI7L9aekd1JL/1Fa2/6Z+PWM7k=; b=ZA5Hm4sTqY0wEoFCcHxfN7iCBHSncZtWrmV+d65P0OoN7y6iORlFpMgNpEFRvc5FEV SJdNOMDs2lgwCJGSLm2lmdTGBmGhT/tctaRbCH+nrd4STeTc29IBYCqu07hpM7LibIBg Xh9BPoyX/j4ta/encUlDx2R/3PDnG25ps1gP4c4keer497xrVtqDKMScb3s5NCCit+CZ +xHJ/XAJvL2d4KeXElbZS7h2OwxUMPm32EryxoFIfI1R2/nUc3xFrqpiul9uZwZKwy1L REcUZpwAmx5JSoaGvOPV+E8ET+xpq/VjoiIhfQAtMc4ZbeU6Ca24qG4OTTaNcqmtdK4i ZxqA== 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=Ey+s89R73pXXQMefmAI7L9aekd1JL/1Fa2/6Z+PWM7k=; b=VVcFf6DGRJMRaLT6GrujETysnHMogsMGvpMo78dBcoOk4oKRkJcYAb04fGVKHekOQn Uw9nnCr2LMkMmgs7nzDm2l9B53pys8dnbGFpKSE4mpjNyqyZgIuH1Bawci3o7FBzmhJR IZmTy4MYawmUWMNbboGgEF2SRF1WcUo2sNn7LWeXndSwlzoVXYco0HF08Kdez1xFSVSL Oca/wAL96j1HDnilSmYHq15zHy/5bsp5vwEaVn+Oa4G1T7ojjFkF3E84YiMoGfGaz57z BzrNpHpHbpX7bvL++6kRcZsGl1gvb0wu0UKKT6Y3E6gGJ/NFLEFEaqpZ00RSBMaliNuC PoUg== X-Gm-Message-State: AGRZ1gKOWqjlWIRm5hPRcxnIZ0X25DpFduYGO4rKYVrEOhsLH4xv8dhQ nU/F4/8Hc2sXPuQT4iBoOLY= X-Received: by 2002:a19:5d42:: with SMTP id p2mr10179798lfj.83.1541966582406; Sun, 11 Nov 2018 12:03:02 -0800 (PST) Received: from [192.168.1.18] (cjk171.neoplus.adsl.tpnet.pl. [83.31.60.171]) by smtp.gmail.com with ESMTPSA id e19-v6sm1919409ljf.67.2018.11.11.12.02.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 12:03:01 -0800 (PST) Subject: Re: [PATCH 02/24] leds: core: Add support for composing LED class device names To: Pavel Machek Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, robh@kernel.org, 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-3-git-send-email-jacek.anaszewski@gmail.com> <20181111120234.GA28794@amd> From: Jacek Anaszewski Message-ID: Date: Sun, 11 Nov 2018 21:02:58 +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: <20181111120234.GA28794@amd> Content-Type: text/plain; charset=windows-1252 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 Hi Pavel, On 11/11/2018 01:02 PM, Pavel Machek wrote: > Hi! > >> Add public led_compose_name() API for composing LED class device >> name basing on fwnode_handle data. The function composes device name >> according to either a new pattern or the legacy >> pattern. The decision on using the >> particular pattern is made basing on whether fwnode contains new >> "function" and "color" properties, or the legacy "label" proeprty. >> >> Backwards compatibility with in-driver hard-coded LED class device >> names is assured thanks to the default_desc argument. >> >> In case none of the aformentioned properties was found, then, for OF >> nodes, the node name is adopted for LED class device name. >> > >> diff --git a/Documentation/leds/leds-class.txt b/Documentation/leds/leds-class.txt >> index 836cb16..e9009c4 100644 >> --- a/Documentation/leds/leds-class.txt >> +++ b/Documentation/leds/leds-class.txt >> @@ -43,7 +43,7 @@ LED Device Naming >> >> Is currently of the form: >> >> -"devicename:colour:function" >> +"colour:function" >> > > I don't think we want to do it in all cases. > > So, on my cellphone seeing lp5523:green:led is indeed not useful. > > But on notebook with usb keyboard attached, you need to keep the > devicename to be able to distinguish capslock on internal keyboard and > capslock on first USB keyboard and capslock on second USB keyboard. > > Taking look at the list of functions, here's stuff like "hdd" and > "hdderr". I assume the first means hdd activity... If we can do it, it > would be nicest to have "sda:green:activity" and maybe > "sda:red:error". For a raid array with 8 drives... > > For example I have a router running linux. It has 4 lan ports, with > correspondings LED, and an wan led. > > Having "green:lan1" to "green:lan4" and "green:wan" plus > "red:wanerror" would work, but I'd really preffer > "eth0:green:link"... "adsl0:green:link", "adsl0:red:error". > > There are now phones with flashes on both main and selfie > cameras. Again, knowing which device is which is important. As is > knowing which display is controlled by particular backlight. It's overcomplicating the naming again. In every case you can tweak the function name to eth0_link, eth1_link etc. -- Best regards, Jacek Anaszewski