[media] v4l: vsp1: Set entities functions
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 16 Feb 2016 00:10:26 +0000 (22:10 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 28 Jun 2016 15:12:26 +0000 (12:12 -0300)
Initialize the function field of all subdev entities instantiated by the
driver. This gets rids of multiple warnings printed by the media
controller core.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/vsp1/vsp1_bru.c
drivers/media/platform/vsp1/vsp1_entity.c
drivers/media/platform/vsp1/vsp1_entity.h
drivers/media/platform/vsp1/vsp1_hsit.c
drivers/media/platform/vsp1/vsp1_lif.c
drivers/media/platform/vsp1/vsp1_lut.c
drivers/media/platform/vsp1/vsp1_rpf.c
drivers/media/platform/vsp1/vsp1_sru.c
drivers/media/platform/vsp1/vsp1_uds.c
drivers/media/platform/vsp1/vsp1_wpf.c

index ed36d3373943b56225e10364796e946b07046488..cae911726778d02ee955f976199d64979fce0c35 100644 (file)
@@ -390,7 +390,8 @@ struct vsp1_bru *vsp1_bru_create(struct vsp1_device *vsp1)
        bru->entity.type = VSP1_ENTITY_BRU;
 
        ret = vsp1_entity_init(vsp1, &bru->entity, "bru",
-                              vsp1->info->num_bru_inputs + 1, &bru_ops);
+                              vsp1->info->num_bru_inputs + 1, &bru_ops,
+                              MEDIA_ENT_F_PROC_VIDEO_COMPOSER);
        if (ret < 0)
                return ERR_PTR(ret);
 
index fd20c0d8aeeaad0f5bf893c9defb5e7f21fe0c58..d72dbcce4b116b5091301c50a259a978854c1a4d 100644 (file)
@@ -340,7 +340,7 @@ static const struct vsp1_route vsp1_routes[] = {
 
 int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
                     const char *name, unsigned int num_pads,
-                    const struct v4l2_subdev_ops *ops)
+                    const struct v4l2_subdev_ops *ops, u32 function)
 {
        struct v4l2_subdev *subdev;
        unsigned int i;
@@ -381,6 +381,7 @@ int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
        subdev = &entity->subdev;
        v4l2_subdev_init(subdev, ops);
 
+       subdev->entity.function = function;
        subdev->entity.ops = &vsp1->media_ops;
        subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 
index a240fc1c59a639ad8d09f4555a95b10ad20a409f..bcdea4ee73c52e4b9a101a2f3da0a8de6c4145b7 100644 (file)
@@ -104,7 +104,7 @@ static inline struct vsp1_entity *to_vsp1_entity(struct v4l2_subdev *subdev)
 
 int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
                     const char *name, unsigned int num_pads,
-                    const struct v4l2_subdev_ops *ops);
+                    const struct v4l2_subdev_ops *ops, u32 function);
 void vsp1_entity_destroy(struct vsp1_entity *entity);
 
 extern const struct v4l2_subdev_internal_ops vsp1_subdev_internal_ops;
index ec90af1bb209a260a892a6ecf0d73bd1bf726153..ab3cae307ba5040620c70db3bbbe522e0971bdd6 100644 (file)
@@ -161,8 +161,9 @@ struct vsp1_hsit *vsp1_hsit_create(struct vsp1_device *vsp1, bool inverse)
        else
                hsit->entity.type = VSP1_ENTITY_HST;
 
-       ret = vsp1_entity_init(vsp1, &hsit->entity, inverse ? "hsi" : "hst", 2,
-                              &hsit_ops);
+       ret = vsp1_entity_init(vsp1, &hsit->entity, inverse ? "hsi" : "hst",
+                              2, &hsit_ops,
+                              MEDIA_ENT_F_PROC_VIDEO_PIXEL_ENC_CONV);
        if (ret < 0)
                return ERR_PTR(ret);
 
index e554b3150748613550bf9b1f5c2862fa81322df3..e006f0df3ce9580dbf4e22a5fe957c517e57e448 100644 (file)
@@ -165,7 +165,12 @@ struct vsp1_lif *vsp1_lif_create(struct vsp1_device *vsp1)
        lif->entity.ops = &lif_entity_ops;
        lif->entity.type = VSP1_ENTITY_LIF;
 
