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: 10707725 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 06A6714BD for ; Sat, 1 Dec 2018 15:17:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E38AA2BC79 for ; Sat, 1 Dec 2018 15:17:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D15302BD40; Sat, 1 Dec 2018 15:17:45 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAB0E2BC79 for ; Sat, 1 Dec 2018 15:17:44 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 588DB2678DF; Sat, 1 Dec 2018 15:41:08 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9C3A5267AAE; Sat, 1 Dec 2018 15:41:05 +0100 (CET) Received: from atrey.karlin.mff.cuni.cz (atrey.karlin.mff.cuni.cz [195.113.26.193]) by alsa0.perex.cz (Postfix) with ESMTP id 2301226770D for ; Sat, 1 Dec 2018 15:41:02 +0100 (CET) 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 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 In-Reply-To: <5f8eece3-95af-7866-d7d0-02cc3cb695ca@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: alsa-devel@alsa-project.org, Ayman Bagabas , Takashi Iwai , platform-driver-x86@vger.kernel.org, Hui Wang , ibm-acpi-devel@lists.sourceforge.net, Pali =?iso-8859-1?q?Roh=E1r?= , Andy Shevchenko , linux-leds@vger.kernel.org Subject: [alsa-devel] Well-known LED names was Re: [PATCH 0/6] Introduce audio-mute LED trigger (and conversions to it) X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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.