summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-08-07 07:55:00 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-08-07 07:55:00 +0200
commit98b5672c4d474f25227450a29f82f14e84c85f3c (patch)
tree38f074aca05571b2bed9295e6f83e098c350c94b /include
parent0c5c47b511763a2a9b216918e041178826fbdacc (diff)
parent427d637327bb4714085ea748bc5e7564ea0acfe6 (diff)
downloadbarebox-98b5672c4d474f25227450a29f82f14e84c85f3c.tar.gz
barebox-98b5672c4d474f25227450a29f82f14e84c85f3c.tar.xz
Merge branch 'for-next/vpl'
Diffstat (limited to 'include')
-rw-r--r--include/fb.h2
-rw-r--r--include/of.h8
-rw-r--r--include/of_graph.h50
-rw-r--r--include/video/vpl.h46
4 files changed, 106 insertions, 0 deletions
diff --git a/include/fb.h b/include/fb.h
index d0bab48bdd..311d5db192 100644
--- a/include/fb.h
+++ b/include/fb.h
@@ -99,6 +99,7 @@ struct display_timings {
unsigned int num_modes;
struct fb_videomode *modes;
+ void *edid;
};
struct i2c_adapter;
@@ -143,6 +144,7 @@ struct fb_info {
};
struct display_timings *of_get_display_timings(struct device_node *np);
+void display_timings_release(struct display_timings *);
int register_framebuffer(struct fb_info *info);
diff --git a/include/of.h b/include/of.h
index 1db210b38a..e0ebc39b74 100644
--- a/include/of.h
+++ b/include/of.h
@@ -153,6 +153,8 @@ extern int of_device_is_available(const struct device_node *device);
extern struct device_node *of_get_parent(const struct device_node *node);
extern struct device_node *of_get_next_available_child(
const struct device_node *node, struct device_node *prev);
+struct device_node *of_get_next_child(const struct device_node *node,
+ struct device_node *prev);
extern int of_get_child_count(const struct device_node *parent);
extern int of_get_available_child_count(const struct device_node *parent);
extern struct device_node *of_get_child_by_name(const struct device_node *node,
@@ -308,6 +310,12 @@ static inline struct device_node *of_get_next_available_child(
return NULL;
}
+static inline struct device_node *of_get_next_child(const struct device_node *node,
+ struct device_node *prev)
+{
+ return NULL;
+}
+
static inline int of_get_child_count(const struct device_node *parent)
{
return -ENOSYS;
diff --git a/include/of_graph.h b/include/of_graph.h
new file mode 100644
index 0000000000..254dd2ca28
--- /dev/null
+++ b/include/of_graph.h
@@ -0,0 +1,50 @@
+/*
+ * OF graph binding parsing helpers
+ *
+ * Copyright (C) 2012 - 2013 Samsung Electronics Co., Ltd.
+ * Author: Sylwester Nawrocki <s.nawrocki@samsung.com>
+ *
+ * Copyright (C) 2012 Renesas Electronics Corp.
+ * Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ */
+#ifndef __LINUX_OF_GRAPH_H
+#define __LINUX_OF_GRAPH_H
+
+/**
+ * struct of_endpoint - the OF graph endpoint data structure
+ * @port: identifier (value of reg property) of a port this endpoint belongs to
+ * @id: identifier (value of reg property) of this endpoint
+ * @local_node: pointer to device_node of this endpoint
+ */
+struct of_endpoint {
+ unsigned int port;
+ unsigned int id;
+ const struct device_node *local_node;
+};
+
+/**
+ * for_each_endpoint_of_node - iterate over every endpoint in a device node
+ * @parent: parent device node containing ports and endpoints
+ * @child: loop variable pointing to the current endpoint node
+ *
+ * When breaking out of the loop, of_node_put(child) has to be called manually.
+ */
+#define for_each_endpoint_of_node(parent, child) \
+ for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \
+ child = of_graph_get_next_endpoint(parent, child))
+
+int of_graph_parse_endpoint(const struct device_node *node,
+ struct of_endpoint *endpoint);
+struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
+struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
+ struct device_node *previous);
+struct device_node *of_graph_get_remote_port_parent(
+ const struct device_node *node);
+struct device_node *of_graph_get_remote_port(const struct device_node *node);
+int of_graph_port_is_available(struct device_node *node);
+
+#endif /* __LINUX_OF_GRAPH_H */
diff --git a/include/video/vpl.h b/include/video/vpl.h
new file mode 100644
index 0000000000..846007f4f5
--- /dev/null
+++ b/include/video/vpl.h
@@ -0,0 +1,46 @@
+#ifndef __VIDEO_VPL_H
+#define __VIDEO_VPL_H
+
+#include <fb.h>
+
+#define VPL_PREPARE 0x67660001
+#define VPL_UNPREPARE 0x67660002
+#define VPL_ENABLE 0x67660003
+#define VPL_DISABLE 0x67660004
+#define VPL_GET_VIDEOMODES 0x67660005
+
+struct vpl {
+ int (*ioctl)(struct vpl *, unsigned int port,
+ unsigned int cmd, void *ptr);
+ struct device_node *node;
+ struct list_head list;
+};
+
+int vpl_register(struct vpl *);
+int vpl_ioctl(struct vpl *, unsigned int port,
+ unsigned int cmd, void *ptr);
+
+struct vpl *of_vpl_get(struct device_node *node, int port);
+
+static inline int vpl_ioctl_prepare(struct vpl *vpl, unsigned int port,
+ struct fb_videomode *mode)
+{
+ return vpl_ioctl(vpl, port, VPL_PREPARE, mode);
+}
+
+static inline int vpl_ioctl_unprepare(struct vpl *vpl, unsigned int port)
+{
+ return vpl_ioctl(vpl, port, VPL_UNPREPARE, NULL);
+}
+
+static inline int vpl_ioctl_enable(struct vpl *vpl, unsigned int port)
+{
+ return vpl_ioctl(vpl, port, VPL_ENABLE, NULL);
+}
+
+static inline int vpl_ioctl_disable(struct vpl *vpl, unsigned int port)
+{
+ return vpl_ioctl(vpl, port, VPL_DISABLE, NULL);
+}
+
+#endif /* __VIDEO_VPL_H */