msm: camera: Support for Multi planar image formats.

Add support for multi-planar image formats. This
allows the luma and chroma planes of the image to
reside in different memory locations.

Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
diff --git a/include/media/msm_camera.h b/include/media/msm_camera.h
index 543be7d..7afe94e 100644
--- a/include/media/msm_camera.h
+++ b/include/media/msm_camera.h
@@ -163,6 +163,9 @@
 #define MSM_CAM_CTRL_CMD_DONE  0
 #define MSM_CAM_SENSOR_VFE_CMD 1
 
+/* Should be same as VIDEO_MAX_PLANES in videodev2.h */
+#define MAX_PLANES 8
+
 /*****************************************************
  *  structure
  *****************************************************/
@@ -202,8 +205,7 @@
 	unsigned short node_idx;
 	unsigned long  phy_addr;
 	uint32_t       phy_offset;
-	uint32_t       y_off;
-	uint32_t       cbcr_off;
+	uint32_t       offset;
 	int32_t        fd;
 	uint32_t       frame_id;
 	int            path;
@@ -860,4 +862,29 @@
 	int8_t total_steps;
 	uint8_t support_3d;
 };
+
+#define V4L2_SINGLE_PLANE	0
+#define V4L2_MULTI_PLANE_Y	0
+#define V4L2_MULTI_PLANE_CBCR	1
+#define V4L2_MULTI_PLANE_CB	1
+#define V4L2_MULTI_PLANE_CR	2
+
+struct plane_data {
+	int plane_id;
+	uint32_t offset;
+	unsigned long size;
+};
+
+struct img_plane_info {
+	uint32_t width;
+	uint32_t height;
+	uint32_t pixelformat;
+	uint8_t buffer_type; /*Single/Multi planar*/
+	uint8_t output_port;
+	uint32_t ext_mode;
+	uint8_t num_planes;
+	struct plane_data plane[MAX_PLANES];
+	uint8_t vpe_can_use;
+};
+
 #endif /* __LINUX_MSM_CAMERA_H */
diff --git a/include/media/videobuf2-msm-mem.h b/include/media/videobuf2-msm-mem.h
index 24eaf13..1cb2fbc 100644
--- a/include/media/videobuf2-msm-mem.h
+++ b/include/media/videobuf2-msm-mem.h
@@ -28,8 +28,10 @@
 	int phyaddr;
 	unsigned long size;
 	int is_userptr;
-	uint32_t y_off;
-	uint32_t cbcr_off;
+	/* Single plane - CbCr offset
+	 * Multi plane - plane offset
+	 */
+	uint32_t offset;
 	int buffer_type;
 	struct file *file;
 	uint32_t addr_offset;
@@ -38,6 +40,7 @@
 	void *alloc_ctx;
 	struct msm_mapped_buffer *msm_buffer;
 	int subsys_id;
+	unsigned long mapped_phyaddr;
 };
 void videobuf2_queue_pmem_contig_init(struct vb2_queue *q,
 					enum v4l2_buf_type type,
@@ -45,10 +48,9 @@
 					unsigned int size,
 					void *priv);
 int videobuf2_pmem_contig_mmap_get(struct videobuf2_contig_pmem *mem,
-					uint32_t yoffset,
-					uint32_t cbcroffset, int path);
+					uint32_t offset, int path);
 int videobuf2_pmem_contig_user_get(struct videobuf2_contig_pmem *mem,
-					uint32_t yoffset, uint32_t cbcroffset,
+					uint32_t offset,
 					uint32_t addr_offset, int path);
 void videobuf2_pmem_contig_user_put(struct videobuf2_contig_pmem *mem);
 unsigned long videobuf2_to_pmem_contig(struct vb2_buffer *buf,