From da54993ac62ca19f1bff3b1bb2a035a637e75a60 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 10 Feb 2012 00:08:02 +0100 Subject: omap3isp: Store ccdc, preview and sensor entities in sub-structures This will allow adding entity-specific fields such as controls to the omap3_isp_device structure. Signed-off-by: Laurent Pinchart --- isp/omap3isp.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'isp/omap3isp.c') diff --git a/isp/omap3isp.c b/isp/omap3isp.c index 341b5e1..9fbd984 100644 --- a/isp/omap3isp.c +++ b/isp/omap3isp.c @@ -456,7 +456,7 @@ omap3_isp_pipeline_create_entity(struct omap3_isp_device *isp, struct media_entity *ment; if (strncmp(name, ":SENSOR", 7) == 0) - ment = isp->sensor; + ment = isp->sensor.entity; else ment = media_get_entity_by_name(isp->mdev, name); @@ -632,7 +632,7 @@ static int omap3_isp_pipeline_try_format(struct omap3_isp_device *isp, else format = *ofmt; - ret = v4l2_subdev_set_format(isp->sensor, &format, 0, + ret = v4l2_subdev_set_format(isp->sensor.entity, &format, 0, V4L2_SUBDEV_FORMAT_TRY); if (ret < 0) { printf("error: get format on sensor output failed.\n"); @@ -676,7 +676,7 @@ static int omap3_isp_pipeline_try_format(struct omap3_isp_device *isp, } if (sink->type == OMAP3_ISP_ENTITY_ENTITY) { - if (sink->entity == isp->ccdc) { + if (sink->entity == isp->ccdc.entity) { if (format_is_shiftable(format.code, ofmt->code)) format.code = ofmt->code; } @@ -793,7 +793,7 @@ static int omap3_isp_pipeline_activate(struct omap3_isp_device *isp, } if (sink->type == OMAP3_ISP_ENTITY_ENTITY) { - if (sink->entity == isp->ccdc) + if (sink->entity == isp->ccdc.entity) format.code = sink->sink.format.code; /* Propagate the format to the link target. */ @@ -855,31 +855,31 @@ struct omap3_isp_device *omap3_isp_open(const char *devname, /* Locate the entities that will be used in the pipelines. OMAP3 ISP * modules are looked up by name. */ - isp->ccdc = media_get_entity_by_name(isp->mdev, ENTITY_CCDC); - isp->preview = media_get_entity_by_name(isp->mdev, ENTITY_PREVIEW); + isp->ccdc.entity = media_get_entity_by_name(isp->mdev, ENTITY_CCDC); + isp->preview.entity = media_get_entity_by_name(isp->mdev, ENTITY_PREVIEW); - if (isp->ccdc == NULL || isp->preview == NULL) { + if (isp->ccdc.entity == NULL || isp->preview.entity == NULL) { printf("error: unable to locate one or more ISP entities.\n"); goto error; } /* The sensor and video nodes are located by following links. */ - for (i = 0; i < isp->ccdc->num_links; ++i) { - entity = isp->ccdc->links[i].source->entity; + for (i = 0; i < isp->ccdc.entity->num_links; ++i) { + entity = isp->ccdc.entity->links[i].source->entity; if (media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV && entity->info.pads == 1) break; } - if (i == isp->ccdc->num_links) { + if (i == isp->ccdc.entity->num_links) { printf("error: unable to locate sensor.\n"); goto error; } - isp->sensor = entity; + isp->sensor.entity = entity; /* Retrieve the sensor default format. */ - ret = v4l2_subdev_get_format(isp->sensor, &isp->sensor_format, 0, + ret = v4l2_subdev_get_format(isp->sensor.entity, &isp->sensor_format, 0, V4L2_SUBDEV_FORMAT_TRY); if (ret < 0) { printf("error: unable to get sensor default format.\n"); -- cgit v1.2.3