[PATCH 130/133] [Jaunty SRU] ARM.imx51 Freescale:ENGR00113464 Fix compiling error for MX31-ads, MX31-3stack and MX35-3stack

Brad Figg brad.figg at canonical.com
Thu Jul 9 17:50:00 BST 2009


Using IPU versions to separate different logic
for various platforms in v4l2 output.

Signed-off-by: Liu Ying <b17645 at freescale.com>
Signed-off-by: Brad Figg <brad.figg at canonical.com>
---
 debian/config/armel/config.imx51                 |    2 +
 drivers/media/video/mxc/output/mxc_v4l2_output.c |  140 +++++++++++++++-------
 drivers/mxc/Kconfig                              |    1 +
 sound/soc/imx/imx-esai.h                         |   25 ++++
 4 files changed, 124 insertions(+), 44 deletions(-)
 create mode 100644 sound/soc/imx/imx-esai.h

diff --git a/debian/config/armel/config.imx51 b/debian/config/armel/config.imx51
index 25bf06f..98ee597 100644
--- a/debian/config/armel/config.imx51
+++ b/debian/config/armel/config.imx51
@@ -1437,7 +1437,9 @@ CONFIG_USB_DSBR=m
 CONFIG_USB_EHCI_ARC=y
 CONFIG_USB_EHCI_ARC_H1=y
 CONFIG_USB_EHCI_ARC_H2=y
+# CONFIG_USB_EHCI_ARC_H2_WAKE_UP is not set
 CONFIG_USB_EHCI_ARC_OTG=y
+# CONFIG_USB_EHCI_ARC_OTG_WAKE_UP is not set
 CONFIG_USB_EHCI_FSL_UTMI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
diff --git a/drivers/media/video/mxc/output/mxc_v4l2_output.c b/drivers/media/video/mxc/output/mxc_v4l2_output.c
index d83be3f..4c70599 100644
--- a/drivers/media/video/mxc/output/mxc_v4l2_output.c
+++ b/drivers/media/video/mxc/output/mxc_v4l2_output.c
@@ -453,6 +453,8 @@ static irqreturn_t mxc_v4l2out_pp_in_irq_handler(int irq, void *dev_id)
 
 	return IRQ_HANDLED;
 }
+
+#ifdef CONFIG_MXC_IPU_V3EX
 /*!
  * Start the output stream
  *
@@ -581,6 +583,8 @@ static int init_VDI(ipu_channel_params_t params, vout_data *vout,
 	}
 	return 0;
 }
+#endif
+
 /*!
  * Start the output stream
  *
@@ -730,6 +734,7 @@ static int mxc_v4l2out_streamon(vout_data * vout)
 	bool use_direct_adc = false;
 	mm_segment_t old_fs;
 
+#ifdef CONFIG_MXC_IPU_V3EX
 	dev_dbg(dev, "mxc_v4l2out_streamon: field format=%d\n",
 		vout->field_fmt);
 	if (vout->field_fmt == V4L2_FIELD_ALTERNATE) {
@@ -737,7 +742,9 @@ static int mxc_v4l2out_streamon(vout_data * vout)
 				mxc_v4l2out_pp_in_irq_handler,
 				0, &vout->video_dev->name, vout);
 		display_input_ch = MEM_VDI_PRP_VF_MEM;
-	} else {
+	} else
+#endif
+	{
 		ipu_request_irq(IPU_IRQ_PP_IN_EOF,
 				mxc_v4l2out_pp_in_irq_handler,
 				0, &vout->video_dev->name, vout);
@@ -767,10 +774,14 @@ static int mxc_v4l2out_streamon(vout_data * vout)
 
 	/* Init Display Channel */
 #ifdef CONFIG_FB_MXC_ASYNC_PANEL
-	if (vout->field_fmt == V4L2_FIELD_ALTERNATE)
+#ifdef CONFIG_MXC_IPU_V3EX
+	if (vout->field_fmt == V4L2_FIELD_ALTERNATE) {
 		ipu_enable_irq(IPU_IRQ_PRP_VF_OUT_EOF);
-	else
+	} else
+#endif
+	{
 		ipu_enable_irq(IPU_IRQ_PP_IN_EOF);
+	}
 
 	if (vout->cur_disp_output < DISP3) {
 		mxcfb_set_refresh_mode(fbi, MXCFB_REFRESH_OFF, 0);
@@ -939,18 +950,25 @@ static int mxc_v4l2out_streamon(vout_data * vout)
 		    (fbi->fix.line_length * fbi->var.yres);
 		vout->display_buf_size = vout->crop_current.width *
 		    vout->crop_current.height * fbi->var.bits_per_pixel / 8;
-		if (vout->field_fmt == V4L2_FIELD_ALTERNATE)
+#ifdef CONFIG_MXC_IPU_V3EX
+		if (vout->field_fmt == V4L2_FIELD_ALTERNATE) {
 			vout->post_proc_ch = MEM_VDI_PRP_VF_MEM;
-		else
+		} else
+#endif
+		{
 			vout->post_proc_ch = MEM_PP_MEM;
+		}
 	}
 
 	/* Init PP */
 	if (use_direct_adc == false && !vout->ic_bypass) {
+#ifdef CONFIG_MXC_IPU_V3EX
 		if (vout->field_fmt == V4L2_FIELD_ALTERNATE) {
 			vout->post_proc_ch = MEM_VDI_PRP_VF_MEM;
 			ipu_enable_irq(IPU_IRQ_PRP_VF_OUT_EOF);
-		} else {
+		} else
+#endif
+		{
 			vout->post_proc_ch = MEM_PP_MEM;
 			ipu_enable_irq(IPU_IRQ_PP_IN_EOF);
 		}
@@ -961,10 +979,13 @@ static int mxc_v4l2out_streamon(vout_data * vout)
 		}
 		memset(&params, 0, sizeof(params));
 		int rc;
