~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/leds/leds-class-flash.rst

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 ==============================
  2 Flash LED handling under Linux
  3 ==============================
  4 
  5 Some LED devices provide two modes - torch and flash. In the LED subsystem
  6 those modes are supported by LED class (see Documentation/leds/leds-class.rst)
  7 and LED Flash class respectively. The torch mode related features are enabled
  8 by default and the flash ones only if a driver declares it by setting
  9 LED_DEV_CAP_FLASH flag.
 10 
 11 In order to enable the support for flash LEDs CONFIG_LEDS_CLASS_FLASH symbol
 12 must be defined in the kernel config. A LED Flash class driver must be
 13 registered in the LED subsystem with led_classdev_flash_register function.
 14 
 15 Following sysfs attributes are exposed for controlling flash LED devices:
 16 (see Documentation/ABI/testing/sysfs-class-led-flash)
 17 
 18         - flash_brightness
 19         - max_flash_brightness
 20         - flash_timeout
 21         - max_flash_timeout
 22         - flash_strobe
 23         - flash_fault
 24 
 25 
 26 V4L2 flash wrapper for flash LEDs
 27 =================================
 28 
 29 A LED subsystem driver can be controlled also from the level of VideoForLinux2
 30 subsystem. In order to enable this CONFIG_V4L2_FLASH_LED_CLASS symbol has to
 31 be defined in the kernel config.
 32 
 33 The driver must call the v4l2_flash_init function to get registered in the
 34 V4L2 subsystem. The function takes six arguments:
 35 
 36 - dev:
 37         flash device, e.g. an I2C device
 38 - of_node:
 39         of_node of the LED, may be NULL if the same as device's
 40 - fled_cdev:
 41         LED flash class device to wrap
 42 - iled_cdev:
 43         LED flash class device representing indicator LED associated with
 44         fled_cdev, may be NULL
 45 - ops:
 46         V4L2 specific ops
 47 
 48         * external_strobe_set
 49                 defines the source of the flash LED strobe -
 50                 V4L2_CID_FLASH_STROBE control or external source, typically
 51                 a sensor, which makes it possible to synchronise the flash
 52                 strobe start with exposure start,
 53         * intensity_to_led_brightness and led_brightness_to_intensity
 54                 perform
 55                 enum led_brightness <-> V4L2 intensity conversion in a device
 56                 specific manner - they can be used for devices with non-linear
 57                 LED current scale.
 58 - config:
 59         configuration for V4L2 Flash sub-device
 60 
 61         * dev_name
 62                 the name of the media entity, unique in the system,
 63         * flash_faults
 64                 bitmask of flash faults that the LED flash class
 65                 device can report; corresponding LED_FAULT* bit definitions are
 66                 available in <linux/led-class-flash.h>,
 67         * torch_intensity
 68                 constraints for the LED in TORCH mode
 69                 in microamperes,
 70         * indicator_intensity
 71                 constraints for the indicator LED
 72                 in microamperes,
 73         * has_external_strobe
 74                 determines whether the flash strobe source
 75                 can be switched to external,
 76 
 77 On remove the v4l2_flash_release function has to be called, which takes one
 78 argument - struct v4l2_flash pointer returned previously by v4l2_flash_init.
 79 This function can be safely called with NULL or error pointer argument.
 80 
 81 Please refer to drivers/leds/leds-max77693.c for an exemplary usage of the
 82 v4l2 flash wrapper.
 83 
 84 Once the V4L2 sub-device is registered by the driver which created the Media
 85 controller device, the sub-device node acts just as a node of a native V4L2
 86 flash API device would. The calls are simply routed to the LED flash API.
 87 
 88 Opening the V4L2 flash sub-device makes the LED subsystem sysfs interface
 89 unavailable. The interface is re-enabled after the V4L2 flash sub-device
 90 is closed.

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php