Zsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget)/translations/zh_CN/leds/leds-class-flashmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/zh_TW/leds/leds-class-flashmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/it_IT/leds/leds-class-flashmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ja_JP/leds/leds-class-flashmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ko_KR/leds/leds-class-flashmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/sp_SP/leds/leds-class-flashmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hFlash LED handling under Linuxh]hFlash LED handling under Linux}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhC/var/lib/git/docbuild/linux/Documentation/leds/leds-class-flash.rsthKubh paragraph)}(hXESome LED devices provide two modes - torch and flash. In the LED subsystem those modes are supported by LED class (see Documentation/leds/leds-class.rst) and LED Flash class respectively. The torch mode related features are enabled by default and the flash ones only if a driver declares it by setting LED_DEV_CAP_FLASH flag.h]hXESome LED devices provide two modes - torch and flash. In the LED subsystem those modes are supported by LED class (see Documentation/leds/leds-class.rst) and LED Flash class respectively. The torch mode related features are enabled by default and the flash ones only if a driver declares it by setting LED_DEV_CAP_FLASH flag.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hIn order to enable the support for flash LEDs CONFIG_LEDS_CLASS_FLASH symbol must be defined in the kernel config. A LED Flash class driver must be registered in the LED subsystem with led_classdev_flash_register function.h]hIn order to enable the support for flash LEDs CONFIG_LEDS_CLASS_FLASH symbol must be defined in the kernel config. A LED Flash class driver must be registered in the LED subsystem with led_classdev_flash_register function.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hFollowing sysfs attributes are exposed for controlling flash LED devices: (see Documentation/ABI/testing/sysfs-class-led-flash)h]hFollowing sysfs attributes are exposed for controlling flash LED devices: (see Documentation/ABI/testing/sysfs-class-led-flash)}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh block_quote)}(hl- flash_brightness - max_flash_brightness - flash_timeout - max_flash_timeout - flash_strobe - flash_fault h]h bullet_list)}(hhh](h list_item)}(hflash_brightnessh]h)}(hhh]hflash_brightness}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hmax_flash_brightnessh]h)}(hj h]hmax_flash_brightness}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhubh)}(h flash_timeouth]h)}(hj h]h flash_timeout}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hmax_flash_timeouth]h)}(hj7h]hmax_flash_timeout}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj5ubah}(h]h ]h"]h$]h&]uh1hhhubh)}(h flash_strobeh]h)}(hjNh]h flash_strobe}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjLubah}(h]h ]h"]h$]h&]uh1hhhubh)}(h flash_fault h]h)}(h flash_faulth]h flash_fault}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjcubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]bullet-uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h!V4L2 flash wrapper for flash LEDsh]h!V4L2 flash wrapper for flash LEDs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hA LED subsystem driver can be controlled also from the level of VideoForLinux2 subsystem. In order to enable this CONFIG_V4L2_FLASH_LED_CLASS symbol has to be defined in the kernel config.h]hA LED subsystem driver can be controlled also from the level of VideoForLinux2 subsystem. In order to enable this CONFIG_V4L2_FLASH_LED_CLASS symbol has to be defined in the kernel config.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h|The driver must call the v4l2_flash_init function to get registered in the V4L2 subsystem. The function takes six arguments:h]h|The driver must call the v4l2_flash_init function to get registered in the V4L2 subsystem. The function takes six arguments:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hjhhubh)}(hhh](h)}(h+dev: flash device, e.g. an I2C deviceh]hdefinition_list)}(hhh]hdefinition_list_item)}(h%dev: flash device, e.g. an I2C deviceh](hterm)}(hdev:h]hdev:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK$hjubh definition)}(hhh]h)}(h flash device, e.g. an I2C deviceh]h flash device, e.g. an I2C device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK$hjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(hFof_node: of_node of the LED, may be NULL if the same as device'sh]j)}(hhh]j)}(h@of_node: of_node of the LED, may be NULL if the same as device'sh](j)}(hof_node:h]hof_node:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK&hj ubj)}(hhh]h)}(h7of_node of the LED, may be NULL if the same as device'sh]h9of_node of the LED, may be NULL if the same as device’s}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhK&hjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(h/fled_cdev: LED flash class device to wraph]j)}(hhh]j)}(h)fled_cdev: LED flash class device to wraph](j)}(h fled_cdev:h]h fled_cdev:}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK(hjLubj)}(hhh]h)}(hLED flash class device to wraph]hLED flash class device to wrap}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hj^ubah}(h]h ]h"]h$]h&]uh1jhjLubeh}(h]h ]h"]h$]h&]uh1jhhhK(hjIubah}(h]h ]h"]h$]h&]uh1jhjEubah}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(hoiled_cdev: LED flash class device representing indicator LED associated with fled_cdev, may be NULLh]j)}(hhh]j)}(hciled_cdev: LED flash class device representing indicator LED associated with fled_cdev, may be NULLh](j)}(h iled_cdev:h]h iled_cdev:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK+hjubj)}(hhh]h)}(hXLED flash class device representing indicator LED associated with fled_cdev, may be NULLh]hXLED flash class device representing indicator LED associated with fled_cdev, may be NULL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK+hjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(hXKops: V4L2 specific ops * external_strobe_set defines the source of the flash LED strobe - V4L2_CID_FLASH_STROBE control or external source, typically a sensor, which makes it possible to synchronise the flash strobe start with exposure start, * intensity_to_led_brightness and led_brightness_to_intensity perform enum led_brightness <-> V4L2 intensity conversion in a device specific manner - they can be used for devices with non-linear LED current scale.h]j)}(hhh]j)}(hX ops: V4L2 specific ops * external_strobe_set defines the source of the flash LED strobe - V4L2_CID_FLASH_STROBE control or external source, typically a sensor, which makes it possible to synchronise the flash strobe start with exposure start, * intensity_to_led_brightness and led_brightness_to_intensity perform enum led_brightness <-> V4L2 intensity conversion in a device specific manner - they can be used for devices with non-linear LED current scale.h](j)}(hops:h]hops:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK8hjubj)}(hhh](h)}(hV4L2 specific opsh]hV4L2 specific ops}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubh)}(hhh](h)}(hexternal_strobe_set defines the source of the flash LED strobe - V4L2_CID_FLASH_STROBE control or external source, typically a sensor, which makes it possible to synchronise the flash strobe start with exposure start,h]j)}(hhh]j)}(hexternal_strobe_set defines the source of the flash LED strobe - V4L2_CID_FLASH_STROBE control or external source, typically a sensor, which makes it possible to synchronise the flash strobe start with exposure start,h](j)}(hexternal_strobe_seth]hexternal_strobe_set}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK3hjubj)}(hhh]h)}(hdefines the source of the flash LED strobe - V4L2_CID_FLASH_STROBE control or external source, typically a sensor, which makes it possible to synchronise the flash strobe start with exposure start,h]hdefines the source of the flash LED strobe - V4L2_CID_FLASH_STROBE control or external source, typically a sensor, which makes it possible to synchronise the flash strobe start with exposure start,}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK3hjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hintensity_to_led_brightness and led_brightness_to_intensity perform enum led_brightness <-> V4L2 intensity conversion in a device specific manner - they can be used for devices with non-linear LED current scale.h]j)}(hhh]j)}(hintensity_to_led_brightness and led_brightness_to_intensity perform enum led_brightness <-> V4L2 intensity conversion in a device specific manner - they can be used for devices with non-linear LED current scale.h](j)}(h;intensity_to_led_brightness and led_brightness_to_intensityh]h;intensity_to_led_brightness and led_brightness_to_intensity}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK8hj?ubj)}(hhh]h)}(hperform enum led_brightness <-> V4L2 intensity conversion in a device specific manner - they can be used for devices with non-linear LED current scale.h]hperform enum led_brightness <-> V4L2 intensity conversion in a device specific manner - they can be used for devices with non-linear LED current scale.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjQubah}(h]h ]h"]h$]h&]uh1jhj?ubeh}(h]h ]h"]h$]h&]uh1jhhhK8hj<ubah}(h]h ]h"]h$]h&]uh1jhj8ubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]j*uh1hhhhK0hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK8hjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(hXconfig: configuration for V4L2 Flash sub-device * dev_name the name of the media entity, unique in the system, * flash_faults bitmask of flash faults that the LED flash class device can report; corresponding LED_FAULT* bit definitions are available in , * torch_intensity constraints for the LED in TORCH mode in microamperes, * indicator_intensity constraints for the indicator LED in microamperes, * has_external_strobe determines whether the flash strobe source can be switched to external, h]j)}(hhh]j)}(hXXconfig: configuration for V4L2 Flash sub-device * dev_name the name of the media entity, unique in the system, * flash_faults bitmask of flash faults that the LED flash class device can report; corresponding LED_FAULT* bit definitions are available in , * torch_intensity constraints for the LED in TORCH mode in microamperes, * indicator_intensity constraints for the indicator LED in microamperes, * has_external_strobe determines whether the flash strobe source can be switched to external, h](j)}(hconfig:h]hconfig:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKKhjubj)}(hhh](h)}(h'configuration for V4L2 Flash sub-deviceh]h'configuration for V4L2 Flash sub-device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjubh)}(hhh](h)}(hBdev_name the name of the media entity, unique in the system,h]j)}(hhh]j)}(hhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK=hjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hflash_faults bitmask of flash faults that the LED flash class device can report; corresponding LED_FAULT* bit definitions are available in ,h]j)}(hhh]j)}(hflash_faults bitmask of flash faults that the LED flash class device can report; corresponding LED_FAULT* bit definitions are available in ,h](j)}(h flash_faultsh]h flash_faults}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKAhjubj)}(hhh]h)}(hbitmask of flash faults that the LED flash class device can report; corresponding LED_FAULT* bit definitions are available in ,h]hbitmask of flash faults that the LED flash class device can report; corresponding LED_FAULT* bit definitions are available in ,}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hj!ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKAhj ubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hRtorch_intensity constraints for the LED in TORCH mode in microamperes,h]j)}(hhh]j)}(hFtorch_intensity constraints for the LED in TORCH mode in microamperes,h](j)}(htorch_intensityh]htorch_intensity}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKDhjQubj)}(hhh]h)}(h6constraints for the LED in TORCH mode in microamperes,h]h6constraints for the LED in TORCH mode in microamperes,}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhjcubah}(h]h ]h"]h$]h&]uh1jhjQubeh}(h]h ]h"]h$]h&]uh1jhhhKDhjNubah}(h]h ]h"]h$]h&]uh1jhjJubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hRindicator_intensity constraints for the indicator LED in microamperes,h]j)}(hhh]j)}(hFindicator_intensity constraints for the indicator LED in microamperes,h](j)}(hindicator_intensityh]hindicator_intensity}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKGhjubj)}(hhh]h)}(h2constraints for the indicator LED in microamperes,h]h2constraints for the indicator LED in microamperes,}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKGhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhhas_external_strobe determines whether the flash strobe source can be switched to external, h]j)}(hhh]j)}(h\has_external_strobe determines whether the flash strobe source can be switched to external, h](j)}(hhas_external_strobeh]hhas_external_strobe}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKKhjubj)}(hhh]h)}(hGdetermines whether the flash strobe source can be switched to external,h]hGdetermines whether the flash strobe source can be switched to external,}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKKhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjuh1hhhhK=hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKKhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjhhhNhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhK$hjhhubh)}(hOn remove the v4l2_flash_release function has to be called, which takes one argument - struct v4l2_flash pointer returned previously by v4l2_flash_init. This function can be safely called with NULL or error pointer argument.h]hOn remove the v4l2_flash_release function has to be called, which takes one argument - struct v4l2_flash pointer returned previously by v4l2_flash_init. This function can be safely called with NULL or error pointer argument.}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhjhhubh)}(h^Please refer to drivers/leds/leds-max77693.c for an exemplary usage of the v4l2 flash wrapper.h]h^Please refer to drivers/leds/leds-max77693.c for an exemplary usage of the v4l2 flash wrapper.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKQhjhhubh)}(hOnce the V4L2 sub-device is registered by the driver which created the Media controller device, the sub-device node acts just as a node of a native V4L2 flash API device would. The calls are simply routed to the LED flash API.h]hOnce the V4L2 sub-device is registered by the driver which created the Media controller device, the sub-device node acts just as a node of a native V4L2 flash API device would. The calls are simply routed to the LED flash API.}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThjhhubh)}(hOpening the V4L2 flash sub-device makes the LED subsystem sysfs interface unavailable. The interface is re-enabled after the V4L2 flash sub-device is closed.h]hOpening the V4L2 flash sub-device makes the LED subsystem sysfs interface unavailable. The interface is re-enabled after the V4L2 flash sub-device is closed.}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKXhjhhubeh}(h]!v4l2-flash-wrapper-for-flash-ledsah ]h"]!v4l2 flash wrapper for flash ledsah$]h&]uh1hhhhhhhhKubeh}(h]flash-led-handling-under-linuxah ]h"]flash led handling under linuxah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jyjvjqjnu nametypes}(jyjquh}(jvhjnju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.