[media] omap3isp: Don't access ISP_CTRL directly in the statistics modules
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 25 May 2012 11:35:10 +0000 (08:35 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 11 Aug 2012 18:54:34 +0000 (15:54 -0300)
Use the existing omap3isp_subclk_enable() and omap3isp_subclk_disable()
functions instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/omap3isp/isp.c
drivers/media/video/omap3isp/isp.h
drivers/media/video/omap3isp/isph3a_aewb.c
drivers/media/video/omap3isp/isph3a_af.c
drivers/media/video/omap3isp/isphist.c

index 1c347633e663b65b1acb561ad6c2e00a868920c2..2e1f32248f101848ccba79cc3583c84509bdda6f 100644 (file)
@@ -1281,7 +1281,9 @@ static void __isp_subclk_update(struct isp_device *isp)
 {
        u32 clk = 0;
 
-       if (isp->subclk_resources & OMAP3_ISP_SUBCLK_H3A)
+       /* AEWB and AF share the same clock. */
+       if (isp->subclk_resources &
+           (OMAP3_ISP_SUBCLK_AEWB | OMAP3_ISP_SUBCLK_AF))
                clk |= ISPCTRL_H3A_CLK_EN;
 
        if (isp->subclk_resources & OMAP3_ISP_SUBCLK_HIST)
index fc7af3e32efd247bd83b16f5197a8a992913e1e8..ba2159b20b0dac1d1dd19ee170ec2f32c901f9e6 100644 (file)
@@ -90,10 +90,11 @@ enum isp_sbl_resource {
 
 enum isp_subclk_resource {
        OMAP3_ISP_SUBCLK_CCDC           = (1 << 0),
-       OMAP3_ISP_SUBCLK_H3A            = (1 << 1),
-       OMAP3_ISP_SUBCLK_HIST           = (1 << 2),
-       OMAP3_ISP_SUBCLK_PREVIEW        = (1 << 3),
-       OMAP3_ISP_SUBCLK_RESIZER        = (1 << 4),
+       OMAP3_ISP_SUBCLK_AEWB           = (1 << 1),
+       OMAP3_ISP_SUBCLK_AF             = (1 << 2),
+       OMAP3_ISP_SUBCLK_HIST           = (1 << 3),
+       OMAP3_ISP_SUBCLK_PREVIEW        = (1 << 4),
+       OMAP3_ISP_SUBCLK_RESIZER        = (1 << 5),
 };
 
 /* ISP: OMAP 34xx ES 1.0 */
index a3c76bf1817585997ebe7dcad9bcdbe3c7345aa1..036e9961d0279a174f075b56dbec29fae1a9ffa3 100644 (file)
@@ -93,17 +93,11 @@ static void h3a_aewb_enable(struct ispstat *aewb, int enable)
        if (enable) {
                isp_reg_set(aewb->isp, OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR,
                            ISPH3A_PCR_AEW_EN);
-               /* This bit is already set if AF is enabled */
-               if (aewb->isp->isp_af.state != ISPSTAT_ENABLED)
-                       isp_reg_set(aewb->isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL,
-                                   ISPCTRL_H3A_CLK_EN);
+               omap3isp_subclk_enable(aewb->isp, OMAP3_ISP_SUBCLK_AEWB);
        } else {
                isp_reg_clr(aewb->isp, OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR,
                            ISPH3A_PCR_AEW_EN);
-               /* This bit can't be cleared if AF is enabled */
-               if (aewb->isp->isp_af.state != ISPSTAT_ENABLED)
-                       isp_reg_clr(aewb->isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL,
-                                   ISPCTRL_H3A_CLK_EN);
+               omap3isp_subclk_disable(aewb->isp, OMAP3_ISP_SUBCLK_AEWB);
        }
 }
 
index 58e0bc41489971a16d47e0afcf6722fc318687dd..42ccce318d5d08adf107953c5662146dc56a9aeb 100644 (file)
@@ -143,17 +143,11 @@ static void h3a_af_enable(struct ispstat *af, int enable)
        if (enable) {
                isp_reg_set(af->isp, OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR,
                            ISPH3A_PCR_AF_EN);
-               /* This bit is already set if AEWB is enabled */
-               if (af->isp->isp_aewb.state != ISPSTAT_ENABLED)
-                       isp_reg_set(af->isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL,
-                                   ISPCTRL_H3A_CLK_EN);
+               omap3isp_subclk_enable(af->isp, OMAP3_ISP_SUBCLK_AF);
        } else {
                isp_reg_clr(af->isp, OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR,
                            ISPH3A_PCR_AF_EN);
-               /* This bit can't be cleared if AEWB is enabled */
-               if (af->isp->isp_aewb.state != ISPSTAT_ENABLED)
-                       isp_reg_clr(af->isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL,
-                                   ISPCTRL_H3A_CLK_EN);
+               omap3isp_subclk_disable(af->isp, OMAP3_ISP_SUBCLK_AF);
        }
 }
 
index 1163907bcddcb17fcdbb3fb8070d697f0842dc98..d1a8dee5e1ca4720adb96fde8c87e6280187d862 100644 (file)
@@ -167,13 +167,11 @@ static void hist_enable(struct ispstat *hist, int enable)
        if (enable) {
                isp_reg_set(hist->isp, OMAP3_ISP_IOMEM_HIST, ISPHIST_PCR,
                            ISPHIST_PCR_ENABLE);
-               isp_reg_set(hist->isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL,
-                           ISPCTRL_HIST_CLK_EN);
+               omap3isp_subclk_enable(hist->isp, OMAP3_ISP_SUBCLK_HIST);
        } else {
                isp_reg_clr(hist->isp, OMAP3_ISP_IOMEM_HIST, ISPHIST_PCR,
                            ISPHIST_PCR_ENABLE);
-               isp_reg_clr(hist->isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL,
-                           ISPCTRL_HIST_CLK_EN);
+               omap3isp_subclk_disable(hist->isp, OMAP3_ISP_SUBCLK_HIST);
        }
 }