From patchwork Thu Jan 20 23:43:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Hostettler X-Patchwork-Id: 493331 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0KNhXnn001093 for ; Thu, 20 Jan 2011 23:43:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755877Ab1ATXnv (ORCPT ); Thu, 20 Jan 2011 18:43:51 -0500 Received: from moutng.kundenserver.de ([212.227.17.10]:59528 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755869Ab1ATXnu (ORCPT ); Thu, 20 Jan 2011 18:43:50 -0500 Received: from localhost (dslb-084-063-099-010.pools.arcor-ip.net [84.63.99.10]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Lz0Xw-1QJVae3D3Q-014EKQ; Fri, 21 Jan 2011 00:43:49 +0100 From: Martin Hostettler To: linux-media@vger.kernel.org, Laurent Pinchart Cc: Martin Hostettler Subject: [PATCH V3] v4l: OMAP3 ISP CCDC: Add support for 8bit greyscale sensors Date: Fri, 21 Jan 2011 00:43:31 +0100 Message-Id: <1295567011-6395-1-git-send-email-martin@neutronstar.dyndns.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <20110120230246.GE13173@neutronstar.dyndns.org> References: <20110120230246.GE13173@neutronstar.dyndns.org> X-Provags-ID: V02:K0:XHxgHACmDpJvnxSLALBf6WarRhf7BssB96spk2FHqvT K5X1FHDSJ2slSL9QBRZItH3S6wE8N1YE3xrr69YlxqYR4oq6f0 d/3n/WuF7kRkXcjuy3NBzWX4c8k5AYChu3Jnzqifzqx0IiuSvz gE7UwyYMRBUKxwsSOfQLKT/7Eh/b7M9QJb4cq3Qpk2JDHQPoCS V4FliyE7lBTEHhFfaqfFRj0ymRFWsDPtCanu07o9ew= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 20 Jan 2011 23:43:52 +0000 (UTC) diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index 578c8bf..7632bc1 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -43,6 +43,7 @@ __ccdc_get_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, unsigned int pad, enum v4l2_subdev_format_whence which); static const unsigned int ccdc_fmts[] = { + V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SBGGR10_1X10, @@ -1127,6 +1128,9 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) ccdc->syncif.datsz = pdata ? pdata->width : 10; ispccdc_config_sync_if(ccdc, &ccdc->syncif); + /* CCDC_PAD_SINK */ + format = &ccdc->formats[CCDC_PAD_SINK]; + syn_mode = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); /* Use the raw, unprocessed data when writing to memory. The H3A and @@ -1144,10 +1148,15 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) else syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ; - isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); + /* Use PACK8 mode for 1byte per pixel formats */ - /* CCDC_PAD_SINK */ - format = &ccdc->formats[CCDC_PAD_SINK]; + if (isp_video_format_info(format->code)->bpp <= 8) + syn_mode |= ISPCCDC_SYN_MODE_PACK8; + else + syn_mode &= ~ISPCCDC_SYN_MODE_PACK8; + + + isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); /* Mosaic filter */ switch (format->code) { diff --git a/drivers/media/video/isp/ispvideo.c b/drivers/media/video/isp/ispvideo.c index 5f984e4..cd3d331 100644 --- a/drivers/media/video/isp/ispvideo.c +++ b/drivers/media/video/isp/ispvideo.c @@ -221,6 +221,8 @@ isp_video_check_format(struct isp_video *video, struct isp_video_fh *vfh) } static struct isp_format_info formats[] = { + { V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_Y8_1X8, + V4L2_MBUS_FMT_Y8_1X8, V4L2_PIX_FMT_GREY, 8, }, { V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_PIX_FMT_SGRBG10DPCM8, 8, }, { V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SBGGR10_1X10,