Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1738601rwl; Wed, 5 Apr 2023 23:55:40 -0700 (PDT) X-Google-Smtp-Source: AKy350bkIXtM+nOljhMH7P0cxilvHmzF6PUGJfxtplbXmwLEvPTTspCWx3Mgbv6ulhPsBtzqJdvg X-Received: by 2002:a17:90b:1c02:b0:23f:2d2c:abcf with SMTP id oc2-20020a17090b1c0200b0023f2d2cabcfmr10271952pjb.7.1680764139782; Wed, 05 Apr 2023 23:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680764139; cv=none; d=google.com; s=arc-20160816; b=x5YSxHRYUrwDMtN+9v1Yk2QIBPwN4v37JBksJSeRi13U9dh8XR9jiCYIWky2snurIS USHA+7Qv0JFXmK2oexpoIlnQSpvBPbAgdW3iK7eKPmakmXySVC/ivGsGL11/LvpUcQuw iTujNFbqFz6Y+4ykK71mc7W7l75V/P6ipi3HZ2R49yw3gzesszGxoMNRcbKz8Vx8ex/Z GqIqeU9vf0njKo7DyOjrXqQ1j+7O3vcQ40NX9M5+LjebOGAwsC01whkR+4WthT96IQ4W ZIFz6fZNnbjf6Ukg4CHUvKD2zBnpaiVj8GaIt2gy4hWoG+CtMKGsRMsIsmWatNKUdmgm FRkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=bNQLVafJ68innmOv02xD9LDBOWxFnu4KDfcCe9VyvKM=; b=UHn76nd9YnCLaM2A816hSD6373a6KHiklkMRq/ClaC8e99gWrcA8hvMZ3AkVqDjxn+ YsPZdeZzgXkWXyOpTPLwGnlLY3RQJx0M2zukoy4q49eIdjLRi/oJCI417um6AZnCX0gb HCLUv8snrMyqOZwEwxbV5Elkmf6vieYXHh1wdzpxWNqrGOmcwKCH2w4/P+xv6P4AskGo TWG+mE3wDIrnsVytKRS91aN0o/SNP+p2TBJoxyWxGOxfmm2C5yvEE0Gq7xUHa81HAxux tVoEo3k/hJtjJHrEyLSfyKqUwUyNI0PsKgRWbihuWrtho9311FpKJ8pc+z9zHWwt4ouL kv6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g1-20020a17090a828100b0023b340b6388si3054302pjn.97.2023.04.05.23.55.28; Wed, 05 Apr 2023 23:55:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233391AbjDFGwh (ORCPT + 99 others); Thu, 6 Apr 2023 02:52:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233235AbjDFGwg (ORCPT ); Thu, 6 Apr 2023 02:52:36 -0400 Received: from 10.mo562.mail-out.ovh.net (10.mo562.mail-out.ovh.net [46.105.72.220]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7A598A66 for ; Wed, 5 Apr 2023 23:52:34 -0700 (PDT) Received: from director2.derp.mail-out.ovh.net (director2.derp.mail-out.ovh.net [79.137.60.36]) by mo562.mail-out.ovh.net (Postfix) with ESMTPS id 930A82455D; Thu, 6 Apr 2023 06:52:32 +0000 (UTC) Received: from director2.derp.mail-out.ovh.net (director2.derp.mail-out.ovh.net. [127.0.0.1]) by director2.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for ; Thu, 6 Apr 2023 06:52:32 +0000 (UTC) Received: from pro2.mail.ovh.net (unknown [10.108.1.244]) by director2.derp.mail-out.ovh.net (Postfix) with ESMTPS id 6A5C51FE27; Thu, 6 Apr 2023 06:52:32 +0000 (UTC) Received: from [192.168.1.41] (88.161.25.233) by DAG1EX1.emp2.local (172.16.2.1) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Apr 2023 08:52:31 +0200 Message-ID: Date: Thu, 6 Apr 2023 08:52:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v8 4/6] leds: class: store the color index in struct led_classdev To: Andy Shevchenko CC: , , , , , , , , , , References: <20230328161541.599463-1-jjhiblot@traphandler.com> <20230328161541.599463-5-jjhiblot@traphandler.com> Content-Language: en-US From: Jean-Jacques Hiblot In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [88.161.25.233] X-ClientProxiedBy: DAG2EX2.emp2.local (172.16.2.12) To DAG1EX1.emp2.local (172.16.2.1) X-Ovh-Tracer-Id: 7795730958712781275 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejvddgudduhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfhisehtkeertddtfeejnecuhfhrohhmpeflvggrnhdqlfgrtghquhgvshcujfhisghlohhtuceojhhjhhhisghlohhtsehtrhgrphhhrghnughlvghrrdgtohhmqeenucggtffrrghtthgvrhhnpedvfeekudegkeeuuedvueeuveejffdtvdethfelkefhfefftdetteffiefgvddtieenucfkpheptddrtddrtddrtddpkeekrdduiedurddvhedrvdeffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepughirhgvtghtohhrvddruggvrhhprdhmrghilhdqohhuthdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepjhhjhhhisghlohhtsehtrhgrphhhrghnughlvghrrdgtohhmpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqlhgvughssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehiedv X-Spam-Status: No, score=-1.4 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/03/2023 19:15, Andy Shevchenko wrote: > On Tue, Mar 28, 2023 at 7:15 PM Jean-Jacques Hiblot > wrote: >> >> This information might be useful for more than only deriving the led's >> name. And since we have this information, we can expose it in the sysfs. > > ... > >> +Date: March 2023 >> +KernelVersion: 6.3 > > Outdated version. > > ... > >> + Color of the led. >> + >> + This is a read-only file. Reading this file returns the color >> + of the led as a string (ex: "red", "green"). > > There are no strict rules about colour and I don't think it's a good > idea. Why in such a case is it different to label? My proposal here at > least documenting that the colour must follow one of the existing > naming standards (like RGB in hex, HTML, or name in accordance with > chosen standard). Actually the colors are defined in an array: led_colors (led-core.c: 88) So the color is one of the following: white, red, reen, blue, amber, violet, yellow, ir, multicolor, rgb There is mention in the TODO file of changing the way RGB leds are handled and the RGB leds would probably show the hex RGB values here. > > Yet, it won't technically prevent abusing that, but at least will show > the intention and allow pointing out to the bugs or develop user space > tooling based on existing parsers (if any). >