Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp817319ybg; Wed, 23 Oct 2019 06:19:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyojmN0ZN814QRjjBQiD8rxoRP34TsarN+ehNiLoo4dvXAtqnmQVHxxySXB6G7R0/IXQ0Bb X-Received: by 2002:a05:6402:1547:: with SMTP id p7mr26330095edx.28.1571836745279; Wed, 23 Oct 2019 06:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571836745; cv=none; d=google.com; s=arc-20160816; b=y/dP0IOxUDvGI+XHe4xiKUE9cF25I6naJHN3/VHpQ2q3Rn0l50uqh81bL3BnwNGBmx TFaSp0dS3Ow17iq1k5VznC66WIElyaQyDMUWN3vVmiFD21HP807P7ZQ69A4V6rCe4Gk6 /1TQ2q8zcwXsgoaJiRGNuun7uWio9gPOE141p+P6ySLSPlsgjBn6AZtikcVrUt0VW9Uu LnhlSXhV/QFvPgS09V2wCKYfp3C0u/aEqUQ4e/4ROwiRCasR5pDm5n+/MHmCEHJ/rZc5 CNvNK+V6Croht6++VVp1S7zMkMATFP+tVGVtgLIeGvTCdwPwrVu6/Iqy3vNz67FEaI8z nf/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=1grGix7INnquJ+nCoUdro+vIkLychKSPVJAg0lZ8wk0=; b=QgPGnDtFsmOlpMdImoWohpFvk9+N9P+UOxXN42OUIeh7GRSIVeEsMKIKnvFY19j95p ol9SThMU3EUDTDaNZZ0j4dF13h8r/wVuGr8GuwRv7UG5pqxbdNzBxTyhCf2zcT/F18qM wEHkucW8vdFATa3+yfP7g5n6L/kvLSSxMK7TeCk8z7CEvbspOpCzfrFDkWv8SxveUmHC JXl3DPIVSBmd7e1aYNR7ghOP5aZSbjDemB/UW9n/kAp88tSdPZX/Ek3SVZRjb2gTYdjx CVLg04WmFfE2kQst4W7oeQEvp8GXPCvSgI8FJGbCuI1m9c5hIczhgFpG3Re7gMqLCbxO pdiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=PVPvSHOt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si1895174ejv.275.2019.10.23.06.18.36; Wed, 23 Oct 2019 06:19:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=PVPvSHOt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389389AbfJWMXv (ORCPT + 99 others); Wed, 23 Oct 2019 08:23:51 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:46452 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731061AbfJWMXu (ORCPT ); Wed, 23 Oct 2019 08:23:50 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9NCNlt2107907; Wed, 23 Oct 2019 07:23:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1571833427; bh=1grGix7INnquJ+nCoUdro+vIkLychKSPVJAg0lZ8wk0=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=PVPvSHOtEG25iwu/5SPmVOwCgEW2vtGv44Dp5ZzLmoNhpqoyRT0NdflYU8XmkGLke DmX521l0GQ9XsCKEwdDXvc6g905Ps+bYvDgZxtEGwxO+P8lagC8/u41fXsgeHcTucL YOi8Utk/caqmJYVeJjHxh4roqPDEc4GH7WdvgdYQ= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9NCNkx5021415 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 23 Oct 2019 07:23:46 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 23 Oct 2019 07:23:36 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 23 Oct 2019 07:23:36 -0500 Received: from [10.250.35.43] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9NCNkEf000439; Wed, 23 Oct 2019 07:23:46 -0500 Subject: Re: [PATCH v14 04/19] leds: multicolor: Introduce a multicolor class definition To: Jacek Anaszewski , CC: , References: <20191018122521.6757-1-dmurphy@ti.com> <20191018122521.6757-5-dmurphy@ti.com> <8a9084d2-184d-fa12-fd29-56bbc74c58b3@gmail.com> From: Dan Murphy Message-ID: <051c6448-ef98-0a23-4761-10a754e489a5@ti.com> Date: Wed, 23 Oct 2019 07:23:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <8a9084d2-184d-fa12-fd29-56bbc74c58b3@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/18/19 4:44 PM, Jacek Anaszewski wrote: > Dan, > > Thank you for the update. > > On 10/18/19 2:25 PM, Dan Murphy wrote: >> Introduce a multicolor class that groups colored LEDs >> within a LED node. >> >> The multi color class groups monochrome LEDs and allows controlling two >> aspects of the final combined color: hue and lightness. The former is >> controlled via _intensity files and the latter is controlled >> via brightness file. >> >> Signed-off-by: Dan Murphy >> --- >> .../ABI/testing/sysfs-class-led-multicolor | 36 +++ >> Documentation/leds/index.rst | 1 + >> Documentation/leds/leds-class-multicolor.rst | 100 +++++++ >> drivers/leds/Kconfig | 10 + >> drivers/leds/Makefile | 1 + >> drivers/leds/led-class-multicolor.c | 271 ++++++++++++++++++ >> include/linux/led-class-multicolor.h | 97 +++++++ >> 7 files changed, 516 insertions(+) >> create mode 100644 Documentation/ABI/testing/sysfs-class-led-multicolor >> create mode 100644 Documentation/leds/leds-class-multicolor.rst >> create mode 100644 drivers/leds/led-class-multicolor.c >> create mode 100644 include/linux/led-class-multicolor.h > [...] >> # LED Platform Drivers >> diff --git a/drivers/leds/led-class-multicolor.c b/drivers/leds/led-class-multicolor.c >> new file mode 100644 >> index 000000000000..453fd8e913e9 >> --- /dev/null >> +++ b/drivers/leds/led-class-multicolor.c >> @@ -0,0 +1,271 @@ >> +// SPDX-License-Identifier: GPL-2.0 >> +// LED Multi Color class interface >> +// Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include "leds.h" >> + >> +#define INTENSITY_NAME "_intensity" >> +#define MAX_INTENSITY_NAME "_max_intensity" >> + >> +int led_mc_calc_color_components(struct led_classdev_mc *mcled_cdev, >> + enum led_brightness brightness, >> + struct led_mc_color_conversion color_component[]) >> +{ >> + struct led_mc_color_entry *priv; >> + int i = 0; >> + >> + list_for_each_entry(priv, &mcled_cdev->color_list, list) { >> + color_component[i].color_id = priv->led_color_id; >> + color_component[i].brightness = brightness * >> + priv->intensity / priv->max_intensity; >> + i++; >> + } > For lines in the function above: > > s/component/components/ Ack > >> + return 0; >> +} >> +EXPORT_SYMBOL_GPL(led_mc_calc_color_components); >