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=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 D55B6C2BA1B for ; Sun, 5 Apr 2020 16:37:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86622206B8 for ; Sun, 5 Apr 2020 16:37:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="pyQYLYsF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727356AbgDEQhA (ORCPT ); Sun, 5 Apr 2020 12:37:00 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:58904 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726696AbgDEQg7 (ORCPT ); Sun, 5 Apr 2020 12:36:59 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 035Gardi026340; Sun, 5 Apr 2020 11:36:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1586104613; bh=G6SDuQLlnW4lCFkGwgKC3dY+eDXPF0x7H5NXfle18g4=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=pyQYLYsFQ/1CzT5K9GemB0iwOvEqX5OekSyT4de2sNk7i9QWTeclIr6d+wGdSGDeQ 2rsyVt0XWPoMWx6eAYB4s/YQH0tqwyrwpjslgJJa6o4SDGMmNtuEREcE4xr5Np7aJ0 9eb2+R6OLkSPtfv4hhtIIruqAmd/OgnRlI7seFGY= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 035GarPB100000 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 5 Apr 2020 11:36:53 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Sun, 5 Apr 2020 11:36:53 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Sun, 5 Apr 2020 11:36:53 -0500 Received: from [10.250.65.13] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 035GaqJL013966; Sun, 5 Apr 2020 11:36:52 -0500 Subject: Re: [PATCH v19 04/18] leds: multicolor: Introduce a multicolor class definition To: Randy Dunlap , Jacek Anaszewski , CC: , References: <20200402204311.14998-1-dmurphy@ti.com> <20200402204311.14998-5-dmurphy@ti.com> <619a1251-d062-b9bf-6752-b867fcaa600b@infradead.org> <34b07ce8-6a38-f45c-4624-730f5597f686@ti.com> <1cbe954e-76fb-9164-6b8c-af4ac70fcd05@infradead.org> From: Dan Murphy Message-ID: Date: Sun, 5 Apr 2020 11:31:06 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <1cbe954e-76fb-9164-6b8c-af4ac70fcd05@infradead.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit 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 4/5/20 11:28 AM, Randy Dunlap wrote: > On 4/5/20 9:18 AM, Dan Murphy wrote: >> Jacek >> >> On 4/5/20 10:08 AM, Jacek Anaszewski wrote: >>> Dan, >>> >>> On 4/3/20 4:39 PM, Dan Murphy wrote: >>>> Randy >>>> >>>> Thanks for the review >>>> >>>> On 4/2/20 10:47 PM, Randy Dunlap wrote: >>>>> Hi, >>>>> Here are a few changes for you to consider: >>>>> >>>>> On 4/2/20 1:42 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 >>>>>        multicolor >>>> Ack >>>>>> 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 >>>>>> --- >>>>>> diff --git a/Documentation/leds/leds-class-multicolor.rst >>>>>> b/Documentation/leds/leds-class-multicolor.rst >>>>>> new file mode 100644 >>>>>> index 000000000000..5bb004999248 >>>>>> --- /dev/null >>>>>> +++ b/Documentation/leds/leds-class-multicolor.rst >>>>>> @@ -0,0 +1,95 @@ >>>>>> +==================================== >>>>>> +Multi Color LED handling under Linux >>>>>     Multicolor >>>> Ack >>>>>> +==================================== >>>>>> + >>>>>> +Description >>>>>> +=========== >>>>>> +The multi color class groups monochrome LEDs and allows controlling two >>>>>         multicolor >>>> Ack >>>>>> +aspects of the final combined color: hue and lightness. The former is >>>>>> +controlled via the color_intensity array file and the latter is >>>>>> controlled >>>>>> +via brightness file. >>>>>> + >>>>>> +For more details on hue and lightness notions please refer to >>>>>> +https://en.wikipedia.org/wiki/CIECAM02. >>>>>> + >>>>>> +Multicolor Class Control >>>>>> +======================== >>>>>> +The multicolor class presents files that groups the colors as >>>>>> indexes in an >>>>>> +array.  These files are children under the LED parent node created >>>>>> by the >>>>>> +led_class framework.  The led_class framework is documented in >>>>>> led-class.rst >>>>>> +within this documentation directory. >>>>>> + >>>>>> +Each colored LED will be indexed under the color_* files. The order >>>>>> of the >>>>>> +colors are arbitrary the color_index file can be read to determine >>>>>> the color >>>>>> +to index value. >>>>>> + >>>>>> +The color_index file is an array that contains the string list of >>>>>> the colors as >>>>>> +they are defined in each color_* array file. >>>>>> + >>>>>> +The color_intensity is an array that can be read or written to for the >>>>>> +individual color intensities.  All elements within this array must >>>>>> be written in >>>>>> +order for the color LED intensities to be updated. >>>>>> + >>>>>> +The color_max_intensity is an array that can be read to indicate >>>>>> each color LED >>>>>> +maximum intensity value. >>>>>> + >>>>>> +The num_color_leds file returns the total number of color LEDs that are >>>>>> +presented in each color_* array. >>>>>> + >>>>>> +Directory Layout Example >>>>>> +======================== >>>>>> +root:/sys/class/leds/multicolor:status# ls -lR >>>>>> +-rw-r--r--    1 root     root          4096 Oct 19 16:16 brightness >>>>>> +-r--r--r--    1 root     root          4096 Oct 19 16:16 color_index >>>>>> +-rw-r--r--    1 root     root          4096 Oct 19 16:16 >>>>>> color_intensity >>>>>> +-r--r--r--    1 root     root          4096 Oct 19 16:16 num_color_leds >>>>>> + >>>>>> +Multicolor Class Brightness Control >>>>>> +=================================== >>>>>> +The multiclor class framework will calculate each monochrome LEDs >>>>>> intensity. >>>>>         multicolor >>>> Ack >>>>>> + >>>>>> +The brightness level for each LED is calculated based on the color LED >>>>>> +intensity setting divided by the parent max_brightness setting >>>>>> multiplied by >>>>>> +the requested brightness. >>>>>> + >>>>>> +led_brightness = brightness * color_intensity/max_brightness >>>>>> + >>>>>> +Example: >>>>>> +A user first writes the color_intensity file with the brightness levels >>>>>> +that for each LED that is necessary to achieve a blueish violet >>>>>> output from a >>>>> drop first "that". >>>> Ack >>>>>                       that are >>>>> necessary                                   from an >>>> Ack and NACK the "from an".  It is from a since R is a consonant >>> But it sounds like a vowel and this rule for creating articles >>> "applies to the sound of the letter beginning the word, not just the >>> letter itself" [0]. >>> >>> [0] https://www.grammar.com/a-vs-an-when-to-use/ >>> >> We have had the same internal debate here at work. >> >> How does "Red" when you say it sound like a vowel?  It is definitely a "R" sound that is first not a vowel sound. >> >> To me "from an RGB" does not sound correct "from a RGB" is actually correct here because R or Red still leads with a consonant in both the sound and letter. >> >> If it sounds as if it is beginning with a vowel sound, *use an*.  Like in "an honor" as the h is silent here.  R is not silent in Red or RGB. > It depends on how one reads "from a RGB." Do you say/think the letters R G B > (I do), or do you think/say red-green-blue? > > From the [0] web page: > Articles with Acronyms, a or an > > Finally, the rule applies to acronyms as well. If you pronounce a letter as a letter and it begins with a vowel sound, you should precede it with an. The consonants with vowel sounds include f, h, l, m, n, r, s, and x. > > He flew in an SST. He fired an M‑1. He attended an FDA hearing. > > By the same token, if a vowel letter, with a consonant sound, is pronounced as a letter, you should use a. > > He made a U‑turn. > > Got it? So what is your grade? > > An A? A B? Surely not an F. > > I will change it.  Its not that big of a change and not worth a continued debate Dan