aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/omap3isp/ispccdc.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-21 05:12:35 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-21 05:12:35 -0400
commit676ee36be04985062522804c2de04f0764212be6 (patch)
tree781df135c5a91a04decad1b7d53b5a925dc11522 /drivers/media/platform/omap3isp/ispccdc.c
parentb18042a673e88c9457a6d1716219c2367ca447b0 (diff)
parente183201b9e917daf2530b637b2f34f1d5afb934d (diff)
Merge branch 'patchwork' into v4l_for_linus
* patchwork: (404 commits) [media] uvcvideo: add support for VIDIOC_QUERY_EXT_CTRL [media] uvcvideo: fix cropcap v4l2-compliance failure [media] media: omap3isp: remove unused clkdev [media] coda: Add tracing support [media] coda: drop dma_sync_single_for_device in coda_bitstream_queue [media] coda: fix fill bitstream errors in nonstreaming case [media] coda: call SEQ_END when the first queue is stopped [media] coda: fail to start streaming if userspace set invalid formats [media] coda: remove duplicate error messages for buffer allocations [media] coda: move parameter buffer in together with context buffer allocation [media] coda: allocate bitstream buffer from REQBUFS, size depends on the format [media] coda: allocate per-context buffers from REQBUFS [media] coda: use strlcpy instead of snprintf [media] coda: bitstream payload is unsigned [media] coda: fix double call to debugfs_remove [media] coda: check kasprintf return value in coda_open [media] coda: bitrate can only be set in kbps steps [media] v4l2-mem2mem: no need to initialize b in v4l2_m2m_next_buf and v4l2_m2m_buf_remove [media] s5p-mfc: set allow_zero_bytesused flag for vb2_queue_init [media] coda: set allow_zero_bytesused flag for vb2_queue_init ...
Diffstat (limited to 'drivers/media/platform/omap3isp/ispccdc.c')
-rw-r--r--drivers/media/platform/omap3isp/ispccdc.c112
1 files changed, 56 insertions, 56 deletions
diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c
index 587489a072d5..a6a61cce43dd 100644
--- a/drivers/media/platform/omap3isp/ispccdc.c
+++ b/drivers/media/platform/omap3isp/ispccdc.c
@@ -32,7 +32,7 @@
32#define CCDC_MIN_HEIGHT 32 32#define CCDC_MIN_HEIGHT 32
33 33
34static struct v4l2_mbus_framefmt * 34static struct v4l2_mbus_framefmt *
35__ccdc_get_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, 35__ccdc_get_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_pad_config *cfg,
36 unsigned int pad, enum v4l2_subdev_format_whence which); 36 unsigned int pad, enum v4l2_subdev_format_whence which);
37 37
38static const unsigned int ccdc_fmts[] = { 38static const unsigned int ccdc_fmts[] = {
@@ -958,11 +958,11 @@ void omap3isp_ccdc_max_rate(struct isp_ccdc_device *ccdc,
958/* 958/*
959 * ccdc_config_sync_if - Set CCDC sync interface configuration 959 * ccdc_config_sync_if - Set CCDC sync interface configuration
960 * @ccdc: Pointer to ISP CCDC device. 960 * @ccdc: Pointer to ISP CCDC device.
961 * @pdata: Parallel interface platform data (may be NULL) 961 * @parcfg: Parallel interface platform data (may be NULL)
962 * @data_size: Data size 962 * @data_size: Data size
963 */ 963 */
964static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc, 964static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc,
965 struct isp_parallel_platform_data *pdata, 965 struct isp_parallel_cfg *parcfg,
966 unsigned int data_size) 966 unsigned int data_size)
967{ 967{
968 struct isp_device *isp = to_isp_device(ccdc); 968 struct isp_device *isp = to_isp_device(ccdc);
@@ -1000,19 +1000,19 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc,
1000 break; 1000 break;
1001 } 1001 }
1002 1002
1003 if (pdata && pdata->data_pol) 1003 if (parcfg && parcfg->data_pol)
1004 syn_mode |= ISPCCDC_SYN_MODE_DATAPOL; 1004 syn_mode |= ISPCCDC_SYN_MODE_DATAPOL;
1005 1005
1006 if (pdata && pdata->hs_pol) 1006 if (parcfg && parcfg->hs_pol)
1007 syn_mode |= ISPCCDC_SYN_MODE_HDPOL; 1007 syn_mode |= ISPCCDC_SYN_MODE_HDPOL;
1008 1008
1009 /* The polarity of the vertical sync signal output by the BT.656 1009 /* The polarity of the vertical sync signal output by the BT.656
1010 * decoder is not documented and seems to be active low. 1010 * decoder is not documented and seems to be active low.
1011 */ 1011 */
1012 if ((pdata && pdata->vs_pol) || ccdc->bt656) 1012 if ((parcfg && parcfg->vs_pol) || ccdc->bt656)
1013 syn_mode |= ISPCCDC_SYN_MODE_VDPOL; 1013 syn_mode |= ISPCCDC_SYN_MODE_VDPOL;
1014 1014
1015 if (pdata && pdata->fld_pol) 1015 if (parcfg && parcfg->fld_pol)
1016 syn_mode |= ISPCCDC_SYN_MODE_FLDPOL; 1016 syn_mode |= ISPCCDC_SYN_MODE_FLDPOL;
1017 1017
1018 isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); 1018 isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE);
@@ -1115,7 +1115,7 @@ static const u32 ccdc_sgbrg_pattern =
1115static void ccdc_configure(struct isp_ccdc_device *ccdc) 1115static void ccdc_configure(struct isp_ccdc_device *ccdc)
1116{ 1116{
1117 struct isp_device *isp = to_isp_device(ccdc); 1117 struct isp_device *isp = to_isp_device(ccdc);
1118 struct isp_parallel_platform_data *pdata = NULL; 1118 struct isp_parallel_cfg *parcfg = NULL;
1119 struct v4l2_subdev *sensor; 1119 struct v4l2_subdev *sensor;
1120 struct v4l2_mbus_framefmt *format; 1120 struct v4l2_mbus_framefmt *format;
1121 const struct v4l2_rect *crop; 1121 const struct v4l2_rect *crop;
@@ -1145,7 +1145,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
1145 if (!ret) 1145 if (!ret)
1146 ccdc->bt656 = cfg.type == V4L2_MBUS_BT656; 1146 ccdc->bt656 = cfg.type == V4L2_MBUS_BT656;
1147 1147
1148 pdata = &((struct isp_v4l2_subdevs_group *)sensor->host_priv) 1148 parcfg = &((struct isp_bus_cfg *)sensor->host_priv)
1149 ->bus.parallel; 1149 ->bus.parallel;
1150 } 1150 }
1151 1151
@@ -1175,10 +1175,10 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
1175 else 1175 else
1176 bridge = ISPCTRL_PAR_BRIDGE_DISABLE; 1176 bridge = ISPCTRL_PAR_BRIDGE_DISABLE;
1177 1177
1178 omap3isp_configure_bridge(isp, ccdc->input, pdata, shift, bridge); 1178 omap3isp_configure_bridge(isp, ccdc->input, parcfg, shift, bridge);
1179 1179
1180 /* Configure the sync interface. */ 1180 /* Configure the sync interface. */
1181 ccdc_config_sync_if(ccdc, pdata, depth_out); 1181 ccdc_config_sync_if(ccdc, parcfg, depth_out);
1182 1182
1183 syn_mode = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); 1183 syn_mode = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE);
1184 1184
@@ -1935,21 +1935,21 @@ static int ccdc_set_stream(struct v4l2_subdev *sd, int enable)
1935} 1935}
1936 1936
1937static struct v4l2_mbus_framefmt * 1937static struct v4l2_mbus_framefmt *
1938__ccdc_get_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, 1938__ccdc_get_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_pad_config *cfg,
1939 unsigned int pad, enum v4l2_subdev_format_whence which) 1939 unsigned int pad, enum v4l2_subdev_format_whence which)
1940{ 1940{
1941 if (which == V4L2_SUBDEV_FORMAT_TRY) 1941 if (which == V4L2_SUBDEV_FORMAT_TRY)
1942 return v4l2_subdev_get_try_format(fh, pad); 1942 return v4l2_subdev_get_try_format(&ccdc->subdev, cfg, pad);
1943 else 1943 else
1944 return &ccdc->formats[pad]; 1944 return &ccdc->formats[pad];
1945} 1945}
1946 1946
1947static struct v4l2_rect * 1947static struct v4l2_rect *
1948__ccdc_get_crop(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, 1948__ccdc_get_crop(struct isp_ccdc_device *ccdc, struct v4l2_subdev_pad_config *cfg,
1949 enum v4l2_subdev_format_whence which) 1949 enum v4l2_subdev_format_whence which)
1950{ 1950{
1951 if (which == V4L2_SUBDEV_FORMAT_TRY) 1951 if (which == V4L2_SUBDEV_FORMAT_TRY)
1952 return v4l2_subdev_get_try_crop(fh, CCDC_PAD_SOURCE_OF); 1952 return v4l2_subdev_get_try_crop(&ccdc->subdev, cfg, CCDC_PAD_SOURCE_OF);
1953 else 1953 else
1954 return &ccdc->crop; 1954 return &ccdc->crop;
1955} 1955}
@@ -1957,12 +1957,12 @@ __ccdc_get_crop(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh,
1957/* 1957/*
1958 * ccdc_try_format - Try video format on a pad 1958 * ccdc_try_format - Try video format on a pad
1959 * @ccdc: ISP CCDC device 1959 * @ccdc: ISP CCDC device
1960 * @fh : V4L2 subdev file handle 1960 * @cfg : V4L2 subdev pad configuration
1961 * @pad: Pad number 1961 * @pad: Pad number
1962 * @fmt: Format 1962 * @fmt: Format
1963 */ 1963 */
1964static void 1964static void
1965ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, 1965ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_pad_config *cfg,
1966 unsigned int pad, struct v4l2_mbus_framefmt *fmt, 1966 unsigned int pad, struct v4l2_mbus_framefmt *fmt,
1967 enum v4l2_subdev_format_whence which) 1967 enum v4l2_subdev_format_whence which)
1968{ 1968{
@@ -1998,7 +1998,7 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh,
1998 case CCDC_PAD_SOURCE_OF: 1998 case CCDC_PAD_SOURCE_OF:
1999 pixelcode = fmt->code; 1999 pixelcode = fmt->code;
2000 field = fmt->field; 2000 field = fmt->field;
2001 *fmt = *__ccdc_get_format(ccdc, fh, CCDC_PAD_SINK, which); 2001 *fmt = *__ccdc_get_format(ccdc, cfg, CCDC_PAD_SINK, which);
2002 2002
2003 /* In SYNC mode the bridge converts YUV formats from 2X8 to 2003 /* In SYNC mode the bridge converts YUV formats from 2X8 to
2004 * 1X16. In BT.656 no such conversion occurs. As we don't know 2004 * 1X16. In BT.656 no such conversion occurs. As we don't know
@@ -2023,7 +2023,7 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh,
2023 } 2023 }
2024 2024
2025 /* Hardcode the output size to the crop rectangle size. */ 2025 /* Hardcode the output size to the crop rectangle size. */
2026 crop = __ccdc_get_crop(ccdc, fh, which); 2026 crop = __ccdc_get_crop(ccdc, cfg, which);
2027 fmt->width = crop->width; 2027 fmt->width = crop->width;
2028 fmt->height = crop->height; 2028 fmt->height = crop->height;
2029 2029
@@ -2040,7 +2040,7 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh,
2040 break; 2040 break;
2041 2041
2042 case CCDC_PAD_SOURCE_VP: 2042 case CCDC_PAD_SOURCE_VP:
2043 *fmt = *__ccdc_get_format(ccdc, fh, CCDC_PAD_SINK, which); 2043 *fmt = *__ccdc_get_format(ccdc, cfg, CCDC_PAD_SINK, which);
2044 2044
2045 /* The video port interface truncates the data to 10 bits. */ 2045 /* The video port interface truncates the data to 10 bits. */
2046 info = omap3isp_video_format_info(fmt->code); 2046 info = omap3isp_video_format_info(fmt->code);
@@ -2112,12 +2112,12 @@ static void ccdc_try_crop(struct isp_ccdc_device *ccdc,
2112/* 2112/*
2113 * ccdc_enum_mbus_code - Handle pixel format enumeration 2113 * ccdc_enum_mbus_code - Handle pixel format enumeration
2114 * @sd : pointer to v4l2 subdev structure 2114 * @sd : pointer to v4l2 subdev structure
2115 * @fh : V4L2 subdev file handle 2115 * @cfg : V4L2 subdev pad configuration
2116 * @code : pointer to v4l2_subdev_mbus_code_enum structure 2116 * @code : pointer to v4l2_subdev_mbus_code_enum structure
2117 * return -EINVAL or zero on success 2117 * return -EINVAL or zero on success
2118 */ 2118 */
2119static int ccdc_enum_mbus_code(struct v4l2_subdev *sd, 2119static int ccdc_enum_mbus_code(struct v4l2_subdev *sd,
2120 struct v4l2_subdev_fh *fh, 2120 struct v4l2_subdev_pad_config *cfg,
2121 struct v4l2_subdev_mbus_code_enum *code) 2121 struct v4l2_subdev_mbus_code_enum *code)
2122{ 2122{
2123 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd); 2123 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd);
@@ -2132,8 +2132,8 @@ static int ccdc_enum_mbus_code(struct v4l2_subdev *sd,
2132 break; 2132 break;
2133 2133
2134 case CCDC_PAD_SOURCE_OF: 2134 case CCDC_PAD_SOURCE_OF:
2135 format = __ccdc_get_format(ccdc, fh, code->pad, 2135 format = __ccdc_get_format(ccdc, cfg, code->pad,
2136 V4L2_SUBDEV_FORMAT_TRY); 2136 code->which);
2137 2137
2138 if (format->code == MEDIA_BUS_FMT_YUYV8_2X8 || 2138 if (format->code == MEDIA_BUS_FMT_YUYV8_2X8 ||
2139 format->code == MEDIA_BUS_FMT_UYVY8_2X8) { 2139 format->code == MEDIA_BUS_FMT_UYVY8_2X8) {
@@ -2163,8 +2163,8 @@ static int ccdc_enum_mbus_code(struct v4l2_subdev *sd,
2163 if (code->index != 0) 2163 if (code->index != 0)
2164 return -EINVAL; 2164 return -EINVAL;
2165 2165
2166 format = __ccdc_get_format(ccdc, fh, code->pad, 2166 format = __ccdc_get_format(ccdc, cfg, code->pad,
2167 V4L2_SUBDEV_FORMAT_TRY); 2167 code->which);
2168 2168
2169 /* A pixel code equal to 0 means that the video port doesn't 2169 /* A pixel code equal to 0 means that the video port doesn't
2170 * support the input format. Don't enumerate any pixel code. 2170 * support the input format. Don't enumerate any pixel code.
@@ -2183,7 +2183,7 @@ static int ccdc_enum_mbus_code(struct v4l2_subdev *sd,
2183} 2183}
2184 2184
2185static int ccdc_enum_frame_size(struct v4l2_subdev *sd, 2185static int ccdc_enum_frame_size(struct v4l2_subdev *sd,
2186 struct v4l2_subdev_fh *fh, 2186 struct v4l2_subdev_pad_config *cfg,
2187 struct v4l2_subdev_frame_size_enum *fse) 2187 struct v4l2_subdev_frame_size_enum *fse)
2188{ 2188{
2189 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd); 2189 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd);
@@ -2195,7 +2195,7 @@ static int ccdc_enum_frame_size(struct v4l2_subdev *sd,
2195 format.code = fse->code; 2195 format.code = fse->code;
2196 format.width = 1; 2196 format.width = 1;
2197 format.height = 1; 2197 format.height = 1;
2198 ccdc_try_format(ccdc, fh, fse->pad, &format, V4L2_SUBDEV_FORMAT_TRY); 2198 ccdc_try_format(ccdc, cfg, fse->pad, &format, fse->which);
2199 fse->min_width = format.width; 2199 fse->min_width = format.width;
2200 fse->min_height = format.height; 2200 fse->min_height = format.height;
2201 2201
@@ -2205,7 +2205,7 @@ static int ccdc_enum_frame_size(struct v4l2_subdev *sd,
2205 format.code = fse->code; 2205 format.code = fse->code;
2206 format.width = -1; 2206 format.width = -1;
2207 format.height = -1; 2207 format.height = -1;
2208 ccdc_try_format(ccdc, fh, fse->pad, &format, V4L2_SUBDEV_FORMAT_TRY); 2208 ccdc_try_format(ccdc, cfg, fse->pad, &format, fse->which);
2209 fse->max_width = format.width; 2209 fse->max_width = format.width;
2210 fse->max_height = format.height; 2210 fse->max_height = format.height;
2211 2211
@@ -2215,7 +2215,7 @@ static int ccdc_enum_frame_size(struct v4l2_subdev *sd,
2215/* 2215/*
2216 * ccdc_get_selection - Retrieve a selection rectangle on a pad 2216 * ccdc_get_selection - Retrieve a selection rectangle on a pad
2217 * @sd: ISP CCDC V4L2 subdevice 2217 * @sd: ISP CCDC V4L2 subdevice
2218 * @fh: V4L2 subdev file handle 2218 * @cfg: V4L2 subdev pad configuration
2219 * @sel: Selection rectangle 2219 * @sel: Selection rectangle
2220 * 2220 *
2221 * The only supported rectangles are the crop rectangles on the output formatter 2221 * The only supported rectangles are the crop rectangles on the output formatter
@@ -2223,7 +2223,7 @@ static int ccdc_enum_frame_size(struct v4l2_subdev *sd,
2223 * 2223 *
2224 * Return 0 on success or a negative error code otherwise. 2224 * Return 0 on success or a negative error code otherwise.
2225 */ 2225 */
2226static int ccdc_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 2226static int ccdc_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,
2227 struct v4l2_subdev_selection *sel) 2227 struct v4l2_subdev_selection *sel)
2228{ 2228{
2229 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd); 2229 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd);
@@ -2239,12 +2239,12 @@ static int ccdc_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
2239 sel->r.width = INT_MAX; 2239 sel->r.width = INT_MAX;
2240 sel->r.height = INT_MAX; 2240 sel->r.height = INT_MAX;
2241 2241
2242 format = __ccdc_get_format(ccdc, fh, CCDC_PAD_SINK, sel->which); 2242 format = __ccdc_get_format(ccdc, cfg, CCDC_PAD_SINK, sel->which);
2243 ccdc_try_crop(ccdc, format, &sel->r); 2243 ccdc_try_crop(ccdc, format, &sel->r);
2244 break; 2244 break;
2245 2245
2246 case V4L2_SEL_TGT_CROP: 2246 case V4L2_SEL_TGT_CROP:
2247 sel->r = *__ccdc_get_crop(ccdc, fh, sel->which); 2247 sel->r = *__ccdc_get_crop(ccdc, cfg, sel->which);
2248 break; 2248 break;
2249 2249
2250 default: 2250 default:
@@ -2257,7 +2257,7 @@ static int ccdc_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
2257/* 2257/*
2258 * ccdc_set_selection - Set a selection rectangle on a pad 2258 * ccdc_set_selection - Set a selection rectangle on a pad
2259 * @sd: ISP CCDC V4L2 subdevice 2259 * @sd: ISP CCDC V4L2 subdevice
2260 * @fh: V4L2 subdev file handle 2260 * @cfg: V4L2 subdev pad configuration
2261 * @sel: Selection rectangle 2261 * @sel: Selection rectangle
2262 * 2262 *
2263 * The only supported rectangle is the actual crop rectangle on the output 2263 * The only supported rectangle is the actual crop rectangle on the output
@@ -2265,7 +2265,7 @@ static int ccdc_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
2265 * 2265 *
2266 * Return 0 on success or a negative error code otherwise. 2266 * Return 0 on success or a negative error code otherwise.
2267 */ 2267 */
2268static int ccdc_set_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 2268static int ccdc_set_selection(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,
2269 struct v4l2_subdev_selection *sel) 2269 struct v4l2_subdev_selection *sel)
2270{ 2270{
2271 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd); 2271 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd);
@@ -2284,17 +2284,17 @@ static int ccdc_set_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
2284 * rectangle. 2284 * rectangle.
2285 */ 2285 */
2286 if (sel->flags & V4L2_SEL_FLAG_KEEP_CONFIG) { 2286 if (sel->flags & V4L2_SEL_FLAG_KEEP_CONFIG) {
2287 sel->r = *__ccdc_get_crop(ccdc, fh, sel->which); 2287 sel->r = *__ccdc_get_crop(ccdc, cfg, sel->which);
2288 return 0; 2288 return 0;
2289 } 2289 }
2290 2290
2291 format = __ccdc_get_format(ccdc, fh, CCDC_PAD_SINK, sel->which); 2291 format = __ccdc_get_format(ccdc, cfg, CCDC_PAD_SINK, sel->which);
2292 ccdc_try_crop(ccdc, format, &sel->r); 2292 ccdc_try_crop(ccdc, format, &sel->r);
2293 *__ccdc_get_crop(ccdc, fh, sel->which) = sel->r; 2293 *__ccdc_get_crop(ccdc, cfg, sel->which) = sel->r;
2294 2294
2295 /* Update the source format. */ 2295 /* Update the source format. */
2296 format = __ccdc_get_format(ccdc, fh, CCDC_PAD_SOURCE_OF, sel->which); 2296 format = __ccdc_get_format(ccdc, cfg, CCDC_PAD_SOURCE_OF, sel->which);
2297 ccdc_try_format(ccdc, fh, CCDC_PAD_SOURCE_OF, format, sel->which); 2297 ccdc_try_format(ccdc, cfg, CCDC_PAD_SOURCE_OF, format, sel->which);
2298 2298
2299 return 0; 2299 return 0;
2300} 2300}
@@ -2302,19 +2302,19 @@ static int ccdc_set_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
2302/* 2302/*
2303 * ccdc_get_format - Retrieve the video format on a pad 2303 * ccdc_get_format - Retrieve the video format on a pad
2304 * @sd : ISP CCDC V4L2 subdevice 2304 * @sd : ISP CCDC V4L2 subdevice
2305 * @fh : V4L2 subdev file handle 2305 * @cfg: V4L2 subdev pad configuration
2306 * @fmt: Format 2306 * @fmt: Format
2307 * 2307 *
2308 * Return 0 on success or -EINVAL if the pad is invalid or doesn't correspond 2308 * Return 0 on success or -EINVAL if the pad is invalid or doesn't correspond
2309 * to the format type. 2309 * to the format type.
2310 */ 2310 */
2311static int ccdc_get_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 2311static int ccdc_get_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,
2312 struct v4l2_subdev_format *fmt) 2312 struct v4l2_subdev_format *fmt)
2313{ 2313{
2314 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd); 2314 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd);
2315 struct v4l2_mbus_framefmt *format; 2315 struct v4l2_mbus_framefmt *format;
2316 2316
2317 format = __ccdc_get_format(ccdc, fh, fmt->pad, fmt->which); 2317 format = __ccdc_get_format(ccdc, cfg, fmt->pad, fmt->which);
2318 if (format == NULL) 2318 if (format == NULL)
2319 return -EINVAL; 2319 return -EINVAL;
2320 2320
@@ -2325,30 +2325,30 @@ static int ccdc_get_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
2325/* 2325/*
2326 * ccdc_set_format - Set the video format on a pad 2326 * ccdc_set_format - Set the video format on a pad
2327 * @sd : ISP CCDC V4L2 subdevice 2327 * @sd : ISP CCDC V4L2 subdevice
2328 * @fh : V4L2 subdev file handle 2328 * @cfg: V4L2 subdev pad configuration
2329 * @fmt: Format 2329 * @fmt: Format
2330 * 2330 *
2331 * Return 0 on success or -EINVAL if the pad is invalid or doesn't correspond 2331 * Return 0 on success or -EINVAL if the pad is invalid or doesn't correspond
2332 * to the format type. 2332 * to the format type.
2333 */ 2333 */
2334static int ccdc_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 2334static int ccdc_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,
2335 struct v4l2_subdev_format *fmt) 2335 struct v4l2_subdev_format *fmt)
2336{ 2336{
2337 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd); 2337 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd);
2338 struct v4l2_mbus_framefmt *format; 2338 struct v4l2_mbus_framefmt *format;
2339 struct v4l2_rect *crop; 2339 struct v4l2_rect *crop;
2340 2340
2341 format = __ccdc_get_format(ccdc, fh, fmt->pad, fmt->which); 2341 format = __ccdc_get_format(ccdc, cfg, fmt->pad, fmt->which);
2342 if (format == NULL) 2342 if (format == NULL)
2343 return -EINVAL; 2343 return -EINVAL;
2344 2344
2345 ccdc_try_format(ccdc, fh, fmt->pad, &fmt->format, fmt->which); 2345 ccdc_try_format(ccdc, cfg, fmt->pad, &fmt->format, fmt->which);
2346 *format = fmt->format; 2346 *format = fmt->format;
2347 2347
2348 /* Propagate the format from sink to source */ 2348 /* Propagate the format from sink to source */
2349 if (fmt->pad == CCDC_PAD_SINK) { 2349 if (fmt->pad == CCDC_PAD_SINK) {
2350 /* Reset the crop rectangle. */ 2350 /* Reset the crop rectangle. */
2351 crop = __ccdc_get_crop(ccdc, fh, fmt->which); 2351 crop = __ccdc_get_crop(ccdc, cfg, fmt->which);
2352 crop->left = 0; 2352 crop->left = 0;
2353 crop->top = 0; 2353 crop->top = 0;
2354 crop->width = fmt->format.width; 2354 crop->width = fmt->format.width;
@@ -2357,16 +2357,16 @@ static int ccdc_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
2357 ccdc_try_crop(ccdc, &fmt->format, crop); 2357 ccdc_try_crop(ccdc, &fmt->format, crop);
2358 2358
2359 /* Update the source formats. */ 2359 /* Update the source formats. */
2360 format = __ccdc_get_format(ccdc, fh, CCDC_PAD_SOURCE_OF, 2360 format = __ccdc_get_format(ccdc, cfg, CCDC_PAD_SOURCE_OF,
2361 fmt->which); 2361 fmt->which);
2362 *format = fmt->format; 2362 *format = fmt->format;
2363 ccdc_try_format(ccdc, fh, CCDC_PAD_SOURCE_OF, format, 2363 ccdc_try_format(ccdc, cfg, CCDC_PAD_SOURCE_OF, format,
2364 fmt->which); 2364 fmt->which);
2365 2365
2366 format = __ccdc_get_format(ccdc, fh, CCDC_PAD_SOURCE_VP, 2366 format = __ccdc_get_format(ccdc, cfg, CCDC_PAD_SOURCE_VP,
2367 fmt->which); 2367 fmt->which);
2368 *format = fmt->format; 2368 *format = fmt->format;
2369 ccdc_try_format(ccdc, fh, CCDC_PAD_SOURCE_VP, format, 2369 ccdc_try_format(ccdc, cfg, CCDC_PAD_SOURCE_VP, format,
2370 fmt->which); 2370 fmt->which);
2371 } 2371 }
2372 2372
@@ -2417,11 +2417,11 @@ static int ccdc_link_validate(struct v4l2_subdev *sd,
2417 2417
2418 /* We've got a parallel sensor here. */ 2418 /* We've got a parallel sensor here. */
2419 if (ccdc->input == CCDC_INPUT_PARALLEL) { 2419 if (ccdc->input == CCDC_INPUT_PARALLEL) {
2420 struct isp_parallel_platform_data *pdata = 2420 struct isp_parallel_cfg *parcfg =
2421 &((struct isp_v4l2_subdevs_group *) 2421 &((struct isp_bus_cfg *)
2422 media_entity_to_v4l2_subdev(link->source->entity) 2422 media_entity_to_v4l2_subdev(link->source->entity)
2423 ->host_priv)->bus.parallel; 2423 ->host_priv)->bus.parallel;
2424 parallel_shift = pdata->data_lane_shift * 2; 2424 parallel_shift = parcfg->data_lane_shift * 2;
2425 } else { 2425 } else {
2426 parallel_shift = 0; 2426 parallel_shift = 0;
2427 } 2427 }
@@ -2453,7 +2453,7 @@ static int ccdc_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
2453 format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10; 2453 format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10;
2454 format.format.width = 4096; 2454 format.format.width = 4096;
2455 format.format.height = 4096; 2455 format.format.height = 4096;
2456 ccdc_set_format(sd, fh, &format); 2456 ccdc_set_format(sd, fh ? fh->pad : NULL, &format);
2457 2457
2458 return 0; 2458 return 0;
2459} 2459}