Make a nicer interface that can be used by anyone accessing the isp. Signed-off-by: Sergio Aguirre <saaguirre@xxxxxx> --- drivers/media/video/isp/isp.c | 17 +++++++++++++++++ drivers/media/video/isp/isp.h | 2 ++ drivers/media/video/isp/ispccdc.c | 10 +--------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index d0500b9..4ca1a73 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -362,6 +362,23 @@ int isp_ccdc_lsc_wait_prefetch(struct isp_device *isp) return -ETIMEDOUT; } +int isp_sbl_busy(struct isp_device *isp, enum isp_sbl_resource res) +{ + int ret = 0; + + if (res & OMAP3_ISP_SBL_CCDC_WRITE) { + ret |= (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_0) & + ISPSBL_CCDC_WR_0_DATA_READY) + | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_1) & + ISPSBL_CCDC_WR_0_DATA_READY) + | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_2) & + ISPSBL_CCDC_WR_0_DATA_READY) + | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_3) & + ISPSBL_CCDC_WR_0_DATA_READY); + } + + return ret; +} static inline void isp_isr_dbg(struct isp_device *isp, u32 irqstatus) { diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index a0149a0..61e0b12 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -282,6 +282,8 @@ void isphist_dma_done(struct isp_device *isp); int isp_ccdc_lsc_wait_prefetch(struct isp_device *isp); +int isp_sbl_busy(struct isp_device *isp, enum isp_sbl_resource res); + 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 9bc1ace..a2fb503 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -1217,15 +1217,7 @@ static int ispccdc_sbl_busy(struct isp_ccdc_device *ccdc) { struct isp_device *isp = to_isp_device(ccdc); - return ispccdc_busy(ccdc) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_0) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_1) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_2) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_3) & - ISPSBL_CCDC_WR_0_DATA_READY); + return ispccdc_busy(ccdc) | isp_sbl_busy(isp, OMAP3_ISP_SBL_CCDC_WRITE); } /* -- 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