summaryrefslogtreecommitdiffstats
path: root/Documentation/leds
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-07-01 22:09:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-07-01 22:09:11 -0400
commit13d45f79a2af84de9083310db58b309a61065208 (patch)
tree06968d83ed6e5e23e1f729cf6f096f9a79f14f72 /Documentation/leds
parent05fde26a943a9c55d8b498d97bb49d3d207e5069 (diff)
parentb67893206fc0a0e8af87130e67f3d8ae553fc87c (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED subsystem updates from Bryan Wu: "In this cycle, we finished to merge patches for LED Flash class driver. Other than that we have some bug fixes and new drivers for LED controllers" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (33 commits) leds:lp55xx: fix firmware loading error leds: fix max77693-led build errors leds: fix aat1290 build errors leds: aat1290: pass flags parameter to devm_gpiod_get leds: ktd2692: pass flags parameter to devm_gpiod_get drivers/leds: don't use module_init in non-modular leds-cobalt-raq.c leds: aat1290: add support for V4L2 Flash sub-device DT: aat1290: Document handling external strobe sources leds: max77693: add support for V4L2 Flash sub-device media: Add registration helpers for V4L2 flash sub-devices v4l: async: Add a pointer to of_node to struct v4l2_subdev, match it Documentation: leds: Add description of v4l2-flash sub-device leds: add BCM6358 LED driver leds: add DT binding for BCM6358 LED controller leds: fix brightness changing when software blinking is active Documentation: leds-lp5523: describe master fader attributes leds: lp5523: add master_fader support leds: leds-gpio: Allow compile test if !GPIOLIB leds: leds-gpio: Add missing #include <linux/of.h> gpiolib: Add missing dummies for the unified device properties interface ...
Diffstat (limited to 'Documentation/leds')
-rw-r--r--Documentation/leds/leds-class-flash.txt51
-rw-r--r--Documentation/leds/leds-lp5523.txt30
2 files changed, 81 insertions, 0 deletions
diff --git a/Documentation/leds/leds-class-flash.txt b/Documentation/leds/leds-class-flash.txt
index 19bb67355424..8da3c6f4b60b 100644
--- a/Documentation/leds/leds-class-flash.txt
+++ b/Documentation/leds/leds-class-flash.txt
@@ -20,3 +20,54 @@ Following sysfs attributes are exposed for controlling flash LED devices:
20 - max_flash_timeout 20 - max_flash_timeout
21 - flash_strobe 21 - flash_strobe
22 - flash_fault 22 - flash_fault
23
24
25V4L2 flash wrapper for flash LEDs
26=================================
27
28A LED subsystem driver can be controlled also from the level of VideoForLinux2
29subsystem. In order to enable this CONFIG_V4L2_FLASH_LED_CLASS symbol has to
30be defined in the kernel config.
31
32The driver must call the v4l2_flash_init function to get registered in the
33V4L2 subsystem. The function takes six arguments:
34- dev : flash device, e.g. an I2C device
35- of_node : of_node of the LED, may be NULL if the same as device's
36- fled_cdev : LED flash class device to wrap
37- iled_cdev : LED flash class device representing indicator LED associated with
38 fled_cdev, may be NULL
39- ops : V4L2 specific ops
40 * external_strobe_set - defines the source of the flash LED strobe -
41 V4L2_CID_FLASH_STROBE control or external source, typically
42 a sensor, which makes it possible to synchronise the flash
43 strobe start with exposure start,
44 * intensity_to_led_brightness and led_brightness_to_intensity - perform
45 enum led_brightness <-> V4L2 intensity conversion in a device
46 specific manner - they can be used for devices with non-linear
47 LED current scale.
48- config : configuration for V4L2 Flash sub-device
49 * dev_name - the name of the media entity, unique in the system,
50 * flash_faults - bitmask of flash faults that the LED flash class
51 device can report; corresponding LED_FAULT* bit definitions are
52 available in <linux/led-class-flash.h>,
53 * torch_intensity - constraints for the LED in TORCH mode
54 in microamperes,
55 * indicator_intensity - constraints for the indicator LED
56 in microamperes,
57 * has_external_strobe - determines whether the flash strobe source
58 can be switched to external,
59
60On remove the v4l2_flash_release function has to be called, which takes one
61argument - struct v4l2_flash pointer returned previously by v4l2_flash_init.
62This function can be safely called with NULL or error pointer argument.
63
64Please refer to drivers/leds/leds-max77693.c for an exemplary usage of the
65v4l2 flash wrapper.
66
67Once the V4L2 sub-device is registered by the driver which created the Media
68controller device, the sub-device node acts just as a node of a native V4L2
69flash API device would. The calls are simply routed to the LED flash API.
70
71Opening the V4L2 flash sub-device makes the LED subsystem sysfs interface
72unavailable. The interface is re-enabled after the V4L2 flash sub-device
73is closed.
diff --git a/Documentation/leds/leds-lp5523.txt b/Documentation/leds/leds-lp5523.txt
index 5b3e91d4ac59..0dbbd279c9b9 100644
--- a/Documentation/leds/leds-lp5523.txt
+++ b/Documentation/leds/leds-lp5523.txt
@@ -49,6 +49,36 @@ There are two ways to run LED patterns.
492) Firmware interface - LP55xx common interface 492) Firmware interface - LP55xx common interface
50 For the details, please refer to 'firmware' section in leds-lp55xx.txt 50 For the details, please refer to 'firmware' section in leds-lp55xx.txt
51 51
52LP5523 has three master faders. If a channel is mapped to one of
53the master faders, its output is dimmed based on the value of the master
54fader.
55
56For example,
57
58 echo "123000123" > master_fader_leds
59
60creates the following channel-fader mappings:
61
62 channel 0,6 to master_fader1
63 channel 1,7 to master_fader2
64 channel 2,8 to master_fader3
65
66Then, to have 25% of the original output on channel 0,6:
67
68 echo 64 > master_fader1
69
70To have 0% of the original output (i.e. no output) channel 1,7:
71
72 echo 0 > master_fader2
73
74To have 100% of the original output (i.e. no dimming) on channel 2,8:
75
76 echo 255 > master_fader3
77
78To clear all master fader controls:
79
80 echo "000000000" > master_fader_leds
81
52Selftest uses always the current from the platform data. 82Selftest uses always the current from the platform data.
53 83
54Each channel contains led current settings. 84Each channel contains led current settings.