+#ifdef CONFIG_MXC_IPU_V3EX
 		if (vout->field_fmt == V4L2_FIELD_ALTERNATE) {
 			rc = init_VDI(params, vout, dev, fbi, &display_input_ch,
 				      out_width, out_height);
-		} else {
+		} else
+#endif
+		{
 			rc = init_PP(params, vout, dev, fbi, &display_input_ch,
 				     out_width, out_height);
 		}
@@ -1046,10 +1067,14 @@ static int mxc_v4l2out_streamoff(vout_data * vout)
 		return 0;
 	}
 
-	if (vout->field_fmt == V4L2_FIELD_ALTERNATE)
+#ifdef CONFIG_MXC_IPU_V3EX
+	if (vout->field_fmt == V4L2_FIELD_ALTERNATE) {
 		ipu_free_irq(IPU_IRQ_PRP_VF_OUT_EOF, vout);
-	else
+	} else
+#endif
+	{
 		ipu_free_irq(IPU_IRQ_PP_IN_EOF, vout);
+	}
 
 	spin_lock_irqsave(&g_lock, lockflag);
 
@@ -1060,10 +1085,14 @@ static int mxc_v4l2out_streamoff(vout_data * vout)
 	}
 
 	if (!vout->ic_bypass) {
-		if (vout->field_fmt == V4L2_FIELD_ALTERNATE)
+#ifdef CONFIG_MXC_IPU_V3EX
+		if (vout->field_fmt == V4L2_FIELD_ALTERNATE) {
 			ipu_disable_irq(IPU_IRQ_PRP_VF_OUT_EOF);
-		else
+		} else
+#endif
+		{
 			ipu_disable_irq(IPU_IRQ_PP_IN_EOF);
+		}
 	}
 
 	spin_unlock_irqrestore(&g_lock, lockflag);
