From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29101C433B4 for ; Wed, 19 May 2021 12:00:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3E2C611AE for ; Wed, 19 May 2021 12:00:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352973AbhESMCG (ORCPT ); Wed, 19 May 2021 08:02:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:41526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237480AbhESMCF (ORCPT ); Wed, 19 May 2021 08:02:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DE60560E0B; Wed, 19 May 2021 12:00:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621425645; bh=blIXtSnMai/7fxVhk3yLSFepus5k5UQNVnOdYzQcSKk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MmspyclnHidsqe4HbwNiYDr1YksHpoCZ9VsDwA2nAO3Q6SeWPiMHKl0cezkUzb+vK 5e6Aymvgn+CRpipTOTNavPv5D60Rx/pHO/ITz0cK20vcXm6WXjnarSOb/uDblGuskN Zq9UHOH2A4tBd+vrPPcbw3TuzMmWYcQbo03FOpP17TFBbQt3D2i+3oOFD6As4+ftmB Zuf/cVWCD5YGxvFEq2Qrjj184mq7ipS8nL64MXZ5Sq1FUe2HBwWvDTIo2UlRLajrvB XAqEC0JtYYkLRUvdwN5FFVaFi7Q/J16qE9E2vCyamRbsU54m/r3+4y4fhM1oMPb4I/ 5YC/Fuj++NV5w== Date: Wed, 19 May 2021 14:00:40 +0200 From: Mauro Carvalho Chehab To: Pavel Machek Cc: Marek =?UTF-8?B?QmVow7pu?= , linuxarm@huawei.com, mauro.chehab@huawei.com, gregkh@linuxfoundation.org, linux-leds@vger.kernel.org Subject: Re: [PATCH v2 06/17] leds: leds-nuc: allow changing the LED colors Message-ID: <20210519140040.5c685336@coco.lan> In-Reply-To: <20210519110725.GB24621@duo.ucw.cz> References: <20210519095713.07be987d@thinkpad> <20210519120507.3ab8c6a4@coco.lan> <20210519110725.GB24621@duo.ucw.cz> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Em Wed, 19 May 2021 13:07:25 +0200 Pavel Machek escreveu: > Hi! > > > > We have multicolor LED framerwork in Linux. This should be implemented > > > via that framework. Please do not implement your own way for RGB leds. > > > > > > Marek > > > > I saw the multicolor LED framework, but IMO it won't fit here. > > > > See, Linux doesn't have direct access to the LED. The access is > > provided via ACPI WMI. > > So? > > > The way BIOS reports the type of the led is via a bitmap flag. > > So, the same LED can be represented with either single-color > > or multi-color one. See: > > https://www.intel.com/content/dam/support/us/en/documents/intel-nuc/WMI-Spec-Intel-NUC-NUC10ixFNx.pdf > > > > Table 2.2 LED Color Type > > Bit Number Type > > 0 Dual-color Blue / Amber > > 1 Dual-color Blue / White > > 2 RGB-color > > 3 Single-color LED > > > > Also as each NUC can support up to 7, and they may have a mix of > > single color, dual color and RGB LEDs, if we would use the > > multicolor class for the colored ones, that would mean that the > > code will need to be duplicated, as, depending on what the BIOS > > reports, the LED would need to be exposed either as via > > led-multicolor-class or as leds-class. > > So? > > > Worse than that, there's even a WMI command that would allow > > to "switch LED type" (see page 8). On other words, the BIOS can > > expose a "virtual" single-color LED, but actually implemented > > in hardware using a RGB one, and this can be changed in real time. > > So you simply always use it as RGB one? Hmm... are you meaning that I should only use the multicolor led class, even when the BIOS is reporting the LEDs as single color? I can surely do that. > > Best regards, > Pavel Thanks, Mauro