Skip to content

Commit b5fb952

Browse files
Sakari Ailusrkhuangtao
authored andcommitted
FROMLIST: v4l: fwnode: Move KernelDoc documentation to the header
In V4L2 the practice is to have the KernelDoc documentation in the header and not in .c source code files. This consequently makes the V4L2 fwnode function documentation part of the Media documentation build. Also correct the link related function and argument naming in documentation. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Niklas Sderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pavel Machek <pavel@ucw.cz> (cherry picked from commit 9115ae34c5fb99ea369972b03fa991ade67ff4f0) https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd http://www.spinics.net/lists/linux-media/msg122688.html Signed-off-by: Marc Herbert <marc.herbert@intel.com> Conflicts: drivers/media/v4l2-core/v4l2-fwnode.c (pure context issue due to _parse_csi1_bus() not here) BUG=b:64133998 TEST=media device topology shows subdevs registered successfully TEST=no camera regression Change-Id: Iccd13312e016a8dfb1f4ed028418f9a35516a9d4 Reviewed-on: https://chromium-review.googlesource.com/693684 Commit-Ready: Tomasz Figa <tfiga@chromium.org> Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
1 parent 8b4143d commit b5fb952

2 files changed

Lines changed: 80 additions & 76 deletions

File tree

drivers/media/v4l2-core/v4l2-fwnode.c

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -146,25 +146,6 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus(
146146

147147
}
148148

149-
/**
150-
* v4l2_fwnode_endpoint_parse() - parse all fwnode node properties
151-
* @fwnode: pointer to the endpoint's fwnode handle
152-
* @vep: pointer to the V4L2 fwnode data structure
153-
*
154-
* All properties are optional. If none are found, we don't set any flags. This
155-
* means the port has a static configuration and no properties have to be
156-
* specified explicitly. If any properties that identify the bus as parallel
157-
* are found and slave-mode isn't set, we set V4L2_MBUS_MASTER. Similarly, if
158-
* we recognise the bus as serial CSI-2 and clock-noncontinuous isn't set, we
159-
* set the V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flag. The caller should hold a
160-
* reference to @fwnode.
161-
*
162-
* NOTE: This function does not parse properties the size of which is variable
163-
* without a low fixed limit. Please use v4l2_fwnode_endpoint_alloc_parse() in
164-
* new drivers instead.
165-
*
166-
* Return: 0 on success or a negative error code on failure.
167-
*/
168149
int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
169150
struct v4l2_fwnode_endpoint *vep)
170151
{
@@ -190,14 +171,6 @@ int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
190171
}
191172
EXPORT_SYMBOL_GPL(v4l2_fwnode_endpoint_parse);
192173

193-
/*
194-
* v4l2_fwnode_endpoint_free() - free the V4L2 fwnode acquired by
195-
* v4l2_fwnode_endpoint_alloc_parse()
196-
* @vep - the V4L2 fwnode the resources of which are to be released
197-
*
198-
* It is safe to call this function with NULL argument or on a V4L2 fwnode the
199-
* parsing of which failed.
200-
*/
201174
void v4l2_fwnode_endpoint_free(struct v4l2_fwnode_endpoint *vep)
202175
{
203176
if (IS_ERR_OR_NULL(vep))
@@ -208,29 +181,6 @@ void v4l2_fwnode_endpoint_free(struct v4l2_fwnode_endpoint *vep)
208181
}
209182
EXPORT_SYMBOL_GPL(v4l2_fwnode_endpoint_free);
210183

211-
/**
212-
* v4l2_fwnode_endpoint_alloc_parse() - parse all fwnode node properties
213-
* @fwnode: pointer to the endpoint's fwnode handle
214-
*
215-
* All properties are optional. If none are found, we don't set any flags. This
216-
* means the port has a static configuration and no properties have to be
217-
* specified explicitly. If any properties that identify the bus as parallel
218-
* are found and slave-mode isn't set, we set V4L2_MBUS_MASTER. Similarly, if
219-
* we recognise the bus as serial CSI-2 and clock-noncontinuous isn't set, we
220-
* set the V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flag. The caller should hold a
221-
* reference to @fwnode.
222-
*
223-
* v4l2_fwnode_endpoint_alloc_parse() has two important differences to
224-
* v4l2_fwnode_endpoint_parse():
225-
*
226-
* 1. It also parses variable size data.
227-
*
228-
* 2. The memory it has allocated to store the variable size data must be freed
229-
* using v4l2_fwnode_endpoint_free() when no longer needed.
230-
*
231-
* Return: Pointer to v4l2_fwnode_endpoint if successful, on an error pointer
232-
* on error.
233-
*/
234184
struct v4l2_fwnode_endpoint *v4l2_fwnode_endpoint_alloc_parse(
235185
struct fwnode_handle *fwnode)
236186
{
@@ -273,24 +223,6 @@ struct v4l2_fwnode_endpoint *v4l2_fwnode_endpoint_alloc_parse(
273223
}
274224
EXPORT_SYMBOL_GPL(v4l2_fwnode_endpoint_alloc_parse);
275225

276-
/**
277-
* v4l2_fwnode_endpoint_parse_link() - parse a link between two endpoints
278-
* @__fwnode: pointer to the endpoint's fwnode at the local end of the link
279-
* @link: pointer to the V4L2 fwnode link data structure
280-
*
281-
* Fill the link structure with the local and remote nodes and port numbers.
282-
* The local_node and remote_node fields are set to point to the local and
283-
* remote port's parent nodes respectively (the port parent node being the
284-
* parent node of the port node if that node isn't a 'ports' node, or the
285-
* grand-parent node of the port node otherwise).
286-
*
287-
* A reference is taken to both the local and remote nodes, the caller must use
288-
* v4l2_fwnode_endpoint_put_link() to drop the references when done with the
289-
* link.
290-
*
291-
* Return: 0 on success, or -ENOLINK if the remote endpoint fwnode can't be
292-
* found.
293-
*/
294226
int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode,
295227
struct v4l2_fwnode_link *link)
296228
{
@@ -325,13 +257,6 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode,
325257
}
326258
EXPORT_SYMBOL_GPL(v4l2_fwnode_parse_link);
327259

