Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2478227ybb; Sun, 5 Apr 2020 08:30:46 -0700 (PDT) X-Google-Smtp-Source: APiQypLPaT2/OiKQPeJIm7Vgf6MEqQp6seonvv50MLnFTiRlp5WsBTUy9ZBHX6PmTpQNdnQkU4jE X-Received: by 2002:a05:6820:122:: with SMTP id i2mr14133337ood.73.1586100646650; Sun, 05 Apr 2020 08:30:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586100646; cv=none; d=google.com; s=arc-20160816; b=Lppt+AfRp2xqArxgrhe4qjwT9y4G5SrnOgvCzro61dzqPwCOWXYsnC6sBIMkZKvLyi JPIMpiEPAoOCnCvCL7Q4b+1jD1GNp5NDakisAAFlLuMycfOa3zXmJaiD0oYXhK3/2pDz BNiPSNAXFziG3GrpyTmS35CMTVDJZXYvUzTurfuuOW+3icaMcbxO/jCN34jLJebb6qcV XLLoQV20ivDFZX1waALb42BFgRG3Ozhbd68gXj4KzS5R6916hI1875XhGPbih9GVTE6d 1zh80TgcphRhKmeTuzIF6iWIwWrz/sBHD6dqd0otzJCZbd3WFPXNoV1dMRM59TFyDmf1 AIJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=hLkdf7CCKQAWd7+E4rtm5ttVQJDXTuxWKBKsMC1VNOw=; b=U/2y3OznzZp2zcPHLlSpVhHmXZbcp5+b1jhyHVTqUv6KbXMBcQDr4sOQaGiAY9IgLY dZQoO6Re1u5KN0I47aXhzkF0uTEJikbkBNWl6Wg2vYyxaJ5u/c7p1OIX6AOuIqekqkBe wR5mrl0jzRcK/vsGukRfeMObY67vi8t9+gwArVw5ye76ZO+6JOq3219ooT4GIr59hGm9 nfzAvqGH/fxDbzX99zgskAiE97BLSVYs7pq5c/qKtZfGzZK0savKeU1xshdTT4nqCmuT Jnvs20ea7BGRrx5rTpz/iJJTRoiTWI4jA9i88FlQEM/cjEhCmEyl7bsWE5NBzVHWj1ev n4Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aaBe9uCd; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si6063178oim.179.2020.04.05.08.30.02; Sun, 05 Apr 2020 08:30:46 -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=@gmail.com header.s=20161025 header.b=aaBe9uCd; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726883AbgDEPIm (ORCPT + 99 others); Sun, 5 Apr 2020 11:08:42 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40257 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbgDEPIm (ORCPT ); Sun, 5 Apr 2020 11:08:42 -0400 Received: by mail-wr1-f68.google.com with SMTP id s8so12188262wrt.7; Sun, 05 Apr 2020 08:08:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hLkdf7CCKQAWd7+E4rtm5ttVQJDXTuxWKBKsMC1VNOw=; b=aaBe9uCdlusTmK47EMfCTf1vq/g2CFgkj1++nGwtGoW9NiuZSwLe5LDyUutB4f/IVA QU6js0LQzq8kpfwv1oQ+KKF7j3fXzicnGsqo2nDWHFV+wrGeDgZFe5sMzdhoNo79oA/k S6vNPK/89lcHa9Qxx5d9yNp9KZFORQwO6GWwqqRS5mMgrXtwyt02e/0/lG753qL4Ac4i 1Gg9Di3COhX6H5DKEqjJF4PkPKqJz0wj3JbKKzIcqC4sQVXPKtdSVCplnmu31RMdJvbp X3zKb6MnCqXbmuC7pF0hbNCGtuJUyysnto4FyxFKgwvabuQL3NjlWXKtlmxcLkKRaHe5 TmKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=hLkdf7CCKQAWd7+E4rtm5ttVQJDXTuxWKBKsMC1VNOw=; b=Gq3UXxhf/6l0Tte80+REsS1emFjcAKRjN4CKc4y4rEQIzzjIYWLE5SE5GqU0ebFS0z 0SqXfc2ybMQMifa2vLlS24itRUP/6KRNXWOzKXO4sOuWfKG+56mTjFbdJBXVhhD7/j0q F9HCwRRKJvjia9kLrIxaPcJ/C4AP4N3IJxs9TxoMotpcdMSvv1Hu8/WfE8t8wTXckVuu KYzXcDWvw3fUkYQJxgNyAm4YSPXgiqB1kjVanBi81TouATVk5g6YLMTaCVQQo2EnTPLw pSDxU1Gx/oDAOFabsBisyDWbsCbyCRKKgjA5Nj07oeyEvEsfFyS7L1O06qcbfXkseC59 ww5w== X-Gm-Message-State: AGi0PuYctmpTTIMRWB/Uid4oTbl37IH8rFAoNHqxIt38iC1266OzcPhe i1K1SBa3tjIxi3dTJho+8rII0e88 X-Received: by 2002:adf:ee41:: with SMTP id w1mr5257107wro.276.1586099319338; Sun, 05 Apr 2020 08:08:39 -0700 (PDT) Received: from [192.168.1.23] (afde158.neoplus.adsl.tpnet.pl. [95.49.82.158]) by smtp.gmail.com with ESMTPSA id z21sm4409882wml.47.2020.04.05.08.08.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Apr 2020 08:08:38 -0700 (PDT) Subject: Re: [PATCH v19 04/18] leds: multicolor: Introduce a multicolor class definition To: Dan Murphy , Randy Dunlap , pavel@ucw.cz Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org 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> From: Jacek Anaszewski Autocrypt: addr=jacek.anaszewski@gmail.com; prefer-encrypt=mutual; keydata= xsFNBFWjfaEBEADd66EQbd6yd8YjG0kbEDT2QIkx8C7BqMXR8AdmA1OMApbfSvEZFT1D/ECR eWFBS8XtApKQx1xAs1j5z70k3zebk2eeNs5ahxi6vM4Qh89vBM46biSKeeX5fLcv7asmGb/a FnHPAfQaKFyG/Bj9V+//ef67hpjJWR3s74C6LZCFLcbZM0z/wTH+baA5Jwcnqr4h/ygosvhP X3gkRzJLSFYekmEv+WHieeKXLrJdsUPUvPJTZtvi3ELUxHNOZwX2oRJStWpmL2QGMwPokRNQ 29GvnueQdQrIl2ylhul6TSrClMrKZqOajDFng7TLgvNfyVZE8WQwmrkTrdzBLfu3kScjE14Q Volq8OtQpTsw5570D4plVKh2ahlhrwXdneSot0STk9Dh1grEB/Jfw8dknvqkdjALUrrM45eF FM4FSMxIlNV8WxueHDss9vXRbCUxzGw37Ck9JWYo0EpcpcvwPf33yntYCbnt+RQRjv7vy3w5 osVwRR4hpbL/fWt1AnZ+RvbP4kYSptOCPQ+Pp1tCw16BOaPjtlqSTcrlD2fo2IbaB5D21SUa IsdZ/XkD+V2S9jCrN1yyK2iKgxtDoUkWiqlfRgH2Ep1tZtb4NLF/S0oCr7rNLO7WbqLZ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A9x+iulggMZQcWC2GvHCaKIpKcFY8XCxk7Hbl5c 8hcPKWOy16NLO6Y66Ws4kMedXuNUHe4zBLVlRbcYUdgT9Brw8nxmxu3KhEVsJkwOpXLUDuzo hQNfg9em95lpAK+VOTocke8PSESy3GbEtmoMueW3caSeDHb5dRP6WrndaYhEOzAA/KjuPU7J LMXOABOMIq+R38y7e2B3TnVDCrccdZDseFPUWmH0cGCGihH/j2UZG+PImrSDCh3h5MedVHGo sI62tmWm0q6lrljwSZmMZ30w1QaGmdFpI3Q6V+nZ7TZldI3x Message-ID: Date: Sun, 5 Apr 2020 17:08:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <34b07ce8-6a38-f45c-4624-730f5597f686@ti.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/ -- Best regards, Jacek Anaszewski