aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-12-21 04:44:01 -0500
committerBryan Wu <cooloney@gmail.com>2013-02-01 20:47:05 -0500
commit08541cbcc7386fa78efb454a92ddbfb1a2859cf9 (patch)
tree288c9a3b4fcd689cb4551999afa39dbfa2fd0ee2 /Documentation
parent8a66a579083a20172a46e74d175a57621dccae0a (diff)
leds: leds-pwm: Add device tree bindings
The DT binding for the pwm-leds devices are similar to the gpio-leds type. LEDs are represented as sub-nodes of the pwm-leds device. The code for handling the DT boot is based on the code found in the leds-gpio driver and adapted to use PWMs instead of GPIOs. To avoid having custom cleanup code in case of DT boot the newly created devm_of_pwm_get() API is used to get the correct PWM instance. For usage see: Documentation/devicetree/bindings/leds/leds-pwm.txt Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/devicetree/bindings/leds/leds-pwm.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/leds/leds-pwm.txt b/Documentation/devicetree/bindings/leds/leds-pwm.txt
new file mode 100644
index 000000000000..7297107cf832
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-pwm.txt
@@ -0,0 +1,48 @@
1LED connected to PWM
2
3Required properties:
4- compatible : should be "pwm-leds".
5
6Each LED is represented as a sub-node of the pwm-leds device. Each
7node's name represents the name of the corresponding LED.
8
9LED sub-node properties:
10- pwms : PWM property to point to the PWM device (phandle)/port (id) and to
11 specify the period time to be used: <&phandle id period_ns>;
12- pwm-names : (optional) Name to be used by the PWM subsystem for the PWM device
13 For the pwms and pwm-names property please refer to:
14 Documentation/devicetree/bindings/pwm/pwm.txt
15- max-brightness : Maximum brightness possible for the LED
16- label : (optional)
17 see Documentation/devicetree/bindings/leds/common.txt
18- linux,default-trigger : (optional)
19 see Documentation/devicetree/bindings/leds/common.txt
20
21Example:
22
23twl_pwm: pwm {
24 /* provides two PWMs (id 0, 1 for PWM1 and PWM2) */
25 compatible = "ti,twl6030-pwm";
26 #pwm-cells = <2>;
27};
28
29twl_pwmled: pwmled {
30 /* provides one PWM (id 0 for Charing indicator LED) */
31 compatible = "ti,twl6030-pwmled";
32 #pwm-cells = <2>;
33};
34
35pwmleds {
36 compatible = "pwm-leds";
37 kpad {
38 label = "omap4::keypad";
39 pwms = <&twl_pwm 0 7812500>;
40 max-brightness = <127>;
41 };
42
43 charging {
44 label = "omap4:green:chrg";
45 pwms = <&twl_pwmled 0 7812500>;
46 max-brightness = <255>;
47 };
48};