328-
/**
329-
* v4l2_fwnode_put_link() - drop references to nodes in a link
330-
* @link: pointer to the V4L2 fwnode link data structure
331-
*
332-
* Drop references to the local and remote nodes in the link. This function
333-
* must be called on every link parsed with v4l2_fwnode_parse_link().
334-
*/
335260
void v4l2_fwnode_put_link(struct v4l2_fwnode_link *link)
336261
{
337262
fwnode_handle_put(link->local_node);

include/media/v4l2-fwnode.h

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,92 @@ struct v4l2_fwnode_link {
9292
unsigned int remote_port;
9393
};
9494

95+
/**
96+
* v4l2_fwnode_endpoint_parse() - parse all fwnode node properties
97+
* @fwnode: pointer to the endpoint's fwnode handle
98+
* @vep: pointer to the V4L2 fwnode data structure
99+
*
100+
* All properties are optional. If none are found, we don't set any flags. This
101+
* means the port has a static configuration and no properties have to be
102+
* specified explicitly. If any properties that identify the bus as parallel
103+
* are found and slave-mode isn't set, we set V4L2_MBUS_MASTER. Similarly, if
104+
* we recognise the bus as serial CSI-2 and clock-noncontinuous isn't set, we
105+
* set the V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flag. The caller should hold a
106+
* reference to @fwnode.
107+
*
108+
* NOTE: This function does not parse properties the size of which is variable
109+
* without a low fixed limit. Please use v4l2_fwnode_endpoint_alloc_parse() in
110+
* new drivers instead.
111+
*
112+
* Return: 0 on success or a negative error code on failure.
113+
*/
95114
int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
96115
struct v4l2_fwnode_endpoint *vep);
116+
117+
/*
118+
* v4l2_fwnode_endpoint_free() - free the V4L2 fwnode acquired by
119+
* v4l2_fwnode_endpoint_alloc_parse()
120+
* @vep - the V4L2 fwnode the resources of which are to be released
121+
*
122+
* It is safe to call this function with NULL argument or on a V4L2 fwnode the
123+
* parsing of which failed.
124+
*/
125+
void v4l2_fwnode_endpoint_free(struct v4l2_fwnode_endpoint *vep);
126+
127+
/**
128+
* v4l2_fwnode_endpoint_alloc_parse() - parse all fwnode node properties
129+
* @fwnode: pointer to the endpoint's fwnode handle
130+
*
131+
* All properties are optional. If none are found, we don't set any flags. This
132+
* means the port has a static configuration and no properties have to be
133+
* specified explicitly. If any properties that identify the bus as parallel
134+
* are found and slave-mode isn't set, we set V4L2_MBUS_MASTER. Similarly, if
135+
* we recognise the bus as serial CSI-2 and clock-noncontinuous isn't set, we
136+
* set the V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flag. The caller should hold a
137+
* reference to @fwnode.
138+
*
139+
* v4l2_fwnode_endpoint_alloc_parse() has two important differences to
140+
* v4l2_fwnode_endpoint_parse():
141+
*
142+
* 1. It also parses variable size data.
143+
*
144+
* 2. The memory it has allocated to store the variable size data must be freed
145+
* using v4l2_fwnode_endpoint_free() when no longer needed.
146+
*
147+
* Return: Pointer to v4l2_fwnode_endpoint if successful, on an error pointer
148+
* on error.
149+
*/
97150
struct v4l2_fwnode_endpoint *v4l2_fwnode_endpoint_alloc_parse(
98151
struct fwnode_handle *fwnode);
99-
void v4l2_fwnode_endpoint_free(struct v4l2_fwnode_endpoint *vep);
152+
153+
/**
154+
* v4l2_fwnode_parse_link() - parse a link between two endpoints
155+
* @fwnode: pointer to the endpoint's fwnode at the local end of the link
156+
* @link: pointer to the V4L2 fwnode link data structure
157+
*
158+
* Fill the link structure with the local and remote nodes and port numbers.
159+
* The local_node and remote_node fields are set to point to the local and
160+
* remote port's parent nodes respectively (the port parent node being the
161+
* parent node of the port node if that node isn't a 'ports' node, or the
162+
* grand-parent node of the port node otherwise).
163+
*
164+
* A reference is taken to both the local and remote nodes, the caller must use
165+
* v4l2_fwnode_put_link() to drop the references when done with the
166+
* link.
167+
*
168+
* Return: 0 on success, or -ENOLINK if the remote endpoint fwnode can't be
169+
* found.
170+
*/
100171
int v4l2_fwnode_parse_link(struct fwnode_handle *fwnode,
101172
struct v4l2_fwnode_link *link);
173+
174+
/**
175+
* v4l2_fwnode_put_link() - drop references to nodes in a link
176+
* @link: pointer to the V4L2 fwnode link data structure
177+
*
178+
* Drop references to the local and remote nodes in the link. This function
179+
* must be called on every link parsed with v4l2_fwnode_parse_link().
180+
*/
102181
void v4l2_fwnode_put_link(struct v4l2_fwnode_link *link);
103182

104183
#endif /* _V4L2_FWNODE_H */

0 commit comments

Comments
 (0)