2 * V4L2 OF binding parsing library
4 * Copyright (C) 2012 - 2013 Samsung Electronics Co., Ltd.
5 * Author: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 * Copyright (C) 2012 Renesas Electronics Corp.
8 * Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
17 #include <linux/list.h>
18 #include <linux/types.h>
19 #include <linux/errno.h>
20 #include <linux/of_graph.h>
22 #include <media/v4l2-mediabus.h>
27 * struct v4l2_of_bus_mipi_csi2 - MIPI CSI-2 bus data structure
28 * @flags: media bus (V4L2_MBUS_*) flags
29 * @data_lanes: an array of physical data lane indexes
30 * @clock_lane: physical lane index of the clock lane
31 * @num_data_lanes: number of data lanes
32 * @lane_polarities: polarity of the lanes. The order is the same of
35 struct v4l2_of_bus_mipi_csi2
{
37 unsigned char data_lanes
[4];
38 unsigned char clock_lane
;
39 unsigned short num_data_lanes
;
40 bool lane_polarities
[5];
44 * struct v4l2_of_bus_parallel - parallel data bus data structure
45 * @flags: media bus (V4L2_MBUS_*) flags
46 * @bus_width: bus width in bits
47 * @data_shift: data shift in bits
49 struct v4l2_of_bus_parallel
{
51 unsigned char bus_width
;
52 unsigned char data_shift
;
56 * struct v4l2_of_endpoint - the endpoint data structure
57 * @base: struct of_endpoint containing port, id, and local of_node
59 * @bus: bus configuration data structure
60 * @head: list head for this structure
62 struct v4l2_of_endpoint
{
63 struct of_endpoint base
;
64 enum v4l2_mbus_type bus_type
;
66 struct v4l2_of_bus_parallel parallel
;
67 struct v4l2_of_bus_mipi_csi2 mipi_csi2
;
69 struct list_head head
;
73 * struct v4l2_of_link - a link between two endpoints
74 * @local_node: pointer to device_node of this endpoint
75 * @local_port: identifier of the port this endpoint belongs to
76 * @remote_node: pointer to device_node of the remote endpoint
77 * @remote_port: identifier of the port the remote endpoint belongs to
80 struct device_node
*local_node
;
81 unsigned int local_port
;
82 struct device_node
*remote_node
;
83 unsigned int remote_port
;
87 int v4l2_of_parse_endpoint(const struct device_node
*node
,
88 struct v4l2_of_endpoint
*endpoint
);
89 int v4l2_of_parse_link(const struct device_node
*node
,
90 struct v4l2_of_link
*link
);
91 void v4l2_of_put_link(struct v4l2_of_link
*link
);
94 static inline int v4l2_of_parse_endpoint(const struct device_node
*node
,
95 struct v4l2_of_endpoint
*link
)
100 static inline int v4l2_of_parse_link(const struct device_node
*node
,
101 struct v4l2_of_link
*link
)
106 static inline void v4l2_of_put_link(struct v4l2_of_link
*link
)
110 #endif /* CONFIG_OF */
112 #endif /* _V4L2_OF_H */