aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2012-10-20 17:48:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-11-28 07:45:50 -0500
commitaab84f55d45ff6838e708f0cb8e1c0166d339ef6 (patch)
tree9501cefb494febf9c7bed88aeb02a212ccf6e799 /drivers/media/platform
parenta7b21061363dc980b3867a65d657ce7796303454 (diff)
[media] omap3isp: Find source pad from external entity
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>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/omap3isp/isp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 5ea5520ff467..cb9bc3436135 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -1767,6 +1767,7 @@ static int isp_register_entities(struct isp_device *isp)
1767 struct media_entity *input; 1767 struct media_entity *input;
1768 unsigned int flags; 1768 unsigned int flags;
1769 unsigned int pad; 1769 unsigned int pad;
1770 unsigned int i;
1770 1771
1771 sensor = isp_register_subdev_group(isp, subdevs->subdevs); 1772 sensor = isp_register_subdev_group(isp, subdevs->subdevs);
1772 if (sensor == NULL) 1773 if (sensor == NULL)
@@ -1814,7 +1815,19 @@ static int isp_register_entities(struct isp_device *isp)
1814 goto done; 1815 goto done;
1815 } 1816 }
1816 1817
1817 ret = media_entity_create_link(&sensor->entity, 0, input, pad, 1818 for (i = 0; i < sensor->entity.num_pads; i++) {
1819 if (sensor->entity.pads[i].flags & MEDIA_PAD_FL_SOURCE)
1820 break;
1821 }
1822 if (i == sensor->entity.num_pads) {
1823 dev_err(isp->dev,
1824 "%s: no source pad in external entity\n",
1825 __func__);
1826 ret = -EINVAL;
1827 goto done;
1828 }
1829
1830 ret = media_entity_create_link(&sensor->entity, i, input, pad,
1818 flags); 1831 flags);
1819 if (ret < 0) 1832 if (ret < 0)
1820 goto done; 1833 goto done;