Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1560087rdd; Thu, 11 Jan 2024 02:58:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSvKTJUv2Qm/cMBxsjwXA6R+19CdHlBN1A9pPF/IE7Tx25mLGC4sDr/s5Pz0mzoINKagT7 X-Received: by 2002:a05:6830:1252:b0:6dc:5f90:8564 with SMTP id s18-20020a056830125200b006dc5f908564mr1055071otp.19.1704970736973; Thu, 11 Jan 2024 02:58:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704970736; cv=none; d=google.com; s=arc-20160816; b=KudJNz34q6Y52Tro8emHflz5F1QxiXSzqfmbMQd22LffodTctBFJta0x5sHRiQgWOl ZGMqblcV+R7CweEndo6bFdeNZCkpdMXnaoo5evPdH3F9PKHo3cRI50HtCU8uUtvuCmyM J682UvgTr24sw/UfLzALjJ4vj2QNXpYydc4E+arhZoo8EjzBuyNQxvMfSp7YVJXwxR+A 3fWjfqWEbR2RcAxD4DW5ujFcljBwv6cWB8AjvInGUfuTuqp0ai3Elj4587bvu67Pk8Zh UWcCuFkObeg165p8SYSJ+GDcx2sI9xt3tz6nH/viCCGpC8h+ZaiBWFcW+ZlskE2roY/T JRlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5dig3qxQc5fWTWcYTH+bdKiDjFvkfnQ4A3aiyyESgh4=; fh=cPe/XQWUPVFT1z4dSQcqwn5SeKixfLYQh9c/tWdxsIQ=; b=cCF2Stv0hSW7JA4vndLX2NPONdf3U5iApth/B3A/pEMjyx6spZ8f+yJ7NHc9/WZaBh y7Vp3aT30pyYMYhqAAyW001a2Ye0uLpy3Y2mdt2VroWFf9Z62X53ADBt/FS8/HfJMHiA tiIogKTr3swqlulFd/H1oyC/TOey/XdSVdgNyfsbKGA4OjVD+ovNM8zeri8w9uzqmI2e 13dwA2LwXmHH+Cb8OoX5ldVAPwPl6dVKP9b4sa2qZ74xuhqwftB85KFZsyc5yIeaKsE4 5qFFK6gd8yyHpqIKL/R+bF87LzQwBsuNSYebQzMgS9CpWqqRrOZOwR4SZWv9/YKXyHkb sM0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pvqQgHrB; spf=pass (google.com: domain of linux-kernel+bounces-23435-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23435-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q63-20020a634342000000b005b95ccd1b4dsi852076pga.82.2024.01.11.02.58.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 02:58:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23435-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pvqQgHrB; spf=pass (google.com: domain of linux-kernel+bounces-23435-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23435-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7D7A528348F for ; Thu, 11 Jan 2024 10:58:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9930B14F76; Thu, 11 Jan 2024 10:58:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pvqQgHrB" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC82C14F65; Thu, 11 Jan 2024 10:58:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0806C433F1; Thu, 11 Jan 2024 10:58:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704970722; bh=ZPmFNbT3sULJipHfdwJsDJ+/K6p0fplCO6ZXJFDlwuU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pvqQgHrBFMIIOQ1F6qtZIzeAZyKo/xS3SbY9P4qoaMaFdOwPE+yiUPJUawBBeyaVu VZAGYiUAEoDeN8OM0cv6+WEDT7xYD43oYJBA1IVOWbdHv1U34noLCI14kkc56YFaqk Pp1gn+mp77YEZZY/wUgPKLdmIsNTgWfFbMG0Qh4V5o2ZN32ePqO7UPQZkFX4cfAGyR I92JYRpWWxHQQoG1QG/wv5C0cF7+sGH6MOsRlfbvCiTiOiq05/dbYeKSq8eFeEpoRm OX25eNa4eAC5cCYnhl5YG367u62MqqQ4VE91SUeqUnZfbjvsJqDgrTfPQl8x5XUsYs l9TRiRoxE/RNw== Date: Thu, 11 Jan 2024 10:58:38 +0000 From: Lee Jones To: Joseph Strauss Cc: pavel@ucw.cz, jansimon.moeller@gmx.de, conor@kernel.org, christophe.jaillet@wanadoo.fr, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] Add multicolor support to BlinkM LED driver Message-ID: <20240111105838.GB1678981@google.com> References: <20240106172944.7593-1-jstrauss@mailbox.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240106172944.7593-1-jstrauss@mailbox.org> On Sat, 06 Jan 2024, Joseph Strauss wrote: > Add multicolor support to the BlinkM driver, making it easier to control > from userspace. The BlinkM LED is a programmable RGB LED. The driver > currently supports only the regular LED sysfs class, resulting in the > creation of three distinct classes, one for red, green, and blue. The > user then has to input three values into the three seperate brightness > files within those classes. The multicolor LED framework makes the > device easier to control with the multi_intensity file: the user can > input three values at once to form a color, while still controlling the > lightness with the brightness file. > > The main struct blinkm_led has changed slightly. The struct led_classdev > for the regular sysfs classes remain. The blinkm_probe function checks > CONFIG_LEDS_BLINKM_MULTICOLOR to decide whether to load the seperate > sysfs classes or the single multicolor one, but never both. The > blinkm_set_mc_brightness() function had to be added to calculate the > three color components and then set the fields of the blinkm_data > structure accordingly. > > All of the feedback has been much appreciated. Thanks! > > Signed-off-by: Joseph Strauss > --- > Changes in v2: > - Replaced instances of the constant 3 with NUM_LEDS, where applicable > - Fixed formatting errors > - Replaced loop inside of blinkm_set_mc_brightness() with equivalent > statements > - Changed id of multicolor class from 4 to 3 > - Replaced call to devm_kmalloc_array() with devm_kcalloc() > Changes in v3: > - Add CONFIG_LEDS_BLINKM_MULTICOLOR to check whether to use multicolor > funcitonality > - Extend well-known-leds.txt to include standard names for RGB and indicator > LEDS > - Change name of Blinkm sysfs class according to well-known-leds.txt > - Simplify struct blinkm_led and struct blinkm_data > - Remove magic numbers > - Fix formatting errors > - Remove unrelated changes > Changes in v4: > - Fix indentation > - Add default case to switch statement > > Documentation/leds/leds-blinkm.rst | 27 ++- > Documentation/leds/well-known-leds.txt | 8 + > drivers/leds/Kconfig | 8 + > drivers/leds/leds-blinkm.c | 217 +++++++++++++++++-------- > 4 files changed, 185 insertions(+), 75 deletions(-) FYI: I won't be reviewing this until all of the build-bots are happy. -- Lee Jones [李琼斯]