From 86efc5043269df417d6145d912c87aafbed0c5c9 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 30 Aug 2013 19:23:31 -0300 Subject: [PATCH] [media] v4l: omap4iss: ipipeif: Shift input data according to the input format 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/omap4iss/iss_ipipeif.c | 4 +++- drivers/staging/media/omap4iss/iss_regs.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/omap4iss/iss_ipipeif.c b/drivers/staging/media/omap4iss/iss_ipipeif.c index 47fb1d6f9444..28538512d043 100644 --- a/drivers/staging/media/omap4iss/iss_ipipeif.c +++ b/drivers/staging/media/omap4iss/iss_ipipeif.c @@ -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 */ diff --git a/drivers/staging/media/omap4iss/iss_regs.h b/drivers/staging/media/omap4iss/iss_regs.h index d9693519b625..5995e62d3e02 100644 --- a/drivers/staging/media/omap4iss/iss_regs.h +++ b/drivers/staging/media/omap4iss/iss_regs.h @@ -368,7 +368,7 @@ #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) -- 2.39.5