Lines Matching refs:fwnode

3  * V4L2 fwnode binding parsing library
5 * The origins of the V4L2 fwnode library are in V4L2 OF library that
28 #include <media/v4l2-fwnode.h>
124 static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
161 rval = fwnode_property_count_u32(fwnode, "data-lanes");
166 fwnode_property_read_u32_array(fwnode, "data-lanes", array,
189 rval = fwnode_property_count_u32(fwnode, "lane-polarities");
200 if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v)) {
213 if (fwnode_property_present(fwnode, "clock-noncontinuous")) {
241 fwnode_property_read_u32_array(fwnode,
266 v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode,
277 if (!fwnode_property_read_u32(fwnode, "hsync-active", &v)) {
285 if (!fwnode_property_read_u32(fwnode, "vsync-active", &v)) {
293 if (!fwnode_property_read_u32(fwnode, "field-even-active", &v)) {
301 if (!fwnode_property_read_u32(fwnode, "pclk-sample", &v)) {
324 if (!fwnode_property_read_u32(fwnode, "data-active", &v)) {
332 if (fwnode_property_present(fwnode, "slave-mode")) {
341 if (!fwnode_property_read_u32(fwnode, "bus-width", &v)) {
346 if (!fwnode_property_read_u32(fwnode, "data-shift", &v)) {
351 if (!fwnode_property_read_u32(fwnode, "sync-on-green-active", &v)) {
359 if (!fwnode_property_read_u32(fwnode, "data-enable-active", &v)) {
387 v4l2_fwnode_endpoint_parse_csi1_bus(struct fwnode_handle *fwnode,
394 if (!fwnode_property_read_u32(fwnode, "clock-inv", &v)) {
399 if (!fwnode_property_read_u32(fwnode, "strobe", &v)) {
404 if (!fwnode_property_read_u32(fwnode, "data-lanes", &v)) {
409 if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v)) {
420 static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
427 pr_debug("===== begin parsing endpoint %pfw\n", fwnode);
429 fwnode_property_read_u32(fwnode, "bus-type", &bus_type);
430 pr_debug("fwnode video bus type %s (%u), mbus type %s (%u)\n",
453 rval = v4l2_fwnode_endpoint_parse_csi2_bus(fwnode, vep,
459 v4l2_fwnode_endpoint_parse_parallel_bus(fwnode, vep,
469 v4l2_fwnode_endpoint_parse_csi1_bus(fwnode, vep, vep->bus_type);
474 rval = v4l2_fwnode_endpoint_parse_csi2_bus(fwnode, vep,
482 v4l2_fwnode_endpoint_parse_parallel_bus(fwnode, vep,
491 fwnode_graph_parse_endpoint(fwnode, &vep->base);
496 int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
501 ret = __v4l2_fwnode_endpoint_parse(fwnode, vep);
503 pr_debug("===== end parsing endpoint %pfw\n", fwnode);
519 int v4l2_fwnode_endpoint_alloc_parse(struct fwnode_handle *fwnode,
524 rval = __v4l2_fwnode_endpoint_parse(fwnode, vep);
528 rval = fwnode_property_count_u64(fwnode, "link-frequencies");
540 rval = fwnode_property_read_u64_array(fwnode,
554 pr_debug("===== end parsing endpoint %pfw\n", fwnode);
560 int v4l2_fwnode_parse_link(struct fwnode_handle *fwnode,
567 fwnode_graph_parse_endpoint(fwnode, &fwep);
570 link->local_node = fwnode_graph_get_port_parent(fwnode);
574 fwnode = fwnode_graph_get_remote_endpoint(fwnode);
575 if (!fwnode)
578 fwnode_graph_parse_endpoint(fwnode, &fwep);
581 link->remote_node = fwnode_graph_get_port_parent(fwnode);
588 fwnode_handle_put(fwnode);
630 v4l2_fwnode_connector_parse_analog(struct fwnode_handle *fwnode,
636 ret = fwnode_property_read_u32(fwnode, "sdtv-standards", &stds);
662 v4l2_fwnode_get_connector_type(struct fwnode_handle *fwnode)
667 if (!fwnode)
671 err = fwnode_property_read_string(fwnode, "compatible", &type_name);
678 int v4l2_fwnode_connector_parse(struct fwnode_handle *fwnode,
686 if (!fwnode)
693 connector_node = fwnode_graph_get_port_parent(fwnode);
697 connector_node = fwnode_graph_get_remote_port_parent(fwnode);
730 int v4l2_fwnode_connector_add_link(struct fwnode_handle *fwnode,
737 if (!fwnode || !connector || connector->type == V4L2_CONN_UNKNOWN)
740 connector_ep = fwnode_graph_get_remote_endpoint(fwnode);
772 struct fwnode_handle *fwnode = dev_fwnode(dev);
779 ret = fwnode_property_read_u32(fwnode, "orientation", &val);
796 ret = fwnode_property_read_u32(fwnode, "rotation", &val);
836 asd = v4l2_async_nf_add_fwnode(notifier, args.fwnode,
838 fwnode_handle_put(args.fwnode);
859 * @fwnode: fwnode to read @prop from
866 * First find an fwnode referred to by the reference at @index in @prop.
868 * Then under that fwnode, @nprops times, for each property in @props,
869 * iteratively follow child nodes starting from fwnode such that they have the
874 * The child fwnode reached at the end of the iteration is then returned to the
881 * underneath the device fwnode, the next tuple identifies a child node
882 * underneath the fwnode identified by the previous tuple, etc. until you
883 * reached the fwnode you need.
973 * @fwnode: fwnode referring to EP40 under ISP.
979 * And you'd get back fwnode referring to EP00 under CAM0.
982 * fwnode, you'll get fwnode referring to EP40 under ISP.
1016 v4l2_fwnode_reference_get_int_prop(struct fwnode_handle *fwnode,
1028 * Obtain remote fwnode as well as the integer arguments.
1033 ret = fwnode_property_get_reference_args(fwnode, prop, NULL, nprops,
1039 * Find a node in the tree under the referred fwnode corresponding to
1042 fwnode = fwnode_args.fwnode;
1046 /* Loop over all child nodes under fwnode. */
1047 fwnode_for_each_child_node(fwnode, child) {
1056 fwnode_handle_put(fwnode);
1060 fwnode = ERR_PTR(-ENOENT);
1066 fwnode = child;
1069 return fwnode;
1106 struct fwnode_handle *fwnode;
1115 fwnode = v4l2_fwnode_reference_get_int_prop(dev_fwnode(dev),
1118 if (IS_ERR(fwnode)) {
1124 if (PTR_ERR(fwnode) != -ENOENT &&
1125 PTR_ERR(fwnode) != -ENODATA)
1126 return PTR_ERR(fwnode);
1129 fwnode_handle_put(fwnode);
1134 !IS_ERR((fwnode = v4l2_fwnode_reference_get_int_prop(dev_fwnode(dev),
1141 asd = v4l2_async_nf_add_fwnode(notifier, fwnode,
1143 fwnode_handle_put(fwnode);
1154 return !fwnode || PTR_ERR(fwnode) == -ENOENT ? 0 : PTR_ERR(fwnode);