[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>
This commit is contained in:
@@ -956,9 +956,14 @@ static int ccp2_link_setup(struct media_entity *entity,
|
||||
{
|
||||
struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
|
||||
struct isp_ccp2_device *ccp2 = v4l2_get_subdevdata(sd);
|
||||
int index = local->index;
|
||||
|
||||
switch (local->index | media_entity_type(remote->entity)) {
|
||||
case CCP2_PAD_SINK | MEDIA_ENT_T_DEVNODE:
|
||||
/* FIXME: this is actually a hack! */
|
||||
if (is_media_entity_v4l2_subdev(remote->entity))
|
||||
index |= 2 << 16;
|
||||
|
||||
switch (index) {
|
||||
case CCP2_PAD_SINK:
|
||||
/* read from memory */
|
||||
if (flags & MEDIA_LNK_FL_ENABLED) {
|
||||
if (ccp2->input == CCP2_INPUT_SENSOR)
|
||||
@@ -970,7 +975,7 @@ static int ccp2_link_setup(struct media_entity *entity,
|
||||
}
|
||||
break;
|
||||
|
||||
case CCP2_PAD_SINK | MEDIA_ENT_T_V4L2_SUBDEV:
|
||||
case CCP2_PAD_SINK | 2 << 16:
|
||||
/* read from sensor/phy */
|
||||
if (flags & MEDIA_LNK_FL_ENABLED) {
|
||||
if (ccp2->input == CCP2_INPUT_MEMORY)
|
||||
@@ -981,7 +986,7 @@ static int ccp2_link_setup(struct media_entity *entity,
|
||||
ccp2->input = CCP2_INPUT_NONE;
|
||||
} break;
|
||||
|
||||
case CCP2_PAD_SOURCE | MEDIA_ENT_T_V4L2_SUBDEV:
|
||||
case CCP2_PAD_SOURCE | 2 << 16:
|
||||
/* write to video port/ccdc */
|
||||
if (flags & MEDIA_LNK_FL_ENABLED)
|
||||
ccp2->output = CCP2_OUTPUT_CCDC;
|
||||
|
Reference in New Issue
Block a user