diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-11-17 12:23:23 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-04-13 17:52:36 -0300 |
commit | 5243453472e7bce74764ddf9f206450dcc8769c5 (patch) | |
tree | f23eb718b6c6e5df792bce7c7b87b9c19d4af606 /drivers/media/platform/vsp1/vsp1_rwpf.h | |
parent | 823329dfee7224712569cc4899720bc470a2fe56 (diff) |
[media] v4l: vsp1: Consolidate entity ops in a struct vsp1_entity_operations
Entities have two operations, a destroy operation stored directly in
vsp1_entity and a set_memory operation stored in a vsp1_rwpf_operations
structure. Move the two to a more generic vsp1_entity_operations
structure that will serve to implement additional operations.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_rwpf.h')
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_rwpf.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.h b/drivers/media/platform/vsp1/vsp1_rwpf.h index 2bbcc331959b..e8ca9b6ee689 100644 --- a/drivers/media/platform/vsp1/vsp1_rwpf.h +++ b/drivers/media/platform/vsp1/vsp1_rwpf.h @@ -32,23 +32,12 @@ struct vsp1_rwpf_memory { dma_addr_t addr[3]; }; -/** - * struct vsp1_rwpf_operations - RPF and WPF operations - * @set_memory: Setup memory buffer access. This operation applies the settings - * stored in the rwpf mem field to the hardware. - */ -struct vsp1_rwpf_operations { - void (*set_memory)(struct vsp1_rwpf *rwpf); -}; - struct vsp1_rwpf { struct vsp1_entity entity; struct v4l2_ctrl_handler ctrls; struct vsp1_video *video; - const struct vsp1_rwpf_operations *ops; - unsigned int max_width; unsigned int max_height; @@ -73,6 +62,11 @@ static inline struct vsp1_rwpf *to_rwpf(struct v4l2_subdev *subdev) return container_of(subdev, struct vsp1_rwpf, entity.subdev); } +static inline struct vsp1_rwpf *entity_to_rwpf(struct vsp1_entity *entity) +{ + return container_of(entity, struct vsp1_rwpf, entity); +} + struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index); struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index); @@ -105,7 +99,7 @@ int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev, */ static inline void vsp1_rwpf_set_memory(struct vsp1_rwpf *rwpf) { - rwpf->ops->set_memory(rwpf); + rwpf->entity.ops->set_memory(&rwpf->entity); } #endif /* __VSP1_RWPF_H__ */ |