summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorOliver Brown <oliver.brown@freescale.com>2013-09-06 11:42:12 -0500
committerOliver Brown <oliver.brown@freescale.com>2013-09-09 22:51:11 -0500
commit6cabc50f365562ed6667bccb7e6a6ace31669f0d (patch)
tree3cf7d1e399d6a24c70d112d737482523b9de412f /include
parent404b864c554d2126826e7c54d61b36fce45df4b1 (diff)
ENGR00278652-1 [Media]: Add MIPI CSI2 driver files
Copied mipi_csi.h from: commit 50ca92f4010a93be265de7aad501b4dcae095a63 Author: Sheng Nan <b38800@freescale.com> Date: Thu Mar 7 13:39:54 2013 +0800 ARM: include: remove definition of mipi-csi2 platform data Other files copied files from: commit 1fb93870965b7d8d67b4db6233a30c06d82f84fc Author: Liu Ying <Ying.Liu@freescale.com> Date: Thu Mar 21 12:15:52 2013 +0800 MIPI-CSI2:Fix a build warning - Changed includes files for 3.10 - Dropped deprecated __devexit - Added generic error message if probe fails - Added configuration and set default to 'n' Signed-off-by: Oliver Brown <oliver.brown@freescale.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mipi_csi2.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/include/linux/mipi_csi2.h b/include/linux/mipi_csi2.h
new file mode 100644
index 000000000000..9cc1f89ef964
--- /dev/null
+++ b/include/linux/mipi_csi2.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __INCLUDE_MIPI_CSI2_H
+#define __INCLUDE_MIPI_CSI2_H
+
+/* mipi csi2 register */
+#define CSI2_VERSION 0x000
+#define CSI2_N_LANES (0x004/4)
+#define CSI2_PHY_SHUTDOWNZ (0x008/4)
+#define CSI2_DPHY_RSTZ (0x00c/4)
+#define CSI2_RESETN (0x010/4)
+#define CSI2_PHY_STATE (0x014/4)
+#define CSI2_DATA_IDS_1 (0x018/4)
+#define CSI2_DATA_IDS_2 (0x01c/4)
+#define CSI2_ERR1 (0x020/4)
+#define CSI2_ERR2 (0x024/4)
+#define CSI2_MSK1 (0x028/4)
+#define CSI2_MSK2 (0x02c/4)
+#define CSI2_PHY_TST_CTRL0 (0x030/4)
+#define CSI2_PHY_TST_CTRL1 (0x034/4)
+#define CSI2_SFT_RESET (0xf00/4)
+
+/* mipi data type */
+#define MIPI_DT_YUV420 0x18 /* YYY.../UYVY.... */
+#define MIPI_DT_YUV420_LEGACY 0x1a /* UYY.../VYY... */
+#define MIPI_DT_YUV422 0x1e /* UYVY... */
+#define MIPI_DT_RGB444 0x20
+#define MIPI_DT_RGB555 0x21
+#define MIPI_DT_RGB565 0x22
+#define MIPI_DT_RGB666 0x23
+#define MIPI_DT_RGB888 0x24
+#define MIPI_DT_RAW6 0x28
+#define MIPI_DT_RAW7 0x29
+#define MIPI_DT_RAW8 0x2a
+#define MIPI_DT_RAW10 0x2b
+#define MIPI_DT_RAW12 0x2c
+#define MIPI_DT_RAW14 0x2d
+
+
+struct mipi_csi2_info;
+/* mipi csi2 API */
+struct mipi_csi2_info *mipi_csi2_get_info(void);
+
+bool mipi_csi2_enable(struct mipi_csi2_info *info);
+
+bool mipi_csi2_disable(struct mipi_csi2_info *info);
+
+bool mipi_csi2_get_status(struct mipi_csi2_info *info);
+
+int mipi_csi2_get_bind_ipu(struct mipi_csi2_info *info);
+
+unsigned int mipi_csi2_get_bind_csi(struct mipi_csi2_info *info);
+
+unsigned int mipi_csi2_get_virtual_channel(struct mipi_csi2_info *info);
+
+unsigned int mipi_csi2_set_lanes(struct mipi_csi2_info *info);
+
+unsigned int mipi_csi2_set_datatype(struct mipi_csi2_info *info,
+ unsigned int datatype);
+
+unsigned int mipi_csi2_get_datatype(struct mipi_csi2_info *info);
+
+unsigned int mipi_csi2_dphy_status(struct mipi_csi2_info *info);
+
+unsigned int mipi_csi2_get_error1(struct mipi_csi2_info *info);
+
+unsigned int mipi_csi2_get_error2(struct mipi_csi2_info *info);
+
+int mipi_csi2_pixelclk_enable(struct mipi_csi2_info *info);
+
+void mipi_csi2_pixelclk_disable(struct mipi_csi2_info *info);
+
+int mipi_csi2_reset(struct mipi_csi2_info *info);
+
+#endif