summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2018-06-02 12:19:35 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-10-04 16:08:09 -0400
commit6970d37cc97d77189d775fd16d47b2ac87d0e757 (patch)
treef8731768cc5c16db6fe1625a74272d893cb8758a /include
parent2d95e7ed07ed29715a801a3d33b2ad2a6fb26ee3 (diff)
media: v4l: fwnode: Let the caller provide V4L2 fwnode endpoint
Instead of allocating the V4L2 fwnode endpoint in v4l2_fwnode_endpoint_alloc_parse, let the caller to do this. This allows setting default parameters for the endpoint which is a very common need for drivers. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Steve Longerbeam <steve_longerbeam@mentor.com> Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/media/v4l2-fwnode.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
index 8b4873c37098..4a371c3ad86c 100644
--- a/include/media/v4l2-fwnode.h
+++ b/include/media/v4l2-fwnode.h
@@ -161,6 +161,7 @@ void v4l2_fwnode_endpoint_free(struct v4l2_fwnode_endpoint *vep);
/**
* v4l2_fwnode_endpoint_alloc_parse() - parse all fwnode node properties
* @fwnode: pointer to the endpoint's fwnode handle
+ * @vep: pointer to the V4L2 fwnode data structure
*
* All properties are optional. If none are found, we don't set any flags. This
* means the port has a static configuration and no properties have to be
@@ -170,6 +171,8 @@ void v4l2_fwnode_endpoint_free(struct v4l2_fwnode_endpoint *vep);
* set the V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flag. The caller should hold a
* reference to @fwnode.
*
+ * The caller must set the bus_type field of @vep to zero.
+ *
* v4l2_fwnode_endpoint_alloc_parse() has two important differences to
* v4l2_fwnode_endpoint_parse():
*
@@ -178,11 +181,10 @@ void v4l2_fwnode_endpoint_free(struct v4l2_fwnode_endpoint *vep);
* 2. The memory it has allocated to store the variable size data must be freed
* using v4l2_fwnode_endpoint_free() when no longer needed.
*
- * Return: Pointer to v4l2_fwnode_endpoint if successful, on an error pointer
- * on error.
+ * Return: 0 on success or a negative error code on failure.
*/
-struct v4l2_fwnode_endpoint *v4l2_fwnode_endpoint_alloc_parse(
- struct fwnode_handle *fwnode);
+int v4l2_fwnode_endpoint_alloc_parse(
+ struct fwnode_handle *fwnode, struct v4l2_fwnode_endpoint *vep);
/**
* v4l2_fwnode_parse_link() - parse a link between two endpoints