summaryrefslogtreecommitdiff
path: root/include/media
diff options
context:
space:
mode:
authorCharlie Huang <chahuang@nvidia.com>2012-11-02 16:16:04 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 01:05:11 -0700
commit80eb684ad7c3edebe6e8bd5047c338a765479bed (patch)
treefe26fe051d971adc415da6e818ca05daee5e4c7b /include/media
parent2e76fb07fe710db6f3c502817bfc705cbae62e93 (diff)
drivers: tegra: imx091: flash control support
add support of the on-sensor flash control bug 1170146 Change-Id: Ie8f48c5f8065ce4b35f24e7839f78fc6d8579482 Signed-off-by: Charlie Huang <chahuang@nvidia.com> Reviewed-on: http://git-master/r/161015 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/imx091.h8
-rw-r--r--include/media/nvc.h1
-rw-r--r--include/media/nvc_image.h39
3 files changed, 44 insertions, 4 deletions
diff --git a/include/media/imx091.h b/include/media/imx091.h
index b13b7b1e68b8..4c101f35ee28 100644
--- a/include/media/imx091.h
+++ b/include/media/imx091.h
@@ -29,6 +29,13 @@ enum imx091_vreg {
IMX091_VREG_IOVDD,
};
+struct imx091_flash_config {
+ u8 xvs_trigger_enabled;
+ u8 sdo_trigger_enabled;
+ u8 adjustable_flash_timing;
+ u16 pulse_width_uS;
+};
+
struct imx091_platform_data {
unsigned cfg;
unsigned num;
@@ -36,6 +43,7 @@ struct imx091_platform_data {
const char *dev_name;
unsigned gpio_count; /* see nvc.h GPIO notes */
struct nvc_gpio_pdata *gpio; /* see nvc.h GPIO notes */
+ struct imx091_flash_config flash_cap;
struct nvc_imager_cap *cap;
unsigned lens_focal_length; /* / _INT2FLOAT_DIVISOR */
unsigned lens_max_aperture; /* / _INT2FLOAT_DIVISOR */
diff --git a/include/media/nvc.h b/include/media/nvc.h
index 0f9bb9bdf3d7..ec5d6aecc44d 100644
--- a/include/media/nvc.h
+++ b/include/media/nvc.h
@@ -79,6 +79,7 @@ enum nvc_params {
NVC_PARAM_FACTORY_CALIBRATION_DATA,
NVC_PARAM_DEV_ID,
NVC_PARAM_GROUP_HOLD,
+ NVC_PARAM_SET_SENSOR_FLASH_MODE,
NVC_PARAM_BEGIN_VENDOR_EXTENSIONS = 0x10000000,
NVC_PARAM_CALIBRATION_STATUS,
NVC_PARAM_TEST_PATTERN,
diff --git a/include/media/nvc_image.h b/include/media/nvc_image.h
index 41eb771ffd07..aa56a4103a55 100644
--- a/include/media/nvc_image.h
+++ b/include/media/nvc_image.h
@@ -57,8 +57,7 @@
#define NVC_IMAGER_IDENTIFIER_MAX 32
#define NVC_IMAGER_FORMAT_MAX 4
#define NVC_IMAGER_CLOCK_PROFILE_MAX 2
-#define NVC_IMAGER_CAPABILITIES_END ((0x3434 << 16) | \
- NVC_IMAGER_API_CAPS_VER)
+#define NVC_IMAGER_CAPABILITIES_VERSION2 ((0x3434 << 16) | 2)
#define NVC_IMAGER_INT2FLOAT_DIVISOR 1000
@@ -203,8 +202,11 @@ struct nvc_imager_cap {
__u32 preferred_mode_index;
__u64 focuser_guid;
__u64 torch_guid;
- __u32 cap_end;
- __u32 align4;
+ __u32 cap_version;
+ __u8 flash_control_enabled;
+ __u8 adjustable_flash_timing;
+ __u8 align4;
+ __u8 align5;
} __packed;
struct nvc_imager_ae {
@@ -216,6 +218,35 @@ struct nvc_imager_ae {
__u8 gain_enable;
} __packed;
+union nvc_imager_flash_control {
+ __u16 mode;
+ struct {
+ __u16 enable:1; /* enable the on-sensor flash control */
+ __u16 edge_trig_en:1; /* two types of flash controls:
+ * 0 - LED_FLASH_EN - supports continued
+ * flash level only, doesn't
+ * support start edge/repeat/dly.
+ * 1 - FLASH_EN - supports control pulse
+ * control pulse attributes are
+ * defined below.
+ */
+ __u16 start_edge:1; /* flash control pulse rise position:
+ * 0 - at the start of the next frame.
+ * 1 - at the effective pixel end
+ * position of the next frame.
+ */
+ __u16 repeat:1; /* flash control pulse repeat:
+ * 0 - only triggers one frame.
+ * 1 - trigger repeats every frame until
+ * Flash_EN = 0.
+ */
+ __u16 delay_frm:2; /* flash control pulse can be delayed
+ * in frame units: (0 - 3) - frame
+ * numbers the pulse is delayed.
+ */
+ } settings;
+};
+
#define NVC_IOCTL_CAPS_RD _IOWR('o', 106, struct nvc_imager_cap)
#define NVC_IOCTL_MODE_WR _IOW('o', 107, struct nvc_imager_bayer)
#define NVC_IOCTL_MODE_RD _IOWR('o', 108, struct nvc_imager_mode_list)