From patchwork Sat Dec 1 14:41:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 10707715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC26B13AF for ; Sat, 1 Dec 2018 14:41:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A753C2DA01 for ; Sat, 1 Dec 2018 14:41:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B6242DA91; Sat, 1 Dec 2018 14:41:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C43672DA01 for ; Sat, 1 Dec 2018 14:41:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726642AbeLBBxo (ORCPT ); Sat, 1 Dec 2018 20:53:44 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:55992 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726621AbeLBBxo (ORCPT ); Sat, 1 Dec 2018 20:53:44 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 9336D8083C; Sat, 1 Dec 2018 15:40:58 +0100 (CET) Date: Sat, 1 Dec 2018 15:41:01 +0100 From: Pavel Machek To: Jacek Anaszewski Cc: Pali =?iso-8859-1?q?Roh=E1r?= , Takashi Iwai , alsa-devel@alsa-project.org, linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, Andy Shevchenko , Hui Wang , Ayman Bagabas Subject: Well-known LED names was Re: [PATCH 0/6] Introduce audio-mute LED trigger (and conversions to it) Message-ID: <20181201144101.GD31631@amd> References: <20181127084418.GA20504@amd> <20181128111806.cb3cncpjeq73sptg@pali> <20181128122505.GA1193@amd> <8bb45cc6-9f98-9fed-9676-7f1429328c4a@gmail.com> <20181128203410.GA20670@amd> <20181128204612.l3bayhop4qmep2hj@pali> <0ed37870-c7b6-fd6b-2f6e-7325fdde3629@gmail.com> <20181128212212.GE20670@amd> <5f8eece3-95af-7866-d7d0-02cc3cb695ca@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5f8eece3-95af-7866-d7d0-02cc3cb695ca@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi! > >>> If external USB keyboard is identified as "input7" device, then > >>> "input7::mute" is a good name for mute key. But "sys::mute" does not say > >>> anything to which device or hardware it belongs nor does not solve > >>> problem that which device/driver/subsystem should have privilege to take > >>> this "sys" name. > >> > >> How about just "platform" for the LEDs being part of the device > >> on which the system is running? > > > > "platform" works for me. > > > > Are we in agreement that this name will be used for all similar LEDs, > > as long as they are on the "main box" of the device, no matter if they > > are connected using acpi, gpio, i2c, ...? > > One doubt: say we have hdd activity LED on the "main box" - it > would be named "platform::disk". > > Now, we add external USB disk. Previously we were considering > the naming for disk LEDs in the form e.g. "sdb::disk". > > If so, there would be discrepancy between internal and external disk > LED names. Similarly in case of eth/adsl/wlan/camera LEDs. Well, it really depends if the "plaform::disk" is for all the disks, or if it is for sda. In the second case, it might be better to name it sda::disk... Anyway... I believe we should start documenting good and bad LEDs, so that patch authors know what is there, and can try to be consistent, and so that userland knows what names to probe for. What about following? Any other LEDs worth mentioning? commit c56708addf9c312cefd760bca218a0545258b217 Author: Pavel Date: Sat Dec 1 15:32:13 2018 +0100 leds: Add list of well-known LED names Signed-off-by: Pavel Machek diff --git a/Documentation/leds/well-known-leds.txt b/Documentation/leds/well-known-leds.txt new file mode 100644 index 0000000..9a262db --- /dev/null +++ b/Documentation/leds/well-known-leds.txt @@ -0,0 +1,42 @@ +-*- org -*- + +It is somehow important to provide consistent interface to the +userland. LED devices have one problem there, and that is naming of +directories in /sys/class/leds. It would be nice if userland would +just know right "name" for given LED function, but situation got more +complex. + +Anyway, if backwards compatibility is not an issue, new code should +use one of the "good" names from this list, and you should extend the +list where applicable. + +Bad names are listed, too, in case you are writing application that +wants to use particular feature, you should probe for good name first +but then try the bad ones, too". + +* Keyboards + +Good: "input*:*:capslock" +Good: "input*:*:scrolllock" +Good: "input*:*:numlock" + +Set of common keyboard LEDs, going back to PC AT or so. + +Bad: "tpacpi::thinklight" (IBM/Lenovo Thinkpads) +Bad: "lp5523:kb{1,2,3,4,5,6,7}" (Nokia N900) + +Keyboard frontlight/backlight. + +* Sound subsystem + +Good: "platform:*:mute" +Good: "platform:*:micmute" + +LEDs on notebook body, indicating that sound input / output is muted. + +* System notification + +Good: "status-led:{red,green,blue}" (Motorola Droid 4) +Bad: "lp5523:{r,g,b}" (Nokia N900) + +Phones usually have multi-color status LED.