-       ret = vsp1_entity_init(vsp1, &lif->entity, "lif", 2, &lif_ops);
+       /* The LIF is never exposed to userspace, but media entity registration
+        * requires a function to be set. Use PROC_VIDEO_PIXEL_FORMATTER just to
+        * avoid triggering a WARN_ON(), the value won't be seen anywhere.
+        */
+       ret = vsp1_entity_init(vsp1, &lif->entity, "lif", 2, &lif_ops,
+                              MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER);
        if (ret < 0)
                return ERR_PTR(ret);
 
index a543debaafb5847fea85a41e82683539d8404df6..855e483acb890d25a2a51303b7df440f8c655afe 100644 (file)
@@ -204,7 +204,8 @@ struct vsp1_lut *vsp1_lut_create(struct vsp1_device *vsp1)
        lut->entity.ops = &lut_entity_ops;
        lut->entity.type = VSP1_ENTITY_LUT;
 
-       ret = vsp1_entity_init(vsp1, &lut->entity, "lut", 2, &lut_ops);
+       ret = vsp1_entity_init(vsp1, &lut->entity, "lut", 2, &lut_ops,
+                              MEDIA_ENT_F_PROC_VIDEO_LUT);
        if (ret < 0)
                return ERR_PTR(ret);
 
index 4b397baef88f867232bf03d1641440a08726c268..47b1714f616353f2768662ce71e7b2b9e425f5b6 100644 (file)
@@ -237,7 +237,8 @@ struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index)
        rpf->entity.index = index;
 
        sprintf(name, "rpf.%u", index);
-       ret = vsp1_entity_init(vsp1, &rpf->entity, name, 2, &rpf_ops);
+       ret = vsp1_entity_init(vsp1, &rpf->entity, name, 2, &rpf_ops,
+                              MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER);
        if (ret < 0)
                return ERR_PTR(ret);
 
index 035c26934bc753dacc0f4bbae16cb2c296c13dfc..e13afd5e4d8b1dc66f548da87f0a58495ede5e06 100644 (file)
@@ -308,7 +308,8 @@ struct vsp1_sru *vsp1_sru_create(struct vsp1_device *vsp1)
        sru->entity.ops = &sru_entity_ops;
        sru->entity.type = VSP1_ENTITY_SRU;
 
-       ret = vsp1_entity_init(vsp1, &sru->entity, "sru", 2, &sru_ops);
+       ret = vsp1_entity_init(vsp1, &sru->entity, "sru", 2, &sru_ops,
+                              MEDIA_ENT_F_PROC_VIDEO_SCALER);
        if (ret < 0)
                return ERR_PTR(ret);
 
index 5d508e70fddaba51b745924697c4595b1b5d6ea8..f22945101bc87bb47d3979b4262e67147292f02c 100644 (file)
@@ -314,7 +314,8 @@ struct vsp1_uds *vsp1_uds_create(struct vsp1_device *vsp1, unsigned int index)
        uds->entity.index = index;
 
        sprintf(name, "uds.%u", index);
-       ret = vsp1_entity_init(vsp1, &uds->entity, name, 2, &uds_ops);
+       ret = vsp1_entity_init(vsp1, &uds->entity, name, 2, &uds_ops,
+                              MEDIA_ENT_F_PROC_VIDEO_SCALER);
        if (ret < 0)
                return ERR_PTR(ret);
 
index 59bdb450e6f17262a6de9a47a1b32ec53d011069..70fb979d4f944f88ac47af2a29e23a2f6173f50c 100644 (file)
@@ -216,7 +216,8 @@ struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index)
        wpf->entity.index = index;
 
        sprintf(name, "wpf.%u", index);
-       ret = vsp1_entity_init(vsp1, &wpf->entity, name, 2, &wpf_ops);
+       ret = vsp1_entity_init(vsp1, &wpf->entity, name, 2, &wpf_ops,
+                              MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER);
        if (ret < 0)
                return ERR_PTR(ret);
 
This page took 0.03348 seconds and 5 git commands to generate.