From patchwork Fri Jun 26 22:05:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 32629 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5QMHLYU005859 for ; Fri, 26 Jun 2009 22:17:21 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n5QM5G5X009863; Fri, 26 Jun 2009 17:05:21 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id n5QM5FEX007050; Fri, 26 Jun 2009 17:05:15 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 79A7C8062C; Fri, 26 Jun 2009 17:05:15 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dlep34.itg.ti.com (dlep34.itg.ti.com [157.170.170.115]) by linux.omap.com (Postfix) with ESMTP id CD41480626 for ; Fri, 26 Jun 2009 17:05:11 -0500 (CDT) Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id n5QM5B2P007032; Fri, 26 Jun 2009 17:05:11 -0500 (CDT) Received: from gt516km11.gt.design.ti.com (gt516km11.gt.design.ti.com [158.218.100.179]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id n5QM5A901753; Fri, 26 Jun 2009 17:05:10 -0500 (CDT) Received: from gt516km11.gt.design.ti.com (localhost.localdomain [127.0.0.1]) by gt516km11.gt.design.ti.com (8.13.1/8.13.1) with ESMTP id n5QM5A8r008362; Fri, 26 Jun 2009 18:05:10 -0400 Received: (from a0868495@localhost) by gt516km11.gt.design.ti.com (8.13.1/8.13.1/Submit) id n5QM5Ao6008359; Fri, 26 Jun 2009 18:05:10 -0400 From: m-karicheri2@ti.com To: davinci-linux-open-source@linux.davincidsp.com, linux-media@vger.kernel.org Date: Fri, 26 Jun 2009 18:05:10 -0400 Message-Id: <1246053910-8337-1-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.6.0.4 Cc: Subject: [PATCH 2/3 - v0] V4L: ccdc driver - adding support for camera capture X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Muralidharan Karicheri Following updates to ccdc driver :- 1) Adding support for camera capture using mt9t031 2) Changed default resolution for ycbcr capture to NTSC to match with tvp514x driver. 3) Returns proper error code from ccdc_init (comments against previous patch version v3) Mandatory Reviewers: Hans Verkuil Signed-off-by: Muralidharan Karicheri --- Applies to v4l-dvb repository drivers/media/video/davinci/dm355_ccdc.c | 21 +++++++++++++-------- drivers/media/video/davinci/dm644x_ccdc.c | 13 +++++++++---- include/media/davinci/dm355_ccdc.h | 2 +- include/media/davinci/dm644x_ccdc.h | 2 +- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/drivers/media/video/davinci/dm355_ccdc.c b/drivers/media/video/davinci/dm355_ccdc.c index 69e38d0..6c6e77c 100644 --- a/drivers/media/video/davinci/dm355_ccdc.c +++ b/drivers/media/video/davinci/dm355_ccdc.c @@ -28,10 +28,9 @@ * files. The setparams() API is called by vpfe_capture driver * to configure module parameters * - * TODO: 1) Raw bayer parameter settings and bayer capture - * 2) Split module parameter structure to module specific ioctl structs - * 3) add support for lense shading correction - * 4) investigate if enum used for user space type definition + * TODO: 1) Split module parameter structure to module specific ioctl structs + * 2) add support for lense shading correction + * 3) investigate if enum used for user space type definition * to be replaced by #defines or integer */ #include @@ -92,7 +91,7 @@ static struct ccdc_params_raw ccdc_hw_params_raw = { /* Object for CCDC ycbcr mode */ static struct ccdc_params_ycbcr ccdc_hw_params_ycbcr = { - .win = CCDC_WIN_PAL, + .win = CCDC_WIN_NTSC, .pix_fmt = CCDC_PIXFMT_YCBCR_8BIT, .frm_fmt = CCDC_FRMFMT_INTERLACED, .fid_pol = VPFE_PINPOL_POSITIVE, @@ -1107,8 +1106,11 @@ static int ccdc_set_hw_if_params(struct vpfe_hw_if_param *params) ccdc_hw_params_ycbcr.vd_pol = params->vdpol; ccdc_hw_params_ycbcr.hd_pol = params->hdpol; break; + case VPFE_RAW_BAYER: + ccdc_hw_params_raw.vd_pol = params->vdpol; + ccdc_hw_params_raw.hd_pol = params->hdpol; + break; default: - /* TODO add support for raw bayer here */ return -EINVAL; } return 0; @@ -1146,9 +1148,12 @@ static struct ccdc_hw_device ccdc_hw_dev = { static int dm355_ccdc_init(void) { + int ret; + printk(KERN_NOTICE "dm355_ccdc_init\n"); - if (vpfe_register_ccdc_device(&ccdc_hw_dev) < 0) - return -1; + ret = vpfe_register_ccdc_device(&ccdc_hw_dev); + if (ret < 0) + return ret; printk(KERN_NOTICE "%s is registered with vpfe.\n", ccdc_hw_dev.name); return 0; diff --git a/drivers/media/video/davinci/dm644x_ccdc.c b/drivers/media/video/davinci/dm644x_ccdc.c index 2f19a91..5dff8d9 100644 --- a/drivers/media/video/davinci/dm644x_ccdc.c +++ b/drivers/media/video/davinci/dm644x_ccdc.c @@ -65,7 +65,7 @@ static struct ccdc_params_raw ccdc_hw_params_raw = { static struct ccdc_params_ycbcr ccdc_hw_params_ycbcr = { .pix_fmt = CCDC_PIXFMT_YCBCR_8BIT, .frm_fmt = CCDC_FRMFMT_INTERLACED, - .win = CCDC_WIN_PAL, + .win = CCDC_WIN_NTSC, .fid_pol = VPFE_PINPOL_POSITIVE, .vd_pol = VPFE_PINPOL_POSITIVE, .hd_pol = VPFE_PINPOL_POSITIVE, @@ -825,8 +825,10 @@ static int ccdc_set_hw_if_params(struct vpfe_hw_if_param *params) ccdc_hw_params_ycbcr.vd_pol = params->vdpol; ccdc_hw_params_ycbcr.hd_pol = params->hdpol; break; + case VPFE_RAW_BAYER: + ccdc_hw_params_raw.vd_pol = params->vdpol; + ccdc_hw_params_raw.hd_pol = params->hdpol; default: - /* TODO add support for raw bayer here */ return -EINVAL; } return 0; @@ -861,9 +863,12 @@ static struct ccdc_hw_device ccdc_hw_dev = { static int dm644x_ccdc_init(void) { + int ret; + printk(KERN_NOTICE "dm644x_ccdc_init\n"); - if (vpfe_register_ccdc_device(&ccdc_hw_dev) < 0) - return -1; + ret = vpfe_register_ccdc_device(&ccdc_hw_dev); + if (ret < 0) + return ret; printk(KERN_NOTICE "%s is registered with vpfe.\n", ccdc_hw_dev.name); return 0; diff --git a/include/media/davinci/dm355_ccdc.h b/include/media/davinci/dm355_ccdc.h index b0ce1af..3526920 100644 --- a/include/media/davinci/dm355_ccdc.h +++ b/include/media/davinci/dm355_ccdc.h @@ -254,7 +254,7 @@ struct ccdc_config_params_raw { #ifdef __KERNEL__ #include -#define CCDC_WIN_PAL {0, 0, 720, 576} +#define CCDC_WIN_NTSC {0, 0, 720, 480} #define CCDC_WIN_VGA {0, 0, 640, 480} /* diff --git a/include/media/davinci/dm644x_ccdc.h b/include/media/davinci/dm644x_ccdc.h index 3e178eb..e34a54a 100644 --- a/include/media/davinci/dm644x_ccdc.h +++ b/include/media/davinci/dm644x_ccdc.h @@ -131,7 +131,7 @@ struct ccdc_config_params_raw { #define NUM_EXTRALINES 8 /* settings for commonly used video formats */ -#define CCDC_WIN_PAL {0, 0, 720, 576} +#define CCDC_WIN_NTSC {0, 0, 720, 480} /* ntsc square pixel */ #define CCDC_WIN_VGA {0, 0, (640 + NUM_EXTRAPIXELS), (480 + NUM_EXTRALINES)}