Skip to content

Commit

Permalink
[media] omap3isp: Find source pad from external entity
Browse files Browse the repository at this point in the history
No longer assume pad number 0 is the source pad of the external entity. Find
the source pad from the external entity and use it instead.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Sakari Ailus authored and Mauro Carvalho Chehab committed Nov 28, 2012
1 parent a7b2106 commit aab84f5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion drivers/media/platform/omap3isp/isp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1767,6 +1767,7 @@ static int isp_register_entities(struct isp_device *isp)
struct media_entity *input;
unsigned int flags;
unsigned int pad;
unsigned int i;

sensor = isp_register_subdev_group(isp, subdevs->subdevs);
if (sensor == NULL)
Expand Down Expand Up @@ -1814,7 +1815,19 @@ static int isp_register_entities(struct isp_device *isp)
goto done;
}

ret = media_entity_create_link(&sensor->entity, 0, input, pad,
for (i = 0; i < sensor->entity.num_pads; i++) {
if (sensor->entity.pads[i].flags & MEDIA_PAD_FL_SOURCE)
break;
}
if (i == sensor->entity.num_pads) {
dev_err(isp->dev,
"%s: no source pad in external entity\n",
__func__);
ret = -EINVAL;
goto done;
}

ret = media_entity_create_link(&sensor->entity, i, input, pad,
flags);
if (ret < 0)
goto done;
Expand Down

0 comments on commit aab84f5

Please sign in to comment.