summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/omap3isp/ispcsi2.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-05-07 22:12:33 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:18:50 -0200
commit59ecd59d782de82d8f2d2bfda2c28f87c0e8b35a (patch)
tree28e20edf9286b7e46dde28aeb6fda8f049b1cfac /drivers/media/platform/omap3isp/ispcsi2.c
parent3efdf62c5f68007020ef935ad2887e7fc4e31c36 (diff)
downloadlinux-59ecd59d782de82d8f2d2bfda2c28f87c0e8b35a.tar.bz2
[media] omap3/omap4/davinci: get rid of MEDIA_ENT_T_V4L2_SUBDEV abuse
On omap3/omap4/davinci drivers, MEDIA_ENT_T_V4L2_SUBDEV macro is abused in order to "simplify" the pad checks. Basically, it does a logical or of this macro, in order to check for a local index and if the entity is either a subdev or not. As we'll get rid of MEDIA_ENT_T_V4L2_SUBDEV macro, replace it by 2 << 16 where it occurs, and add a note saying that the code there is actually a hack. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/omap3isp/ispcsi2.c')
-rw-r--r--drivers/media/platform/omap3isp/ispcsi2.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/platform/omap3isp/ispcsi2.c b/drivers/media/platform/omap3isp/ispcsi2.c
index 0fb057a74f69..b1617f7efdee 100644
--- a/drivers/media/platform/omap3isp/ispcsi2.c
+++ b/drivers/media/platform/omap3isp/ispcsi2.c
@@ -1144,14 +1144,19 @@ static int csi2_link_setup(struct media_entity *entity,
struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
struct isp_csi2_device *csi2 = v4l2_get_subdevdata(sd);
struct isp_csi2_ctrl_cfg *ctrl = &csi2->ctrl;
+ int index = local->index;
/*
* The ISP core doesn't support pipelines with multiple video outputs.
* Revisit this when it will be implemented, and return -EBUSY for now.
*/
- switch (local->index | media_entity_type(remote->entity)) {
- case CSI2_PAD_SOURCE | MEDIA_ENT_T_DEVNODE:
+ /* FIXME: this is actually a hack! */
+ if (is_media_entity_v4l2_subdev(remote->entity))
+ index |= 2 << 16;
+
+ switch (index) {
+ case CSI2_PAD_SOURCE:
if (flags & MEDIA_LNK_FL_ENABLED) {
if (csi2->output & ~CSI2_OUTPUT_MEMORY)
return -EBUSY;
@@ -1161,7 +1166,7 @@ static int csi2_link_setup(struct media_entity *entity,
}
break;
- case CSI2_PAD_SOURCE | MEDIA_ENT_T_V4L2_SUBDEV:
+ case CSI2_PAD_SOURCE | 2 << 16:
if (flags & MEDIA_LNK_FL_ENABLED) {
if (csi2->output & ~CSI2_OUTPUT_CCDC)
return -EBUSY;