[media] v4l: omap4iss: ipipeif: Shift input data according to the input format
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 30 Aug 2013 22:23:31 +0000 (19:23 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 11 Dec 2013 08:57:49 +0000 (06:57 -0200)
Input samples must be left-aligned on the ISIF 16-bit data bus.
Configure the 16-to-16-bit selector to shift data according to the input
format.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/staging/media/omap4iss/iss_ipipeif.c
drivers/staging/media/omap4iss/iss_regs.h

index 47fb1d6f944436735324097e54a354ddc8ce752d..28538512d0431face9690836069941e0a89a860c 100644 (file)
@@ -129,6 +129,7 @@ static void ipipeif_set_outaddr(struct iss_ipipeif_device *ipipeif, u32 addr)
 static void ipipeif_configure(struct iss_ipipeif_device *ipipeif)
 {
        struct iss_device *iss = to_iss_device(ipipeif);
+       const struct iss_format_info *info;
        struct v4l2_mbus_framefmt *format;
        u32 isif_ccolp = 0;
 
@@ -194,9 +195,10 @@ cont_raw:
                        ISIF_MODESET_INPMOD_RAW | ISIF_MODESET_CCDW_2BIT,
                        iss->regs[OMAP4_ISS_MEM_ISP_ISIF] + ISIF_MODESET);
 
+               info = omap4iss_video_format_info(format->code);
                writel((readl(iss->regs[OMAP4_ISS_MEM_ISP_ISIF] + ISIF_CGAMMAWD) &
                        ~ISIF_CGAMMAWD_GWDI_MASK) |
-                       ISIF_CGAMMAWD_GWDI_BIT11,
+                       ISIF_CGAMMAWD_GWDI(info->bpp),
                        iss->regs[OMAP4_ISS_MEM_ISP_ISIF] + ISIF_CGAMMAWD);
 
                /* Set RAW Bayer pattern */
index d9693519b6255e4dc8c28ffe2a00ceb6370881b4..5995e62d3e0281330861e62ec53b66f8c6c365ed 100644 (file)
 
 #define ISIF_CGAMMAWD                                  (0x0080)
 #define ISIF_CGAMMAWD_GWDI_MASK                                (0xF << 1)
-#define ISIF_CGAMMAWD_GWDI_BIT11                       (0x4 << 1)
+#define ISIF_CGAMMAWD_GWDI(bpp)                                ((16 - (bpp)) << 1)
 
 #define ISIF_CCDCFG                                    (0x0088)
 #define ISIF_CCDCFG_Y8POS                              (1 << 11)