Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1739660rwl; Wed, 5 Apr 2023 23:57:00 -0700 (PDT) X-Google-Smtp-Source: AKy350Zstz15B3z0Nfydk9AJmt6fM8f7I/zeLYIEHogLoUOiVm7OH4BYd0DDWmbUKaH7yF0LLLcB X-Received: by 2002:a05:6a20:671e:b0:d9:237e:9d08 with SMTP id q30-20020a056a20671e00b000d9237e9d08mr1810141pzh.3.1680764219966; Wed, 05 Apr 2023 23:56:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680764219; cv=none; d=google.com; s=arc-20160816; b=noBP/6nx+zI6VP7+8ZWMHu3AiLLxlVy7q/i1/17hRx7dgXJ8Nw2vFni3jtaICka+o/ r1VICFW7gHWTKepBPU2M2aQLGSo4ywQ9jwUKJHyKfiqXqc5HhpzksBaoGnWnUvD5hVP/ oMNP+YQ5fdr6SiSrj1+ixdUwe0Mt77HXKvT8bSiQkssSfwIC9Aa0S1ivTmb0R2M4WgY1 8XjNRkZBIIFYM9QfrVHAmksPmvJDbfyzxMWZHVI2a/nyVj8t1I8XkPDernelp4R8UKsx 9UGzLsCg97ifa0Im0wjBO7It0X7HsEB6si4WzCI019DYuCKPXQWu+gK6kRzPWY2UOe+g 4kGw== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=YSuOl31CMrYO99HhaMCLAydd8CcbHb1JVFkj99+lVFg=; b=MLZjmXLZn8oVqg2CSMqXYVYWEeLTzJVqDeQQzkTDG0Nvh4dYqykxoRkEf8PHjTlqT0 8Frfk6KCrCFP2pCCHdsT3Q/j1Z+X522b/C4iPNh5ViVh4Xezq81cwuoe/pulnC0cI/Mt vEUM18G2IuGg6mrUP0fx4lhGAtGVX5CQfamG5CfVdyPUHZzyDkz72rPQ/7xhbo2PWUzf oQRKN6skKFlvpb3Ru1MTHMNgNggpkoUSIiXg63gHAAinKDQN0BDvGTTDeM+WGBIxFkB5 wNiKlr3v2qAd3sstqsjUCEA5eVzoToCzsCAHPeD5fUgQHHI7aGAPMIGTlgtTCr+QthsI /VAw== 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 184-20020a6309c1000000b005141a94819asi624900pgj.99.2023.04.05.23.56.48; Wed, 05 Apr 2023 23:56:59 -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 S235448AbjDFGzi (ORCPT + 99 others); Thu, 6 Apr 2023 02:55:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235376AbjDFGzh (ORCPT ); Thu, 6 Apr 2023 02:55:37 -0400 Received: from 3.mo562.mail-out.ovh.net (3.mo562.mail-out.ovh.net [46.105.33.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1156AD22 for ; Wed, 5 Apr 2023 23:54:46 -0700 (PDT) Received: from director1.derp.mail-out.ovh.net (director1.derp.mail-out.ovh.net [51.68.80.175]) by mo562.mail-out.ovh.net (Postfix) with ESMTPS id E3AFC2459D; Thu, 6 Apr 2023 06:54:39 +0000 (UTC) Received: from director1.derp.mail-out.ovh.net (director1.derp.mail-out.ovh.net. [127.0.0.1]) by director1.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for ; Thu, 6 Apr 2023 06:54:39 +0000 (UTC) Received: from pro2.mail.ovh.net (unknown [10.109.143.62]) by director1.derp.mail-out.ovh.net (Postfix) with ESMTPS id 80CDD201A40; Thu, 6 Apr 2023 06:54:39 +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:54:38 +0200 Message-ID: Date: Thu, 6 Apr 2023 08:54:38 +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 6/6] leds: Add a multicolor LED driver to group monochromatic LEDs Content-Language: en-US To: Andy Shevchenko CC: , , , , , , , , , , References: <20230328161541.599463-1-jjhiblot@traphandler.com> <20230328161541.599463-7-jjhiblot@traphandler.com> 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: DAG1EX2.emp2.local (172.16.2.2) To DAG1EX1.emp2.local (172.16.2.1) X-Ovh-Tracer-Id: 7831478280874768859 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejvddgudduiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfhisehtkeertddtfeejnecuhfhrohhmpeflvggrnhdqlfgrtghquhgvshcujfhisghlohhtuceojhhjhhhisghlohhtsehtrhgrphhhrghnughlvghrrdgtohhmqeenucggtffrrghtthgvrhhnpedvfeekudegkeeuuedvueeuveejffdtvdethfelkefhfefftdetteffiefgvddtieenucfkpheptddrtddrtddrtddpkeekrdduiedurddvhedrvdeffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepughirhgvtghtohhruddruggvrhhprdhmrghilhdqohhuthdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepjhhjhhhisghlohhtsehtrhgrphhhrghnughlvghrrdgtohhmpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqlhgvughssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehiedv X-Spam-Status: No, score=-1.4 required=5.0 tests=NICE_REPLY_A,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:20, Andy Shevchenko wrote: > On Tue, Mar 28, 2023 at 7:15 PM Jean-Jacques Hiblot > wrote: >> >> Grouping multiple monochrome LEDs into a multicolor LED device has a few >> benefits over handling the group in user-space: >> - The state of the LEDs relative to each other is consistent. In other >> words, if 2 threads competes to set the LED to green and red, the >> end-result cannot be black or yellow. >> - The multicolor LED as a whole can be driven through the sysfs LED >> interface. > > ... > >> +config LEDS_GROUP_MULTICOLOR >> + tristate "LEDs group multi-color support" >> + depends on OF || COMPILE_TEST > > Why is OF a dependency? > Can't we make it a firmware provider agnostic solution from day 1? That would be possible, unfortunately I have no way of testing the ACPI stuff. That's why I prefer sticking to OF. > >> + help >> + This option enables support for monochrome LEDs that are >> + grouped into multicolor LEDs. >> + This useful in the case where LEDs of different colors are > > This is > >> + physically grouped in a single multi-color LED and driven >> + by a controller that doesn't have multi-color support. >> + >> + To compile this driver as a module, choose M here: the module >> + will be called leds-group-multicolor. > > ... > >> + led_cdev = devm_of_led_get_optional(dev, count); > > I don't see how this is OF specific to this driver. Maybe it needs to > be patched first, so we will have something non-OF specific? > >> + if (IS_ERR(led_cdev)) >> + return dev_err_probe(dev, PTR_ERR(led_cdev), "Unable to get LED #%d", >> + count); > > At least we need to have a FIXME or so here. >