Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp375470lqh; Tue, 7 May 2024 01:37:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVpO+tVWPnpmq9FTg0d6f2e8kBHBVO+5slIVTr2t2ZtRI8kgv7+7b4TqD/TsZrM5kJz4C9OCFF5o3j85sUEowKE9jMW9YKR3dwFiohc+w== X-Google-Smtp-Source: AGHT+IF+T8h/pJi8LbB9hU/pdZodrnA8Arpl/iI2XJDaRONqNlgAle2d8avkuXF07zQ0IyjuF7I5 X-Received: by 2002:a05:6a20:3c8e:b0:1af:ac8c:4366 with SMTP id b14-20020a056a203c8e00b001afac8c4366mr2318528pzj.30.1715071066611; Tue, 07 May 2024 01:37:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715071066; cv=pass; d=google.com; s=arc-20160816; b=T89tISG381n8Uo4qkDW6I6FZIKuLiMmBXqZs1AVzFNkZrfVSQo3e8/NDrU91ziWcNG RKS1+zMR6RiDa3ZjcMvahKSJMybR36xvOuOXedJpmx6TSd1e6q6nLnDKKoJDYf0VZTIU etsZV12nIs5unNjrs6ZSza1nioTP3m09rPYW1Yv2273qqm9tNG0Ob8JBSWhZlhxdqDs6 0Lq0+P74TFE2Xc7JPkZ6zYxaOBF7efHBmjRslpUIN0yql6RnO/Cw8zDJXxSEG8NtsaCW T3VSNBxHFu6TxNwaMkyzyHrkXyx6RQwZsJM8SR8LgfI+ylex+wSbY9odhLb9anwluz0r BmWw== ARC-Message-Signature: i=2; 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=1usUF93y6fod3kJZKggEuWsjtu680iu18BNEwiZ0ojo=; fh=o+dekRqAdzbbk0j38DtDemRluutLWYM2Dxji1jvixQ4=; b=tqJX/NTe/Gp1inWveaVIPKAQxlt1FHrYGDSmmz3M+Tvx4GHfpg59THcrkAm2TYfhAh ObYjTZuvueuXZrdwadCrEW7Mput+cMKHIiVJYHVRuutDWvaj9QBihWaxyVF+WuF697A7 yp+EHY55s0XUz6ymLqC4JCiwpgTaRIbdAMSAVa5Lt3WgJLG5+RZHhdjDn9h6BSGvRojR Eh2RAHoFxliJZS24wgBXjdd5OimxRAmqhcWncxRx4VyLIqevXKTrFiEL/i0qjSA7M0be /8qenqhKZGxL6h87b3qawPvy5gNfaao+LRpiLTkILpA9wwukYdkND3lijpY3SH2Hm0PS tn+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F4hpFepO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-170879-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170879-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 fi28-20020a056a00399c00b006f3e9aa0eabsi10214832pfb.257.2024.05.07.01.37.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 01:37:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170879-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=F4hpFepO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-170879-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170879-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 41AE1284B68 for ; Tue, 7 May 2024 08:37:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5157F14D2A3; Tue, 7 May 2024 08:37:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F4hpFepO" 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 7A1EE197; Tue, 7 May 2024 08:37:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715071059; cv=none; b=h7Yz8k85OokL0wP66LPl3GZjKwzJ4PrdU0sMSiLKS4CDaOeWVO/QoxGV2IzHJqGWpU93UYp1PLHy98gOUsrO6Fg4hCE2hwWEgiHjgrA0Bly5SCwm4Zkt2FnTozdh3QBFwhVs8dQvCboxiod3SJIdhCAcJXDodgHL/XJ//idqfng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715071059; c=relaxed/simple; bh=vi9YOV5qG9HXcW2k/I0KiZGqA7SE9VSwft0G8L/iFhc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UMzcgGUIGDje8Z+DQqogPYWd+t6rhdYFkdFdAa+/Aohqu6aJhFNzvRx54tKXfT/TuRRGGE5SMXCH43R0YgPCEVgNBj5zOeCIJAWFtMHSFE3bNJPz2D6KSu8rzqYjAaVpBN41BgKhG2D3eHzW8XqTLmqwE6K5q1ed0B1HAmToHSs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F4hpFepO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EFDCC2BBFC; Tue, 7 May 2024 08:37:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715071059; bh=vi9YOV5qG9HXcW2k/I0KiZGqA7SE9VSwft0G8L/iFhc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F4hpFepOraGCAv2dQXic6FYIBIztIKWbS33m4jm/h7+ftAUojUVY3FXg6D9ajjXyg V6IagW7AoMAGy6wlnSuEp703/u8OIm8YV3bRVhu0h7W/Bz50u7+GCAlOh94QM3ED+9 uJLGgLbAXXUWF5znr/cI3DCYNM1B98tJlSitXD0TjyvXCJ05y0x5t/n0Xf71bY6DnJ ktn4PpGouvMP0m5RJ78J0gevZ/0A1EwErQYOgT90Na9oollfL0mkx4lr/K/YglqjUY jNWTNcsEXlH2d2PbkEWua99UK/A21+9Q29B7zD0ul0MGq1xwJR4GU6XvJehSe7TRRh 7tM5Z7Q+vKbaQ== Date: Tue, 7 May 2024 09:37:35 +0100 From: Lee Jones To: Joseph Strauss Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6] Add multicolor support to BlinkM LED driver Message-ID: <20240507083735.GV1227636@google.com> References: <20240428162309.32111-1-jstrauss@mailbox.org> <20240503085724.GL1227636@google.com> <20240503232636.kbygwgo6h2c5evqc@libretux> 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: <20240503232636.kbygwgo6h2c5evqc@libretux> On Fri, 03 May 2024, Joseph Strauss wrote: > On 24/05/03 09:57AM, Lee Jones wrote: > > On Sun, 28 Apr 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. > > > > > > 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 > > > Changes in v5: > > > - Fix warnings related to snprintf on s390 architecture, reported by > > > 0-DAY CI Kernel Test Service > > > Changes in v6: > > > - Refactored struct blinkm_led to use a union > > > - Refactored blinkm_probe() > > > - Clarified documentation > > > > > > Documentation/leds/leds-blinkm.rst | 31 +++- > > > Documentation/leds/well-known-leds.txt | 8 + > > > drivers/leds/Kconfig | 8 + > > > drivers/leds/leds-blinkm.c | 223 +++++++++++++++++-------- > > > 4 files changed, 198 insertions(+), 72 deletions(-) > > > > Just tried to apply this, but checkpatch.pl has some complaints. > > > > Please fix them and resubmit, thanks. > > > > -- > > Lee Jones [李琼斯] > I fixed the errors and warnings that resulted from my patch, but am I correct in assuming I am not responsible for fixing the warnings from other parts of the file? It would make the patch messier is my concern. [line wrap?] Yes, you are correct. It's not on you to fix existing issues. -- Lee Jones [李琼斯]