Source
static inline struct v4l2_flash *v4l2_ctrl_to_v4l2_flash(struct v4l2_ctrl *c)
/*
* V4L2 flash LED sub-device registration helpers.
*
* Copyright (C) 2015 Samsung Electronics Co., Ltd
* Author: Jacek Anaszewski <j.anaszewski@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
struct led_classdev_flash;
struct led_classdev;
struct v4l2_flash;
enum led_brightness;
/**
* struct v4l2_flash_ctrl_data - flash control initialization data, filled
* basing on the features declared by the LED flash
* class driver in the v4l2_flash_config
* @config: initialization data for a control
* @cid: contains v4l2 flash control id if the config
* field was initialized, 0 otherwise
*/
struct v4l2_flash_ctrl_data {
struct v4l2_ctrl_config config;
u32 cid;
};
/**
* struct v4l2_flash_ops - V4L2 flash operations
*
* @external_strobe_set: Setup strobing the flash by hardware pin state
* assertion.
* @intensity_to_led_brightness: Convert intensity to brightness in a device
* specific manner
* @led_brightness_to_intensity: convert brightness to intensity in a device
* specific manner.
*/
struct v4l2_flash_ops {
int (*external_strobe_set)(struct v4l2_flash *v4l2_flash,
bool enable);
enum led_brightness (*intensity_to_led_brightness)
(struct v4l2_flash *v4l2_flash, s32 intensity);
s32 (*led_brightness_to_intensity)
(struct v4l2_flash *v4l2_flash, enum led_brightness);
};
/**
* struct v4l2_flash_config - V4L2 Flash sub-device initialization data
* @dev_name: the name of the media entity,
* unique in the system
* @intensity: non-flash strobe constraints for the LED
* @flash_faults: bitmask of flash faults that the LED flash class
* device can report; corresponding LED_FAULT* bit
* definitions are available in the header file
* <linux/led-class-flash.h>