summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCharlie Huang <chahuang@nvidia.com>2011-06-29 10:44:58 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:46 -0800
commite4a6422877d29a9dc49ea0945ea4309621924e1e (patch)
tree8e257b095f89f778cfecb4159790e906f54a690d /include
parent67218430b19712154725e3c7a60ab0dfdc3844d5 (diff)
media: video: tegra: enable ov9726 sensor
initial support for sensor ov9726 bug 829399 Original-Change-Id: I67315dfce7baf2c14f49bf526c10fe19cf32d1d3 Reviewed-on: http://git-master/r/40472 Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com> Reviewed-by: Chonglei Huang <chahuang@nvidia.com> Tested-by: Chonglei Huang <chahuang@nvidia.com> Rebase-Id: R31312b2b0fda96348bb14461651ccb27aa30b0de
Diffstat (limited to 'include')
-rw-r--r--include/media/ov9726.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/include/media/ov9726.h b/include/media/ov9726.h
new file mode 100644
index 000000000000..34678fb0708f
--- /dev/null
+++ b/include/media/ov9726.h
@@ -0,0 +1,68 @@
+/*
+* ov9726.h
+*
+* Copyright (c) 2011, NVIDIA, All Rights Reserved.
+*
+* 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 __OV9726_H__
+#define __OV9726_H__
+
+#include <linux/ioctl.h>
+
+#define OV9726_I2C_ADDR 0x20
+
+#define OV9726_IOCTL_SET_MODE _IOW('o', 1, struct ov9726_cust_mode)
+#define OV9726_IOCTL_SET_FRAME_LENGTH _IOW('o', 2, __u32)
+#define OV9726_IOCTL_SET_COARSE_TIME _IOW('o', 3, __u32)
+#define OV9726_IOCTL_SET_GAIN _IOW('o', 4, __u16)
+#define OV9726_IOCTL_GET_STATUS _IOR('o', 5, __u8)
+
+struct ov9726_mode {
+ int mode_id;
+ int xres;
+ int yres;
+ __u32 frame_length;
+ __u32 coarse_time;
+ __u16 gain;
+};
+
+struct ov9726_reg {
+ __u16 addr;
+ __u16 val;
+};
+
+struct ov9726_cust_mode {
+ struct ov9726_mode mode;
+ __u16 reg_num;
+ struct ov9726_reg *reg_seq;
+};
+
+#define OV9726_TABLE_WAIT_MS 0
+#define OV9726_TABLE_END 1
+
+#ifdef __KERNEL__
+#define OV9726_REG_FRAME_LENGTH_HI 0x340
+#define OV9726_REG_FRAME_LENGTH_LO 0x341
+#define OV9726_REG_COARSE_TIME_HI 0x202
+#define OV9726_REG_COARSE_TIME_LO 0x203
+#define OV9726_REG_GAIN_HI 0x204
+#define OV9726_REG_GAIN_LO 0x205
+
+#define OV9726_MAX_RETRIES 3
+
+struct ov9726_platform_data {
+ int (*power_on)(void);
+ int (*power_off)(void);
+ unsigned gpio_rst;
+ bool rst_low_active;
+ unsigned gpio_pwdn;
+ bool pwdn_low_active;
+};
+#endif /* __KERNEL__ */
+
+#endif /* __OV9726_H__ */
+