Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp357341lqh; Fri, 31 May 2024 03:38:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFXQWYB9bvHA+H4KVU5gaLnOYLYFbC/DdUI6IH9NEghuF52GkgKRNo01R7HQimxY6d7ZBx6j0W5/Gqo+7M24FvFoCLzJpqlfWgDaW+Sg== X-Google-Smtp-Source: AGHT+IGGMYPjVafLkOKeX6RAzmISWckPn7chFD0t7t9Xm2R7yRq+nVo2cWqS8uRoYMwgmkshDMIC X-Received: by 2002:a17:906:a008:b0:a62:2c5f:5a64 with SMTP id a640c23a62f3a-a681fc5c68amr112919366b.15.1717151932603; Fri, 31 May 2024 03:38:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717151932; cv=pass; d=google.com; s=arc-20160816; b=oOnmK0jo4UI0WqpW+26lok8ptI56QyFl2R/VSMC+uia/ShNm6niCAsTN4Q+P899pUp Us6m3eI4mUygcYwrcJgyssjcnZYAWdNvjvQ7id318u8vV0tXfKN+W4va3f26C2DzSMpb CRINbJmog3OLe160l2FtdL7wsEUjxV+agMsC9nsSdW+ZNEbN5gZ45tJkNX18yjScnZv/ xcrkj1Ad0Uf37mP0KZ3EEpQEBzriBF3LZdyQwkIX4sR4SNwiuPnEIgr7JgJUuX4rEUgL d/IOWmOatueRzfRHqdFnmfylk0K9KVTg1HD7uJGhXLpYRTOu7OzQ/+NJyfWptkOdO0L7 TJsg== 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=WYmIKYhdYOmIQc0MDLFiI96YzwZFCBQvvnD93aDnZss=; fh=cPe/XQWUPVFT1z4dSQcqwn5SeKixfLYQh9c/tWdxsIQ=; b=OEBK3WD0OkDFzuj1QJM+kvs5up39sVex1SkrNbd4kVxtpcIhSpW8V6PwDu39a4Fg1R mbCaLn0Ik4gl/RWmRlYs2B9TVBoP6TomIJ3FdQbtn+XeLpc4pqvc+MwoKVApWR/AXWc4 TVuRzeYM8HTkY8VoNzxDFjeOWVhD9VollRv36AhLNrBQL30nbU2ctLz9JvvHpzbXeiVI oBTinNFsUWI1GwVC/jLMfp/sHk0cM2juDRJ4eU0K/UHN3PjM4ZBEPdgvCcebSPAD2WCF kKC7ncnoMvL5ElgXUYLnBDYb/oGkUSsd8b7pN676T9R6WcYP9aDxlBcVnd3LjLNIk3xO 15ig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I26DnSIc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196680-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196680-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a67e6f02b09si80980566b.139.2024.05.31.03.38.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 03:38:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196680-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I26DnSIc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196680-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196680-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 37EEF1F25442 for ; Fri, 31 May 2024 10:38:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A52A15624D; Fri, 31 May 2024 10:38:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I26DnSIc" 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 729B9155CB4; Fri, 31 May 2024 10:38:45 +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=1717151925; cv=none; b=R2HLgqY91SgFqqGH7oYlMiSMXYJgFDOGU+Iyd7v2d2rxyDlPEf8ZosAS1KTsCDFrZUtydt7obJvWkp9wUr2+TgLo0FZ0rY05s7QI9sgd2n02ju8l3xiCCShNTVSqcZOOMIRPmYtZYdTWaQkRMWmxdFM3Bp6KhiUe4WLqFj6PFoE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717151925; c=relaxed/simple; bh=h/2sOB9x1IUImpZzBBj2jDaXq1nmHaIGab6FBR+GwAo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Qlt8I68xZ4Iq8nbUMUZk10zaMujwd3o5Cl/34adJUFLzemCflGwnNZWUM+IolVtRWyBRaB6ZtJ8mHdyx4U7ntDROWJG9TOhPE/QrK6EG4FelCfOSt4Ibd60X+zZ0hMgCGCG71idjQn9KdzsL6xhMUsNv7b2E3J9UdHgQ59HWCLQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I26DnSIc; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38167C116B1; Fri, 31 May 2024 10:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717151925; bh=h/2sOB9x1IUImpZzBBj2jDaXq1nmHaIGab6FBR+GwAo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I26DnSIcFGef+qsXDEWbQkVxxktWUDIDKCPzFYgx7pK4mCFk5Xv0LonIfoQzFbfyH J/acrbKpqHQHwuf3yQ9aP4VUJC1isRCeUXRCM40FMcfNY6dXIMAJbIRtSGj59d495V 1g0M9/ijeVnYV90NIy57eCnGJTE5YTvgGjVjqB7KjAcziP6B8fS5gBby/h2LUHZ2zS EEouwQESdZ+/muMhtpUKPQ6OBFTQPX5yr0tpgSIu/jxP4FyasNCoB7JvL4J0xK1kA/ G7DpYbOrz2LPpEAw0MYuxKc5EhXNxOEro/VbXL+20rIXuD9GaHR5XLPYaCV2fQ3tY7 xcOmo35hWcQ8g== Date: Fri, 31 May 2024 11:38:40 +0100 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 v7] Add multicolor support to BlinkM LED driver Message-ID: <20240531103840.GC1005600@google.com> References: <20240506201905.789376-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: <20240506201905.789376-1-jstrauss@mailbox.org> On Mon, 06 May 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 > Changes in v7: > - Fix formatting and spelling errors > > Documentation/leds/leds-blinkm.rst | 31 +++- > Documentation/leds/well-known-leds.txt | 8 + > drivers/leds/Kconfig | 8 + > drivers/leds/leds-blinkm.c | 224 +++++++++++++++++-------- > 4 files changed, 199 insertions(+), 72 deletions(-) Applying patch(es) Applying: Add multicolor support to BlinkM LED driver Using index info to reconstruct a base tree... M Documentation/leds/well-known-leds.txt M drivers/leds/Kconfig M drivers/leds/leds-blinkm.c Checking patch Documentation/leds/leds-blinkm.rst... Checking patch Documentation/leds/well-known-leds.txt... Checking patch drivers/leds/Kconfig... Checking patch drivers/leds/leds-blinkm.c... Applied patch Documentation/leds/leds-blinkm.rst cleanly. Applied patch Documentation/leds/well-known-leds.txt cleanly. Applied patch drivers/leds/Kconfig cleanly. Applied patch drivers/leds/leds-blinkm.c cleanly. Falling back to patching base and 3-way merge... error: Your local changes to the following files would be overwritten by merge: Documentation/leds/leds-blinkm.rst Documentation/leds/well-known-leds.txt drivers/leds/Kconfig drivers/leds/leds-blinkm.c Please commit your changes or stash them before you merge. Aborting error: Failed to merge in the changes. Patch failed at 0001 Add multicolor support to BlinkM LED driver -- Lee Jones [李琼斯]