Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6284225imu; Wed, 30 Jan 2019 12:00:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN51K8fKi+R5agsaqNwy05iOzucK7EztAXEB+xyfANgEife0t8XXJfM17udM098J13acBRpA X-Received: by 2002:a63:ae01:: with SMTP id q1mr28216534pgf.402.1548878414957; Wed, 30 Jan 2019 12:00:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548878414; cv=none; d=google.com; s=arc-20160816; b=G1CIFC2Ddlp0cUeebxUMEAKCDFfPvIKskqPpxLve94eLciisKmol4a5IkB/6hf1pk+ NIDEHQ4vz4tLd2ZibfdDbIblzF4bhVUkGJLO4k6CkMLBerAi3U1nDWYS3c339UqtBxYM w7kHnhjX72modu71dXXC6Y5sa0xJaDdw/smmGMYpbD31gE/ZIHBCJxIbdW+TgahjlTkB BL3T2ai02QfwNjwx8ot2NRYq7Pp/Wswg/LhW+rGjJgPqC/dVBSkjIJPTLR7FNZRnPnX2 HjZaVUMgxvuoo4MkLUf/ZQa6rI1e69d3QBcjx4K+KSUgQrDxUSqrjMU5V23xXVtgk0CS mDbw== 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=zvfRJknrDHIcRsKQceExcpFozfIp1joBR5g2o7OwTCA=; b=xqWryMO5x9cxE2WJcTEWEFIADnCwHhL8sOInXGIWFF1pVVkWcac98LoEyjIs1UjjZe Vwj3MGsOxGN12PDiA0aYBo4dsYCqB65NbQxZ3Ie6hCYx3QJM+xrh1sCXMh1UC6oC4HAH Py8SMn3TtVt38YqJQH5BuDLPmpFa9p4aans0NUhqNJlEN5nXHrtr9ngk2eRjUHx3WB0z W1h43s/2XN8Wfi1YK8HeeJVtanjQRITz7RitMp5BdCvwh2wWnu9g2ux7g6dXOoe0ti5c 3Kd0P9MYwAxdgXV8e4eY2w+1dIafhZ5b2fLIfcbLTliZUfgeaYdOpuOeXa1UvrZ5562x TUtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=eZRgqpUX; 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 z14si1948770pga.349.2019.01.30.11.59.58; Wed, 30 Jan 2019 12:00:14 -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=@ti.com header.s=ti-com-17Q1 header.b=eZRgqpUX; 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 S1733236AbfA3T7s (ORCPT + 99 others); Wed, 30 Jan 2019 14:59:48 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:53714 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730077AbfA3T7s (ORCPT ); Wed, 30 Jan 2019 14:59:48 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0UJxgxb113615; Wed, 30 Jan 2019 13:59:42 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1548878382; bh=zvfRJknrDHIcRsKQceExcpFozfIp1joBR5g2o7OwTCA=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=eZRgqpUXybEMFUV7Dcn807d2aMreW4QJF4O/U2TH6ZBQ5fUpf6hzp/wNI2IOSSYyD 8Tha1LJJpLWtVwF2ZBc2IXnNRxYoWBsAyajf+pe6RwGywUcqhSzsErQu3BGFDNEJuV FEwwwMkda3GI42cnIQ6Ybca9SZYWCPqOPkFkl17s= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0UJxgaW094612 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 30 Jan 2019 13:59:42 -0600 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 30 Jan 2019 13:59:41 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 30 Jan 2019 13:59:41 -0600 Received: from [172.22.83.85] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0UJxfBt020525; Wed, 30 Jan 2019 13:59:41 -0600 Subject: Re: [RFC PATCH] leds: multicolor: Add sysfs interface definition To: Jacek Anaszewski , , CC: , References: <20190130183005.833-1-dmurphy@ti.com> From: Dan Murphy Message-ID: <333a146a-a469-5b72-5e81-ff7f522dc598@ti.com> Date: Wed, 30 Jan 2019 13:59:33 -0600 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: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit 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 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. 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. I don't think we have fully vetted the brightness-model yet so I prefer to omit it and possibly introduce that later. 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. >> > -- ------------------ Dan Murphy