linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Murphy <dmurphy@ti.com>
To: <jacek.anaszewski@gmail.com>, <pavel@ucw.cz>, <robh+dt@kernel.org>
Cc: <devicetree@vger.kernel.org>, <linux-leds@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Dan Murphy <dmurphy@ti.com>
Subject: [PATCH v3 3/9] documention: leds: Add multicolor class documentation
Date: Thu, 23 May 2019 14:08:14 -0500	[thread overview]
Message-ID: <20190523190820.29375-4-dmurphy@ti.com> (raw)
In-Reply-To: <20190523190820.29375-1-dmurphy@ti.com>

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 <dmurphy@ti.com>
---
 Documentation/leds/leds-class-multicolor.txt | 99 ++++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 Documentation/leds/leds-class-multicolor.txt

diff --git a/Documentation/leds/leds-class-multicolor.txt b/Documentation/leds/leds-class-multicolor.txt
new file mode 100644
index 000000000000..edbb8139e514
--- /dev/null
+++ b/Documentation/leds/leds-class-multicolor.txt
@@ -0,0 +1,99 @@
+
+Multi Color LED handling under Linux
+=================================================
+
+Author: Dan Murphy <dmurphy@ti.com>
+
+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 by the led_class
+framework.  The led_class framework is documented in led-class.txt within this
+documentation directory.
+
+Each colored LED is given its 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
-- 
2.21.0.5.gaeb582a983


  parent reply	other threads:[~2019-05-23 19:51 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 19:08 [PATCH v3 0/9] Multicolor Framework update Dan Murphy
2019-05-23 19:08 ` [PATCH v3 1/9] leds: multicolor: Add sysfs interface definition Dan Murphy
2019-05-27 10:33   ` Pavel Machek
2019-05-28  0:45     ` Dan Murphy
2019-05-28 11:34       ` Dan Murphy
2019-05-30 19:40         ` Pavel Machek
2019-05-30 20:43           ` Dan Murphy
2019-05-27 20:00   ` Jacek Anaszewski
2019-05-28 17:32     ` Dan Murphy
2019-05-28 17:44       ` Jacek Anaszewski
2019-05-28 18:19         ` Dan Murphy
2019-05-28 18:29           ` Jacek Anaszewski
2019-05-30 14:30             ` Dan Murphy
2019-05-23 19:08 ` [PATCH v3 2/9] dt: bindings: Add multicolor class dt bindings documention Dan Murphy
2019-06-14 17:00   ` Rob Herring
2019-06-14 17:18     ` Dan Murphy
2019-06-18 15:36       ` Rob Herring
2019-06-18 18:19         ` Jacek Anaszewski
2019-06-18 18:57           ` Rob Herring
2019-05-23 19:08 ` Dan Murphy [this message]
2019-05-23 19:08 ` [PATCH v3 4/9] dt-bindings: leds: Add multicolor ID to the color ID list Dan Murphy
2019-06-14 17:00   ` Rob Herring
2019-05-23 19:08 ` [PATCH v3 5/9] " Dan Murphy
2019-05-23 19:08 ` [PATCH v3 6/9] leds: multicolor: Introduce a multicolor class definition Dan Murphy
2019-06-20 16:10   ` Jacek Anaszewski
2019-06-20 20:06     ` Dan Murphy
2019-06-20 21:42       ` Jacek Anaszewski
2019-05-23 19:08 ` [PATCH v3 7/9] dt: bindings: lp50xx: Introduce the lp50xx family of RGB drivers Dan Murphy
2019-05-24 20:50   ` Rob Herring
2019-05-28  0:47     ` Dan Murphy
2019-06-11 21:51   ` Rob Herring
2019-05-23 19:08 ` [PATCH v3 8/9] leds: lp50xx: Add the LP50XX family of the RGB LED driver Dan Murphy
2019-05-23 19:08 ` [PATCH v3 9/9] leds: Update the lp55xx to use the multi color framework Dan Murphy
2019-06-14  7:02 ` [PATCH v3 0/9] Multicolor Framework update Alexander Dahl
2019-06-14 14:23   ` Dan Murphy
2019-06-16 15:49   ` Pavel Machek
2019-06-17 13:47     ` Dan Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190523190820.29375-4-dmurphy@ti.com \
    --to=dmurphy@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).