Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6441193imu; Wed, 30 Jan 2019 15:00:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN4bCd58GOiCbWJcWJ651kBNvURj2NnH4N1Jk6aotmS5CQStiLFu4IVpPCQFbUNyTgdfhcde X-Received: by 2002:a62:178f:: with SMTP id 137mr32111572pfx.226.1548889212107; Wed, 30 Jan 2019 15:00:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548889212; cv=none; d=google.com; s=arc-20160816; b=zU8PIa/YpFk6uDHDo5c1Ub0TP/3aqVaMOhAjOLtS22Y1owYw3rZ6W873NNms/5eXls zXfvxtACbWg8W8KQw9ISjYJGnlDWBDojOrscZ/BHgc18AIsYKIBpJwt/KJnVuc0MWyAK QZMU6hnOmFYIew9fz2Y2sPe3nje6Z7ntducBsl/XxShnmYjntIxS5U/FByRN3+uf44Gn oUyzKjaU6IlOEcxwbUf4R11TyXRIn131D/wn4urZnDknAOZmY5w0xYqDAyKKZI7zDdvg T5EyLwlksftkZr20c4iG1Nac/lQ81T3YlJvdyDV9yXGeT9tby91KY35qg9NppSTmoPaR Fzcg== 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:from:references:cc:to:subject:dkim-signature; bh=sHh6R0cj+Zd+YyixiSqQDixoTsB4Kn6GO0L0R/czJN8=; b=o5j26nMSDXIgLOA+/qzcK+R5Eh/K3uXVp254kHf9beHE96Y321VWZ/lsj6RnIupyih N+bR9sm24DEeYawJxn/ymd65fpCtcHKfQtfZ4jS3IrRCcS4DuMbaBNASgTres/cAsUxs DIqn6mNjC67XdFiAniTzF1kkY59hgbcLHJSuyJn99ZOyygzE8xUiUEDzGt/NM1Up4ZrK TE/igzmKECCigln6tJRLyNdmU6Foi+gV5dfoxv1poIEW3NBOTbo7AtsbN6mYuVC3OLRn 1oBL+VkObLYqigaRnktD7mXlPVRYqXVrzEOIbnF1JCV9/gfBMD7lFMZqbMbz5uixgx2N 2u5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=azOq5qT2; 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 q2si2676549plr.204.2019.01.30.14.59.56; Wed, 30 Jan 2019 15:00:12 -0800 (PST) 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=azOq5qT2; 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 S1731770AbfA3UUQ (ORCPT + 99 others); Wed, 30 Jan 2019 15:20:16 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:33560 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726857AbfA3UUQ (ORCPT ); Wed, 30 Jan 2019 15:20:16 -0500 Received: by mail-lf1-f68.google.com with SMTP id i26so659298lfc.0; Wed, 30 Jan 2019 12:20:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=sHh6R0cj+Zd+YyixiSqQDixoTsB4Kn6GO0L0R/czJN8=; b=azOq5qT2yRtd2binatQwsCftpQyd4nj1G7iyzsW20eig4DFdXaAemGHih4k4OMHMno yVCtO+G7lpSopBR9drCaX0qtO6AJFGfRvJYjhlUaFj/Pu11dwXfYEA3jr2cEO8G6u1Oy Lvwr9zsrQRU3mZq+Hl26znFuheCE4Vc24gyG7KeRFAOsaoh+tw9xoYi7CfBKhbOTLDIg 8KWTMo/a3lT7uADgwsGxuFj2wlU8Wm4aHypFu0FgamDQ0myUcfk6iMtCxp3X1HM2UEQN +wRE4H0Gjtgi5qJ6m7noHPkjDSjhA2hdzdipSPDFwUIhYDQ1OsmoQLNOCoLOqxpsKd51 +UQQ== 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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sHh6R0cj+Zd+YyixiSqQDixoTsB4Kn6GO0L0R/czJN8=; b=oKjyQFCfYHjre8hrkoDZeE8fbspdKyS6mPpBytE6ne20/FAyIiSdKmXNb+hRCW38UT 0e0QWimbg/szpTdjVWM6IZ+HKEA5M1QQG2jPcXbc8NzjX997zCeMf5BsmOcdU+/jWh4I LlO8D62CbLiyIHNI6V/MEahZtL4Q5GiXq7JQ1EToJTyGw7v5R3XkGH1bkhxNlVTAwN6B PkX8Kd7d5DcS17oavGe/DbSLZ7jjsxc4H8S4WqNvpM+lIGxj5dPltsEdgnKU1rY3jHHk 7U+nr5Wg6UMo+vQC4EkNAmHZi0tzGYDL7agErkWiRKwAdqYP83JRc60HaAL78uzmCd8m uX8g== X-Gm-Message-State: AJcUukfXPe548rnS5pGu2reyCXui74SqJJG6VcLmFbMehxGJk6ZJW4k1 0mpjrUege5MQugIYBpQ68yk0gFQx X-Received: by 2002:a19:4849:: with SMTP id v70mr26429604lfa.62.1548879612483; Wed, 30 Jan 2019 12:20:12 -0800 (PST) Received: from [192.168.1.18] (dks71.neoplus.adsl.tpnet.pl. [83.24.22.71]) by smtp.gmail.com with ESMTPSA id p23sm453685lfh.47.2019.01.30.12.20.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jan 2019 12:20:11 -0800 (PST) Subject: Re: [RFC PATCH] leds: multicolor: Add sysfs interface definition To: Dan Murphy , robh+dt@kernel.org, pavel@ucw.cz Cc: linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org References: <20190130183005.833-1-dmurphy@ti.com> <333a146a-a469-5b72-5e81-ff7f522dc598@ti.com> From: Jacek Anaszewski Message-ID: Date: Wed, 30 Jan 2019 21:20:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <333a146a-a469-5b72-5e81-ff7f522dc598@ti.com> Content-Type: text/plain; charset=utf-8; format=flowed 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 1/30/19 8:59 PM, Dan Murphy wrote: > Jacek > > On 1/30/19 1:37 PM, Jacek Anaszewski wrote: >> Hi Dan, >> >> Thank you for the RFC. >> >> One vital thing is missing - documentation of brightness file must >> be updated to define its semantics for LED multi color class. >> >> Either we need brightness-model file returning only "onoff" option >> available, or, for time being, fix the max_brightness for LED multi >> color class to 1 (which will map to max intensity level for each color). >> > > I can make max_brightness default to 1 if not set by the LED driver. > > But the LP50xx has brightness controls so setting max_brightness from the driver should over ride > the max of 1 in the upper level. Yes, so the max_brightness should be updated basing on current brightness-model. For LEDn_BRIGHTNESS of LP50xx we could have "hw" or maybe even better just "lp50xx-linear" and "lp50xx-logarithmic" - I just forgot about that capability of the device. > For devices that do not support brightness as a separate control we can create a file called > max_brightness_ that defines the max that a specific color can be set to. If max_brightness > is set to 1 then create max_brightness_. If max_brightness > 1 then do not create the files. Right. We will need dedicated max_brightness for each color. They should be placed also in the colors directory, next to the color files. > I don't think we have fully vetted the brightness-model yet so I prefer to omit > it and possibly introduce that later. We need to start from something. It will give better overview of the whole idea. Best regards, Jacek Anaszewski > Dan > >> Best regards, >> Jacek Anaszewski >> >> On 1/30/19 7:30 PM, Dan Murphy wrote: >>> Add a documentation of LED Multicolor LED class specific >>> sysfs attributes. >>> >>> Signed-off-by: Dan Murphy >>> --- >>>   .../ABI/testing/sysfs-class-led-multicolor    | 38 +++++++++++++++++++ >>>   1 file changed, 38 insertions(+) >>>   create mode 100644 Documentation/ABI/testing/sysfs-class-led-multicolor >>> >>> diff --git a/Documentation/ABI/testing/sysfs-class-led-multicolor b/Documentation/ABI/testing/sysfs-class-led-multicolor >>> new file mode 100644 >>> index 000000000000..19f8da9b150e >>> --- /dev/null >>> +++ b/Documentation/ABI/testing/sysfs-class-led-multicolor >>> @@ -0,0 +1,38 @@ >>> +What:        /sys/class/leds//color/sync_enable >>> +Date:        January 2019 >>> +KernelVersion:    5.0 >>> +Contact:    Dan Murphy >>> +Description:    read/write >>> +        Writing a 1 to this file will enable the sychronization of all >>> +        the defined color LEDs within the LED node.  Writing a 0 to >>> +        this file will disable syncing. >>> + >>> +What:        /sys/class/leds//color/sync >>> +Date:        January 2019 >>> +KernelVersion:    5.0 >>> +Contact:    Dan Murphy >>> +Description:    write only >>> +        Writing a 1 to this file while sync_enable is set to 1 will >>> +        synchronize all defined LEDs within the LED node.  All LEDs >>> +        defined will be configured based on the brightness that has >>> +        been requested. >>> + >>> +        If sync_enable is set to 0 then writing a 1 to sync has no >>> +        affect on the LEDs. >>> + >>> +What:        /sys/class/leds//color/ >>> +Date:        January 2019 >>> +KernelVersion:    5.0 >>> +Contact:    Dan Murphy >>> +Description:    read/write >>> +        These files are dynamically created based on the colors defined >>> +        by the registrar of the class. >>> +        The led color(s) can be but not limited to red, green, blue, >>> +        white, amber and violet.  If sync is enabled then writing the >>> +        brightness value of the LED is deferred until a 1 is >>> +        written to /sys/class/leds//color/sync.  If syncing is >>> +        disabled then the LED brightness value will be written >>> +        immediately to the LED driver. >>> + >>> +        The value of the color is from 0 to >>> +        /sys/class/leds//max_brightness. >>> >> > >