@@ -113,6 +113,35 @@ static inline u32 media_entity_subtype(struct media_entity *entity)
return entity->type & MEDIA_ENT_SUBTYPE_MASK;
}
+static inline bool is_media_entity_av_dma(struct media_entity *entity)
+{
+ if (!entity)
+ return false;
+
+ if (entity->type == MEDIA_ENT_T_AV_DMA)
+ return true;
+
+ return false;
+}
+
+static inline bool is_media_entity_v4l2_subdev(struct media_entity *entity)
+{
+ if (!entity)
+ return false;
+
+ switch (entity->type) {
+ case MEDIA_ENT_T_CAM_SENSOR:
+ case MEDIA_ENT_T_CAM_FLASH:
+ case MEDIA_ENT_T_CAM_LENS:
+ case MEDIA_ENT_T_ATV_DECODER:
+ case MEDIA_ENT_T_TUNER:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
#define MEDIA_ENTITY_ENUM_MAX_DEPTH 16
#define MEDIA_ENTITY_ENUM_MAX_ID 64
As we'll be removing entity subtypes from the Kernel, we need to provide a way for drivers and core to check if a given entity is represented by a V4L2 subdev or if it is an A/V DMA. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>