From patchwork Mon Apr 1 17:33:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 161562 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp749933jan; Mon, 1 Apr 2019 10:45:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUwXeE34ICTq6Sa7fWxAJK6FkhaYA2FMmbiFCW1Wic1l5SR81MGdDpakuNShVgcQWpmqlH X-Received: by 2002:a17:902:be04:: with SMTP id r4mr51735136pls.218.1554140708841; Mon, 01 Apr 2019 10:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554140708; cv=none; d=google.com; s=arc-20160816; b=qt0PdEYeMUgydQGOntsAf/Lrl5h/1Ciw7KqohuO3pLIh60deQBH3Df7+YJBCzTZvkw GvgsuJiHrt0Q3O0AY0F0Ue0VrCdpBaSgAP0unPqD64lViGrAglC2M39TCG45wQL8/LyI QSLmlCIA9PU5mHDMIHnoqTnnFDK+QouarSQJi+joTTMpFMryQIvL5cnRCkAdwEWBTrM/ WNNrw0n3xJck44YONOFzRDzewyW8O/9QaKqcg2FNKidhxSbT2gH4kkuV4vhKfxiwxWV8 G8dQM4zatKcqnQ27naXhq1NtHx5VZ1S9L/HtxIg+g06JaWdXBAMsoyE1lpljqqgzRaJt gkvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=xDYlTH5XXfThFNxXnCwRk3hxMj0oZHMo/0kqlGCr+P8=; b=vgRIUhhUnWGJccQ8rxeh5ZJNLCn8wA5e+H4CPAD23iisGuDBiTBliR8NG+vXbFzzIX Ja7VLHYw5aKfteOcZ84phCIFhRDctjvyst3hUepOC14k+AHhm3RdLhs1HObJ/q8ds68F ro7JLhtUfMXw/s0CSXbiLp1NJxCHsLj8YQLTaJ3ZcGTGKUlswdnOd1AcoZlWrninLAgI h+RmzvzuLgdich4GQ0BBl3VHNnSxs6rvTnURtWXsB0gYzDGbtKuGHPfllsBcPQf1fB1n r0HFc8Y06lKvTpm9JeY9EKUwUuUktqUDpSCDTANTxgdo7S4EGj92DV2W817N2joGutgg 9etA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=wt+Viejc; 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 4si9306018plh.289.2019.04.01.10.45.08; Mon, 01 Apr 2019 10:45:08 -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=wt+Viejc; 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 S2387759AbfDAReW (ORCPT + 31 others); Mon, 1 Apr 2019 13:34:22 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:34210 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387556AbfDAReR (ORCPT ); Mon, 1 Apr 2019 13:34:17 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x31HY41r129011; Mon, 1 Apr 2019 12:34:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554140044; bh=xDYlTH5XXfThFNxXnCwRk3hxMj0oZHMo/0kqlGCr+P8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=wt+Viejc7IW4vTS6ae4Gh7bCMhr6r5NosiXz6r21flpDIcWMLabMkvBdQWgR4DAab aIrHeu6Gw3xV3pJVSg/l1BUb2p31JmC07TuTrIZPIhbMhBRKzyyAalK8I+pD4Sg9TZ cX7chlNuYPR194wYCjVcpIbi4aS17+kRIlwzR9tw= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x31HY46b110627 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 1 Apr 2019 12:34:04 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 1 Apr 2019 12:34:04 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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.1713.5 via Frontend Transport; Mon, 1 Apr 2019 12:34:03 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x31HY33c036390; Mon, 1 Apr 2019 12:34:03 -0500 From: Dan Murphy To: , , CC: , , , Dan Murphy Subject: [RFC PATCH 2/5] dt: bindings: Add multicolor class dt bindings documention Date: Mon, 1 Apr 2019 12:33:57 -0500 Message-ID: <20190401173400.14238-3-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20190401173400.14238-1-dmurphy@ti.com> References: <20190401173400.14238-1-dmurphy@ti.com> MIME-Version: 1.0 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 Add DT bindings for the LEDs multicolor class framework. Signed-off-by: Dan Murphy --- .../bindings/leds/leds-class-multicolor.txt | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-class-multicolor.txt -- 2.19.0 diff --git a/Documentation/devicetree/bindings/leds/leds-class-multicolor.txt b/Documentation/devicetree/bindings/leds/leds-class-multicolor.txt new file mode 100644 index 000000000000..4b1a26104c79 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-class-multicolor.txt @@ -0,0 +1,140 @@ +* Multicolor LED properties + +Multicolor LEDs can consist of a RGB, RGBW or a RGBA LED clusters. These devices +can be grouped together and also provide a modeling mechanism so that the +cluster LEDs can vary in hue and intensity to produce a wide range of colors. + +The nodes and properties defined in this document are unique to the multicolor +LED class. Common LED nodes and properties are inherited from the common.txt +within this documentation directory. + +Required LED Child properties: + - color : This is the color ID of the LED. Definitions can be found + in include/linux/leds/common.txt + +Optional LED Child properties: + - available-brightness-models : This is the phandle to the brightness-model + node(s) that this LED cluster can support. + +Required Brightness model properties + - led-brightness-model : This flag alerts the device driver and class + code that this node is a brightness model node + and to process the properties differently. + +Required Brightness model child properties + - model_name : This is the name of the model presented to the user. This + should be a color that the LED cluster can produce for + the device it is attached to. + - layout : This is the LED layout for the levels. This layout will + determine the color order of the levels. The layout and + level-x properties array should be the same size. + - level-x : These are the values for the LEDs to produce the color that + is defined. These values are placed in the array according + to the layout property. + +led-controller@30 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,lp5024"; + reg = <0x29>; + + lp5024_model_yellow: brightness-models { + led-brightness-model; + model@0 { + model_name = "yellow"; + layout = ; + level-1 = <255 227 40>; + level-2 = <255 240 136>; + level-3 = <255 247 196>; + }; + }; + + lp5024_model_orange: brightness-models { + led-brightness-model; + model@1 { + model_name = "orange"; + layout = ; + level-1 = <236 140 16>; + level-2 = <236 157 55>; + level-3 = <236 183 115>; + }; + }; + + multi-led@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + label = "rgb:led_mod4"; + available-brightness-models = <&lp5024_model_yellow>; + + led@12 { + reg = <12>; + color = ; + }; + + led@13 { + reg = <13>; + color = ; + }; + + led@14 { + reg = <14>; + color = ; + }; + }; + + /* Only support RGB no model defined */ + multi-led@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + label = "rgb:led_mod1"; + + led@3 { + reg = <3>; + color = ; + }; + + led@4 { + reg = <4>; + color = ; + }; + + led@5 { + reg = <5>; + color = ; + }; + }; + + multi-led@2 { + #address-cells = <1>; + #size-cells = <0>; + label = "rgb:banks"; + reg = <2>; + ti,led-bank = <2 3 5>; + available-brightness-models = <&lp5024_model_orange>; + + led@6 { + reg = <0x6>; + color = ; + led-sources = <6 9 15>; + }; + + led@7 { + reg = <0x7>; + color = ; + led-sources = <7 10 16>; + }; + + led@8 { + reg = <0x8>; + color = ; + led-sources = <8 11 17>; + }; + }; + +}; From patchwork Mon Apr 1 17:33:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 161561 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp749593jan; Mon, 1 Apr 2019 10:44:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3Kw/iKlIAJKFmNcIbJFeMUCf93q2l5TusXAL09ASG2xysUHuDrgsbRpTxSi4mymZZbLEe X-Received: by 2002:aa7:8518:: with SMTP id v24mr63488904pfn.219.1554140687232; Mon, 01 Apr 2019 10:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554140687; cv=none; d=google.com; s=arc-20160816; b=uyuke5ywu7n/kxCkhn+Ft4dVNtQh6Ldreb7ETqwTOiKvK4x+GG5Tx25AVkiDK8PdNf mVD595HFpFmjvjRvfTFYenFoP2OdWyoHTXdiQK6eQT9R+IrMuUkDTF+ULpUo+6IojVKu qBTFHVLQeJZtKAa/NkG4z5MsuaqsQfiZKk6EJ0JeXxPOw+rlCPaNrA1QaAF0VZs2wS+i SUyOYbKPrWWNQVsEz1KAg994EbAY5Py6KWNSBkqcmvthWYJ25T0PzPNinKb8XBm64NZY ZoIKCkGOthkKcztmlabVq7iAAPvwBQ9EpvFS8mR59wJpULrEUe0/18yKGHspciX9H7tI /pEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=jhFtVq8XbnvL8fgMI7lfcJzn1wR46lpfAaDIbBalNxs=; b=aZ6UkT44C/bPmQEc1WLcm/M/MN2DVUqfH7XdFoe+02yExmDfELzBlgsJk+f6in6DFt GbNZU8nD4WB5lOUQgCb0m7vhbc/d7L4kQwrFmK8+C5fhefbzrPwscPN68ktBquPA2e13 4rDMzNtgTN9fiRzsMNIIJZysTqwDOr6/37OPfMn7wAVs6Gu4LUnqFvFhT31XfPrYaIEF iFTN/t+JfbtWz5R8wNfFDKsb6CmOOYpBFOnXI1vAd732QF6p3fSc/qOU0zapH9BZ15TO lLDhiH4urN66uoskfLVz/m5wrR6f+cWSt0VtFbSeAKRHJOmXGclCosBJoUG61xmpHluc cjyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=h+Nruv5D; 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 k9si9180585pgb.532.2019.04.01.10.44.46; Mon, 01 Apr 2019 10:44:47 -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=h+Nruv5D; 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 S2387781AbfDAReY (ORCPT + 31 others); Mon, 1 Apr 2019 13:34:24 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:33438 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387737AbfDAReR (ORCPT ); Mon, 1 Apr 2019 13:34:17 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x31HY5ce012709; Mon, 1 Apr 2019 12:34:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554140045; bh=jhFtVq8XbnvL8fgMI7lfcJzn1wR46lpfAaDIbBalNxs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=h+Nruv5D4/k7KSkkYycWPUCzIdJ/qjk87ge33kXpBvCMMfSuf92nI7+bTojSIVYoW Fn8KCeeJrbnUaEWU+WN8RUJoFqej1D11JLzulr0vRJnZcfWnsTghlWxt+FHfe7r7if /HuooWq1jqV439eSczhvet+8EeED0CUPJRbLryuc= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x31HY58w019961 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 1 Apr 2019 12:34:05 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 1 Apr 2019 12:34:05 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE107.ent.ti.com (157.170.170.37) 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; Mon, 1 Apr 2019 12:34:04 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x31HY4Lq036411; Mon, 1 Apr 2019 12:34:04 -0500 From: Dan Murphy To: , , CC: , , , Dan Murphy Subject: [RFC PATCH 3/5] documention: leds: Add multicolor class documentation Date: Mon, 1 Apr 2019 12:33:58 -0500 Message-ID: <20190401173400.14238-4-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20190401173400.14238-1-dmurphy@ti.com> References: <20190401173400.14238-1-dmurphy@ti.com> MIME-Version: 1.0 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 Add the support documentation on the multicolor LED framework. This document defines the directores and file generated by the multicolor framework. It also documents usage. Signed-off-by: Dan Murphy --- Documentation/leds/leds-class-multicolor.txt | 99 ++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Documentation/leds/leds-class-multicolor.txt -- 2.19.0 diff --git a/Documentation/leds/leds-class-multicolor.txt b/Documentation/leds/leds-class-multicolor.txt new file mode 100644 index 000000000000..8112b99a7668 --- /dev/null +++ b/Documentation/leds/leds-class-multicolor.txt @@ -0,0 +1,99 @@ + +Multi Color LED handling under Linux +================================================= + +Authors: Dan Murphy + +Description +----------- +There are varying monochrome LED colors available for application. These +LEDs can be used as a single use case LED or can be mixed with other color +LEDs to produce the full spectrum of color. Color LEDs that are grouped +can be presented under a single LED node with individual color control. +The multicolor class groups these LEDs and allows dynamically setting the value +of a single LED or setting the brightness values of the LEDs in the group and +updating the LEDs virtually simultaneously. + +Multicolor Class Control +------------------------- +The multicolor class presents the LED groups under a directory called "colors". +This directory is a child under the LED parent node created but the led_class +framework. The led_class framework is documented in led-class.txt within this +documentation directory. + +Each colored LED is given it's own directory. These directories can be but not +limited to red, green, blue, white, amber, yellow and violet. Under these +directories the brightness and max_brightness files are presented for each LED. + +Under the "colors" directory there are two files created "sync" and +"sync_enable". The sync_enable file controls whether the LED brightness +value is set real time or if the LED brightness value setting is deferred until +the "sync" file is written. If sync_enable is set then writing to each LED +"brightness" file will store the brightness value. Once the "sync" file is +written then each LED color defined in the node will write the brightness of +the LED in the device driver. + +If "sync_enable" is not set then writing the brightness value of the LED to the +device driver is done immediately. Writing the "sync" file has no affect. + +Directory Layout Example +------------------------ +root:/sys/class/leds/rgb:grouped_leds# ls -lR colors/ +colors/: +drwxr-xr-x 2 root root 0 Jun 28 20:21 blue +drwxr-xr-x 2 root root 0 Jun 28 20:21 green +drwxr-xr-x 2 root root 0 Jun 28 20:21 red +--w------- 1 root root 4096 Jun 28 20:21 sync +-rw------- 1 root root 4096 Jun 28 20:22 sync_enable + +colors/blue: +-rw------- 1 root root 4096 Jun 28 20:21 brightness +-r-------- 1 root root 4096 Jun 28 20:27 max_brightness + +colors/green: +-rw------- 1 root root 4096 Jun 28 20:22 brightness +-r-------- 1 root root 4096 Jun 28 20:27 max_brightness + +colors/red: +-rw------- 1 root root 4096 Jun 28 20:21 brightness +-r-------- 1 root root 4096 Jun 28 20:27 max_brightness + +Example of Writing LEDs with Sync Enabled +----------------------------------------- +Below the red, green and blue LEDs are set to corresponding values. These +values are stored and not written until the sync file is written. + +cd /sys/class/leds/rgb:grouped_leds/colors + +echo 1 > sync_enable + +echo 100 > red/brightness +echo 80 > green/brightness +echo 180 > blue/brightness + +* LED device driver has not been updated and the LED states have not changed. +* Writing the LED brightness files again will only change the stored value and +* not the device driver value. + +echo 1 > sync + +* LED device driver has been updated the LEDs should present the brightness +* levels that have been set. Since sync_enable is still enabled writing to the +* LED brightness files will not change the current brightnesses. + +Example of Writing LEDs with Sync Disabled +------------------------------------------ +Below the values of each LED are written to the device driver immediately upon +request. + +cd /sys/class/leds/rgb:grouped_leds/colors + +echo 0 > sync_enable + +echo 100 > red/brightness // Red LED should be on with the current brightness +echo 80 > green/brightness // Green LED should be on with the current brightness +echo 180 > blue/brightness // Blue LED should be on with the current brightness +. +. +. +echo 0 > green/brightness // Green LED should be off