codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame^] | 1 | /* |
| 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 |
| 24 | extern "C" { |
| 25 | #endif |
| 26 | |
| 27 | /******************************************* |
| 28 | * Define |
| 29 | *******************************************/ |
| 30 | /* TVOUT control */ |
| 31 | #ifdef SAMSUNG_EXYNOS4210 |
| 32 | #define TVOUT_DEV "/dev/video14" |
| 33 | #else |
| 34 | #define TVOUT_DEV "/dev/video16" |
| 35 | #endif |
| 36 | #define HPD_DEV "/dev/HPD" |
| 37 | |
| 38 | /* ------------- Output -----------------*/ |
| 39 | /* type */ |
| 40 | #define V4L2_OUTPUT_TYPE_MSDMA 4 |
| 41 | #define V4L2_OUTPUT_TYPE_COMPOSITE 5 |
| 42 | #define V4L2_OUTPUT_TYPE_SVIDEO 6 |
| 43 | #define V4L2_OUTPUT_TYPE_YPBPR_INERLACED 7 |
| 44 | #define V4L2_OUTPUT_TYPE_YPBPR_PROGRESSIVE 8 |
| 45 | #define V4L2_OUTPUT_TYPE_RGB_PROGRESSIVE 9 |
| 46 | #define V4L2_OUTPUT_TYPE_DIGITAL 10 |
| 47 | #define V4L2_OUTPUT_TYPE_HDMI V4L2_OUTPUT_TYPE_DIGITAL |
| 48 | #define V4L2_OUTPUT_TYPE_HDMI_RGB 11 |
| 49 | #define V4L2_OUTPUT_TYPE_DVI 12 |
| 50 | |
| 51 | /* ------------- STD -------------------*/ |
| 52 | #define V4L2_STD_PAL_BDGHI\ |
| 53 | (V4L2_STD_PAL_B|V4L2_STD_PAL_D|V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_PAL_I) |
| 54 | |
| 55 | #define V4L2_STD_480P_60_16_9 ((v4l2_std_id)0x04000000) |
| 56 | #define V4L2_STD_480P_60_4_3 ((v4l2_std_id)0x05000000) |
| 57 | #define V4L2_STD_576P_50_16_9 ((v4l2_std_id)0x06000000) |
| 58 | #define V4L2_STD_576P_50_4_3 ((v4l2_std_id)0x07000000) |
| 59 | #define V4L2_STD_720P_60 ((v4l2_std_id)0x08000000) |
| 60 | #define V4L2_STD_720P_50 ((v4l2_std_id)0x09000000) |
| 61 | #define V4L2_STD_1080P_60 ((v4l2_std_id)0x0a000000) |
| 62 | #define V4L2_STD_1080P_50 ((v4l2_std_id)0x0b000000) |
| 63 | #define V4L2_STD_1080I_60 ((v4l2_std_id)0x0c000000) |
| 64 | #define V4L2_STD_1080I_50 ((v4l2_std_id)0x0d000000) |
| 65 | #define V4L2_STD_480P_59 ((v4l2_std_id)0x0e000000) |
| 66 | #define V4L2_STD_720P_59 ((v4l2_std_id)0x0f000000) |
| 67 | #define V4L2_STD_1080I_59 ((v4l2_std_id)0x10000000) |
| 68 | #define V4L2_STD_1080P_59 ((v4l2_std_id)0x11000000) |
| 69 | #define V4L2_STD_1080P_30 ((v4l2_std_id)0x12000000) |
| 70 | #define V4L2_STD_TVOUT_720P_60_SBS_HALF ((v4l2_std_id)0x13000000) |
| 71 | #define V4L2_STD_TVOUT_720P_59_SBS_HALF ((v4l2_std_id)0x14000000) |
| 72 | #define V4L2_STD_TVOUT_720P_50_TB ((v4l2_std_id)0x15000000) |
| 73 | #define V4L2_STD_TVOUT_1080P_24_TB ((v4l2_std_id)0x16000000) |
| 74 | #define V4L2_STD_TVOUT_1080P_23_TB ((v4l2_std_id)0x17000000) |
| 75 | |
| 76 | /* TVOUT video */ |
| 77 | #ifdef SAMSUNG_EXYNOS4210 |
| 78 | #define TVOUT_DEV_V "/dev/video21" |
| 79 | #else |
| 80 | #define TVOUT_DEV_V "/dev/video20" |
| 81 | #endif |
| 82 | |
| 83 | /* ------------- Input ------------------*/ |
| 84 | /* type */ |
| 85 | #define V4L2_INPUT_TYPE_MSDMA 3 |
| 86 | #define V4L2_INPUT_TYPE_FIFO 4 |
| 87 | |
| 88 | /* TVOUT video */ |
| 89 | #define PFX_NODE_FB "/dev/graphics/fb" |
| 90 | |
| 91 | /******************************************* |
| 92 | * structures |
| 93 | *******************************************/ |
| 94 | |
| 95 | /* TVOUT */ |
| 96 | struct v4l2_vid_overlay_src { |
| 97 | void *base_y; |
| 98 | void *base_c; |
| 99 | struct v4l2_pix_format pix_fmt; |
| 100 | }; |
| 101 | |
| 102 | struct v4l2_window_s5p_tvout { |
| 103 | __u32 capability; |
| 104 | __u32 flags; |
| 105 | __u32 priority; |
| 106 | struct v4l2_window win; |
| 107 | }; |
| 108 | |
| 109 | struct v4l2_pix_format_s5p_tvout { |
| 110 | void *base_y; |
| 111 | void *base_c; |
| 112 | __u32 src_img_endian; |
| 113 | struct v4l2_pix_format pix_fmt; |
| 114 | }; |
| 115 | |
| 116 | struct vid_overlay_param { |
| 117 | struct v4l2_vid_overlay_src src; |
| 118 | struct v4l2_rect src_crop; |
| 119 | struct v4l2_framebuffer dst; |
| 120 | struct v4l2_window dst_win; |
| 121 | }; |
| 122 | |
| 123 | struct tvout_param { |
| 124 | struct v4l2_pix_format_s5p_tvout tvout_src; |
| 125 | struct v4l2_window_s5p_tvout tvout_rect; |
| 126 | struct v4l2_rect tvout_dst; |
| 127 | }; |
| 128 | |
| 129 | struct overlay_param { |
| 130 | struct v4l2_framebuffer overlay_frame; |
| 131 | struct v4l2_window_s5p_tvout overlay_rect; |
| 132 | struct v4l2_rect overlay_dst; |
| 133 | }; |
| 134 | |
| 135 | /* FB */ |
| 136 | struct s5ptvfb_user_window { |
| 137 | int x; |
| 138 | int y; |
| 139 | }; |
| 140 | |
| 141 | struct s5ptvfb_user_plane_alpha { |
| 142 | int channel; |
| 143 | unsigned char alpha; |
| 144 | }; |
| 145 | |
| 146 | struct s5ptvfb_user_chroma { |
| 147 | int enabled; |
| 148 | unsigned char red; |
| 149 | unsigned char green; |
| 150 | unsigned char blue; |
| 151 | }; |
| 152 | |
| 153 | enum s5ptvfb_ver_scaling_t { |
| 154 | VERTICAL_X1, |
| 155 | VERTICAL_X2, |
| 156 | }; |
| 157 | |
| 158 | enum s5ptvfb_hor_scaling_t { |
| 159 | HORIZONTAL_X1, |
| 160 | HORIZONTAL_X2, |
| 161 | }; |
| 162 | |
| 163 | struct s5ptvfb_user_scaling { |
| 164 | enum s5ptvfb_ver_scaling_t ver; |
| 165 | enum s5ptvfb_hor_scaling_t hor; |
| 166 | }; |
| 167 | |
| 168 | /******************************************* |
| 169 | * custom ioctls |
| 170 | *******************************************/ |
| 171 | |
| 172 | #define VIDIOC_S_BASEADDR _IOR('V', 83, int) |
| 173 | |
| 174 | #define VIDIOC_HDCP_ENABLE _IOWR('V', 100, unsigned int) |
| 175 | #define VIDIOC_HDCP_STATUS _IOR('V', 101, unsigned int) |
| 176 | #define VIDIOC_HDCP_PROT_STATUS _IOR('V', 102, unsigned int) |
| 177 | |
| 178 | #define VIDIOC_INIT_AUDIO _IOR('V', 103, unsigned int) |
| 179 | #define VIDIOC_AV_MUTE _IOR('V', 104, unsigned int) |
| 180 | #define VIDIOC_G_AVMUTE _IOR('V', 105, unsigned int) |
| 181 | #define HPD_GET_STATE _IOR('H', 100, unsigned int) |
| 182 | |
| 183 | #define S5PTVFB_WIN_POSITION _IOW('F', 213, struct s5ptvfb_user_window) |
| 184 | #define S5PTVFB_WIN_SET_PLANE_ALPHA _IOW('F', 214, struct s5ptvfb_user_plane_alpha) |
| 185 | #define S5PTVFB_WIN_SET_CHROMA _IOW('F', 215, struct s5ptvfb_user_chroma) |
| 186 | |
| 187 | #define S5PTVFB_SET_VSYNC_INT _IOW('F', 216, unsigned int) |
| 188 | #define S5PTVFB_WAITFORVSYNC _IO('F', 32) |
| 189 | #define S5PTVFB_WIN_SET_ADDR _IOW('F', 219, unsigned int) |
| 190 | #define S5PTVFB_SET_WIN_ON _IOW('F', 220, unsigned int) |
| 191 | #define S5PTVFB_SET_WIN_OFF _IOW('F', 221, unsigned int) |
| 192 | #define S5PTVFB_SCALING _IOW('F', 222, struct s5ptvfb_user_scaling) |
| 193 | |
| 194 | #ifdef __cplusplus |
| 195 | } |
| 196 | #endif |
| 197 | |
| 198 | #endif /* __S5P_TVOUT_H__ */ |