From 788e269606519115213dea985eeee564c164f289 Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Mon, 17 Mar 2014 11:28:53 +0800 Subject: [PATCH] ENGR00303663 mxc v4l2 capture: Don't return error if we cannot get mipi csi2 The mipi csi2 code is ugly present in the capture pipeline setup/disable routions with '#ifdef CONFIG_MXC_MIPI_CSI2/#endif' protected. Whenever it finds mipi_csi2_info is not gotten correctly, it will return error to callers. This breaks the normally routines in which mipi csi2 is not used and mipi csi2 driver is disabled in its devicetree node(but with the Kconfig CONFIG_MXC_MIPI_CSI2 defined). A real example is the capture feature on the MX6 Sabreauto platforms. We have only parallel CSI input on it and the mipi csi2 driver is disabled in its devicetree node but with the Kconfig CONFIG_MXC_MIPI_CSI2 defined. So, a reasonable choice at present is not to return error if mipi_csi2_info cannot be gotten, though we could eventually re-organize the capture code for a better total solution in the future. Signed-off-by: Liu Ying (cherry picked from commit 8133b7fd26e8b068fa8ab9cd62eae090c76080be) --- .../media/platform/mxc/capture/ipu_bg_overlay_sdc.c | 10 +--------- drivers/media/platform/mxc/capture/ipu_csi_enc.c | 10 +--------- .../media/platform/mxc/capture/ipu_fg_overlay_sdc.c | 10 +--------- drivers/media/platform/mxc/capture/ipu_prp_enc.c | 10 +--------- drivers/media/platform/mxc/capture/ipu_prp_vf_sdc.c | 10 +--------- drivers/media/platform/mxc/capture/ipu_prp_vf_sdc_bg.c | 10 +--------- 6 files changed, 6 insertions(+), 54 deletions(-) diff --git a/drivers/media/platform/mxc/capture/ipu_bg_overlay_sdc.c b/drivers/media/platform/mxc/capture/ipu_bg_overlay_sdc.c index ad5e1c860e01..4a975b54a977 100644 --- a/drivers/media/platform/mxc/capture/ipu_bg_overlay_sdc.c +++ b/drivers/media/platform/mxc/capture/ipu_bg_overlay_sdc.c @@ -1,6 +1,6 @@ /* - * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2004-2014 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -189,10 +189,6 @@ static int csi_enc_setup(cam_data *cam) params.csi_mem.mipi_vc = 0; params.csi_mem.mipi_id = 0; } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif @@ -411,10 +407,6 @@ static int bg_overlay_stop(void *private) && cam->csi == csi_id) mipi_csi2_pixelclk_disable(mipi_csi2_info); } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif diff --git a/drivers/media/platform/mxc/capture/ipu_csi_enc.c b/drivers/media/platform/mxc/capture/ipu_csi_enc.c index 4752f7701c04..fb3c6a24322a 100644 --- a/drivers/media/platform/mxc/capture/ipu_csi_enc.c +++ b/drivers/media/platform/mxc/capture/ipu_csi_enc.c @@ -1,5 +1,5 @@ /* - * Copyright 2009-2013 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2009-2014 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -157,10 +157,6 @@ static int csi_enc_setup(cam_data *cam) params.csi_mem.mipi_vc = 0; params.csi_mem.mipi_id = 0; } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif @@ -309,10 +305,6 @@ static int csi_enc_disabling_tasks(void *private) && cam->csi == csi_id) mipi_csi2_pixelclk_disable(mipi_csi2_info); } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif diff --git a/drivers/media/platform/mxc/capture/ipu_fg_overlay_sdc.c b/drivers/media/platform/mxc/capture/ipu_fg_overlay_sdc.c index 416b40b8046c..80136156ceaf 100644 --- a/drivers/media/platform/mxc/capture/ipu_fg_overlay_sdc.c +++ b/drivers/media/platform/mxc/capture/ipu_fg_overlay_sdc.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2004-2014 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 @@ -195,10 +195,6 @@ static int csi_enc_setup(cam_data *cam) params.csi_mem.mipi_vc = 0; params.csi_mem.mipi_id = 0; } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif @@ -508,10 +504,6 @@ static int foreground_stop(void *private) && cam->csi == csi_id) mipi_csi2_pixelclk_disable(mipi_csi2_info); } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif diff --git a/drivers/media/platform/mxc/capture/ipu_prp_enc.c b/drivers/media/platform/mxc/capture/ipu_prp_enc.c index c16312761d7d..af419e356e6d 100644 --- a/drivers/media/platform/mxc/capture/ipu_prp_enc.c +++ b/drivers/media/platform/mxc/capture/ipu_prp_enc.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2004-2014 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -161,10 +161,6 @@ static int prp_enc_setup(cam_data *cam) enc.csi_prp_enc_mem.mipi_vc = 0; enc.csi_prp_enc_mem.mipi_id = 0; } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif @@ -471,10 +467,6 @@ static int prp_enc_disabling_tasks(void *private) && cam->csi == csi_id) mipi_csi2_pixelclk_disable(mipi_csi2_info); } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif diff --git a/drivers/media/platform/mxc/capture/ipu_prp_vf_sdc.c b/drivers/media/platform/mxc/capture/ipu_prp_vf_sdc.c index 8bf5344df684..b9610f1ed820 100644 --- a/drivers/media/platform/mxc/capture/ipu_prp_vf_sdc.c +++ b/drivers/media/platform/mxc/capture/ipu_prp_vf_sdc.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2004-2014 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 @@ -196,10 +196,6 @@ static int prpvf_start(void *private) vf.csi_prp_vf_mem.mipi_vc = 0; vf.csi_prp_vf_mem.mipi_id = 0; } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif @@ -458,10 +454,6 @@ static int prpvf_stop(void *private) && cam->csi == csi_id) mipi_csi2_pixelclk_disable(mipi_csi2_info); } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif diff --git a/drivers/media/platform/mxc/capture/ipu_prp_vf_sdc_bg.c b/drivers/media/platform/mxc/capture/ipu_prp_vf_sdc_bg.c index 2667fca81a76..a24d82dfca63 100644 --- a/drivers/media/platform/mxc/capture/ipu_prp_vf_sdc_bg.c +++ b/drivers/media/platform/mxc/capture/ipu_prp_vf_sdc_bg.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2004-2014 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -181,10 +181,6 @@ static int prpvf_start(void *private) vf.csi_prp_vf_mem.mipi_vc = 0; vf.csi_prp_vf_mem.mipi_id = 0; } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif @@ -387,10 +383,6 @@ static int prpvf_stop(void *private) && cam->csi == csi_id) mipi_csi2_pixelclk_disable(mipi_csi2_info); } - } else { - printk(KERN_ERR "%s() in %s: Fail to get mipi_csi2_info!\n", - __func__, __FILE__); - return -EPERM; } #endif -- 2.39.2