@@ -132,11 +132,13 @@ struct isp_reg {
* ISPCTRL_PAR_BRIDGE_DISABLE - Disable
* ISPCTRL_PAR_BRIDGE_LENDIAN - Little endian
* ISPCTRL_PAR_BRIDGE_BENDIAN - Big endian
+ * @datsz: Width of the data-bus in bits (8, 10, 11, 12, 13) or 0 for default (10bit)
*/
struct isp_parallel_platform_data {
unsigned int data_lane_shift:2;
unsigned int clk_pol:1;
unsigned int bridge:4;
+ unsigned int data_bus_width;
};
/**
@@ -45,6 +45,7 @@ static const unsigned int ccdc_fmts[] = {
V4L2_MBUS_FMT_SRGGB10_1X10,
V4L2_MBUS_FMT_SBGGR10_1X10,
V4L2_MBUS_FMT_SGBRG10_1X10,
+ V4L2_MBUS_FMT_Y8_1X8,
};
/*
@@ -1069,6 +1070,10 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
isp_configure_bridge(isp, ccdc->input, pdata);
ispccdc_config_sync_if(ccdc, &ccdc->syncif);
+ /* CCDC_PAD_SINK */
+ format = &ccdc->formats[CCDC_PAD_SINK];
+ isp_video_mbus_to_pix(&ccdc->video_out, format, &pix);
+
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
@@ -1086,10 +1091,14 @@ 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 */
+ if (pix.bytesperline < format->width * 2)
+ syn_mode |= ISPCCDC_SYN_MODE_PACK8;
+ else
+ syn_mode &= ~ISPCCDC_SYN_MODE_PACK8;
- /* CCDC_PAD_SINK */
- format = &ccdc->formats[CCDC_PAD_SINK];
+
+ isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE);
/* Mosaic filter */
switch (format->code) {
@@ -1128,7 +1137,6 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
<< ISPCCDC_VERT_LINES_NLV_SHIFT,
OMAP3_ISP_IOMEM_CCDC, ISPCCDC_VERT_LINES);
- isp_video_mbus_to_pix(&ccdc->video_out, format, &pix);
ispccdc_config_outlineoffset(ccdc, pix.bytesperline, 0, 0);
/* CCDC_PAD_SOURCE_VP */
@@ -2164,6 +2172,9 @@ int isp_ccdc_init(struct isp_device *isp)
ccdc->syncif.ccdc_mastermode = 0;
ccdc->syncif.datapol = 0;
ccdc->syncif.datsz = 10;
+ if (isp->pdata->subdevs->interface == ISP_INTERFACE_PARALLEL
+ && isp->pdata->subdevs->bus.parallel.data_bus_width != 0)
+ ccdc->syncif.datsz = isp->pdata->subdevs->bus.parallel.data_bus_width;
ccdc->syncif.fldmode = 0;
ccdc->syncif.fldout = 0;
ccdc->syncif.fldpol = 0;
@@ -2172,7 +2183,7 @@ int isp_ccdc_init(struct isp_device *isp)
ccdc->syncif.vdpol = 0;
ccdc->clamp.oblen = 0;
- ccdc->clamp.dcsubval = 64;
+ ccdc->clamp.dcsubval = (ccdc->syncif.datsz == 8) ? 0 : 64;
ccdc->vpcfg.pixelclk = 0;
@@ -228,6 +228,10 @@ void isp_video_mbus_to_pix(const struct isp_video *video,
pix->pixelformat = V4L2_PIX_FMT_YUYV;
pix->bytesperline = pix->width * 2;
break;
+ case V4L2_MBUS_FMT_Y8_1X8:
+ pix->pixelformat = V4L2_PIX_FMT_GREY;
+ pix->bytesperline = pix->width;
+ break;
case V4L2_MBUS_FMT_UYVY8_1X16:
default:
pix->pixelformat = V4L2_PIX_FMT_UYVY;
@@ -261,6 +265,9 @@ void isp_video_pix_to_mbus(const struct v4l2_pix_format *pix,
case V4L2_PIX_FMT_YUYV:
mbus->code = V4L2_MBUS_FMT_YUYV8_1X16;
break;
+ case V4L2_PIX_FMT_GREY:
+ mbus->code = V4L2_MBUS_FMT_Y8_1X8;
+ break;
case V4L2_PIX_FMT_UYVY:
default:
mbus->code = V4L2_MBUS_FMT_UYVY8_1X16;