summaryrefslogtreecommitdiff
path: root/include/media/ov9772.h
diff options
context:
space:
mode:
authorPhil Breczinski <pbreczinski@nvidia.com>2012-09-12 19:28:58 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 01:04:58 -0700
commitd4f2bc5c8a6ab55683a79c365013804ed8501714 (patch)
treeec42967e29c4d1378c0154e4bc97f0cfc448a996 /include/media/ov9772.h
parentc465cb5029e2c95eb845081b0555f5fc1c068fea (diff)
media: video: tegra: ov9772 NVC driver
Replace old framework ov9772 driver with new framework NVC driver. Bug 1041786 Change-Id: I4e6c1e22d745688e652becdc94171874333bb865 Signed-off-by: Phil Breczinski <pbreczinski@nvidia.com> (cherry picked from commit 9c4d6d1da8e5083adea4545288c10ee46edc3903) Reviewed-on: http://git-master/r/139517 Reviewed-on: http://git-master/r/146022 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'include/media/ov9772.h')
-rw-r--r--include/media/ov9772.h87
1 files changed, 36 insertions, 51 deletions
diff --git a/include/media/ov9772.h b/include/media/ov9772.h
index 2f49ac5f73a5..6fe41943cf9b 100644
--- a/include/media/ov9772.h
+++ b/include/media/ov9772.h
@@ -1,62 +1,47 @@
-/**
- * Copyright (c) 2012 NVIDIA Corporation. All rights reserved.
+/*
+ * nvc_ov9772.h - ov9772 sensor driver
*
- * NVIDIA Corporation and its licensors retain all intellectual property
- * and proprietary rights in and to this software and related documentation
- * and any modifications thereto. Any use, reproduction, disclosure or
- * distribution of this software and related documentation without an express
- * license agreement from NVIDIA Corporation is strictly prohibited.
+ * * Copyright (c) 2012 NVIDIA Corporation. All rights reserved.
+ *
+ * Contributors:
+ * Phil Breczinski <pbreczinski@nvidia.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
*/
#ifndef __OV9772_H__
#define __OV9772_H__
-#include <linux/ioctl.h>
-
-#define OV9772_IOCTL_SET_MODE _IOW('o', 1, struct ov9772_mode)
-#define OV9772_IOCTL_GET_STATUS _IOR('o', 2, __u8)
-#define OV9772_IOCTL_SET_FRAME_LENGTH _IOW('o', 3, __u32)
-#define OV9772_IOCTL_SET_COARSE_TIME _IOW('o', 4, __u32)
-#define OV9772_IOCTL_SET_GAIN _IOW('o', 5, __u16)
-#define OV9772_IOCTL_GET_SENSORDATA _IOR('o', 6, struct ov9772_sensordata)
-#define OV9772_IOCTL_SET_GROUP_HOLD _IOW('o', 7, struct ov9772_ae)
-
-struct ov9772_mode {
- int xres;
- int yres;
- __u32 frame_length;
- __u32 coarse_time;
- __u16 gain;
-};
-
-struct ov9772_ae {
- __u32 frame_length;
- __u8 frame_length_enable;
- __u32 coarse_time;
- __u8 coarse_time_enable;
- __s32 gain;
- __u8 gain_enable;
+#include <media/nvc.h>
+#include <media/nvc_image.h>
+
+/* See notes in the nvc.h file on the GPIO usage */
+enum ov9772_gpio_type {
+ OV9772_GPIO_TYPE_SHTDN = 0,
+ OV9772_GPIO_TYPE_PWRDN,
+ OV9772_GPIO_TYPE_I2CMUX,
+ OV9772_GPIO_TYPE_GP1,
+ OV9772_GPIO_TYPE_GP2,
+ OV9772_GPIO_TYPE_GP3,
};
-struct ov9772_sensordata {
- __u32 fuse_id_size;
- __u8 fuse_id[16];
-};
-
-#ifdef __KERNEL__
-
-#define OV9772_REG_FRAME_LENGTH_HI 0x340
-#define OV9772_REG_FRAME_LENGTH_LO 0x341
-#define OV9772_REG_COARSE_TIME_HI 0x202
-#define OV9772_REG_COARSE_TIME_LO 0x203
-#define OV9772_REG_GAIN_HI 0x204
-#define OV9772_REG_GAIN_LO 0x205
-
struct ov9772_platform_data {
- int (*power_on)(struct device *);
- int (*power_off)(struct device *);
+ unsigned cfg;
+ unsigned num;
+ unsigned sync;
+ const char *dev_name;
+ unsigned gpio_count;
+ struct nvc_gpio_pdata *gpio; /* see nvc.h GPIO notes */
+ struct nvc_imager_cap *cap;
+ unsigned lens_focal_length; /* / _INT2FLOAT_DIVISOR */
+ unsigned lens_max_aperture; /* / _INT2FLOAT_DIVISOR */
+ unsigned lens_fnumber; /* / _INT2FLOAT_DIVISOR */
+ unsigned lens_view_angle_h; /* / _INT2FLOAT_DIVISOR */
+ unsigned lens_view_angle_v; /* / _INT2FLOAT_DIVISOR */
+ int (*probe_clock)(unsigned long);
+ int (*power_on)(struct device *);
+ int (*power_off)(struct device *);
};
-#endif /* __KERNEL__ */
-
#endif /* __OV9772_H__ */
-