@@ -1088,22 +1117,13 @@ static int mxc_v4l2out_streamoff(vout_data * vout)
 	}
 
 	if (vout->post_proc_ch == MEM_PP_MEM ||
-	    vout->post_proc_ch == MEM_PRP_VF_MEM ||
-	    vout->post_proc_ch == MEM_VDI_PRP_VF_MEM) {
+	    vout->post_proc_ch == MEM_PRP_VF_MEM) {
 		/* SDC or ADC with Rotation */
 		if (!ipu_can_rotate_in_place(vout->rotate)) {
-			if (vout->field_fmt == V4L2_FIELD_ALTERNATE) {
-				ipu_unlink_channels(MEM_VDI_PRP_VF_MEM,
-						    MEM_ROT_VF_MEM);
-				ipu_unlink_channels(MEM_ROT_VF_MEM,
-						    vout->display_ch);
-				ipu_disable_channel(MEM_ROT_VF_MEM, true);
-			} else {
-				ipu_unlink_channels(MEM_PP_MEM, MEM_ROT_PP_MEM);
-				ipu_unlink_channels(MEM_ROT_PP_MEM,
-						    vout->display_ch);
-				ipu_disable_channel(MEM_ROT_PP_MEM, true);
-			}
+			ipu_unlink_channels(MEM_PP_MEM, MEM_ROT_PP_MEM);
+			ipu_unlink_channels(MEM_ROT_PP_MEM,
+					    vout->display_ch);
+			ipu_disable_channel(MEM_ROT_PP_MEM, true);
 
 			if (vout->rot_pp_bufs[0]) {
 				mxc_free_buffers(vout->rot_pp_bufs,
@@ -1111,19 +1131,12 @@ static int mxc_v4l2out_streamoff(vout_data * vout)
 						 vout->display_buf_size);
 			}
 		} else {
-			if (vout->field_fmt == V4L2_FIELD_ALTERNATE)
-				ipu_unlink_channels(MEM_VDI_PRP_VF_MEM,
-						    vout->display_ch);
-			else
-				ipu_unlink_channels(MEM_PP_MEM,
-						    vout->display_ch);
-		}
-		if (vout->field_fmt == V4L2_FIELD_ALTERNATE) {
-			ipu_disable_channel(MEM_VDI_PRP_VF_MEM, true);
-		} else {
-			ipu_disable_channel(MEM_PP_MEM, true);
+			ipu_unlink_channels(MEM_PP_MEM,
+					    vout->display_ch);
 		}
 
+		ipu_disable_channel(MEM_PP_MEM, true);
+
 		if (vout->display_ch == ADC_SYS2 ||
 			vout->display_ch == MEM_FG_SYNC) {
 			ipu_disable_channel(vout->display_ch, true);
@@ -1142,16 +1155,55 @@ static int mxc_v4l2out_streamoff(vout_data * vout)
 			vout->display_bufs[1] = 0;
 		}
 
-		if (vout->field_fmt == V4L2_FIELD_ALTERNATE) {
-			ipu_uninit_channel(MEM_VDI_PRP_VF_MEM);
-			if (!ipu_can_rotate_in_place(vout->rotate))
-				ipu_uninit_channel(MEM_ROT_VF_MEM);
+		ipu_uninit_channel(MEM_PP_MEM);
+		if (!ipu_can_rotate_in_place(vout->rotate))
+			ipu_uninit_channel(MEM_ROT_PP_MEM);
+	}
+#ifdef CONFIG_MXC_IPU_V3EX
+	 else if (vout->post_proc_ch == MEM_VDI_PRP_VF_MEM) {
+		if (!ipu_can_rotate_in_place(vout->rotate)) {
+			ipu_unlink_channels(MEM_VDI_PRP_VF_MEM,
+					    MEM_ROT_VF_MEM);
+			ipu_unlink_channels(MEM_ROT_VF_MEM,
+					    vout->display_ch);
+			ipu_disable_channel(MEM_ROT_VF_MEM, true);
+
+			if (vout->rot_pp_bufs[0]) {
+				mxc_free_buffers(vout->rot_pp_bufs,
+						 vout->rot_pp_bufs_vaddr, 2,
+						 vout->display_buf_size);
+			}
+		} else {
+			ipu_unlink_channels(MEM_VDI_PRP_VF_MEM,
+					    vout->display_ch);
+		}
+
+		ipu_disable_channel(MEM_VDI_PRP_VF_MEM, true);
+
+		if (vout->display_ch == ADC_SYS2 ||
+			vout->display_ch == MEM_FG_SYNC) {
+			ipu_disable_channel(vout->display_ch, true);
+			ipu_uninit_channel(vout->display_ch);
 		} else {
-			ipu_uninit_channel(MEM_PP_MEM);
-			if (!ipu_can_rotate_in_place(vout->rotate))
-				ipu_uninit_channel(MEM_ROT_PP_MEM);
+			fbi->var.activate |= FB_ACTIVATE_FORCE;
+			fb_set_var(fbi, &fbi->var);
+
+			if (vout->display_ch == MEM_FG_SYNC) {
+				acquire_console_sem();
+				fb_blank(fbi, FB_BLANK_POWERDOWN);
+				release_console_sem();
+			}
+
+			vout->display_bufs[0] = 0;
+			vout->display_bufs[1] = 0;
 		}
-	} else {		/* ADC Direct */
+
+		ipu_uninit_channel(MEM_VDI_PRP_VF_MEM);
+		if (!ipu_can_rotate_in_place(vout->rotate))
+			ipu_uninit_channel(MEM_ROT_VF_MEM);
+	}
+#endif
+	else {		/* ADC Direct */
 		ipu_disable_channel(MEM_PP_ADC, true);
 		ipu_uninit_channel(MEM_PP_ADC);
 	}
diff --git a/drivers/mxc/Kconfig b/drivers/mxc/Kconfig
index 31fbabd..24c5155 100644
--- a/drivers/mxc/Kconfig
+++ b/drivers/mxc/Kconfig
@@ -7,6 +7,7 @@ menu "MXC support drivers"
 config MXC_IPU
 	bool "Image Processing Unit Driver"
 	select MXC_IPU_V3 if ARCH_MX51
+	select MXC_IPU_V3EX if ARCH_MX51
 	help
 	  If you plan to use the Image Processing unit, say
 	  Y here. IPU is needed by Framebuffer and V4L2 drivers.
diff --git a/sound/soc/imx/imx-esai.h b/sound/soc/imx/imx-esai.h
new file mode 100644
index 0000000..8ac2e3f
--- /dev/null
+++ b/sound/soc/imx/imx-esai.h
@@ -0,0 +1,25 @@
+/*
+ * imx-esai.h  --  ESAI driver header file for Freescale IMX
+ *
+ * Copyright 2008-2009 Freescale  Semiconductor, Inc. All Rights Reserved.
+ */
+
+/*
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#ifndef _MXC_ESAI_H
+#define _MXC_ESAI_H
+
+#define IMX_DAI_ESAI_TX 0x04
+#define IMX_DAI_ESAI_RX 0x08
+#define IMX_DAI_ESAI_TXRX (IMX_DAI_ESAI_TX | IMX_DAI_ESAI_RX)
+
+extern struct snd_soc_dai imx_esai_dai;
+
+#endif
-- 
1.6.0.4




More information about the kernel-team mailing list