blob: 85b8dad5ddee4931536aee463b24447b77128522 [file] [log] [blame]
Petr Havlenac9288142012-11-15 14:07:10 +05301/*
2 * Copyright@ Samsung Electronics Co. LTD
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __S5P_TVOUT_H__
18#define __S5P_TVOUT_H__
19
20#include <linux/fb.h>
21#include <linux/videodev2.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/*******************************************
28 * Define
29 *******************************************/
30/* TVOUT control */
31
32#define TVOUT_DEV "/dev/video14"
33#define TVOUT_DEV_V "/dev/video21"
34#define TVOUT_DEV_V2 "/dev/video22"
35
36/* ------------- Output -----------------*/
37/* type */
38#define V4L2_OUTPUT_TYPE_MSDMA 4
39#define V4L2_OUTPUT_TYPE_COMPOSITE 5
40#define V4L2_OUTPUT_TYPE_SVIDEO 6
41#define V4L2_OUTPUT_TYPE_YPBPR_INERLACED 7
42#define V4L2_OUTPUT_TYPE_YPBPR_PROGRESSIVE 8
43#define V4L2_OUTPUT_TYPE_RGB_PROGRESSIVE 9
44#define V4L2_OUTPUT_TYPE_DIGITAL 10
45#define V4L2_OUTPUT_TYPE_HDMI V4L2_OUTPUT_TYPE_DIGITAL
46#define V4L2_OUTPUT_TYPE_HDMI_RGB 11
47#define V4L2_OUTPUT_TYPE_DVI 12
48
49/* ------------- STD -------------------*/
50#define V4L2_STD_PAL_BDGHI\
51 (V4L2_STD_PAL_B|V4L2_STD_PAL_D|V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_PAL_I)
52
53#define V4L2_STD_480P_60_16_9 ((v4l2_std_id)0x04000000)
54#define V4L2_STD_480P_60_4_3 ((v4l2_std_id)0x05000000)
55#define V4L2_STD_576P_50_16_9 ((v4l2_std_id)0x06000000)
56#define V4L2_STD_576P_50_4_3 ((v4l2_std_id)0x07000000)
57#define V4L2_STD_720P_60 ((v4l2_std_id)0x08000000)
58#define V4L2_STD_720P_50 ((v4l2_std_id)0x09000000)
59#define V4L2_STD_1080P_60 ((v4l2_std_id)0x0a000000)
60#define V4L2_STD_1080P_50 ((v4l2_std_id)0x0b000000)
61#define V4L2_STD_1080I_60 ((v4l2_std_id)0x0c000000)
62#define V4L2_STD_1080I_50 ((v4l2_std_id)0x0d000000)
63#define V4L2_STD_480P_59 ((v4l2_std_id)0x0e000000)
64#define V4L2_STD_720P_59 ((v4l2_std_id)0x0f000000)
65#define V4L2_STD_1080I_59 ((v4l2_std_id)0x10000000)
66#define V4L2_STD_1080P_59 ((v4l2_std_id)0x11000000)
67#define V4L2_STD_1080P_30 ((v4l2_std_id)0x12000000)
68#define V4L2_STD_TVOUT_720P_60_SBS_HALF ((v4l2_std_id)0x13000000)
69#define V4L2_STD_TVOUT_720P_59_SBS_HALF ((v4l2_std_id)0x14000000)
70#define V4L2_STD_TVOUT_720P_50_TB ((v4l2_std_id)0x15000000)
71#define V4L2_STD_TVOUT_1080P_24_TB ((v4l2_std_id)0x16000000)
72#define V4L2_STD_TVOUT_1080P_23_TB ((v4l2_std_id)0x17000000)
73
74/* ------------- Input ------------------*/
75/* type */
76#define V4L2_INPUT_TYPE_MSDMA 3
77#define V4L2_INPUT_TYPE_FIFO 4
78
79/* TVOUT video */
80#define PFX_NODE_FB "/dev/graphics/fb"
81
82/*******************************************
83 * structures
84 *******************************************/
85
86/* TVOUT */
87struct v4l2_vid_overlay_src {
88 void *base_y;
89 void *base_c;
90 struct v4l2_pix_format pix_fmt;
91};
92
93struct v4l2_window_s5p_tvout {
94 __u32 capability;
95 __u32 flags;
96 __u32 priority;
97 struct v4l2_window win;
98};
99
100struct v4l2_pix_format_s5p_tvout {
101 void *base_y;
102 void *base_c;
103 __u32 src_img_endian;
104 struct v4l2_pix_format pix_fmt;
105};
106
107struct vid_overlay_param {
108 struct v4l2_vid_overlay_src src;
109 struct v4l2_rect src_crop;
110 struct v4l2_framebuffer dst;
111 struct v4l2_window dst_win;
112};
113
114struct tvout_param {
115 struct v4l2_pix_format_s5p_tvout tvout_src;
116 struct v4l2_window_s5p_tvout tvout_rect;
117 struct v4l2_rect tvout_dst;
118};
119
120struct overlay_param {
121 struct v4l2_framebuffer overlay_frame;
122 struct v4l2_window_s5p_tvout overlay_rect;
123 struct v4l2_rect overlay_dst;
124};
125
126/* FB */
127struct s5ptvfb_user_window {
128 int x;
129 int y;
130};
131
132struct s5ptvfb_user_plane_alpha {
133 int channel;
134 unsigned char alpha;
135};
136
137struct s5ptvfb_user_chroma {
138 int enabled;
139 unsigned char red;
140 unsigned char green;
141 unsigned char blue;
142};
143
144enum s5ptvfb_ver_scaling_t {
145 VERTICAL_X1,
146 VERTICAL_X2,
147};
148
149enum s5ptvfb_hor_scaling_t {
150 HORIZONTAL_X1,
151 HORIZONTAL_X2,
152};
153
154struct s5ptvfb_user_scaling {
155 enum s5ptvfb_ver_scaling_t ver;
156 enum s5ptvfb_hor_scaling_t hor;
157};
158
159/*******************************************
160 * custom ioctls
161 *******************************************/
162
163#define VIDIOC_S_BASEADDR _IOR('V', 83, int)
164
165#define VIDIOC_HDCP_ENABLE _IOWR('V', 100, unsigned int)
166#define VIDIOC_HDCP_STATUS _IOR('V', 101, unsigned int)
167#define VIDIOC_HDCP_PROT_STATUS _IOR('V', 102, unsigned int)
168
169#define VIDIOC_INIT_AUDIO _IOR('V', 103, unsigned int)
170#define VIDIOC_AV_MUTE _IOR('V', 104, unsigned int)
171#define VIDIOC_G_AVMUTE _IOR('V', 105, unsigned int)
172#define HPD_GET_STATE _IOR('H', 100, unsigned int)
173
174#define S5PTVFB_WIN_POSITION _IOW('F', 213, struct s5ptvfb_user_window)
175#define S5PTVFB_WIN_SET_PLANE_ALPHA _IOW('F', 214, struct s5ptvfb_user_plane_alpha)
176#define S5PTVFB_WIN_SET_CHROMA _IOW('F', 215, struct s5ptvfb_user_chroma)
177
178#define S5PTVFB_SET_VSYNC_INT _IOW('F', 216, unsigned int)
179#define S5PTVFB_WAITFORVSYNC _IO('F', 32)
180#define S5PTVFB_WIN_SET_ADDR _IOW('F', 219, unsigned int)
181#define S5PTVFB_SET_WIN_ON _IOW('F', 220, unsigned int)
182#define S5PTVFB_SET_WIN_OFF _IOW('F', 221, unsigned int)
183#define S5PTVFB_SCALING _IOW('F', 222, struct s5ptvfb_user_scaling)
184
185#ifdef __cplusplus
186}
187#endif
188
189#endif /* __S5P_TVOUT_H__ */