summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHu He <hhe@nvidia.com>2014-11-25 14:59:07 -0800
committerWinnie Hsu <whsu@nvidia.com>2015-02-09 17:06:22 -0800
commit231a96efcdf47e971ce70412332ad436b1ffb619 (patch)
tree59a9c03c74592fbe7272bed1575a78cef8bc8fc7 /include
parentc017b032a284d7cb1974f7e80a6c3613089b9c0e (diff)
Kernel: add ov4689 kernel driver
Bug 1600299 Change-Id: I63f4d597bcc8b960407a7291fde6aa2ddb5bec25 Signed-off-by: Ming Wong <miwong@nvidia.com> Reviewed-on: http://git-master/r/674099 Reviewed-by: Winnie Hsu <whsu@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'include')
-rw-r--r--include/media/ov4689.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/include/media/ov4689.h b/include/media/ov4689.h
new file mode 100644
index 000000000000..fa60d6cab65d
--- /dev/null
+++ b/include/media/ov4689.h
@@ -0,0 +1,77 @@
+/*
+ * ov4689.h - ov4689 sensor driver
+ *
+ * Copyright (c) 2015 NVIDIA Corporation. All rights reserved.
+ *
+ * Contributors:
+ * Jerry Chang <jerchang@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 __OV4689_H__
+#define __OV4689_H__
+
+#include <linux/ioctl.h>
+
+#define OV4689_IOCTL_SET_MODE _IOW('o', 1, struct ov4689_mode)
+#define OV4689_IOCTL_SET_FRAME_LENGTH _IOW('o', 2, __u32)
+#define OV4689_IOCTL_SET_COARSE_TIME _IOW('o', 3, __u32)
+#define OV4689_IOCTL_SET_GAIN _IOW('o', 4, __u16)
+#define OV4689_IOCTL_GET_STATUS _IOR('o', 5, __u8)
+#define OV4689_IOCTL_SET_GROUP_HOLD _IOW('o', 6, struct ov4689_grouphold)
+#define OV4689_IOCTL_GET_SENSORDATA _IOR('o', 7, struct ov4689_sensordata)
+#define OV4689_IOCTL_SET_FLASH _IOW('o', 8, struct ov4689_flash_control)
+#define OV4689_IOCTL_SET_POWER _IOW('o', 20, __u32)
+
+struct ov4689_sensordata {
+ __u32 fuse_id_size;
+ __u8 fuse_id[16];
+};
+
+struct ov4689_mode {
+ __u32 xres;
+ __u32 yres;
+ __u32 fps;
+ __u32 frame_length;
+ __u32 coarse_time;
+ __u16 gain;
+};
+
+struct ov4689_grouphold {
+ __u32 frame_length;
+ __u8 frame_length_enable;
+ __u32 coarse_time;
+ __u8 coarse_time_enable;
+ __s32 gain;
+ __u8 gain_enable;
+};
+
+struct ov4689_flash_control {
+ u8 enable;
+ u8 edge_trig_en;
+ u8 start_edge;
+ u8 repeat;
+ u16 delay_frm;
+};
+
+#ifdef __KERNEL__
+struct ov4689_power_rail {
+ struct regulator *dvdd;
+ struct regulator *avdd;
+ struct regulator *iovdd;
+ struct regulator *vif;
+};
+
+struct ov4689_platform_data {
+ struct ov4689_flash_control flash_cap;
+ int (*power_on)(struct ov4689_power_rail *pw);
+ int (*power_off)(struct ov4689_power_rail *pw);
+ const char *mclk_name;
+ unsigned int reset_gpio;
+};
+#endif /* __KERNEL__ */
+
+#endif /* __OV4689_H__ */