v4l2-mc.h (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) v4l2-mc.h (8fd390b89cc8ca786bc1b66d8a76512a6068b081)
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * v4l2-mc.h - Media Controller V4L2 types and prototypes
4 *
5 * Copyright (C) 2016 Mauro Carvalho Chehab <mchehab@kernel.org>
6 * Copyright (C) 2006-2010 Nokia Corporation
7 * Copyright (c) 2016 Intel Corporation.
8 */

--- 72 unchanged lines hidden (view full) ---

81 * v4l2-core interfaces don't have access to video device and
82 * this interface finds the struct video_device for the q and
83 * calls v4l_enable_media_source().
84 */
85int v4l_vb2q_enable_media_source(struct vb2_queue *q);
86
87
88/**
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * v4l2-mc.h - Media Controller V4L2 types and prototypes
4 *
5 * Copyright (C) 2016 Mauro Carvalho Chehab <mchehab@kernel.org>
6 * Copyright (C) 2006-2010 Nokia Corporation
7 * Copyright (c) 2016 Intel Corporation.
8 */

--- 72 unchanged lines hidden (view full) ---

81 * v4l2-core interfaces don't have access to video device and
82 * this interface finds the struct video_device for the q and
83 * calls v4l_enable_media_source().
84 */
85int v4l_vb2q_enable_media_source(struct vb2_queue *q);
86
87
88/**
89 * v4l2_pipeline_pm_use - Update the use count of an entity
90 * @entity: The entity
91 * @use: Use (1) or stop using (0) the entity
89 * v4l2_pipeline_pm_get - Increase the use count of a pipeline
90 * @entity: The root entity of a pipeline
92 *
91 *
93 * Update the use count of all entities in the pipeline and power entities on or
94 * off accordingly.
92 * Update the use count of all entities in the pipeline and power entities on.
95 *
93 *
96 * This function is intended to be called in video node open (use ==
97 * 1) and release (use == 0). It uses struct media_entity.use_count to
98 * track the power status. The use of this function should be paired
99 * with v4l2_pipeline_link_notify().
94 * This function is intended to be called in video node open. It uses
95 * struct media_entity.use_count to track the power status. The use
96 * of this function should be paired with v4l2_pipeline_link_notify().
100 *
97 *
101 * Return 0 on success or a negative error code on failure. Powering entities
102 * off is assumed to never fail. No failure can occur when the use parameter is
103 * set to 0.
98 * Return 0 on success or a negative error code on failure.
104 */
99 */
105int v4l2_pipeline_pm_use(struct media_entity *entity, int use);
100int v4l2_pipeline_pm_get(struct media_entity *entity);
106
101
102/**
103 * v4l2_pipeline_pm_put - Decrease the use count of a pipeline
104 * @entity: The root entity of a pipeline
105 *
106 * Update the use count of all entities in the pipeline and power entities off.
107 *
108 * This function is intended to be called in video node release. It uses
109 * struct media_entity.use_count to track the power status. The use
110 * of this function should be paired with v4l2_pipeline_link_notify().
111 */
112void v4l2_pipeline_pm_put(struct media_entity *entity);
107
113
114
108/**
109 * v4l2_pipeline_link_notify - Link management notification callback
110 * @link: The link
111 * @flags: New link flags that will be applied
112 * @notification: The link's state change notification type (MEDIA_DEV_NOTIFY_*)
113 *
114 * React to link management on powered pipelines by updating the use count of
115 * all entities in the source and sink sides of the link. Entities are powered
116 * on or off accordingly. The use of this function should be paired
115/**
116 * v4l2_pipeline_link_notify - Link management notification callback
117 * @link: The link
118 * @flags: New link flags that will be applied
119 * @notification: The link's state change notification type (MEDIA_DEV_NOTIFY_*)
120 *
121 * React to link management on powered pipelines by updating the use count of
122 * all entities in the source and sink sides of the link. Entities are powered
123 * on or off accordingly. The use of this function should be paired
117 * with v4l2_pipeline_pm_use().
124 * with v4l2_pipeline_pm_{get,put}().
118 *
119 * Return 0 on success or a negative error code on failure. Powering entities
120 * off is assumed to never fail. This function will not fail for disconnection
121 * events.
122 */
123int v4l2_pipeline_link_notify(struct media_link *link, u32 flags,
124 unsigned int notification);
125

--- 13 unchanged lines hidden (view full) ---

139{
140}
141
142static inline int v4l_vb2q_enable_media_source(struct vb2_queue *q)
143{
144 return 0;
145}
146
125 *
126 * Return 0 on success or a negative error code on failure. Powering entities
127 * off is assumed to never fail. This function will not fail for disconnection
128 * events.
129 */
130int v4l2_pipeline_link_notify(struct media_link *link, u32 flags,
131 unsigned int notification);
132

--- 13 unchanged lines hidden (view full) ---

146{
147}
148
149static inline int v4l_vb2q_enable_media_source(struct vb2_queue *q)
150{
151 return 0;
152}
153
147static inline int v4l2_pipeline_pm_use(struct media_entity *entity, int use)
154static inline int v4l2_pipeline_pm_get(struct media_entity *entity)
148{
149 return 0;
150}
151
155{
156 return 0;
157}
158
159static inline void v4l2_pipeline_pm_put(struct media_entity *entity)
160{}
161
152static inline int v4l2_pipeline_link_notify(struct media_link *link, u32 flags,
153 unsigned int notification)
154{
155 return 0;
156}
157
158#endif /* CONFIG_MEDIA_CONTROLLER */
159#endif /* _V4L2_MC_H */
162static inline int v4l2_pipeline_link_notify(struct media_link *link, u32 flags,
163 unsigned int notification)
164{
165 return 0;
166}
167
168#endif /* CONFIG_MEDIA_CONTROLLER */
169#endif /* _V4L2_MC_H */