2 * vsp1_entity.h -- R-Car VSP1 Base Entity
4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 #ifndef __VSP1_ENTITY_H__
14 #define __VSP1_ENTITY_H__
16 #include <linux/list.h>
18 #include <media/v4l2-subdev.h>
22 enum vsp1_entity_type {
34 struct vsp1_device *vsp1;
36 enum vsp1_entity_type type;
41 struct list_head list_dev;
42 struct list_head list_pipe;
44 struct media_pad *pads;
45 unsigned int source_pad;
47 struct media_entity *sink;
49 struct v4l2_subdev subdev;
50 struct v4l2_mbus_framefmt *formats;
53 static inline struct vsp1_entity *to_vsp1_entity(struct v4l2_subdev *subdev)
55 return container_of(subdev, struct vsp1_entity, subdev);
58 int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
59 unsigned int num_pads);
60 void vsp1_entity_destroy(struct vsp1_entity *entity);
62 extern const struct v4l2_subdev_internal_ops vsp1_subdev_internal_ops;
63 extern const struct media_entity_operations vsp1_media_ops;
65 struct v4l2_mbus_framefmt *
66 vsp1_entity_get_pad_format(struct vsp1_entity *entity,
67 struct v4l2_subdev_fh *fh,
68 unsigned int pad, u32 which);
69 void vsp1_entity_init_formats(struct v4l2_subdev *subdev,
70 struct v4l2_subdev_fh *fh);
72 #endif /* __VSP1_ENTITY_H__ */