aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vsp1/vsp1_entity.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_entity.h')
-rw-r--r--drivers/media/platform/vsp1/vsp1_entity.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_entity.h b/drivers/media/platform/vsp1/vsp1_entity.h
new file mode 100644
index 000000000000..c4feab2cbb81
--- /dev/null
+++ b/drivers/media/platform/vsp1/vsp1_entity.h
@@ -0,0 +1,68 @@
1/*
2 * vsp1_entity.h -- R-Car VSP1 Base Entity
3 *
4 * Copyright (C) 2013 Renesas Corporation
5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 *
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.
12 */
13#ifndef __VSP1_ENTITY_H__
14#define __VSP1_ENTITY_H__
15
16#include <linux/list.h>
17
18#include <media/v4l2-subdev.h>
19
20struct vsp1_device;
21
22enum vsp1_entity_type {
23 VSP1_ENTITY_LIF,
24 VSP1_ENTITY_RPF,
25 VSP1_ENTITY_UDS,
26 VSP1_ENTITY_WPF,
27};
28
29struct vsp1_entity {
30 struct vsp1_device *vsp1;
31
32 enum vsp1_entity_type type;
33 unsigned int index;
34 unsigned int id;
35 unsigned int route;
36
37 struct list_head list_dev;
38 struct list_head list_pipe;
39
40 struct media_pad *pads;
41 unsigned int source_pad;
42
43 struct media_entity *sink;
44
45 struct v4l2_subdev subdev;
46 struct v4l2_mbus_framefmt *formats;
47};
48
49static inline struct vsp1_entity *to_vsp1_entity(struct v4l2_subdev *subdev)
50{
51 return container_of(subdev, struct vsp1_entity, subdev);
52}
53
54int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
55 unsigned int num_pads);
56void vsp1_entity_destroy(struct vsp1_entity *entity);
57
58extern const struct v4l2_subdev_internal_ops vsp1_subdev_internal_ops;
59extern const struct media_entity_operations vsp1_media_ops;
60
61struct v4l2_mbus_framefmt *
62vsp1_entity_get_pad_format(struct vsp1_entity *entity,
63 struct v4l2_subdev_fh *fh,
64 unsigned int pad, u32 which);
65void vsp1_entity_init_formats(struct v4l2_subdev *subdev,
66 struct v4l2_subdev_fh *fh);
67
68#endif /* __VSP1_ENTITY_H__ */