diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-08-31 10:03:53 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-11 15:02:56 -0400 |
commit | c51364cafa26dca2022f9b31da1c41e27c306c47 (patch) | |
tree | ca9c16f27c21c1c368b539671ff7a57d7d9e3a86 | |
parent | 73ea57eb5442aece696a7a03e2cd4509d38e55fd (diff) |
[media] omap3isp: ccdc: Add YUV input formats support
Enable the bridge automatically when the input format is YUYV8 or UYVY8.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/omap3isp/isp.c | 4 | ||||
-rw-r--r-- | drivers/media/video/omap3isp/isp.h | 2 | ||||
-rw-r--r-- | drivers/media/video/omap3isp/ispccdc.c | 145 | ||||
-rw-r--r-- | drivers/media/video/omap3isp/ispvideo.c | 4 | ||||
-rw-r--r-- | include/media/omap3isp.h | 11 |
5 files changed, 129 insertions, 37 deletions
diff --git a/drivers/media/video/omap3isp/isp.c b/drivers/media/video/omap3isp/isp.c index 36805ca72688..e0096e07dbdc 100644 --- a/drivers/media/video/omap3isp/isp.c +++ b/drivers/media/video/omap3isp/isp.c | |||
@@ -293,7 +293,7 @@ static void isp_core_init(struct isp_device *isp, int idle) | |||
293 | void omap3isp_configure_bridge(struct isp_device *isp, | 293 | void omap3isp_configure_bridge(struct isp_device *isp, |
294 | enum ccdc_input_entity input, | 294 | enum ccdc_input_entity input, |
295 | const struct isp_parallel_platform_data *pdata, | 295 | const struct isp_parallel_platform_data *pdata, |
296 | unsigned int shift) | 296 | unsigned int shift, unsigned int bridge) |
297 | { | 297 | { |
298 | u32 ispctrl_val; | 298 | u32 ispctrl_val; |
299 | 299 | ||
@@ -302,12 +302,12 @@ void omap3isp_configure_bridge(struct isp_device *isp, | |||
302 | ispctrl_val &= ~ISPCTRL_PAR_CLK_POL_INV; | 302 | ispctrl_val &= ~ISPCTRL_PAR_CLK_POL_INV; |
303 | ispctrl_val &= ~ISPCTRL_PAR_SER_CLK_SEL_MASK; | 303 | ispctrl_val &= ~ISPCTRL_PAR_SER_CLK_SEL_MASK; |
304 | ispctrl_val &= ~ISPCTRL_PAR_BRIDGE_MASK; | 304 | ispctrl_val &= ~ISPCTRL_PAR_BRIDGE_MASK; |
305 | ispctrl_val |= bridge; | ||
305 | 306 | ||
306 | switch (input) { | 307 | switch (input) { |
307 | case CCDC_INPUT_PARALLEL: | 308 | case CCDC_INPUT_PARALLEL: |
308 | ispctrl_val |= ISPCTRL_PAR_SER_CLK_SEL_PARALLEL; | 309 | ispctrl_val |= ISPCTRL_PAR_SER_CLK_SEL_PARALLEL; |
309 | ispctrl_val |= pdata->clk_pol << ISPCTRL_PAR_CLK_POL_SHIFT; | 310 | ispctrl_val |= pdata->clk_pol << ISPCTRL_PAR_CLK_POL_SHIFT; |
310 | ispctrl_val |= pdata->bridge << ISPCTRL_PAR_BRIDGE_SHIFT; | ||
311 | shift += pdata->data_lane_shift * 2; | 311 | shift += pdata->data_lane_shift * 2; |
312 | break; | 312 | break; |
313 | 313 | ||
diff --git a/drivers/media/video/omap3isp/isp.h b/drivers/media/video/omap3isp/isp.h index ba2159b20b0d..8be7487c326f 100644 --- a/drivers/media/video/omap3isp/isp.h +++ b/drivers/media/video/omap3isp/isp.h | |||
@@ -236,7 +236,7 @@ int omap3isp_pipeline_set_stream(struct isp_pipeline *pipe, | |||
236 | void omap3isp_configure_bridge(struct isp_device *isp, | 236 | void omap3isp_configure_bridge(struct isp_device *isp, |
237 | enum ccdc_input_entity input, | 237 | enum ccdc_input_entity input, |
238 | const struct isp_parallel_platform_data *pdata, | 238 | const struct isp_parallel_platform_data *pdata, |
239 | unsigned int shift); | 239 | unsigned int shift, unsigned int bridge); |
240 | 240 | ||
241 | struct isp_device *omap3isp_get(struct isp_device *isp); | 241 | struct isp_device *omap3isp_get(struct isp_device *isp); |
242 | void omap3isp_put(struct isp_device *isp); | 242 | void omap3isp_put(struct isp_device *isp); |
diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c index c58b0c68ce36..aa9df9d71a7b 100644 --- a/drivers/media/video/omap3isp/ispccdc.c +++ b/drivers/media/video/omap3isp/ispccdc.c | |||
@@ -61,6 +61,8 @@ static const unsigned int ccdc_fmts[] = { | |||
61 | V4L2_MBUS_FMT_SRGGB12_1X12, | 61 | V4L2_MBUS_FMT_SRGGB12_1X12, |
62 | V4L2_MBUS_FMT_SBGGR12_1X12, | 62 | V4L2_MBUS_FMT_SBGGR12_1X12, |
63 | V4L2_MBUS_FMT_SGBRG12_1X12, | 63 | V4L2_MBUS_FMT_SGBRG12_1X12, |
64 | V4L2_MBUS_FMT_YUYV8_2X8, | ||
65 | V4L2_MBUS_FMT_UYVY8_2X8, | ||
64 | }; | 66 | }; |
65 | 67 | ||
66 | /* | 68 | /* |
@@ -973,8 +975,19 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc, | |||
973 | unsigned int data_size) | 975 | unsigned int data_size) |
974 | { | 976 | { |
975 | struct isp_device *isp = to_isp_device(ccdc); | 977 | struct isp_device *isp = to_isp_device(ccdc); |
978 | const struct v4l2_mbus_framefmt *format; | ||
976 | u32 syn_mode = ISPCCDC_SYN_MODE_VDHDEN; | 979 | u32 syn_mode = ISPCCDC_SYN_MODE_VDHDEN; |
977 | 980 | ||
981 | format = &ccdc->formats[CCDC_PAD_SINK]; | ||
982 | |||
983 | if (format->code == V4L2_MBUS_FMT_YUYV8_2X8 || | ||
984 | format->code == V4L2_MBUS_FMT_UYVY8_2X8) { | ||
985 | /* The bridge is enabled for YUV8 formats. Configure the input | ||
986 | * mode accordingly. | ||
987 | */ | ||
988 | syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR16; | ||
989 | } | ||
990 | |||
978 | switch (data_size) { | 991 | switch (data_size) { |
979 | case 8: | 992 | case 8: |
980 | syn_mode |= ISPCCDC_SYN_MODE_DATSIZ_8; | 993 | syn_mode |= ISPCCDC_SYN_MODE_DATSIZ_8; |
@@ -1000,6 +1013,19 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc, | |||
1000 | syn_mode |= ISPCCDC_SYN_MODE_VDPOL; | 1013 | syn_mode |= ISPCCDC_SYN_MODE_VDPOL; |
1001 | 1014 | ||
1002 | isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); | 1015 | isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); |
1016 | |||
1017 | /* The CCDC_CFG.Y8POS bit is used in YCbCr8 input mode only. The | ||
1018 | * hardware seems to ignore it in all other input modes. | ||
1019 | */ | ||
1020 | if (format->code == V4L2_MBUS_FMT_UYVY8_2X8) | ||
1021 | isp_reg_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, | ||
1022 | ISPCCDC_CFG_Y8POS); | ||
1023 | else | ||
1024 | isp_reg_clr(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, | ||
1025 | ISPCCDC_CFG_Y8POS); | ||
1026 | |||
1027 | isp_reg_clr(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_REC656IF, | ||
1028 | ISPCCDC_REC656IF_R656ON); | ||
1003 | } | 1029 | } |
1004 | 1030 | ||
1005 | /* CCDC formats descriptions */ | 1031 | /* CCDC formats descriptions */ |
@@ -1088,6 +1114,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) | |||
1088 | unsigned int depth_in = 0; | 1114 | unsigned int depth_in = 0; |
1089 | struct media_pad *pad; | 1115 | struct media_pad *pad; |
1090 | unsigned long flags; | 1116 | unsigned long flags; |
1117 | unsigned int bridge; | ||
1091 | unsigned int shift; | 1118 | unsigned int shift; |
1092 | u32 syn_mode; | 1119 | u32 syn_mode; |
1093 | u32 ccdc_pattern; | 1120 | u32 ccdc_pattern; |
@@ -1098,7 +1125,9 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) | |||
1098 | pdata = &((struct isp_v4l2_subdevs_group *)sensor->host_priv) | 1125 | pdata = &((struct isp_v4l2_subdevs_group *)sensor->host_priv) |
1099 | ->bus.parallel; | 1126 | ->bus.parallel; |
1100 | 1127 | ||
1101 | /* Compute shift value for lane shifter to configure the bridge. */ | 1128 | /* Compute the lane shifter shift value and enable the bridge when the |
1129 | * input format is YUV. | ||
1130 | */ | ||
1102 | fmt_src.pad = pad->index; | 1131 | fmt_src.pad = pad->index; |
1103 | fmt_src.which = V4L2_SUBDEV_FORMAT_ACTIVE; | 1132 | fmt_src.which = V4L2_SUBDEV_FORMAT_ACTIVE; |
1104 | if (!v4l2_subdev_call(sensor, pad, get_fmt, NULL, &fmt_src)) { | 1133 | if (!v4l2_subdev_call(sensor, pad, get_fmt, NULL, &fmt_src)) { |
@@ -1109,14 +1138,18 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) | |||
1109 | fmt_info = omap3isp_video_format_info | 1138 | fmt_info = omap3isp_video_format_info |
1110 | (isp->isp_ccdc.formats[CCDC_PAD_SINK].code); | 1139 | (isp->isp_ccdc.formats[CCDC_PAD_SINK].code); |
1111 | depth_out = fmt_info->width; | 1140 | depth_out = fmt_info->width; |
1112 | |||
1113 | shift = depth_in - depth_out; | 1141 | shift = depth_in - depth_out; |
1114 | omap3isp_configure_bridge(isp, ccdc->input, pdata, shift); | ||
1115 | 1142 | ||
1116 | ccdc_config_sync_if(ccdc, pdata, depth_out); | 1143 | if (fmt_info->code == V4L2_MBUS_FMT_YUYV8_2X8) |
1144 | bridge = ISPCTRL_PAR_BRIDGE_LENDIAN; | ||
1145 | else if (fmt_info->code == V4L2_MBUS_FMT_UYVY8_2X8) | ||
1146 | bridge = ISPCTRL_PAR_BRIDGE_BENDIAN; | ||
1147 | else | ||
1148 | bridge = ISPCTRL_PAR_BRIDGE_DISABLE; | ||
1117 | 1149 | ||
1118 | /* CCDC_PAD_SINK */ | 1150 | omap3isp_configure_bridge(isp, ccdc->input, pdata, shift, bridge); |
1119 | format = &ccdc->formats[CCDC_PAD_SINK]; | 1151 | |
1152 | ccdc_config_sync_if(ccdc, pdata, depth_out); | ||
1120 | 1153 | ||
1121 | syn_mode = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); | 1154 | syn_mode = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); |
1122 | 1155 | ||
@@ -1135,13 +1168,8 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) | |||
1135 | else | 1168 | else |
1136 | syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ; | 1169 | syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ; |
1137 | 1170 | ||
1138 | /* Use PACK8 mode for 1byte per pixel formats. */ | 1171 | /* CCDC_PAD_SINK */ |
1139 | if (omap3isp_video_format_info(format->code)->width <= 8) | 1172 | format = &ccdc->formats[CCDC_PAD_SINK]; |
1140 | syn_mode |= ISPCCDC_SYN_MODE_PACK8; | ||
1141 | else | ||
1142 | syn_mode &= ~ISPCCDC_SYN_MODE_PACK8; | ||
1143 | |||
1144 | isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); | ||
1145 | 1173 | ||
1146 | /* Mosaic filter */ | 1174 | /* Mosaic filter */ |
1147 | switch (format->code) { | 1175 | switch (format->code) { |
@@ -1172,6 +1200,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) | |||
1172 | OMAP3_ISP_IOMEM_CCDC, ISPCCDC_VDINT); | 1200 | OMAP3_ISP_IOMEM_CCDC, ISPCCDC_VDINT); |
1173 | 1201 | ||
1174 | /* CCDC_PAD_SOURCE_OF */ | 1202 | /* CCDC_PAD_SOURCE_OF */ |
1203 | format = &ccdc->formats[CCDC_PAD_SOURCE_OF]; | ||
1175 | crop = &ccdc->crop; | 1204 | crop = &ccdc->crop; |
1176 | 1205 | ||
1177 | isp_reg_writel(isp, (crop->left << ISPCCDC_HORZ_INFO_SPH_SHIFT) | | 1206 | isp_reg_writel(isp, (crop->left << ISPCCDC_HORZ_INFO_SPH_SHIFT) | |
@@ -1185,6 +1214,24 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) | |||
1185 | 1214 | ||
1186 | ccdc_config_outlineoffset(ccdc, ccdc->video_out.bpl_value, 0, 0); | 1215 | ccdc_config_outlineoffset(ccdc, ccdc->video_out.bpl_value, 0, 0); |
1187 | 1216 | ||
1217 | /* The CCDC outputs data in UYVY order by default. Swap bytes to get | ||
1218 | * YUYV. | ||
1219 | */ | ||
1220 | if (format->code == V4L2_MBUS_FMT_YUYV8_1X16) | ||
1221 | isp_reg_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, | ||
1222 | ISPCCDC_CFG_BSWD); | ||
1223 | else | ||
1224 | isp_reg_clr(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, | ||
1225 | ISPCCDC_CFG_BSWD); | ||
1226 | |||
1227 | /* Use PACK8 mode for 1byte per pixel formats. */ | ||
1228 | if (omap3isp_video_format_info(format->code)->width <= 8) | ||
1229 | syn_mode |= ISPCCDC_SYN_MODE_PACK8; | ||
1230 | else | ||
1231 | syn_mode &= ~ISPCCDC_SYN_MODE_PACK8; | ||
1232 | |||
1233 | isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); | ||
1234 | |||
1188 | /* CCDC_PAD_SOURCE_VP */ | 1235 | /* CCDC_PAD_SOURCE_VP */ |
1189 | format = &ccdc->formats[CCDC_PAD_SOURCE_VP]; | 1236 | format = &ccdc->formats[CCDC_PAD_SOURCE_VP]; |
1190 | 1237 | ||
@@ -1199,6 +1246,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) | |||
1199 | (format->height << ISPCCDC_VP_OUT_VERT_NUM_SHIFT), | 1246 | (format->height << ISPCCDC_VP_OUT_VERT_NUM_SHIFT), |
1200 | OMAP3_ISP_IOMEM_CCDC, ISPCCDC_VP_OUT); | 1247 | OMAP3_ISP_IOMEM_CCDC, ISPCCDC_VP_OUT); |
1201 | 1248 | ||
1249 | /* Lens shading correction. */ | ||
1202 | spin_lock_irqsave(&ccdc->lsc.req_lock, flags); | 1250 | spin_lock_irqsave(&ccdc->lsc.req_lock, flags); |
1203 | if (ccdc->lsc.request == NULL) | 1251 | if (ccdc->lsc.request == NULL) |
1204 | goto unlock; | 1252 | goto unlock; |
@@ -1776,8 +1824,8 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, | |||
1776 | unsigned int pad, struct v4l2_mbus_framefmt *fmt, | 1824 | unsigned int pad, struct v4l2_mbus_framefmt *fmt, |
1777 | enum v4l2_subdev_format_whence which) | 1825 | enum v4l2_subdev_format_whence which) |
1778 | { | 1826 | { |
1779 | struct v4l2_mbus_framefmt *format; | ||
1780 | const struct isp_format_info *info; | 1827 | const struct isp_format_info *info; |
1828 | enum v4l2_mbus_pixelcode pixelcode; | ||
1781 | unsigned int width = fmt->width; | 1829 | unsigned int width = fmt->width; |
1782 | unsigned int height = fmt->height; | 1830 | unsigned int height = fmt->height; |
1783 | struct v4l2_rect *crop; | 1831 | struct v4l2_rect *crop; |
@@ -1785,9 +1833,6 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, | |||
1785 | 1833 | ||
1786 | switch (pad) { | 1834 | switch (pad) { |
1787 | case CCDC_PAD_SINK: | 1835 | case CCDC_PAD_SINK: |
1788 | /* TODO: If the CCDC output formatter pad is connected directly | ||
1789 | * to the resizer, only YUV formats can be used. | ||
1790 | */ | ||
1791 | for (i = 0; i < ARRAY_SIZE(ccdc_fmts); i++) { | 1836 | for (i = 0; i < ARRAY_SIZE(ccdc_fmts); i++) { |
1792 | if (fmt->code == ccdc_fmts[i]) | 1837 | if (fmt->code == ccdc_fmts[i]) |
1793 | break; | 1838 | break; |
@@ -1803,8 +1848,26 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, | |||
1803 | break; | 1848 | break; |
1804 | 1849 | ||
1805 | case CCDC_PAD_SOURCE_OF: | 1850 | case CCDC_PAD_SOURCE_OF: |
1806 | format = __ccdc_get_format(ccdc, fh, CCDC_PAD_SINK, which); | 1851 | pixelcode = fmt->code; |
1807 | memcpy(fmt, format, sizeof(*fmt)); | 1852 | *fmt = *__ccdc_get_format(ccdc, fh, CCDC_PAD_SINK, which); |
1853 | |||
1854 | /* YUV formats are converted from 2X8 to 1X16 by the bridge and | ||
1855 | * can be byte-swapped. | ||
1856 | */ | ||
1857 | if (fmt->code == V4L2_MBUS_FMT_YUYV8_2X8 || | ||
1858 | fmt->code == V4L2_MBUS_FMT_UYVY8_2X8) { | ||
1859 | /* Use the user requested format if YUV. */ | ||
1860 | if (pixelcode == V4L2_MBUS_FMT_YUYV8_2X8 || | ||
1861 | pixelcode == V4L2_MBUS_FMT_UYVY8_2X8 || | ||
1862 | pixelcode == V4L2_MBUS_FMT_YUYV8_1X16 || | ||
1863 | pixelcode == V4L2_MBUS_FMT_UYVY8_1X16) | ||
1864 | fmt->code = pixelcode; | ||
1865 | |||
1866 | if (fmt->code == V4L2_MBUS_FMT_YUYV8_2X8) | ||
1867 | fmt->code = V4L2_MBUS_FMT_YUYV8_1X16; | ||
1868 | else if (fmt->code == V4L2_MBUS_FMT_UYVY8_2X8) | ||
1869 | fmt->code = V4L2_MBUS_FMT_UYVY8_1X16; | ||
1870 | } | ||
1808 | 1871 | ||
1809 | /* Hardcode the output size to the crop rectangle size. */ | 1872 | /* Hardcode the output size to the crop rectangle size. */ |
1810 | crop = __ccdc_get_crop(ccdc, fh, which); | 1873 | crop = __ccdc_get_crop(ccdc, fh, which); |
@@ -1813,13 +1876,17 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, | |||
1813 | break; | 1876 | break; |
1814 | 1877 | ||
1815 | case CCDC_PAD_SOURCE_VP: | 1878 | case CCDC_PAD_SOURCE_VP: |
1816 | format = __ccdc_get_format(ccdc, fh, CCDC_PAD_SINK, which); | 1879 | *fmt = *__ccdc_get_format(ccdc, fh, CCDC_PAD_SINK, which); |
1817 | memcpy(fmt, format, sizeof(*fmt)); | ||
1818 | 1880 | ||
1819 | /* The video port interface truncates the data to 10 bits. */ | 1881 | /* The video port interface truncates the data to 10 bits. */ |
1820 | info = omap3isp_video_format_info(fmt->code); | 1882 | info = omap3isp_video_format_info(fmt->code); |
1821 | fmt->code = info->truncated; | 1883 | fmt->code = info->truncated; |
1822 | 1884 | ||
1885 | /* YUV formats are not supported by the video port. */ | ||
1886 | if (fmt->code == V4L2_MBUS_FMT_YUYV8_2X8 || | ||
1887 | fmt->code == V4L2_MBUS_FMT_UYVY8_2X8) | ||
1888 | fmt->code = 0; | ||
1889 | |||
1823 | /* The number of lines that can be clocked out from the video | 1890 | /* The number of lines that can be clocked out from the video |
1824 | * port output must be at least one line less than the number | 1891 | * port output must be at least one line less than the number |
1825 | * of input lines. | 1892 | * of input lines. |
@@ -1902,14 +1969,46 @@ static int ccdc_enum_mbus_code(struct v4l2_subdev *sd, | |||
1902 | break; | 1969 | break; |
1903 | 1970 | ||
1904 | case CCDC_PAD_SOURCE_OF: | 1971 | case CCDC_PAD_SOURCE_OF: |
1972 | format = __ccdc_get_format(ccdc, fh, code->pad, | ||
1973 | V4L2_SUBDEV_FORMAT_TRY); | ||
1974 | |||
1975 | if (format->code == V4L2_MBUS_FMT_YUYV8_2X8 || | ||
1976 | format->code == V4L2_MBUS_FMT_UYVY8_2X8) { | ||
1977 | /* In YUV mode the CCDC can swap bytes. */ | ||
1978 | if (code->index == 0) | ||
1979 | code->code = V4L2_MBUS_FMT_YUYV8_1X16; | ||
1980 | else if (code->index == 1) | ||
1981 | code->code = V4L2_MBUS_FMT_UYVY8_1X16; | ||
1982 | else | ||
1983 | return -EINVAL; | ||
1984 | } else { | ||
1985 | /* In raw mode, no configurable format confversion is | ||
1986 | * available. | ||
1987 | */ | ||
1988 | if (code->index == 0) | ||
1989 | code->code = format->code; | ||
1990 | else | ||
1991 | return -EINVAL; | ||
1992 | } | ||
1993 | break; | ||
1994 | |||
1905 | case CCDC_PAD_SOURCE_VP: | 1995 | case CCDC_PAD_SOURCE_VP: |
1906 | /* No format conversion inside CCDC */ | 1996 | /* The CCDC supports no configurable format conversion |
1997 | * compatible with the video port. Enumerate a single output | ||
1998 | * format code. | ||
1999 | */ | ||
1907 | if (code->index != 0) | 2000 | if (code->index != 0) |
1908 | return -EINVAL; | 2001 | return -EINVAL; |
1909 | 2002 | ||
1910 | format = __ccdc_get_format(ccdc, fh, CCDC_PAD_SINK, | 2003 | format = __ccdc_get_format(ccdc, fh, code->pad, |
1911 | V4L2_SUBDEV_FORMAT_TRY); | 2004 | V4L2_SUBDEV_FORMAT_TRY); |
1912 | 2005 | ||
2006 | /* A pixel code equal to 0 means that the video port doesn't | ||
2007 | * support the input format. Don't enumerate any pixel code. | ||
2008 | */ | ||
2009 | if (format->code == 0) | ||
2010 | return -EINVAL; | ||
2011 | |||
1913 | code->code = format->code; | 2012 | code->code = format->code; |
1914 | break; | 2013 | break; |
1915 | 2014 | ||
diff --git a/drivers/media/video/omap3isp/ispvideo.c b/drivers/media/video/omap3isp/ispvideo.c index 98a8bfc84fb4..3a5085e90024 100644 --- a/drivers/media/video/omap3isp/ispvideo.c +++ b/drivers/media/video/omap3isp/ispvideo.c | |||
@@ -120,6 +120,10 @@ static struct isp_format_info formats[] = { | |||
120 | { V4L2_MBUS_FMT_YUYV8_2X8, V4L2_MBUS_FMT_YUYV8_2X8, | 120 | { V4L2_MBUS_FMT_YUYV8_2X8, V4L2_MBUS_FMT_YUYV8_2X8, |
121 | V4L2_MBUS_FMT_YUYV8_2X8, 0, | 121 | V4L2_MBUS_FMT_YUYV8_2X8, 0, |
122 | V4L2_PIX_FMT_YUYV, 8, 2, }, | 122 | V4L2_PIX_FMT_YUYV, 8, 2, }, |
123 | /* Empty entry to catch the unsupported pixel code (0) used by the CCDC | ||
124 | * module and avoid NULL pointer dereferences. | ||
125 | */ | ||
126 | { 0, } | ||
123 | }; | 127 | }; |
124 | 128 | ||
125 | const struct isp_format_info * | 129 | const struct isp_format_info * |
diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h index 5ab9449fce1e..95842696857f 100644 --- a/include/media/omap3isp.h +++ b/include/media/omap3isp.h | |||
@@ -42,12 +42,6 @@ enum isp_interface_type { | |||
42 | }; | 42 | }; |
43 | 43 | ||
44 | enum { | 44 | enum { |
45 | ISP_BRIDGE_DISABLE = 0, | ||
46 | ISP_BRIDGE_LITTLE_ENDIAN = 2, | ||
47 | ISP_BRIDGE_BIG_ENDIAN = 3, | ||
48 | }; | ||
49 | |||
50 | enum { | ||
51 | ISP_LANE_SHIFT_0 = 0, | 45 | ISP_LANE_SHIFT_0 = 0, |
52 | ISP_LANE_SHIFT_2 = 1, | 46 | ISP_LANE_SHIFT_2 = 1, |
53 | ISP_LANE_SHIFT_4 = 2, | 47 | ISP_LANE_SHIFT_4 = 2, |
@@ -69,10 +63,6 @@ enum { | |||
69 | * 0 - Active high, 1 - Active low | 63 | * 0 - Active high, 1 - Active low |
70 | * @data_pol: Data polarity | 64 | * @data_pol: Data polarity |
71 | * 0 - Normal, 1 - One's complement | 65 | * 0 - Normal, 1 - One's complement |
72 | * @bridge: CCDC Bridge input control | ||
73 | * ISP_BRIDGE_DISABLE - Disable | ||
74 | * ISP_BRIDGE_LITTLE_ENDIAN - Little endian | ||
75 | * ISP_BRIDGE_BIG_ENDIAN - Big endian | ||
76 | */ | 66 | */ |
77 | struct isp_parallel_platform_data { | 67 | struct isp_parallel_platform_data { |
78 | unsigned int data_lane_shift:2; | 68 | unsigned int data_lane_shift:2; |
@@ -80,7 +70,6 @@ struct isp_parallel_platform_data { | |||
80 | unsigned int hs_pol:1; | 70 | unsigned int hs_pol:1; |
81 | unsigned int vs_pol:1; | 71 | unsigned int vs_pol:1; |
82 | unsigned int data_pol:1; | 72 | unsigned int data_pol:1; |
83 | unsigned int bridge:2; | ||
84 | }; | 73 | }; |
85 | 74 | ||
86 | enum { | 75 | enum { |