summaryrefslogtreecommitdiffstats
path: root/include/video/vpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/video/vpl.h')
-rw-r--r--include/video/vpl.h46
1 files changed, 46 insertions, 0 deletions
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 */