RE: [PATCH 3/11 - v3] dm355 ccdc module for vpfe capture driver

2009-06-22 Thread Karicheri, Muralidharan
 snip

  +static int dm355_ccdc_init(void)
  +{
  +       printk(KERN_NOTICE dm355_ccdc_init\n);
  +       if (vpfe_register_ccdc_device(ccdc_hw_dev)  0)
  +               return -1;

 Don't you want to rewrite this to return good error code?
 int ret;
 printk();
 ret = vpfe_register_ccdc_device();
 if (ret  0)
 return ret;

 I know you have tight/fast track/hard schedule, so you can do this
 improvement later, after merging this patch.

I haven't changed this or the similar comment in patch 4/11, but it is
something that Muralidharan should look at and fix later.

Regards,

   Hans
[MK] I will take care of this through a separate patch

Murali
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/11 - v3] dm355 ccdc module for vpfe capture driver

2009-06-17 Thread m-karicheri2
From: Muralidharan Karicheri m-kariche...@ti.com

DM355 CCDC hw module

Adds ccdc hw module for DM355 CCDC. This registers with the bridge
driver a set of hw_ops for configuring the CCDC for a specific
decoder device connected to vpfe.

The module description and owner information added

Reviewed by: Hans Verkuil hverk...@xs4all.nl
Reviewed by: Laurent Pinchart laurent.pinch...@skynet.be

Signed-off-by: Muralidharan Karicheri m-kariche...@ti.com
---
Applies to v4l-dvb repository

 drivers/media/video/davinci/dm355_ccdc.c  | 1163 +
 drivers/media/video/davinci/dm355_ccdc_regs.h |  310 +++
 include/media/davinci/dm355_ccdc.h|  336 +++
 3 files changed, 1809 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/davinci/dm355_ccdc.c
 create mode 100644 drivers/media/video/davinci/dm355_ccdc_regs.h
 create mode 100644 include/media/davinci/dm355_ccdc.h

diff --git a/drivers/media/video/davinci/dm355_ccdc.c 
b/drivers/media/video/davinci/dm355_ccdc.c
new file mode 100644
index 000..69e38d0
--- /dev/null
+++ b/drivers/media/video/davinci/dm355_ccdc.c
@@ -0,0 +1,1163 @@
+/*
+ * Copyright (C) 2005-2009 Texas Instruments Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * CCDC hardware module for DM355
+ * --
+ *
+ * This module is for configuring DM355 CCD controller of VPFE to capture
+ * Raw yuv or Bayer RGB data from a decoder. CCDC has several modules
+ * such as Defect Pixel Correction, Color Space Conversion etc to
+ * pre-process the Bayer RGB data, before writing it to SDRAM. This
+ * module also allows application to configure individual
+ * module parameters through VPFE_CMD_S_CCDC_RAW_PARAMS IOCTL.
+ * To do so, application include dm355_ccdc.h and vpfe_capture.h header
+ * 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
+ * to be replaced by #defines or integer
+ */
+#include linux/platform_device.h
+#include linux/uaccess.h
+#include linux/videodev2.h
+#include media/davinci/dm355_ccdc.h
+#include media/davinci/vpss.h
+#include dm355_ccdc_regs.h
+#include ccdc_hw_device.h
+
+MODULE_LICENSE(GPL);
+MODULE_DESCRIPTION(CCDC Driver for DM355);
+MODULE_AUTHOR(Texas Instruments);
+
+static struct device *dev;
+
+/* Object for CCDC raw mode */
+static struct ccdc_params_raw ccdc_hw_params_raw = {
+   .pix_fmt = CCDC_PIXFMT_RAW,
+   .frm_fmt = CCDC_FRMFMT_PROGRESSIVE,
+   .win = CCDC_WIN_VGA,
+   .fid_pol = VPFE_PINPOL_POSITIVE,
+   .vd_pol = VPFE_PINPOL_POSITIVE,
+   .hd_pol = VPFE_PINPOL_POSITIVE,
+   .gain = {
+   .r_ye = 256,
+   .gb_g = 256,
+   .gr_cy = 256,
+   .b_mg = 256
+   },
+   .config_params = {
+   .datasft = 2,
+   .data_sz = CCDC_DATA_10BITS,
+   .mfilt1 = CCDC_NO_MEDIAN_FILTER1,
+   .mfilt2 = CCDC_NO_MEDIAN_FILTER2,
+   .alaw = {
+   .gama_wd = 2,
+   },
+   .blk_clamp = {
+   .sample_pixel = 1,
+   .dc_sub = 25
+   },
+   .col_pat_field0 = {
+   .olop = CCDC_GREEN_BLUE,
+   .olep = CCDC_BLUE,
+   .elop = CCDC_RED,
+   .elep = CCDC_GREEN_RED
+   },
+   .col_pat_field1 = {
+   .olop = CCDC_GREEN_BLUE,
+   .olep = CCDC_BLUE,
+   .elop = CCDC_RED,
+   .elep = CCDC_GREEN_RED
+   },
+   },
+};
+
+
+/* Object for CCDC ycbcr mode */
+static struct ccdc_params_ycbcr ccdc_hw_params_ycbcr = {
+   .win = CCDC_WIN_PAL,
+   .pix_fmt = CCDC_PIXFMT_YCBCR_8BIT,
+   .frm_fmt = CCDC_FRMFMT_INTERLACED,
+   .fid_pol = VPFE_PINPOL_POSITIVE,
+   .vd_pol = VPFE_PINPOL_POSITIVE,
+   .hd_pol = VPFE_PINPOL_POSITIVE,
+   .bt656_enable = 1,
+   .pix_order = 

Re: [PATCH 3/11 - v3] dm355 ccdc module for vpfe capture driver

2009-06-17 Thread Alexey Klimov
Hello,
one more small comment

On Thu, Jun 18, 2009 at 12:11 AM, m-kariche...@ti.com wrote:
 From: Muralidharan Karicheri m-kariche...@ti.com

 DM355 CCDC hw module

 Adds ccdc hw module for DM355 CCDC. This registers with the bridge
 driver a set of hw_ops for configuring the CCDC for a specific
 decoder device connected to vpfe.

 The module description and owner information added


snip


 +static int dm355_ccdc_init(void)
 +{
 +       printk(KERN_NOTICE dm355_ccdc_init\n);
 +       if (vpfe_register_ccdc_device(ccdc_hw_dev)  0)
 +               return -1;

Don't you want to rewrite this to return good error code?
int ret;
printk();
ret = vpfe_register_ccdc_device();
if (ret  0)
return ret;

I know you have tight/fast track/hard schedule, so you can do this
improvement later, after merging this patch.

 +       printk(KERN_NOTICE %s is registered with vpfe.\n,
 +               ccdc_hw_dev.name);
 +       return 0;
 +}
 +
 +static void dm355_ccdc_exit(void)
 +{
 +       vpfe_unregister_ccdc_device(ccdc_hw_dev);
 +}


-- 
Best regards, Klimov Alexey
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html