summaryrefslogtreecommitdiff
path: root/include/media
diff options
context:
space:
mode:
authorKassey Li <kasseyl@nvidia.com>2014-12-11 17:54:31 +0800
committerMatthew Pedro <mapedro@nvidia.com>2015-04-15 18:35:12 -0700
commit46f03f55b25c08721384ed0eabe85913da7a15da (patch)
treed4c11c0a4a2d5490942ef2295029a878efd289e4 /include/media
parenta2d5506261b58d191b01b5c677c02cebedda6436 (diff)
kernel: add imx185 sensor support
Bug 200044433 Change-Id: I792062649c247229270678a44d10323d2744b569 Signed-off-by: Kassey Li <kasseyl@nvidia.com> Reviewed-on: http://git-master/r/721561 Reviewed-by: Matthew Pedro <mapedro@nvidia.com> Tested-by: Matthew Pedro <mapedro@nvidia.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/imx185.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/include/media/imx185.h b/include/media/imx185.h
new file mode 100644
index 000000000000..d7bb1e0286ba
--- /dev/null
+++ b/include/media/imx185.h
@@ -0,0 +1,88 @@
+/**
+ * Copyright (c) 2014-2015, NVIDIA Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __IMX185_H__
+#define __IMX185_H__
+
+#include <linux/ioctl.h> /* For IOCTL macros */
+#include <media/nvc.h>
+#include <media/nvc_image.h>
+
+#define IMX185_IOCTL_SET_MODE _IOW('o', 1, struct imx185_mode)
+#define IMX185_IOCTL_GET_STATUS _IOR('o', 2, __u8)
+#define IMX185_IOCTL_SET_FRAME_LENGTH _IOW('o', 3, __u32)
+#define IMX185_IOCTL_SET_COARSE_TIME _IOW('o', 4, __u32)
+#define IMX185_IOCTL_SET_GAIN _IOW('o', 5, __u16)
+#define IMX185_IOCTL_GET_SENSORDATA _IOR('o', 6, struct imx185_sensordata)
+#define IMX185_IOCTL_SET_GROUP_HOLD _IOW('o', 7, struct imx185_ae)
+#define IMX185_IOCTL_SET_POWER _IOW('o', 20, __u32)
+#define IMX185_IOCTL_GET_FLASH_CAP _IOR('o', 30, __u32)
+#define IMX185_IOCTL_SET_FLASH_MODE _IOW('o', 31, \
+ struct imx185_flash_control)
+
+struct imx185_mode {
+ int xres;
+ int yres;
+ __u32 frame_length;
+ __u32 coarse_time;
+ __u16 gain;
+};
+
+struct imx185_ae {
+ __u32 frame_length;
+ __u8 frame_length_enable;
+ __u32 coarse_time;
+ __u8 coarse_time_enable;
+ __s32 gain;
+ __u8 gain_enable;
+};
+
+struct imx185_sensordata {
+ __u32 fuse_id_size;
+ __u8 fuse_id[16];
+};
+
+struct imx185_flash_control {
+ u8 enable;
+ u8 edge_trig_en;
+ u8 start_edge;
+ u8 repeat;
+ u16 delay_frm;
+};
+
+
+#ifdef __KERNEL__
+struct imx185_power_rail {
+ struct regulator *dvdd;
+ struct regulator *avdd;
+ struct regulator *iovdd;
+ struct regulator *ext_reg1;
+ struct regulator *ext_reg2;
+};
+
+struct imx185_platform_data {
+ struct imx185_flash_control flash_cap;
+ const char *mclk_name; /* NULL for default default_mclk */
+ unsigned int cam1_gpio;
+ unsigned int reset_gpio;
+ unsigned int af_gpio;
+ bool ext_reg;
+ int (*power_on)(struct imx185_power_rail *pw);
+ int (*power_off)(struct imx185_power_rail *pw);
+};
+#endif /* __KERNEL__ */
+
+#endif /* __IMX185_H__ */