aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxc/include/mach/mipi_csi2.h
diff options
context:
space:
mode:
authorEven Xu <Feng.Xu@freescale.com>2011-11-04 13:46:01 +0800
committerEric Miao <eric.miao@canonical.com>2011-11-10 07:39:05 +0800
commit733bb1d2160bdfaf8b405fb8e08d575d58e29e60 (patch)
treed2c417055f525471dda3ca26b15c84bd03699260 /arch/arm/plat-mxc/include/mach/mipi_csi2.h
parented7b5053122dd296bd82bb2c8b27cea35e47d76c (diff)
ENGR00161382-1 MX6Q MIPI CSI2: Add platform data
Add MIPI csi2 platform data Signed-off-by: Even Xu <b21019@freescale.com>
Diffstat (limited to 'arch/arm/plat-mxc/include/mach/mipi_csi2.h')
-rw-r--r--arch/arm/plat-mxc/include/mach/mipi_csi2.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/include/mach/mipi_csi2.h b/arch/arm/plat-mxc/include/mach/mipi_csi2.h
new file mode 100644
index 00000000000..b2660836c29
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/mipi_csi2.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2011 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_YUV422 0x1e
+#define MIPI_DT_RGB444 0x20
+#define MIPI_DT_RGB555 0x21
+#define MIPI_DT_RGB565 0x22
+#define MIPI_DT_RGB888 0x24
+#define MIPI_DT_RAW8 0x2a
+#define MIPI_DT_RAW10 0x2b
+
+
+struct mipi_csi2_info;
+/* mipi csi2 API */
+struct mipi_csi2_info *mipi_csi2_get_info(void);
+
+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);
+
+/**
+ * struct mipi_csi2_platform_data - MIPI CSI2 driver platform data.
+ *
+ * This structure communicates platform-specific information to the
+ * MIPI CSI2 driver that can't be expressed as resources.
+ *
+ * @ipu_id: the id of IPUs on which this MIPI CSI2 works
+ *
+ * @csi_id: the id of IPU CSI interfaces
+ *
+ * @v_channel: mipi virtual channel num
+ *
+ * @lanes: mipi lanes
+ *
+ * @init: A pointer to a function the driver will call to
+ * initialize the platform (e.g., set up the pin mux).
+ * @exit: A pointer to a function the driver will call to
+ * exit the platform (e.g., free pins).
+ */
+struct mipi_csi2_platform_data {
+ int ipu_id;
+ unsigned int csi_id;
+ unsigned int v_channel;
+ unsigned int lanes;
+ char *dphy_clk;
+ char *pixel_clk;
+ int (*init)(struct platform_device *);
+ void (*exit)(struct platform_device *);
+};
+
+#endif