|
@@ -322,17 +322,10 @@ static void isp_subdev_propagate(struct v4l2_subdev *sd,
|
|
|
r.width = ffmt[pad]->width;
|
|
|
r.height = ffmt[pad]->height;
|
|
|
|
|
|
-#ifndef ISP2401
|
|
|
- atomisp_subdev_set_selection(sd, cfg, which, pad, target, flags,
|
|
|
- &r);
|
|
|
+ atomisp_subdev_set_selection(sd, cfg, which, pad,
|
|
|
+ target, flags, &r);
|
|
|
break;
|
|
|
}
|
|
|
-#else
|
|
|
- atomisp_subdev_set_selection(sd, cfg, which, pad,
|
|
|
- target, flags, &r);
|
|
|
- break;
|
|
|
- }
|
|
|
-#endif
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -444,19 +437,10 @@ int atomisp_subdev_set_selection(struct v4l2_subdev *sd,
|
|
|
i < ATOMISP_SUBDEV_PADS_NUM; i++) {
|
|
|
struct v4l2_rect tmp = *crop[pad];
|
|
|
|
|
|
-#ifndef ISP2401
|
|
|
atomisp_subdev_set_selection(
|
|
|
sd, cfg, which, i, V4L2_SEL_TGT_COMPOSE,
|
|
|
flags, &tmp);
|
|
|
}
|
|
|
-#else
|
|
|
- atomisp_subdev_set_selection(sd, cfg,
|
|
|
- which, i,
|
|
|
- V4L2_SEL_TGT_COMPOSE,
|
|
|
- flags,
|
|
|
- &tmp);
|
|
|
- }
|
|
|
-#endif
|
|
|
}
|
|
|
|
|
|
if (which == V4L2_SUBDEV_FORMAT_TRY)
|
|
@@ -611,24 +595,14 @@ static int atomisp_get_sensor_bin_factor(struct atomisp_sub_device *asd)
|
|
|
return hbin;
|
|
|
}
|
|
|
|
|
|
-#ifndef ISP2401
|
|
|
-void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,
|
|
|
- uint32_t which, uint32_t pad,
|
|
|
- struct v4l2_mbus_framefmt *ffmt)
|
|
|
-#else
|
|
|
void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd,
|
|
|
struct v4l2_subdev_pad_config *cfg, uint32_t which,
|
|
|
uint32_t pad, struct v4l2_mbus_framefmt *ffmt)
|
|
|
-#endif
|
|
|
{
|
|
|
struct atomisp_sub_device *isp_sd = v4l2_get_subdevdata(sd);
|
|
|
struct atomisp_device *isp = isp_sd->isp;
|
|
|
struct v4l2_mbus_framefmt *__ffmt =
|
|
|
-#ifndef ISP2401
|
|
|
atomisp_subdev_get_ffmt(sd, cfg, which, pad);
|
|
|
-#else
|
|
|
- atomisp_subdev_get_ffmt(sd, cfg, which, pad);
|
|
|
-#endif
|
|
|
uint16_t vdev_pad = atomisp_subdev_source_pad(sd->devnode);
|
|
|
enum atomisp_input_stream_id stream_id;
|
|
|
|
|
@@ -692,12 +666,8 @@ void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd,
|
|
|
* to the format type.
|
|
|
*/
|
|
|
static int isp_subdev_get_format(struct v4l2_subdev *sd,
|
|
|
-#ifndef ISP2401
|
|
|
- struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *fmt)
|
|
|
-#else
|
|
|
struct v4l2_subdev_pad_config *cfg,
|
|
|
struct v4l2_subdev_format *fmt)
|
|
|
-#endif
|
|
|
{
|
|
|
fmt->format = *atomisp_subdev_get_ffmt(sd, cfg, fmt->which, fmt->pad);
|
|
|
|
|
@@ -715,12 +685,8 @@ static int isp_subdev_get_format(struct v4l2_subdev *sd,
|
|
|
* to the format type.
|
|
|
*/
|
|
|
static int isp_subdev_set_format(struct v4l2_subdev *sd,
|
|
|
-#ifndef ISP2401
|
|
|
- struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *fmt)
|
|
|
-#else
|
|
|
struct v4l2_subdev_pad_config *cfg,
|
|
|
struct v4l2_subdev_format *fmt)
|
|
|
-#endif
|
|
|
{
|
|
|
atomisp_subdev_set_ffmt(sd, cfg, fmt->which, fmt->pad, &fmt->format);
|
|
|
|
|
@@ -736,30 +702,18 @@ static const struct v4l2_subdev_core_ops isp_subdev_v4l2_core_ops = {
|
|
|
|
|
|
/* V4L2 subdev pad operations */
|
|
|
static const struct v4l2_subdev_pad_ops isp_subdev_v4l2_pad_ops = {
|
|
|
-#ifndef ISP2401
|
|
|
- .enum_mbus_code = isp_subdev_enum_mbus_code,
|
|
|
- .get_fmt = isp_subdev_get_format, .set_fmt = isp_subdev_set_format,
|
|
|
- .get_selection = isp_subdev_get_selection,
|
|
|
- .set_selection = isp_subdev_set_selection,
|
|
|
- .link_validate = v4l2_subdev_link_validate_default,
|
|
|
-#else
|
|
|
.enum_mbus_code = isp_subdev_enum_mbus_code,
|
|
|
.get_fmt = isp_subdev_get_format,
|
|
|
.set_fmt = isp_subdev_set_format,
|
|
|
.get_selection = isp_subdev_get_selection,
|
|
|
.set_selection = isp_subdev_set_selection,
|
|
|
.link_validate = v4l2_subdev_link_validate_default,
|
|
|
-#endif
|
|
|
};
|
|
|
|
|
|
/* V4L2 subdev operations */
|
|
|
static const struct v4l2_subdev_ops isp_subdev_v4l2_ops = {
|
|
|
-#ifndef ISP2401
|
|
|
- .core = &isp_subdev_v4l2_core_ops, .pad = &isp_subdev_v4l2_pad_ops,
|
|
|
-#else
|
|
|
.core = &isp_subdev_v4l2_core_ops,
|
|
|
.pad = &isp_subdev_v4l2_pad_ops,
|
|
|
-#endif
|
|
|
};
|
|
|
|
|
|
static void isp_subdev_init_params(struct atomisp_sub_device *asd)
|
|
@@ -1187,12 +1141,8 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd)
|
|
|
pads[ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE].flags = MEDIA_PAD_FL_SOURCE;
|
|
|
pads[ATOMISP_SUBDEV_PAD_SOURCE_VIDEO].flags = MEDIA_PAD_FL_SOURCE;
|
|
|
|
|
|
-#ifndef ISP2401
|
|
|
asd->fmt[ATOMISP_SUBDEV_PAD_SINK].fmt.code =
|
|
|
MEDIA_BUS_FMT_SBGGR10_1X10;
|
|
|
-#else
|
|
|
- asd->fmt[ATOMISP_SUBDEV_PAD_SINK].fmt.code = MEDIA_BUS_FMT_SBGGR10_1X10;
|
|
|
-#endif
|
|
|
asd->fmt[ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW].fmt.code =
|
|
|
MEDIA_BUS_FMT_SBGGR10_1X10;
|
|
|
asd->fmt[ATOMISP_SUBDEV_PAD_SOURCE_VF].fmt.code =
|
|
@@ -1209,39 +1159,19 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd)
|
|
|
return ret;
|
|
|
|
|
|
atomisp_init_subdev_pipe(asd, &asd->video_in,
|
|
|
-#ifndef ISP2401
|
|
|
- V4L2_BUF_TYPE_VIDEO_OUTPUT);
|
|
|
-#else
|
|
|
V4L2_BUF_TYPE_VIDEO_OUTPUT);
|
|
|
-#endif
|
|
|
|
|
|
atomisp_init_subdev_pipe(asd, &asd->video_out_preview,
|
|
|
-#ifndef ISP2401
|
|
|
- V4L2_BUF_TYPE_VIDEO_CAPTURE);
|
|
|
-#else
|
|
|
V4L2_BUF_TYPE_VIDEO_CAPTURE);
|
|
|
-#endif
|
|
|
|
|
|
atomisp_init_subdev_pipe(asd, &asd->video_out_vf,
|
|
|
-#ifndef ISP2401
|
|
|
- V4L2_BUF_TYPE_VIDEO_CAPTURE);
|
|
|
-#else
|
|
|
V4L2_BUF_TYPE_VIDEO_CAPTURE);
|
|
|
-#endif
|
|
|
|
|
|
atomisp_init_subdev_pipe(asd, &asd->video_out_capture,
|
|
|
-#ifndef ISP2401
|
|
|
- V4L2_BUF_TYPE_VIDEO_CAPTURE);
|
|
|
-#else
|
|
|
V4L2_BUF_TYPE_VIDEO_CAPTURE);
|
|
|
-#endif
|
|
|
|
|
|
atomisp_init_subdev_pipe(asd, &asd->video_out_video_capture,
|
|
|
-#ifndef ISP2401
|
|
|
- V4L2_BUF_TYPE_VIDEO_CAPTURE);
|
|
|
-#else
|
|
|
V4L2_BUF_TYPE_VIDEO_CAPTURE);
|
|
|
-#endif
|
|
|
|
|
|
atomisp_init_acc_pipe(asd, &asd->video_acc);
|
|
|
|
|
@@ -1401,11 +1331,7 @@ void atomisp_subdev_cleanup_pending_events(struct atomisp_sub_device *asd)
|
|
|
unsigned int i, pending_event;
|
|
|
|
|
|
list_for_each_entry_safe(fh, fh_tmp,
|
|
|
-#ifndef ISP2401
|
|
|
&asd->subdev.devnode->fh_list, list) {
|
|
|
-#else
|
|
|
- &asd->subdev.devnode->fh_list, list) {
|
|
|
-#endif
|
|
|
pending_event = v4l2_event_pending(fh);
|
|
|
for (i = 0; i < pending_event; i++)
|
|
|
v4l2_event_dequeue(fh, &event, 1);
|
|
@@ -1471,9 +1397,6 @@ error:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-#ifndef ISP2401
|
|
|
-
|
|
|
-#endif
|
|
|
/*
|
|
|
* atomisp_subdev_init - ISP Subdevice initialization.
|
|
|
* @dev: Device pointer specific to the ATOM ISP.
|