diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-11-17 17:23:23 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-04-13 23:52:36 +0300 |
commit | 5243453472e7bce74764ddf9f206450dcc8769c5 (patch) | |
tree | f23eb718b6c6e5df792bce7c7b87b9c19d4af606 /drivers/media/platform/vsp1/vsp1_rpf.c | |
parent | 823329dfee7224712569cc4899720bc470a2fe56 (diff) | |
download | linux-5243453472e7bce74764ddf9f206450dcc8769c5.tar.xz |
[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_rpf.c')
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_rpf.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c b/drivers/media/platform/vsp1/vsp1_rpf.c index 8d9e511fd61a..a68f26db9b3f 100644 --- a/drivers/media/platform/vsp1/vsp1_rpf.c +++ b/drivers/media/platform/vsp1/vsp1_rpf.c @@ -141,11 +141,13 @@ static struct v4l2_subdev_ops rpf_ops = { }; /* ----------------------------------------------------------------------------- - * Video Device Operations + * VSP1 Entity Operations */ -static void rpf_set_memory(struct vsp1_rwpf *rpf) +static void rpf_set_memory(struct vsp1_entity *entity) { + struct vsp1_rwpf *rpf = entity_to_rwpf(entity); + vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_Y, rpf->mem.addr[0] + rpf->offsets[0]); vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_C0, @@ -154,7 +156,7 @@ static void rpf_set_memory(struct vsp1_rwpf *rpf) rpf->mem.addr[2] + rpf->offsets[1]); } -static const struct vsp1_rwpf_operations rpf_vdev_ops = { +static const struct vsp1_entity_operations rpf_entity_ops = { .set_memory = rpf_set_memory, }; @@ -172,11 +174,10 @@ struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index) if (rpf == NULL) return ERR_PTR(-ENOMEM); - rpf->ops = &rpf_vdev_ops; - rpf->max_width = RPF_MAX_WIDTH; rpf->max_height = RPF_MAX_HEIGHT; + rpf->entity.ops = &rpf_entity_ops; rpf->entity.type = VSP1_ENTITY_RPF; rpf->entity.index = index; |