@@ -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 <linux/platform_device.h>
@@ -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;
@@ -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;
@@ -254,7 +254,7 @@ struct ccdc_config_params_raw {
#ifdef __KERNEL__
#include <linux/io.h>
-#define CCDC_WIN_PAL {0, 0, 720, 576}
+#define CCDC_WIN_NTSC {0, 0, 720, 480}
#define CCDC_WIN_VGA {0, 0, 640, 480}
/*
@@ -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)}