[omap3isp RFC][RESEND PATCH v2 2/4] omap3isp: Move CCDC LSC prefetch wait to main isp code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since this sequence strictly touches ISP global registers, it's
not really part of the same register address space than the CCDC.

Do this check in main isp code instead.

Also, rename function from ispccdc_lsc_* to isp_ccdc_lsc_*.

Signed-off-by: Sergio Aguirre <saaguirre@xxxxxx>
---
 drivers/media/video/isp/isp.c     |   24 ++++++++++++++++++++++++
 drivers/media/video/isp/isp.h     |    2 ++
 drivers/media/video/isp/ispccdc.c |   26 +-------------------------
 3 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c
index 1ff7193..d0500b9 100644
--- a/drivers/media/video/isp/isp.c
+++ b/drivers/media/video/isp/isp.c
@@ -339,6 +339,30 @@ void isphist_dma_done(struct isp_device *isp)
 	}
 }
 
+int isp_ccdc_lsc_wait_prefetch(struct isp_device *isp)
+{
+	unsigned int wait;
+
+	isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ,
+		       OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
+
+	/* timeout 1 ms */
+	for (wait = 0; wait < 1000; wait++) {
+		if (isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS) &
+				  IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ) {
+			isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ,
+				       OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
+			return 0;
+		}
+
+		rmb();
+		udelay(1);
+	}
+
+	return -ETIMEDOUT;
+}
+
+
 static inline void isp_isr_dbg(struct isp_device *isp, u32 irqstatus)
 {
 	static const char *name[] = {
diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h
index 5edbc86..a0149a0 100644
--- a/drivers/media/video/isp/isp.h
+++ b/drivers/media/video/isp/isp.h
@@ -280,6 +280,8 @@ struct isp_device {
 
 void isphist_dma_done(struct isp_device *isp);
 
+int isp_ccdc_lsc_wait_prefetch(struct isp_device *isp);
+
 void isp_flush(struct isp_device *isp);
 
 int isp_pipeline_set_stream(struct isp_pipeline *pipe,
diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c
index 4244edf..9bc1ace 100644
--- a/drivers/media/video/isp/ispccdc.c
+++ b/drivers/media/video/isp/ispccdc.c
@@ -223,30 +223,6 @@ static void ispccdc_lsc_setup_regs(struct isp_ccdc_device *ccdc,
 		       ISPCCDC_LSC_INITIAL);
 }
 
-static int ispccdc_lsc_wait_prefetch(struct isp_ccdc_device *ccdc)
-{
-	struct isp_device *isp = to_isp_device(ccdc);
-	unsigned int wait;
-
-	isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ,
-		       OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
-
-	/* timeout 1 ms */
-	for (wait = 0; wait < 1000; wait++) {
-		if (isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS) &
-				  IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ) {
-			isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ,
-				       OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
-			return 0;
-		}
-
-		rmb();
-		udelay(1);
-	}
-
-	return -ETIMEDOUT;
-}
-
 /*
  * __ispccdc_lsc_enable - Enables/Disables the Lens Shading Compensation module.
  * @ccdc: Pointer to ISP CCDC device.
@@ -272,7 +248,7 @@ static int __ispccdc_lsc_enable(struct isp_ccdc_device *ccdc, int enable)
 			ISPCCDC_LSC_ENABLE, enable ? ISPCCDC_LSC_ENABLE : 0);
 
 	if (enable) {
-		if (ispccdc_lsc_wait_prefetch(ccdc) < 0) {
+		if (isp_ccdc_lsc_wait_prefetch(isp) < 0) {
 			isp_reg_clr(isp, OMAP3_ISP_IOMEM_CCDC,
 				    ISPCCDC_LSC_CONFIG, ISPCCDC_LSC_ENABLE);
 			ccdc->lsc.state = LSC_STATE_STOPPED;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux