diff options
author | Erik Lilliebjerg <elilliebjerg@nvidia.com> | 2012-03-20 03:56:00 -0700 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-03-22 03:58:52 -0700 |
commit | ea168e22b7c0b2ca0f6c74f15aa3714f6a72b82f (patch) | |
tree | 5a2daf6a37a5a14c2f4c68b961a2420d7938d3bc /include | |
parent | f8de79d91f59794f07797672998897e6576b9161 (diff) |
media: common camera headers
- Add support for ISP focus
Bug 852480
Change-Id: Ibd4c983d80a5021a88b46033c51c26d1b8120e62
Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-on: http://git-master/r/91203
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/media/nvc.h | 166 | ||||
-rw-r--r-- | include/media/nvc_focus.h | 17 | ||||
-rw-r--r-- | include/media/nvc_image.h | 7 |
3 files changed, 149 insertions, 41 deletions
diff --git a/include/media/nvc.h b/include/media/nvc.h index 7fd4bf2da6ac..9b24b0ea019e 100644 --- a/include/media/nvc.h +++ b/include/media/nvc.h @@ -20,50 +20,79 @@ #include <linux/ioctl.h> +#define NVC_INT2FLOAT_DIVISOR_1K 1000 +#define NVC_INT2FLOAT_DIVISOR_1M 1000000 +#define NVC_INT2FLOAT_DIVISOR 1000 + struct nvc_param { int param; __u32 sizeofvalue; void *p_value; } __packed; -#define NVC_PARAM_EXPOSURE 0 -#define NVC_PARAM_GAIN 1 -#define NVC_PARAM_FRAMERATE 2 -#define NVC_PARAM_MAX_FRAMERATE 3 -#define NVC_PARAM_INPUT_CLOCK 4 -#define NVC_PARAM_LOCUS 5 -#define NVC_PARAM_FLASH_CAPS 6 -#define NVC_PARAM_FLASH_LEVEL 7 -#define NVC_PARAM_FLASH_PIN_STATE 8 -#define NVC_PARAM_TORCH_CAPS 9 -#define NVC_PARAM_TORCH_LEVEL 10 -#define NVC_PARAM_FOCAL_LEN 11 -#define NVC_PARAM_MAX_APERTURE 12 -#define NVC_PARAM_FNUMBER 13 -#define NVC_PARAM_EXPOSURE_LIMITS 14 -#define NVC_PARAM_GAIN_LIMITS 15 -#define NVC_PARAM_FRAMERATE_LIMITS 16 -#define NVC_PARAM_FRAME_RATES 17 -#define NVC_PARAM_EXP_LATCH_TIME 19 -#define NVC_PARAM_REGION_USED 20 -#define NVC_PARAM_SELF_TEST 23 -#define NVC_PARAM_STS 24 -#define NVC_PARAM_TESTMODE 25 -#define NVC_PARAM_EXPECTED_VALUES 26 -#define NVC_PARAM_RESET 27 -#define NVC_PARAM_OPTIMIZE_RES 28 -#define NVC_PARAM_LINES_PER_SEC 30 -#define NVC_PARAM_CAPS 31 -#define NVC_PARAM_STEREO_CAP 33 -#define NVC_PARAM_FOCUS_STEREO 34 -#define NVC_PARAM_STEREO 35 -#define NVC_PARAM_INHERENT_GAIN 36 -#define NVC_PARAM_VIEW_ANGLE_H 37 -#define NVC_PARAM_VIEW_ANGLE_V 38 -#define NVC_PARAM_DEV_ID 46 -#define NVC_PARAM_TEST_PATTERN 0x10000002 -#define NVC_PARAM_SENSOR_TYPE 0x10000006 -#define NVC_PARAM_I2C 1001 +enum nvc_params { + NVC_PARAM_EXPOSURE = 0, + NVC_PARAM_GAIN, + NVC_PARAM_FRAMERATE, + NVC_PARAM_MAX_FRAMERATE, + NVC_PARAM_INPUT_CLOCK, + NVC_PARAM_LOCUS, + NVC_PARAM_FLASH_CAPS, + NVC_PARAM_FLASH_LEVEL, + NVC_PARAM_FLASH_PIN_STATE, + NVC_PARAM_TORCH_CAPS, + NVC_PARAM_TORCH_LEVEL, + NVC_PARAM_FOCAL_LEN, + NVC_PARAM_MAX_APERTURE, + NVC_PARAM_FNUMBER, + NVC_PARAM_EXPOSURE_LIMITS, + NVC_PARAM_GAIN_LIMITS, + NVC_PARAM_FRAMERATE_LIMITS, + NVC_PARAM_FRAME_RATES, + NVC_PARAM_CLOCK_LIMITS, + NVC_PARAM_EXP_LATCH_TIME, + NVC_PARAM_REGION_USED, + NVC_PARAM_CALIBRATION_DATA, + NVC_PARAM_CALIBRATION_OVERRIDES, + NVC_PARAM_SELF_TEST, + NVC_PARAM_STS, + NVC_PARAM_TESTMODE, + NVC_PARAM_EXPECTED_VALUES, + NVC_PARAM_RESET, + NVC_PARAM_OPTIMIZE_RES, + NVC_PARAM_DETECT_COLOR_TEMP, + NVC_PARAM_LINES_PER_SEC, + NVC_PARAM_CAPS, + NVC_PARAM_CUSTOM_BLOCK_INFO, + NVC_PARAM_STEREO_CAP, + NVC_PARAM_FOCUS_STEREO, + NVC_PARAM_STEREO, + NVC_PARAM_INHERENT_GAIN, + NVC_PARAM_VIEW_ANGLE_H, + NVC_PARAM_VIEW_ANGLE_V, + NVC_PARAM_ISP_SETTING, + NVC_PARAM_OPERATION_MODE, + NVC_PARAM_SUPPORT_ISP, + NVC_PARAM_AWB_LOCK, + NVC_PARAM_AE_LOCK, + NVC_PARAM_RES_CHANGE_WAIT_TIME, + NVC_PARAM_FACTORY_CALIBRATION_DATA, + NVC_PARAM_DEV_ID, + NVC_PARAM_GROUP_HOLD, + NVC_PARAM_BEGIN_VENDOR_EXTENSIONS = 0x10000000, + NVC_PARAM_CALIBRATION_STATUS, + NVC_PARAM_TEST_PATTERN, + NVC_PARAM_MODULE_INFO, + NVC_PARAM_FLASH_MAX_POWER, + NVC_PARAM_DIRECTION, + NVC_PARAM_SENSOR_TYPE, + NVC_PARAM_DLI_CHECK, + NVC_PARAM_PARALLEL_DLI_CHECK, + NVC_PARAM_BRACKET_CAPS, + NVC_PARAM_NUM, + NVC_PARAM_I2C, + NVC_PARAM_FORCE32 = 0x7FFFFFFF +}; /* sync off */ #define NVC_SYNC_OFF 0 @@ -77,10 +106,66 @@ struct nvc_param { #define NVC_RESET_HARD 0 #define NVC_RESET_SOFT 1 +struct nvc_param_isp { + int attr; + void *p_data; + __u32 data_size; +} __packed; + +struct nvc_isp_focus_param { + __s32 min_pos; + __s32 max_pos; + __s32 hyperfocal; + __s32 macro; + __s32 powersave; +} __packed; + +struct nvc_isp_focus_pos { + __u32 is_auto; + __s32 value; +} __packed; + +struct nvc_isp_focus_region { + __u32 num_region; + __s32 value; +} __packed; + +enum nvc_params_isp { + NVC_PARAM_ISP_FOCUS_CAF = 16389, + NVC_PARAM_ISP_FOCUS_CAF_PAUSE, + NVC_PARAM_ISP_FOCUS_CAF_STS, + NVC_PARAM_ISP_FOCUS_POS = 16407, + NVC_PARAM_ISP_FOCUS_RANGE, + NVC_PARAM_ISP_FOCUS_AF_RGN = 16413, + NVC_PARAM_ISP_FOCUS_AF_RGN_MASK, + NVC_PARAM_ISP_FOCUS_AF_RGN_STS, + NVC_PARAM_ISP_FOCUS_CTRL = 16424, + NVC_PARAM_ISP_FOCUS_TRGR, + NVC_PARAM_ISP_FOCUS_STS, +}; + +#define NVC_PARAM_ISP_FOCUS_STS_BUSY 0 +#define NVC_PARAM_ISP_FOCUS_STS_LOCKD 1 +#define NVC_PARAM_ISP_FOCUS_STS_FAILD 2 +#define NVC_PARAM_ISP_FOCUS_STS_ERR 3 + +#define NVC_PARAM_ISP_FOCUS_CTRL_ON 0 +#define NVC_PARAM_ISP_FOCUS_CTRL_OFF 1 +#define NVC_PARAM_ISP_FOCUS_CTRL_AUTO 2 +#define NVC_PARAM_ISP_FOCUS_CTRL_ALOCK 3 + +#define NVC_PARAM_ISP_FOCUS_CAF_CONVRG 1 +#define NVC_PARAM_ISP_FOCUS_CAF_SEARCH 2 + +#define NVC_PARAM_ISP_FOCUS_POS_INF 0 + + #define NVC_IOCTL_PWR_WR _IOW('o', 102, int) #define NVC_IOCTL_PWR_RD _IOW('o', 103, int) #define NVC_IOCTL_PARAM_WR _IOW('o', 104, struct nvc_param) #define NVC_IOCTL_PARAM_RD _IOWR('o', 105, struct nvc_param) +#define NVC_IOCTL_PARAM_ISP_RD _IOWR('o', 200, struct nvc_param_isp) +#define NVC_IOCTL_PARAM_ISP_WR _IOWR('o', 201, struct nvc_param_isp) #ifdef __KERNEL__ @@ -133,6 +218,11 @@ struct nvc_param { #define NVC_PWR_COMM 5 #define NVC_PWR_ON 6 +struct nvc_regulator_init { + unsigned vreg_num; + const char *vreg_name; +}; + struct nvc_regulator { bool vreg_flag; struct regulator *vreg; diff --git a/include/media/nvc_focus.h b/include/media/nvc_focus.h index fd83258abab3..bed9df11a34a 100644 --- a/include/media/nvc_focus.h +++ b/include/media/nvc_focus.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 NVIDIA Corporation. +/* Copyright (C) 2012 NVIDIA Corporation. * * 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 @@ -18,6 +18,21 @@ #ifndef __NVC_FOCUS_H__ #define __NVC_FOCUS_H__ +/* NVC_FOCUS_CAP_VER0: invalid */ +/* NVC_FOCUS_CAP_VER1: + * __u32 version + * __u32 actuator_range + * __u32 settle_time + */ +#define NVC_FOCUS_CAP_VER1 1 +/* NVC_FOCUS_CAP_VER2 adds: + * __u32 focus_macro; + * __u32 focus_hyper; + * __u32 focus_infinity; + */ +#define NVC_FOCUS_CAP_VER2 2 +#define NVC_FOCUS_CAP_VER 2 /* latest version */ + enum nvc_focus_sts { NVC_FOCUS_STS_UNKNOWN = 1, NVC_FOCUS_STS_NO_DEVICE, diff --git a/include/media/nvc_image.h b/include/media/nvc_image.h index f4af497c2ad0..1bf884d8122a 100644 --- a/include/media/nvc_image.h +++ b/include/media/nvc_image.h @@ -25,8 +25,6 @@ #define NVC_IMAGER_API_DYNAMIC_VER 1 #define NVC_IMAGER_API_BAYER_VER 1 -#define NVC_IMAGER_PARAM_BAYER 0xE100 - #define NVC_IMAGER_TEST_NONE 0 #define NVC_IMAGER_TEST_COLORBARS 1 #define NVC_IMAGER_TEST_CHECKERBOARD 2 @@ -51,6 +49,7 @@ #define NVC_IMAGER_INT2FLOAT_DIVISOR 1000 +#define NVC_FOCUS_INTERNAL (0x665F4E5643414D69ULL) #define NVC_FOCUS_GUID(n) (0x665F4E5643414D30ULL | ((n) & 0xF)) #define NVC_TORCH_GUID(n) (0x6C5F4E5643414D30ULL | ((n) & 0xF)) @@ -67,6 +66,10 @@ struct nvc_imager_static_nvc { __u32 view_angle_v; __u32 stereo_cap; __u32 res_chg_wait_time; + __u8 support_isp; + __u8 align1; + __u8 align2; + __u8 align3; __u32 place_holder1; __u32 place_holder2; __u32 place_holder3; |