162306a36Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci.. _flash-controls:
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci***********************
662306a36Sopenharmony_ciFlash Control Reference
762306a36Sopenharmony_ci***********************
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciThe V4L2 flash controls are intended to provide generic access to flash
1062306a36Sopenharmony_cicontroller devices. Flash controller devices are typically used in
1162306a36Sopenharmony_cidigital cameras.
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciThe interface can support both LED and xenon flash devices. As of
1462306a36Sopenharmony_ciwriting this, there is no xenon flash driver using this interface.
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci.. _flash-controls-use-cases:
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ciSupported use cases
2062306a36Sopenharmony_ci===================
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciUnsynchronised LED flash (software strobe)
2462306a36Sopenharmony_ci------------------------------------------
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ciUnsynchronised LED flash is controlled directly by the host as the
2762306a36Sopenharmony_cisensor. The flash must be enabled by the host before the exposure of the
2862306a36Sopenharmony_ciimage starts and disabled once it ends. The host is fully responsible
2962306a36Sopenharmony_cifor the timing of the flash.
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ciExample of such device: Nokia N900.
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ciSynchronised LED flash (hardware strobe)
3562306a36Sopenharmony_ci----------------------------------------
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ciThe synchronised LED flash is pre-programmed by the host (power and
3862306a36Sopenharmony_citimeout) but controlled by the sensor through a strobe signal from the
3962306a36Sopenharmony_cisensor to the flash.
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ciThe sensor controls the flash duration and timing. This information
4262306a36Sopenharmony_citypically must be made available to the sensor.
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ciLED flash as torch
4662306a36Sopenharmony_ci------------------
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ciLED flash may be used as torch in conjunction with another use case
4962306a36Sopenharmony_ciinvolving camera or individually.
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci.. _flash-control-id:
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ciFlash Control IDs
5562306a36Sopenharmony_ci-----------------
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci``V4L2_CID_FLASH_CLASS (class)``
5862306a36Sopenharmony_ci    The FLASH class descriptor.
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci``V4L2_CID_FLASH_LED_MODE (menu)``
6162306a36Sopenharmony_ci    Defines the mode of the flash LED, the high-power white LED attached
6262306a36Sopenharmony_ci    to the flash controller. Setting this control may not be possible in
6362306a36Sopenharmony_ci    presence of some faults. See V4L2_CID_FLASH_FAULT.
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci.. tabularcolumns:: |p{5.7cm}|p{11.8cm}|
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci.. flat-table::
6962306a36Sopenharmony_ci    :header-rows:  0
7062306a36Sopenharmony_ci    :stub-columns: 0
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci    * - ``V4L2_FLASH_LED_MODE_NONE``
7362306a36Sopenharmony_ci      - Off.
7462306a36Sopenharmony_ci    * - ``V4L2_FLASH_LED_MODE_FLASH``
7562306a36Sopenharmony_ci      - Flash mode.
7662306a36Sopenharmony_ci    * - ``V4L2_FLASH_LED_MODE_TORCH``
7762306a36Sopenharmony_ci      - Torch mode.
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci        See V4L2_CID_FLASH_TORCH_INTENSITY.
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci``V4L2_CID_FLASH_STROBE_SOURCE (menu)``
8462306a36Sopenharmony_ci    Defines the source of the flash LED strobe.
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci.. tabularcolumns:: |p{7.5cm}|p{7.5cm}|
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci.. flat-table::
8962306a36Sopenharmony_ci    :header-rows:  0
9062306a36Sopenharmony_ci    :stub-columns: 0
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci    * - ``V4L2_FLASH_STROBE_SOURCE_SOFTWARE``
9362306a36Sopenharmony_ci      - The flash strobe is triggered by using the
9462306a36Sopenharmony_ci	V4L2_CID_FLASH_STROBE control.
9562306a36Sopenharmony_ci    * - ``V4L2_FLASH_STROBE_SOURCE_EXTERNAL``
9662306a36Sopenharmony_ci      - The flash strobe is triggered by an external source. Typically
9762306a36Sopenharmony_ci	this is a sensor, which makes it possible to synchronise the
9862306a36Sopenharmony_ci	flash strobe start to exposure start.
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci``V4L2_CID_FLASH_STROBE (button)``
10362306a36Sopenharmony_ci    Strobe flash. Valid when V4L2_CID_FLASH_LED_MODE is set to
10462306a36Sopenharmony_ci    V4L2_FLASH_LED_MODE_FLASH and V4L2_CID_FLASH_STROBE_SOURCE
10562306a36Sopenharmony_ci    is set to V4L2_FLASH_STROBE_SOURCE_SOFTWARE. Setting this
10662306a36Sopenharmony_ci    control may not be possible in presence of some faults. See
10762306a36Sopenharmony_ci    V4L2_CID_FLASH_FAULT.
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ci``V4L2_CID_FLASH_STROBE_STOP (button)``
11062306a36Sopenharmony_ci    Stop flash strobe immediately.
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_ci``V4L2_CID_FLASH_STROBE_STATUS (boolean)``
11362306a36Sopenharmony_ci    Strobe status: whether the flash is strobing at the moment or not.
11462306a36Sopenharmony_ci    This is a read-only control.
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci``V4L2_CID_FLASH_TIMEOUT (integer)``
11762306a36Sopenharmony_ci    Hardware timeout for flash. The flash strobe is stopped after this
11862306a36Sopenharmony_ci    period of time has passed from the start of the strobe.
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci``V4L2_CID_FLASH_INTENSITY (integer)``
12162306a36Sopenharmony_ci    Intensity of the flash strobe when the flash LED is in flash mode
12262306a36Sopenharmony_ci    (V4L2_FLASH_LED_MODE_FLASH). The unit should be milliamps (mA)
12362306a36Sopenharmony_ci    if possible.
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci``V4L2_CID_FLASH_TORCH_INTENSITY (integer)``
12662306a36Sopenharmony_ci    Intensity of the flash LED in torch mode
12762306a36Sopenharmony_ci    (V4L2_FLASH_LED_MODE_TORCH). The unit should be milliamps (mA)
12862306a36Sopenharmony_ci    if possible. Setting this control may not be possible in presence of
12962306a36Sopenharmony_ci    some faults. See V4L2_CID_FLASH_FAULT.
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_ci``V4L2_CID_FLASH_INDICATOR_INTENSITY (integer)``
13262306a36Sopenharmony_ci    Intensity of the indicator LED. The indicator LED may be fully
13362306a36Sopenharmony_ci    independent of the flash LED. The unit should be microamps (uA) if
13462306a36Sopenharmony_ci    possible.
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ci``V4L2_CID_FLASH_FAULT (bitmask)``
13762306a36Sopenharmony_ci    Faults related to the flash. The faults tell about specific problems
13862306a36Sopenharmony_ci    in the flash chip itself or the LEDs attached to it. Faults may
13962306a36Sopenharmony_ci    prevent further use of some of the flash controls. In particular,
14062306a36Sopenharmony_ci    V4L2_CID_FLASH_LED_MODE is set to V4L2_FLASH_LED_MODE_NONE
14162306a36Sopenharmony_ci    if the fault affects the flash LED. Exactly which faults have such
14262306a36Sopenharmony_ci    an effect is chip dependent. Reading the faults resets the control
14362306a36Sopenharmony_ci    and returns the chip to a usable state if possible.
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ci.. tabularcolumns:: |p{8.4cm}|p{9.1cm}|
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci.. flat-table::
14862306a36Sopenharmony_ci    :header-rows:  0
14962306a36Sopenharmony_ci    :stub-columns: 0
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci    * - ``V4L2_FLASH_FAULT_OVER_VOLTAGE``
15262306a36Sopenharmony_ci      - Flash controller voltage to the flash LED has exceeded the limit
15362306a36Sopenharmony_ci	specific to the flash controller.
15462306a36Sopenharmony_ci    * - ``V4L2_FLASH_FAULT_TIMEOUT``
15562306a36Sopenharmony_ci      - The flash strobe was still on when the timeout set by the user ---
15662306a36Sopenharmony_ci	V4L2_CID_FLASH_TIMEOUT control --- has expired. Not all flash
15762306a36Sopenharmony_ci	controllers may set this in all such conditions.
15862306a36Sopenharmony_ci    * - ``V4L2_FLASH_FAULT_OVER_TEMPERATURE``
15962306a36Sopenharmony_ci      - The flash controller has overheated.
16062306a36Sopenharmony_ci    * - ``V4L2_FLASH_FAULT_SHORT_CIRCUIT``
16162306a36Sopenharmony_ci      - The short circuit protection of the flash controller has been
16262306a36Sopenharmony_ci	triggered.
16362306a36Sopenharmony_ci    * - ``V4L2_FLASH_FAULT_OVER_CURRENT``
16462306a36Sopenharmony_ci      - Current in the LED power supply has exceeded the limit specific to
16562306a36Sopenharmony_ci	the flash controller.
16662306a36Sopenharmony_ci    * - ``V4L2_FLASH_FAULT_INDICATOR``
16762306a36Sopenharmony_ci      - The flash controller has detected a short or open circuit
16862306a36Sopenharmony_ci	condition on the indicator LED.
16962306a36Sopenharmony_ci    * - ``V4L2_FLASH_FAULT_UNDER_VOLTAGE``
17062306a36Sopenharmony_ci      - Flash controller voltage to the flash LED has been below the
17162306a36Sopenharmony_ci	minimum limit specific to the flash controller.
17262306a36Sopenharmony_ci    * - ``V4L2_FLASH_FAULT_INPUT_VOLTAGE``
17362306a36Sopenharmony_ci      - The input voltage of the flash controller is below the limit under
17462306a36Sopenharmony_ci	which strobing the flash at full current will not be possible.The
17562306a36Sopenharmony_ci	condition persists until this flag is no longer set.
17662306a36Sopenharmony_ci    * - ``V4L2_FLASH_FAULT_LED_OVER_TEMPERATURE``
17762306a36Sopenharmony_ci      - The temperature of the LED has exceeded its allowed upper limit.
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_ci
18062306a36Sopenharmony_ci
18162306a36Sopenharmony_ci``V4L2_CID_FLASH_CHARGE (boolean)``
18262306a36Sopenharmony_ci    Enable or disable charging of the xenon flash capacitor.
18362306a36Sopenharmony_ci
18462306a36Sopenharmony_ci``V4L2_CID_FLASH_READY (boolean)``
18562306a36Sopenharmony_ci    Is the flash ready to strobe? Xenon flashes require their capacitors
18662306a36Sopenharmony_ci    charged before strobing. LED flashes often require a cooldown period
18762306a36Sopenharmony_ci    after strobe during which another strobe will not be possible. This
18862306a36Sopenharmony_ci    is a read-only control.
189