diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/ad5816.h | 79 | ||||
-rw-r--r-- | include/media/ar0832_main.h | 13 | ||||
-rw-r--r-- | include/media/nvc_focus.h | 53 | ||||
-rw-r--r-- | include/media/ov2710.h | 11 | ||||
-rw-r--r-- | include/media/ov5640.h | 64 | ||||
-rw-r--r-- | include/media/ov5650.h | 6 | ||||
-rw-r--r-- | include/media/tegra_camera.h | 4 |
7 files changed, 215 insertions, 15 deletions
diff --git a/include/media/ad5816.h b/include/media/ad5816.h new file mode 100644 index 000000000000..c51417ca472b --- /dev/null +++ b/include/media/ad5816.h @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2011-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 + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307, USA + */ + +#ifndef __AD5816_H__ +#define __AD5816_H__ + +#include <media/nvc_focus.h> +#include <media/nvc.h> + +typedef enum { + AD5816_VREG_VDD = 0, + AD5816_VREG_VDD_AF, + AD5816_VREG_VDD_I2C +} ad5816_vreg; + +typedef enum { + AD5816_GPIO_RESET = 0, + AD5816_GPIO_I2CMUX, + AD5816_GPIO_GP1, + AD5816_GPIO_GP2, + AD5816_GPIO_GP3 +} ad5816_gpio_types; + + +struct ad5816_platform_data { + int cfg; + int num; + int sync; + const char *dev_name; + struct nvc_focus_nvc (*nvc); + struct nvc_focus_cap (*cap); + struct ad5816_pdata_info (*info); + int gpio_count; + struct nvc_gpio_pdata *gpio; +}; + +struct ad5816_pdata_info { + float focal_length; + float fnumber; + __u32 settle_time; + __s16 pos_low; + __s16 pos_high; + __s16 limit_low; + __s16 limit_high; + int move_timeoutms; + __u32 focus_hyper_ratio; + __u32 focus_hyper_div; +}; + +// Register Definitions + +#define IC_INFO 0x00 +#define IC_VERSION 0x01 +#define CONTROL 0x02 +#define VCM_CODE_MSB 0x03 +#define VCM_CODE_LSB 0x04 +#define STATUS 0x05 +#define MODE 0x06 +#define VCM_FREQ 0x07 +#define VCM_THRESHOLD 0x08 + + +#endif +/* __AD5816_H__ */ diff --git a/include/media/ar0832_main.h b/include/media/ar0832_main.h index f5e3713b46fb..fe46c228a9f1 100644 --- a/include/media/ar0832_main.h +++ b/include/media/ar0832_main.h @@ -12,6 +12,7 @@ #define __AR0832_MAIN_H__ #include <linux/ioctl.h> /* For IOCTL macros */ +#include <media/nvc_focus.h> #define AR0832_IOCTL_SET_MODE _IOW('o', 0x01, struct ar0832_mode) #define AR0832_IOCTL_SET_FRAME_LENGTH _IOW('o', 0x02, __u32) @@ -23,10 +24,11 @@ #define AR0832_IOCTL_SET_POWER_ON _IOW('o', 0x08, struct ar0832_mode) #define AR0832_IOCTL_SET_SENSOR_REGION _IOW('o', 0x09, struct ar0832_stereo_region) -#define AR0832_FOCUSER_IOCTL_GET_CONFIG _IOR('o', 0x10, struct ar0832_focuser_config) +#define AR0832_FOCUSER_IOCTL_GET_CONFIG _IOR('o', 0x10, struct nv_focuser_config) #define AR0832_FOCUSER_IOCTL_SET_POSITION _IOW('o', 0x11, __u32) #define AR0832_IOCTL_GET_SENSOR_ID _IOR('o', 0x12, __u16) +#define AR0832_FOCUSER_IOCTL_SET_CONFIG _IOW('o', 0x13, struct nv_focuser_config) #define AR0832_SENSOR_ID_8141 0x1006 #define AR0832_SENSOR_ID_8140 0x3006 @@ -85,15 +87,6 @@ struct ar0832_stereo_region { struct ar0832_point image_end; }; -struct ar0832_focuser_config { - __u32 settle_time; - __u32 actuator_range; - __u32 pos_low; - __u32 pos_high; - __u32 focal_length; - __u32 fnumber; - __u32 max_aperture; -}; #ifdef __KERNEL__ struct ar0832_platform_data { diff --git a/include/media/nvc_focus.h b/include/media/nvc_focus.h index bed9df11a34a..e37d897d8323 100644 --- a/include/media/nvc_focus.h +++ b/include/media/nvc_focus.h @@ -33,6 +33,8 @@ #define NVC_FOCUS_CAP_VER2 2 #define NVC_FOCUS_CAP_VER 2 /* latest version */ +#define AF_POS_INVALID_VALUE INT_MAX + enum nvc_focus_sts { NVC_FOCUS_STS_UNKNOWN = 1, NVC_FOCUS_STS_NO_DEVICE, @@ -52,12 +54,55 @@ struct nvc_focus_nvc { struct nvc_focus_cap { __u32 version; - __u32 actuator_range; + __s32 actuator_range; + __u32 settle_time; + __s32 focus_macro; + __s32 focus_hyper; + __s32 focus_infinity; + __u32 slew_rate; + __u32 position_translate; +} __packed; + + +#define NV_FOCUSER_SET_MAX 10 +#define NV_FOCUSER_SET_DISTANCE_PAIR 16 + +struct nv_focuser_set_dist_pairs { + __s32 fdn; + __s32 distance; +} __packed; + +struct nv_focuser_set { + __s32 posture; + __s32 macro; + __s32 hyper; + __s32 inf; + __s32 hysteresis; __u32 settle_time; - __u32 focus_macro; - __u32 focus_hyper; - __u32 focus_infinity; + __s32 macro_offset; + __s32 inf_offset; + __u32 num_dist_pairs; + struct nv_focuser_set_dist_pairs + dist_pair[NV_FOCUSER_SET_DISTANCE_PAIR]; } __packed; +struct nv_focuser_config { + __u32 focal_length; + __u32 fnumber; + __u32 max_aperture; + __s32 actuator_range; + __u32 settle_time; + __u32 range_ends_reversed; + __s32 pos_working_low; + __s32 pos_working_high; + __s32 pos_actual_low; + __s32 pos_actual_high; + __u32 slew_rate; + __u32 circle_of_confusion; + __u32 num_focuser_sets; + struct nv_focuser_set focuser_set[NV_FOCUSER_SET_MAX]; +} __packed; + + #endif /* __NVC_FOCUS_H__ */ diff --git a/include/media/ov2710.h b/include/media/ov2710.h index e3d43056d700..aeeaea8849e0 100644 --- a/include/media/ov2710.h +++ b/include/media/ov2710.h @@ -27,6 +27,7 @@ #define OV2710_IOCTL_SET_COARSE_TIME _IOW('o', 3, __u32) #define OV2710_IOCTL_SET_GAIN _IOW('o', 4, __u16) #define OV2710_IOCTL_GET_STATUS _IOR('o', 5, __u8) +#define OV2710_IOCTL_SET_GROUP_HOLD _IOW('o', 6, struct ov2710_ae) struct ov2710_mode { int xres; @@ -35,6 +36,16 @@ struct ov2710_mode { __u32 coarse_time; __u16 gain; }; + +struct ov2710_ae { + __u32 frame_length; + __u8 frame_length_enable; + __u32 coarse_time; + __u8 coarse_time_enable; + __s32 gain; + __u8 gain_enable; +}; + #ifdef __KERNEL__ struct ov2710_platform_data { int (*power_on)(void); diff --git a/include/media/ov5640.h b/include/media/ov5640.h new file mode 100644 index 000000000000..edae5fe4b1a8 --- /dev/null +++ b/include/media/ov5640.h @@ -0,0 +1,64 @@ +/* + * ov5640.h - header for YUV camera sensor OV5640 driver. + * + * 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 + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307, USA + */ + +#ifndef __OV5640_H__ +#define __OV5640_H__ + +#include <linux/ioctl.h> /* For IOCTL macros */ + +#define OV5640_IOCTL_SET_SENSOR_MODE _IOW('o', 1, struct ov5640_mode) +#define OV5640_IOCTL_GET_SENSOR_STATUS _IOR('o', 2, __u8) +#define OV5640_IOCTL_GET_CONFIG _IOR('o', 3, struct ov5640_config) +#define OV5640_IOCTL_SET_FPOSITION _IOW('o', 4, __u32) +#define OV5640_IOCTL_POWER_LEVEL _IOW('o', 5, __u32) +#define OV5640_IOCTL_GET_AF_STATUS _IOR('o', 6, __u8) +#define OV5640_IOCTL_SET_AF_MODE _IOR('o', 7, __u8) + +#define OV5640_POWER_LEVEL_OFF 0 +#define OV5640_POWER_LEVEL_ON 1 +#define OV5640_POWER_LEVEL_SUS 2 + +struct ov5640_mode { + int xres; + int yres; +}; + +struct ov5640_config { + __u32 settle_time; + __u32 pos_low; + __u32 pos_high; + float focal_length; + float fnumber; +}; + +enum { + OV5640_AF_INIFINITY, + OV5640_AF_TRIGGER, +}; + +#ifdef __KERNEL__ +struct ov5640_platform_data { + int (*power_on)(void); + int (*power_off)(void); + +}; +#endif /* __KERNEL__ */ + +#endif /* __OV5640_H__ */ diff --git a/include/media/ov5650.h b/include/media/ov5650.h index 5c4a87cfbe8d..a8f70a592d89 100644 --- a/include/media/ov5650.h +++ b/include/media/ov5650.h @@ -32,6 +32,7 @@ #define OV5650_IOCTL_SET_GROUP_HOLD _IOW('o', 8, struct ov5650_ae) #define OV5650_IOCTL_SET_CAMERA_MODE _IOW('o', 10, __u32) #define OV5650_IOCTL_SYNC_SENSORS _IOW('o', 11, __u32) +#define OV5650_IOCTL_GET_SENSORDATA _IOR('o', 12, struct ov5650_sensordata) /* OV5650 registers */ #define OV5650_SRM_GRUP_ACCESS (0x3212) @@ -64,6 +65,11 @@ enum ov5650_test_pattern { TEST_PATTERN_CHECKERBOARD }; +struct ov5650_sensordata { + __u32 fuse_id_size; + __u8 fuse_id[16]; +}; + struct ov5650_mode { int xres; int yres; diff --git a/include/media/tegra_camera.h b/include/media/tegra_camera.h index 8ee290758262..9dea1485781d 100644 --- a/include/media/tegra_camera.h +++ b/include/media/tegra_camera.h @@ -23,12 +23,14 @@ enum { TEGRA_CAMERA_MODULE_ISP = 0, TEGRA_CAMERA_MODULE_VI, TEGRA_CAMERA_MODULE_CSI, - TEGRA_CAMERA_MODULE_MAX, + TEGRA_CAMERA_MODULE_EMC, + TEGRA_CAMERA_MODULE_MAX }; enum { TEGRA_CAMERA_VI_CLK, TEGRA_CAMERA_VI_SENSOR_CLK, + TEGRA_CAMERA_EMC_CLK }; struct tegra_camera_clk_info { |