Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Side by Side Diff: drivers/media/video/samsung/tv20/s5p_tv.h

Issue 2036011: V4L/DVB : Add S5PV210 TV out driver support (Closed) Base URL: swsolcc@12.23.106.100:kernel-samsung.git
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /* linux/drivers/media/video/samsung/tv20/s5p_tv.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - TV out driver header file for Samsung TVOut driver
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13 #include <linux/fs.h>
14 #include <linux/interrupt.h>
15 #include <linux/videodev2.h>
16 #include <linux/platform_device.h>
17 #include <linux/fb.h>
18
19 #include "tv_out_s5pv210.h"
20
21 /* #define CONFIG_TVOUT_DBG */
22
23 #define V4L2_STD_ALL_HD ((v4l2_std_id)0xffffffff)
24
25 #define TVOUT_MINOR_TVOUT 14 /* TVOUT VIDEO OUT */
26 #define TVOUT_MINOR_VID 21 /* VIDEO OVERLAY */
27
28 #define USE_VMIXER_INTERRUPT 1
29
30 #define AVI_RGB_IF (0x0<<5)
31 #define AVI_YCBCR444_IF (0x2<<5)
32
33 #define AVI_ITU601 (0x1<<6)
34 #define AVI_ITU709 (0x2<<6)
35
36 #define AVI_PAR_4_3 (0x1<<4)
37 #define AVI_PAR_16_9 (0x2<<4)
38
39 #define AVI_NO_PIXEL_REPEAT (0x0<<0)
40
41 /* The below definition is for V4L2 Tile NV12 color format */
42 #define V4L2_PIX_FMT_NV12T v4l2_fourcc('T', 'V', '1', '2')
43
44 #define AVI_VIC_2 (2<<0) /* 720x480p@59.94/60Hz 4:3 */
45 #define AVI_VIC_3 (3<<0) /* 720x480p@59.94/60Hz 16:9 */
46 #define AVI_VIC_4 (4<<0) /* 1280x720p@59.94/60Hz 16:9 */
47 #define AVI_VIC_5 (5<<0) /* 1920x1080i@59.94/60Hz 16:9 */
48 #define AVI_VIC_16 (16<<0) /* 1920x1080p@60Hz 16:9 */
49 #define AVI_VIC_17 (17<<0) /* 720x576p@50Hz 4:3 */
50 #define AVI_VIC_18 (18<<0) /* 720x576p@50Hz 16:9 */
51 #define AVI_VIC_19 (19<<0) /* 1280x720p@50Hz 16:9 */
52 #define AVI_VIC_20 (20<<0) /* 1920x1080i@50Hz 16:9 */
53 #define AVI_VIC_31 (31<<0) /* 1920x1080p@50Hz */
54 #define AVI_VIC_34 (34<<0) /* 1920x1080p@30Hz */
55
56 #define VP_UPDATE_RETRY_MAXIMUM 30
57 #define VP_WAIT_UPDATE_SLEEP 3
58
59 struct tvout_output_if {
60 enum s5p_tv_disp_mode disp_mode;
61 enum s5p_tv_o_mode out_mode;
62 };
63
64 struct s5p_img_size {
65 u32 img_width;
66 u32 img_height;
67 };
68
69 struct s5p_img_offset {
70 u32 offset_x;
71 u32 offset_y;
72 };
73
74 /*
75 * Video Layer Data
76 */
77 struct s5p_video_img_address {
78 u32 y_address;
79 u32 c_address;
80 };
81
82 struct s5p_vl_mode {
83 bool line_skip;
84 enum s5p_vp_mem_mode mem_mode;
85 enum s5p_vp_chroma_expansion chroma_exp;
86 enum s5p_vp_filed_id_toggle toggle_id;
87 };
88
89 struct s5p_vl_sharpness {
90 u32 th_noise;
91 enum s5p_vp_sharpness_control sharpness;
92 };
93
94 struct s5p_vl_csc_ctrl {
95 bool sub_y_offset_en;
96 bool csc_en;
97 };
98
99 struct s5p_video_poly_filter_coef {
100 enum s5p_vp_poly_coeff poly_coeff;
101 signed char ch0;
102 signed char ch1;
103 signed char ch2;
104 signed char ch3;
105 };
106
107 struct s5p_vl_bright_contrast_ctrl {
108 enum s5p_vp_line_eq eq_num;
109 u32 intc;
110 u32 slope;
111 };
112
113 struct s5p_video_csc_coef {
114 enum s5p_vp_csc_coeff csc_coeff;
115 u32 coeff;
116 };
117
118 struct s5p_vl_param {
119 bool win_blending;
120 u32 alpha;
121 u32 priority;
122 u32 top_y_address;
123 u32 top_c_address;
124 enum s5p_endian_type src_img_endian;
125 u32 img_width;
126 u32 img_height;
127 u32 src_offset_x;
128 u32 src_offset_y;
129 u32 src_width;
130 u32 src_height;
131 u32 dest_offset_x;
132 u32 dest_offset_y;
133 u32 dest_width;
134 u32 dest_height;
135 };
136
137 /*
138 * GRP Layer Data
139 */
140 struct s5p_tv_vo {
141 u32 index;
142 struct v4l2_framebuffer fb;
143 struct v4l2_window win;
144 struct v4l2_rect dst_rect;
145 bool win_blending;
146 bool blank_change;
147 bool pixel_blending;
148 bool pre_mul;
149 u32 blank_color;
150 u32 priority;
151 u32 base_addr;
152 };
153
154 /*
155 *BG Layer Data
156 */
157 struct s5p_bg_dither {
158 bool cr_dither_en;
159 bool cb_dither_en;
160 bool y_dither_en;
161 };
162
163 struct s5p_bg_color {
164 u32 color_y;
165 u32 color_cb;
166 u32 color_cr;
167 };
168
169 /*
170 * Video Mixer Data
171 */
172 struct s5p_vm_csc_coef {
173 enum s5p_yuv_fmt_component component;
174 enum s5p_tv_coef_y_mode mode;
175 u32 coeff_0;
176 u32 coeff_1;
177 u32 coeff_2;
178 };
179
180 /*
181 * SDout Data
182 */
183 struct s5p_sdout_order {
184 enum s5p_sd_order order;
185 bool dac[3];
186 };
187
188 struct s5p_sd_vscale_cfg {
189 enum s5p_sd_level component_level;
190 enum s5p_sd_vsync_ratio component_ratio;
191 enum s5p_sd_level composite_level;
192 enum s5p_sd_vsync_ratio composite_ratio;
193 };
194
195 struct s5p_sd_vbi {
196 bool wss_cvbs;
197 enum s5p_sd_closed_caption_type caption_cvbs;
198 bool wss_y_svideo;
199 enum s5p_sd_closed_caption_type caption_y_svideo;
200 bool cgmsa_rgb;
201 bool wss_rgb;
202 enum s5p_sd_closed_caption_type caption_rgb;
203 bool cgmsa_y_pb_pr;
204 bool wss_y_pb_pr;
205 enum s5p_sd_closed_caption_type caption_y_pb_pr;
206 };
207
208 struct s5p_sd_offset_gain {
209 enum s5p_sd_channel_sel channel;
210 u32 offset;
211 u32 gain;
212 };
213
214 struct s5p_sd_delay {
215 u32 delay_y;
216 u32 offset_video_start;
217 u32 offset_video_end;
218 };
219
220 struct s5p_sd_bright_hue_saturat {
221 bool bright_hue_sat_adj;
222 u32 gain_brightness;
223 u32 offset_brightness;
224 u32 gain0_cb_hue_saturation;
225 u32 gain1_cb_hue_saturation;
226 u32 gain0_cr_hue_saturation;
227 u32 gain1_cr_hue_saturation;
228 u32 offset_cb_hue_saturation;
229 u32 offset_cr_hue_saturation;
230 };
231
232 struct s5p_sd_rgb_compensat {
233 bool rgb_color_compensation;
234 u32 max_rgb_cube;
235 u32 min_rgb_cube;
236 };
237
238 struct s5p_sd_cvbs_compensat {
239 bool cvbs_color_compensation;
240 u32 y_lower_mid;
241 u32 y_bottom;
242 u32 y_top;
243 u32 y_upper_mid;
244 u32 radius;
245 };
246
247 struct s5p_sd_svideo_compensat {
248 bool y_color_compensation;
249 u32 y_top;
250 u32 y_bottom;
251 u32 yc_cylinder;
252 };
253
254 struct s5p_sd_component_porch {
255 u32 back_525;
256 u32 front_525;
257 u32 back_625;
258 u32 front_625;
259 };
260
261 struct s5p_sd_vesa_rgb_sync {
262 enum s5p_sd_vesa_rgb_sync_type sync_type;
263 enum s5p_tv_active_polarity vsync_active;
264 enum s5p_tv_active_polarity hsync_active;
265 };
266
267 struct s5p_sd_ch_xtalk_cancellat_coeff {
268 enum s5p_sd_channel_sel channel;
269 u32 coeff1;
270 u32 coeff2;
271 };
272
273 struct s5p_sd_closed_caption {
274 u32 display_cc;
275 u32 nondisplay_cc;
276 };
277
278 struct s5p_sd_525_data {
279 bool analog_on;
280 enum s5p_sd_525_copy_permit copy_permit;
281 enum s5p_sd_525_mv_psp mv_psp;
282 enum s5p_sd_525_copy_info copy_info;
283 enum s5p_sd_525_aspect_ratio display_ratio;
284 };
285
286 struct s5p_sd_625_data {
287 bool surroun_f_sound;
288 bool copyright;
289 bool copy_protection;
290 bool text_subtitles;
291 enum s5p_sd_625_subtitles open_subtitles;
292 enum s5p_sd_625_camera_film camera_film;
293 enum s5p_sd_625_color_encoding color_encoding;
294 bool helper_signal;
295 enum s5p_sd_625_aspect_ratio display_ratio;
296 };
297
298 /*
299 * HDMI video Data
300 */
301 struct s5p_hdmi_bluescreen {
302 bool enable;
303 u8 cb_b;
304 u8 y_g;
305 u8 cr_r;
306 };
307
308 struct s5p_hdmi_color_range {
309 u8 y_min;
310 u8 y_max;
311 u8 c_min;
312 u8 c_max;
313 };
314
315 struct s5p_hdmi_video_infoframe {
316 enum s5p_hdmi_transmit trans_type;
317 u8 check_sum;
318 u8 *data;
319 };
320
321 struct s5p_hdmi_tg_cmd {
322 bool timing_correction_en;
323 bool bt656_sync_en;
324 bool tg_en;
325 };
326
327 struct s5p_hdmi_spd_infoframe {
328 enum s5p_hdmi_transmit trans_type;
329 u8 *spd_header;
330 u8 *spd_data;
331 };
332
333 /*
334 * TVout API Data
335 */
336 struct s5p_tv_v4l2 {
337 struct v4l2_output *output;
338 struct v4l2_standard *std;
339 struct v4l2_format *fmt_v;
340 struct v4l2_format *fmt_vo_0;
341 struct v4l2_format *fmt_vo_1;
342 };
343
344 #define S5PTVFB_AVALUE(r, g, b) \
345 (((r & 0xf) << 8) | ((g & 0xf) << 4) | ((b & 0xf) << 0))
346 #define S5PTVFB_CHROMA(r, g, b) \
347 (((r & 0xff) << 16) | ((g & 0xff) << 8) | ((b & 0xff) << 0))
348
349 #define S5PTVFB_WIN_POSITION \
350 _IOW('F', 213, struct s5ptvfb_user_window)
351 #define S5PTVFB_WIN_SET_PLANE_ALPHA \
352 _IOW('F', 214, struct s5ptvfb_user_plane_alpha)
353 #define S5PTVFB_WIN_SET_CHROMA \
354 _IOW('F', 215, struct s5ptvfb_user_chroma)
355 #define S5PTVFB_WAITFORVSYNC \
356 _IO('F', 32)
357 #define S5PTVFB_SET_VSYNC_INT \
358 _IOW('F', 216, u32)
359 #define S5PTVFB_POWER_OFF \
360 _IOW('F', 217, u32)
361 #define S5PTVFB_POWER_ON \
362 _IOW('F', 218, u32)
363 #define S5PTVFB_WIN_SET_ADDR \
364 _IOW('F', 219, u32)
365 #define S5PTVFB_SET_WIN_ON \
366 _IOW('F', 220, u32)
367 #define S5PTVFB_SET_WIN_OFF \
368 _IOW('F', 221, u32)
369
370 enum s5ptvfb_data_path_t {
371 DATA_PATH_FIFO = 0,
372 DATA_PATH_DMA = 1,
373 };
374
375 enum s5ptvfb_alpha_t {
376 PLANE_BLENDING,
377 PIXEL_BLENDING,
378 };
379
380 enum s5ptvfb_chroma_dir_t {
381 CHROMA_FG,
382 CHROMA_BG,
383 };
384
385 struct s5ptvfb_alpha {
386 enum s5ptvfb_alpha_t mode;
387 int channel;
388 unsigned int value;
389 };
390
391 struct s5ptvfb_chroma {
392 int enabled;
393 int blended;
394 unsigned int key;
395 unsigned int comp_key;
396 unsigned int alpha;
397 enum s5ptvfb_chroma_dir_t dir;
398 };
399
400 struct s5ptvfb_user_window {
401 int x;
402 int y;
403 };
404
405 struct s5ptvfb_user_plane_alpha {
406 int channel;
407 unsigned char red;
408 unsigned char green;
409 unsigned char blue;
410 };
411
412 struct s5ptvfb_user_chroma {
413 int enabled;
414 unsigned char red;
415 unsigned char green;
416 unsigned char blue;
417 };
418
419 struct s5ptvfb_window {
420 int id;
421 int enabled;
422 atomic_t in_use;
423 int x;
424 int y;
425 enum s5ptvfb_data_path_t path;
426 int local_channel;
427 int dma_burst;
428 unsigned int pseudo_pal[16];
429 struct s5ptvfb_alpha alpha;
430 struct s5ptvfb_chroma chroma;
431 int (*suspend_fifo)(void);
432 int (*resume_fifo)(void);
433 };
434
435 struct s5ptvfb_lcd_timing {
436 int h_fp;
437 int h_bp;
438 int h_sw;
439 int v_fp;
440 int v_fpe;
441 int v_bp;
442 int v_bpe;
443 int v_sw;
444 };
445
446 struct s5ptvfb_lcd_polarity {
447 int rise_vclk;
448 int inv_hsync;
449 int inv_vsync;
450 int inv_vden;
451 };
452
453 struct s5ptvfb_lcd {
454 int width;
455 int height;
456 int bpp;
457 int freq;
458 struct s5ptvfb_lcd_timing timing;
459 struct s5ptvfb_lcd_polarity polarity;
460
461 void (*init_ldi)(void);
462 };
463
464 struct s5p_tv_status {
465 /* TVOUT_SET_INTERFACE_PARAM */
466 bool tvout_param_available;
467 struct tvout_output_if tvout_param;
468
469 /* TVOUT_SET_OUTPUT_ENABLE/DISABLE */
470 bool tvout_output_enable;
471
472 /* TVOUT_SET_LAYER_MODE/POSITION */
473 bool vl_mode;
474 bool grp_mode[2];
475
476 /* Video Layer Parameters */
477 struct s5p_vl_param vl_basic_param;
478 struct s5p_vl_mode vl_op_mode;
479 struct s5p_vl_sharpness vl_sharpness;
480 struct s5p_vl_csc_ctrl vl_csc_control;
481 struct s5p_vl_bright_contrast_ctrl vl_bc_control[8];
482
483 enum s5p_vp_src_color src_color;
484 enum s5p_vp_field field_id;
485 enum s5p_vp_pxl_rate vl_rate;
486 enum s5p_vp_csc_type vl_csc_type;
487
488 u32 vl_top_y_address;
489 u32 vl_top_c_address;
490 u32 vl_bottom_y_address;
491 u32 vl_bottom_c_address;
492 u32 vl_src_offset_x;
493 u32 vl_src_x_fact_step;
494 u32 vl_src_offset_y;
495 u32 vl_src_width;
496 u32 vl_src_height;
497 u32 vl_dest_offset_x;
498 u32 vl_dest_offset_y;
499 u32 vl_dest_width;
500 u32 vl_dest_height;
501 bool vl2d_ipc;
502
503 bool vl_poly_filter_default;
504 bool vl_bypass_post_process;
505 u32 vl_saturation;
506 bool us_vl_brightness;
507 u8 vl_contrast;
508 u32 vl_bright_offset;
509 bool vl_csc_coef_default;
510
511 /* GRP Layer Common Parameters */
512 enum s5p_vmx_burst_mode grp_burst;
513 enum s5p_endian_type grp_endian;
514
515 /* BackGroung Layer Parameters */
516 struct s5p_bg_dither bg_dither;
517 struct s5p_bg_color bg_color[3];
518
519 /* Video Mixer Parameters */
520 bool vm_csc_coeff_default;
521
522 /* SDout Parameters */
523 struct s5p_sd_vscale_cfg sdout_video_scale_cfg;
524 struct s5p_sd_vbi sdout_vbi;
525 struct s5p_sd_offset_gain sdout_offset_gain[3];
526 struct s5p_sd_delay sdout_delay;
527 struct s5p_sd_bright_hue_saturat sdout_bri_hue_set;
528 struct s5p_sd_rgb_compensat sdout_rgb_compen;
529 struct s5p_sd_cvbs_compensat sdout_cvbs_compen;
530 struct s5p_sd_svideo_compensat sdout_svideo_compen;
531 struct s5p_sd_component_porch sdout_comp_porch;
532 struct s5p_sd_vesa_rgb_sync sdout_rgb_sync;
533 struct s5p_sd_ch_xtalk_cancellat_coeff sdout_xtalk_cc[3];
534 struct s5p_sd_closed_caption sdout_closed_capt;
535 struct s5p_sd_525_data sdout_wss_525;
536 struct s5p_sd_625_data sdout_wss_625;
537 struct s5p_sd_525_data sdout_cgms_525;
538 struct s5p_sd_625_data sdout_cgms_625;
539
540 enum s5p_sd_order sdout_order;
541 enum s5p_sd_sync_sig_pin sdout_sync_pin;
542
543 bool sdout_color_sub_carrier_phase_adj;
544 bool sdout_dac_on[3];
545 bool sdout_y_pb_pr_comp;
546
547 /* HDMI video parameters */
548 struct s5p_hdmi_bluescreen hdmi_video_blue_screen;
549 struct s5p_hdmi_color_range hdmi_color_range;
550 struct s5p_hdmi_video_infoframe hdmi_av_info_frame;
551 struct s5p_hdmi_video_infoframe hdmi_mpg_info_frame;
552 struct s5p_hdmi_tg_cmd hdmi_tg_cmd;
553 u8 avi_byte[13];
554 u8 mpg_byte[5];
555
556 /* HDMI parameters */
557 struct s5p_hdmi_spd_infoframe hdmi_spd_info_frame;
558 u8 spd_header[3];
559 u8 spd_data[28];
560 bool hdcp_en;
561 enum s5p_hdmi_audio_type hdmi_audio_type;
562 bool hpd_status;
563
564 /* TVOUT_SET_LAYER_ENABLE/DISABLE */
565 bool vp_layer_enable;
566 bool grp_layer_enable[2];
567
568 /* i2c for hdcp port */
569
570 struct i2c_client *hdcp_i2c_client;
571
572 struct s5p_tv_vo overlay[2];
573
574 struct video_device *video_dev[3];
575
576 struct clk *tvenc_clk;
577 struct clk *vp_clk;
578 struct clk *mixer_clk;
579 struct clk *hdmi_clk;
580 struct clk *i2c_phy_clk;
581 struct clk *sclk_tv;
582 struct clk *sclk_hdmi;
583 struct clk *sclk_mixer;
584
585 struct s5p_tv_v4l2 v4l2;
586
587 struct s5ptvfb_window win;
588 struct fb_info *fb;
589 struct device *dev_fb;
590
591 struct s5ptvfb_lcd *lcd;
592 struct mutex fb_lock;
593 };
594
595 /* Interrupt for Vsync */
596 extern wait_queue_head_t s5ptv_wq;
597
598 /* F R A M E B U F F E R */
599 #define S5PTVFB_NAME "s5ptvfb"
600
601 /*
602 * V4L2 TVOUT EXTENSIONS
603 *
604 */
605 /* Input */
606 #define V4L2_INPUT_TYPE_MSDMA 3
607 #define V4L2_INPUT_TYPE_FIFO 4
608
609 /* Output */
610 #define V4L2_OUTPUT_TYPE_MSDMA 4
611 #define V4L2_OUTPUT_TYPE_COMPOSITE 5
612 #define V4L2_OUTPUT_TYPE_SVIDEO 6
613 #define V4L2_OUTPUT_TYPE_YPBPR_INERLACED 7
614 #define V4L2_OUTPUT_TYPE_YPBPR_PROGRESSIVE 8
615 #define V4L2_OUTPUT_TYPE_RGB_PROGRESSIVE 9
616 #define V4L2_OUTPUT_TYPE_DIGITAL 10
617 #define V4L2_OUTPUT_TYPE_HDMI V4L2_OUTPUT_TYPE_DIGITAL
618 #define V4L2_OUTPUT_TYPE_HDMI_RGB 11
619 #define V4L2_OUTPUT_TYPE_DVI 12
620
621 /* STD */
622 #define V4L2_STD_PAL_BDGHI (V4L2_STD_PAL_B| \
623 V4L2_STD_PAL_D| \
624 V4L2_STD_PAL_G| \
625 V4L2_STD_PAL_H| \
626 V4L2_STD_PAL_I)
627
628 #define V4L2_STD_480P_60_16_9 ((v4l2_std_id)0x04000000)
629 #define V4L2_STD_480P_60_4_3 ((v4l2_std_id)0x05000000)
630 #define V4L2_STD_576P_50_16_9 ((v4l2_std_id)0x06000000)
631 #define V4L2_STD_576P_50_4_3 ((v4l2_std_id)0x07000000)
632 #define V4L2_STD_720P_60 ((v4l2_std_id)0x08000000)
633 #define V4L2_STD_720P_50 ((v4l2_std_id)0x09000000)
634 #define V4L2_STD_1080P_60 ((v4l2_std_id)0x0a000000)
635 #define V4L2_STD_1080P_50 ((v4l2_std_id)0x0b000000)
636 #define V4L2_STD_1080I_60 ((v4l2_std_id)0x0c000000)
637 #define V4L2_STD_1080I_50 ((v4l2_std_id)0x0d000000)
638 #define V4L2_STD_480P_59 ((v4l2_std_id)0x0e000000)
639 #define V4L2_STD_720P_59 ((v4l2_std_id)0x0f000000)
640 #define V4L2_STD_1080I_59 ((v4l2_std_id)0x10000000)
641 #define V4L2_STD_1080P_59 ((v4l2_std_id)0x11000000)
642 #define V4L2_STD_1080P_30 ((v4l2_std_id)0x12000000)
643
644 #define FORMAT_FLAGS_DITHER 0x01
645 #define FORMAT_FLAGS_PACKED 0x02
646 #define FORMAT_FLAGS_PLANAR 0x04
647 #define FORMAT_FLAGS_RAW 0x08
648 #define FORMAT_FLAGS_CrCb 0x10
649
650 /* ext. param */
651 #define V4L2_FBUF_FLAG_PRE_MULTIPLY 0x0040
652 #define V4L2_FBUF_CAP_PRE_MULTIPLY 0x0080
653
654 struct v4l2_window_s5p_tvout {
655 u32 capability;
656 u32 flags;
657 u32 priority;
658
659 struct v4l2_window win;
660 };
661
662 struct v4l2_pix_format_s5p_tvout {
663 void *base_y;
664 void *base_c;
665 bool src_img_endian;
666
667 struct v4l2_pix_format pix_fmt;
668 };
669
670 extern const struct v4l2_ioctl_ops s5p_tv_v4l2_v_ops;
671 extern const struct v4l2_ioctl_ops s5p_tv_v4l2_vo_ops;
672 extern const struct v4l2_ioctl_ops s5p_tv_v4l2_ops;
673 extern const struct v4l2_ioctl_ops s5p_tv_v4l2_vid_ops;
674
675 extern struct s5p_tv_status s5ptv_status;
676
677 extern void s5p_tv_v4l2_init_param(void);
678
679 extern long s5p_tv_ioctl(struct file *file, u32 cmd, unsigned long arg);
680 extern long s5p_tv_vid_ioctl(struct file *file, u32 cmd, unsigned long arg);
681 extern long s5p_tv_v_ioctl(struct file *file, u32 cmd, unsigned long arg);
682 extern long s5p_tv_vo_ioctl(struct file *file, u32 cmd, unsigned long arg);
683
684 /*
685 * STDA layer api - must be refine!!
686 *
687 */
688
689 int __init tv_hdmi_probe(
690 struct platform_device *pdev, u32 res_num, u32 res_num2);
691 int tv_hdmi_phy_power(bool on);
692
693 int __init tv_sdout_probe(struct platform_device *pdev, u32 res_num);
694 int __init tv_mixer_probe(struct platform_device *pdev, u32 res_num);
695 int __init tv_vp_probe(struct platform_device *pdev, u32 res_num);
696
697 int __init tv_hdmi_release(struct platform_device *pdev);
698 int __init tv_sdout_release(struct platform_device *pdev);
699 int __init tv_mixer_release(struct platform_device *pdev);
700 int __init tv_vp_release(struct platform_device *pdev);
701
702 /* GRP */
703 extern bool tv_grp_api_proc(unsigned long arg, u32 cmd);
704 extern bool tv_grp_init_param(
705 enum s5p_tv_vmx_layer vm_layer, unsigned long p_buf_in);
706 extern bool tv_grp_start(enum s5p_tv_vmx_layer vmLayer);
707 extern bool tv_grp_stop(enum s5p_tv_vmx_layer vmLayer);
708
709 /* TVOUT_IF */
710 extern bool tv_if_api_proc(unsigned long arg, u32 cmd);
711 extern bool tv_if_init_param(void);
712 extern bool tv_if_start(void);
713 extern bool tv_if_stop(void);
714 extern bool tv_if_set_disp(void);
715
716 /* Video Layer */
717 extern bool tv_vlayer_set_blending(unsigned long p_buf_in);
718 extern bool tv_vlayer_set_alpha(unsigned long p_buf_in);
719 extern bool tv_vlayer_api_proc(unsigned long arg, u32 cmd);
720 extern bool tv_vlayer_init_param(unsigned long p_buf_in);
721 extern bool tv_vlayer_set_priority(unsigned long p_buf_in);
722 extern bool tv_vlayer_set_field_id(unsigned long p_buf_in);
723 extern bool tv_vlayer_set_top_address(unsigned long p_buf_in);
724 extern bool tv_vlayer_set_bottom_address(unsigned long p_buf_in);
725 extern bool tv_vlayer_set_img_size(unsigned long p_buf_in);
726 extern bool tv_vlayer_set_src_position(unsigned long p_buf_in);
727 extern bool tv_vlayer_set_dest_position(unsigned long p_buf_in);
728 extern bool tv_vlayer_set_src_size(unsigned long p_buf_in);
729 extern bool tv_vlayer_set_dest_size(unsigned long p_buf_in);
730 extern bool tv_vlayer_set_brightness(unsigned long p_buf_in);
731 extern bool tv_vlayer_set_contrast(unsigned long p_buf_in);
732 extern void tv_vlayer_get_priority(unsigned long p_buf_out);
733 extern bool tv_vlayer_set_brightness_contrast_control(
734 unsigned long p_buf_in);
735 extern bool tv_vlayer_set_poly_filter_coef(unsigned long p_buf_in);
736 extern bool tv_vlayer_set_csc_coef(unsigned long p_buf_in);
737 extern bool tv_vlayer_start(void);
738 extern bool tv_vlayer_stop(void);
739
740 /*
741 * raw i/o ftn!!
742 *
743 */
744 /* HDCP */
745 irqreturn_t tv_hdmi_irq(int irq, void *dev_id);
746 void tv_set_hpd_detection(u32 detection_type, bool hdcp_enabled,
747 struct i2c_client *client);
748 bool tv_start_hdcp(void);
749 bool tv_stop_hdcp(void);
750 void tv_hdcp_reset(void);
751
752 /* HDMI */
753 void tv_hdmi_set_hpd_onoff(bool on_off);
754 void tv_hdmi_audio_set_config(enum s5p_tv_audio_codec_type audio_codec);
755 void tv_hdmi_audio_set_acr(u32 sample_rate);
756 void tv_hdmi_audio_set_asp(void);
757 void tv_hdmi_audio_clock_enable(void);
758 void tv_hdmi_audio_set_repetition_time(
759 enum s5p_tv_audio_codec_type audio_codec,
760 u32 bits, u32 frame_size_code);
761 void tv_hdmi_audio_irq_enable(u32 irq_en);
762 void tv_hdmi_audio_set_aui(enum s5p_tv_audio_codec_type audio_codec,
763 u32 sample_rate, u32 bits);
764 void tv_hdmi_video_set_bluescreen(bool en, u8 cb, u8 y_g, u8 cr_r);
765 enum s5p_tv_hdmi_err tv_hdmi_init_spd_infoframe(
766 enum s5p_hdmi_transmit trans_type,
767 u8 *spd_header, u8 *spd_data);
768 void tv_hdmi_init_hpd_onoff(bool on_off);
769 enum s5p_tv_hdmi_err tv_hdmi_audio_init(
770 enum s5p_tv_audio_codec_type audio_codec,
771 u32 sample_rate, u32 bits, u32 frame_size_code);
772 enum s5p_tv_hdmi_err tv_hdmi_video_init_display_mode(
773 enum s5p_tv_disp_mode disp_mode, enum s5p_tv_o_mode out_mode);
774 void tv_hdmi_video_init_bluescreen(bool en, u8 cb, u8 y_g, u8 cr_r);
775 void tv_hdmi_video_init_color_range(u8 y_min, u8 y_max,
776 u8 c_min, u8 c_max);
777 enum s5p_tv_hdmi_err tv_hdmi_video_init_csc(enum s5p_tv_hdmi_csc_type csc_type);
778 enum s5p_tv_hdmi_err tv_hdmi_video_init_avi_infoframe(
779 enum s5p_hdmi_transmit trans_type, u8 check_sum, u8 *pavi_data);
780 enum s5p_tv_hdmi_err tv_hdmi_video_init_mpg_infoframe(
781 enum s5p_hdmi_transmit trans_type, u8 check_sum, u8 *pmpg_data);
782 void tv_hdmi_video_init_tg_cmd(bool t_correction_en,
783 bool BT656_sync_en, bool tg_en);
784 bool tv_hdmi_start(enum s5p_hdmi_audio_type hdmi_audio_type,
785 bool HDCP_en, struct i2c_client *ddc_port);
786 void tv_hdmi_stop(void);
787
788 /* SDOUT */
789 enum s5p_tv_sd_err tv_sdout_init_video_scale_cfg(
790 enum s5p_sd_level component_level,
791 enum s5p_sd_vsync_ratio component_ratio,
792 enum s5p_sd_level composite_level,
793 enum s5p_sd_vsync_ratio composite_ratio);
794 enum s5p_tv_sd_err tv_sdout_init_sync_signal_pin(enum s5p_sd_sync_sig_pin pin);
795 enum s5p_tv_sd_err tv_sdout_init_vbi(bool wss_cvbs,
796 enum s5p_sd_closed_caption_type caption_cvbs, bool wss_y_sideo,
797 enum s5p_sd_closed_caption_type caption_y_sideo, bool cgmsa_rgb,
798 bool wss_rgb, enum s5p_sd_closed_caption_type caption_rgb,
799 bool cgmsa_y_ppr, bool wss_y_ppr,
800 enum s5p_sd_closed_caption_type caption_y_ppr);
801 enum s5p_tv_sd_err tv_sdout_init_offset_gain(
802 enum s5p_sd_channel_sel channel, u32 offset, u32 gain);
803 void tv_sdout_init_delay(
804 u32 delay_y, u32 offset_video_start, u32 offset_video_end);
805 void tv_sdout_init_schlock(bool color_sucarrier_pha_adj);
806 enum s5p_tv_sd_err tv_sdout_init_dac_power_onoff(
807 enum s5p_sd_channel_sel channel, bool dac_on);
808 void tv_sdout_init_color_compensaton_onoff(bool bright_hue_saturation_adj,
809 bool y_ppr_color_compensation, bool rgb_color_compensation,
810 bool y_c_color_compensation, bool y_cvbs_color_compensation);
811 void tv_sdout_init_brightness_hue_saturation(u32 gain_brightness,
812 u32 offset_brightness, u32 gain0_cb_hue_saturation,
813 u32 gain1_cb_hue_saturation, u32 gain0_cr_hue_saturation,
814 u32 gain1_cr_hue_saturation, u32 offset_cb_hue_saturation,
815 u32 offset_cr_hue_saturation);
816 void tv_sdout_init_rgb_color_compensation(
817 u32 max_rgb_cube, u32 min_rgb_cube);
818 void tv_sdout_init_cvbs_color_compensation(u32 y_lower_mid, u32 y_bottom,
819 u32 y_top, u32 y_upper_mid, u32 radius);
820 void tv_sdout_init_svideo_color_compensation(u32 y_top, u32 y_bottom,
821 u32 y_c_cylinder);
822 void tv_sdout_init_component_porch(u32 back_525, u32 front_525,
823 u32 back_625, u32 front_625);
824 enum s5p_tv_sd_err tv_sdout_init_vesa_rgb_sync(
825 enum s5p_sd_vesa_rgb_sync_type sync_type,
826 enum s5p_tv_active_polarity v_sync_active,
827 enum s5p_tv_active_polarity h_sync_active);
828 void tv_sdout_init_oversampling_filter_coeff(
829 u32 size, u32 *pcoeff0, u32 *pcoeff1, u32 *pcoeff2);
830 enum s5p_tv_sd_err tv_sdout_init_ch_xtalk_cancel_coef(
831 enum s5p_sd_channel_sel channel, u32 coeff2, u32 coeff1);
832 void tv_sdout_init_closed_caption(u32 display_cc, u32 non_display_cc);
833 enum s5p_tv_sd_err tv_sdout_init_wss525_data(
834 enum s5p_sd_525_copy_permit copy_permit, enum s5p_sd_525_mv_psp mv_psp,
835 enum s5p_sd_525_copy_info copy_info, bool analog_on,
836 enum s5p_sd_525_aspect_ratio display_ratio);
837 enum s5p_tv_sd_err tv_sdout_init_wss625_data(bool surround_sound,
838 bool copyright, bool copy_protection, bool text_subtitles,
839 enum s5p_sd_625_subtitles open_subtitles,
840 enum s5p_sd_625_camera_film camera_film,
841 enum s5p_sd_625_color_encoding color_encoding, bool helper_signal,
842 enum s5p_sd_625_aspect_ratio display_ratio);
843 enum s5p_tv_sd_err tv_sdout_init_cgmsa525_data(
844 enum s5p_sd_525_copy_permit copy_permit, enum s5p_sd_525_mv_psp mv_psp,
845 enum s5p_sd_525_copy_info copy_info, bool analog_on,
846 enum s5p_sd_525_aspect_ratio display_ratio);
847 enum s5p_tv_sd_err tv_sdout_init_cgmsa625_data(bool surround_sound,
848 bool copyright, bool copy_protection, bool text_subtitles,
849 enum s5p_sd_625_subtitles open_subtitles,
850 enum s5p_sd_625_camera_film camera_film,
851 enum s5p_sd_625_color_encoding color_encoding, bool helper_signal,
852 enum s5p_sd_625_aspect_ratio display_ratio);
853 enum s5p_tv_sd_err tv_sdout_init_display_mode(enum s5p_tv_disp_mode disp_mode,
854 enum s5p_tv_o_mode out_mode, enum s5p_sd_order order);
855 void tv_sdout_start(void);
856 void tv_sdout_stop(void);
857 void tv_sdout_sw_reset(bool active);
858 void tv_sdout_set_interrupt_enable(bool vsync_intr_en);
859 void tv_sdout_clear_interrupt_pending(void);
860 bool tv_sdout_get_interrupt_pending(void);
861
862 /* VMIXER */
863 enum s5p_tv_vmx_err tv_vm_set_win_blend(
864 enum s5p_tv_vmx_layer layer, bool enable);
865 enum s5p_tv_vmx_err tv_vm_set_layer_alpha(
866 enum s5p_tv_vmx_layer layer, u32 alpha);
867 enum s5p_tv_vmx_err tv_vm_set_layer_show(
868 enum s5p_tv_vmx_layer layer, bool show);
869 enum s5p_tv_vmx_err tv_vm_set_layer_priority(
870 enum s5p_tv_vmx_layer layer, u32 priority);
871 enum s5p_tv_vmx_err tv_vm_set_grp_base_address(
872 enum s5p_tv_vmx_layer layer, u32 baseaddr);
873 enum s5p_tv_vmx_err tv_vm_set_grp_layer_position(enum s5p_tv_vmx_layer layer,
874 u32 dst_offs_x, u32 dst_offs_y);
875 enum s5p_tv_vmx_err tv_vm_set_grp_layer_size(enum s5p_tv_vmx_layer layer,
876 u32 span, u32 width, u32 height, u32 src_offs_x, u32 src_offs_y);
877 enum s5p_tv_vmx_err tv_vm_set_bg_color(enum s5p_tv_vmx_bg_color_num colornum,
878 u32 color_y, u32 color_cb, u32 color_cr);
879 enum s5p_tv_vmx_err tv_vm_init_status_reg(enum s5p_vmx_burst_mode burst,
880 enum s5p_endian_type endian);
881 enum s5p_tv_vmx_err tv_vm_init_display_mode(enum s5p_tv_disp_mode mode,
882 enum s5p_tv_o_mode output_mode);
883
884 /* for grp layer scaling */
885 enum s5p_tv_vmx_err tv_vm_init_layer(enum s5p_tv_disp_mode mode,
886 enum s5p_tv_vmx_layer layer, bool show, bool winblending, u32 alpha,
887 u32 priority, enum s5p_tv_vmx_color_fmt color, bool blankchange,
888 bool pixelblending, bool premul, u32 blankcolor, u32 baseaddr,
889 u32 span, u32 width, u32 height, u32 src_offs_x, u32 src_offs_y,
890 u32 dst_offs_x, u32 dst_offs_y, u32 dst_x, u32 dst_y);
891 void tv_vm_set_ctrl(enum s5p_tv_vmx_layer layer, bool premul,
892 bool pixel_blending, bool blank_change, bool win_blending,
893 enum s5p_tv_vmx_color_fmt color, u32 alpha, u32 blank_color);
894 void tv_vm_init_bg_dither_enable(bool cr_dither_enable,
895 bool cdither_enable, bool y_dither_enable);
896 enum s5p_tv_vmx_err tv_vm_init_bg_color(enum s5p_tv_vmx_bg_color_num color_num,
897 u32 color_y, u32 color_cb, u32 color_cr);
898 enum s5p_tv_vmx_err tv_vm_init_csc_coef(enum s5p_yuv_fmt_component component,
899 enum s5p_tv_coef_y_mode mode, u32 coeff0, u32 coeff1, u32 coeff2);
900 void tv_vm_init_csc_coef_default(enum s5p_tv_vmx_csc_type csc_type);
901 enum s5p_tv_vmx_err tv_vm_get_layer_info(enum s5p_tv_vmx_layer layer,
902 bool *show, u32 *priority);
903 void tv_vm_start(void);
904 void tv_vm_stop(void);
905 enum s5p_tv_vmx_err tv_vm_set_underflow_interrupt_enable(
906 enum s5p_tv_vmx_layer layer, bool en);
907 enum s5p_tv_vmx_err tv_vm_set_vsync_interrupt(bool en);
908 void tv_vm_clear_pend_all(void);
909 irqreturn_t tv_mixer_irq(int irq, void *dev_id);
910
911 /* VPROCESSOR */
912 void tv_vp_set_field_id(enum s5p_vp_field mode);
913 enum s5p_tv_vp_err tv_vp_set_top_field_address(u32 top_y_addr,
914 u32 top_c_addr);
915 enum s5p_tv_vp_err tv_vp_set_bottom_field_address(u32 bottom_y_addr,
916 u32 bottom_c_addr);
917 enum s5p_tv_vp_err tv_vp_set_img_size(u32 img_width, u32 img_height);
918 void tv_vp_set_src_position(u32 src_off_x, u32 src_x_fract_step,
919 u32 src_off_y);
920 void tv_vp_set_dest_position(u32 dst_off_x, u32 dst_off_y);
921 void tv_vp_set_src_dest_size(u32 src_width, u32 src_height, u32 dst_width,
922 u32 dst_height, bool ipc_2d);
923 enum s5p_tv_vp_err tv_vp_set_poly_filter_coef(enum s5p_vp_poly_coeff poly_coeff,
924 signed char ch0, signed char ch1, signed char ch2, signed char ch3);
925 void tv_vp_set_poly_filter_coef_default(u32 h_ratio, u32 v_ratio);
926 void tv_vp_set_src_dest_size_with_default_poly_filter_coef(u32 src_width,
927 u32 src_height, u32 dst_width, u32 dst_height, bool ipc_2d);
928 enum s5p_tv_vp_err tv_vp_set_brightness_contrast_control(
929 enum s5p_vp_line_eq eq_num, u32 intc, u32 slope);
930 void tv_vp_set_brightness(bool brightness);
931 void tv_vp_set_contrast(u8 contrast);
932 enum s5p_tv_vp_err tv_vp_update(void);
933 enum s5p_vp_field tv_vp_get_field_id(void);
934 bool tv_vp_get_update_status(void);
935 void tv_vp_init_field_id(enum s5p_vp_field mode);
936 void tv_vp_init_op_mode(bool line_skip, enum s5p_vp_mem_mode mem_mode,
937 enum s5p_vp_chroma_expansion chroma_exp,
938 enum s5p_vp_filed_id_toggle toggle_id);
939 void tv_vp_init_pixel_rate_control(enum s5p_vp_pxl_rate rate);
940 enum s5p_tv_vp_err tv_vp_init_layer(u32 top_y_addr, u32 top_c_addr,
941 u32 bottom_y_addr, u32 bottom_c_addr,
942 enum s5p_endian_type src_img_endian, u32 img_width, u32 img_height,
943 u32 src_off_x, u32 src_x_fract_step, u32 src_off_y, u32 src_width,
944 u32 src_height, u32 dst_off_x, u32 dst_off_y, u32 dst_width,
945 u32 dst_height, bool ipc_2d);
946 enum s5p_tv_vp_err tv_vp_init_layer_def_poly_filter_coef(u32 top_y_addr,
947 u32 top_c_addr, u32 bottom_y_addr, u32 bottom_c_addr,
948 enum s5p_endian_type src_img_endian, u32 img_width, u32 img_height,
949 u32 src_off_x, u32 src_x_fract_step, u32 src_off_y, u32 src_width,
950 u32 src_height, u32 dst_off_x, u32 dst_off_y, u32 dst_width,
951 u32 dst_height, bool ipc_2d);
952 enum s5p_tv_vp_err tv_vp_init_poly_filter_coef(
953 enum s5p_vp_poly_coeff poly_coeff, signed char ch0, signed char ch1,
954 signed char ch2, signed char ch3);
955 void tv_vp_init_bypass_post_process(bool bypass);
956 enum s5p_tv_vp_err tv_vp_init_csc_coef(enum s5p_vp_csc_coeff csc_coeff,
957 u32 coeff);
958 void tv_vp_init_saturation(u32 sat);
959 void tv_vp_init_sharpness(u32 th_h_noise,
960 enum s5p_vp_sharpness_control sharpness);
961 enum s5p_tv_vp_err tv_vp_init_brightness_contrast_control(
962 enum s5p_vp_line_eq eq_num, u32 intc, u32 slope);
963 void tv_vp_init_brightness(bool brightness);
964 void tv_vp_init_contrast(u8 contrast);
965 void tv_vp_init_brightness_offset(u32 offset);
966 void tv_vp_init_csc_control(bool suy_offset_en, bool csc_en);
967 enum s5p_tv_vp_err tv_vp_init_csc_coef_default(enum s5p_vp_csc_type csc_type);
968 enum s5p_tv_vp_err tv_vp_start(void);
969 enum s5p_tv_vp_err tv_vp_stop(void);
970 void tv_vp_sw_reset(void);
971
972 /* TV_CLOCK */
973 void tv_clk_init_hpll(u32 lock_time, bool vsel, u32 mdiv,
974 u32 pdiv, u32 sdiv);
975 int tv_clk_change_internal(void);
976
977 enum s5p_tv_clk_err tv_clk_init_mout_hpll(
978 enum s5p_tv_clk_mout_hpll mout_hpll);
979 enum s5p_tv_clk_err tv_clk_init_video_mixer(
980 enum s5p_tv_clk_vmiexr_srcclk src_clk);
981 void tv_clk_init_hdmi_ratio(u32 clk_div);
982 void tv_clk_set_hdmi_i2c_clk_onoff(bool clk_on);
983
984 /* TV_POWER */
985 void tv_power_init_mtc_stable_counter(u32 value);
986 void tv_powerinitialize_dac_onoff(bool on);
987 void tv_powerset_dac_onoff(bool on);
988 bool tv_power_get_power_status(void);
989 bool tv_power_get_dac_power_status(void);
990 void tv_poweron(void);
991 void tv_poweroff(void);
992
993 extern struct s5p_tv_status s5ptv_status;
994 extern struct s5p_tv_vo s5ptv_overlay[2];
995 extern void s5p_hdmi_enable_interrupts(enum s5p_tv_hdmi_interrrupt intr);
996 extern void s5p_hdmi_disable_interrupts(enum s5p_tv_hdmi_interrrupt intr);
997 extern void s5p_hdmi_clear_pending(enum s5p_tv_hdmi_interrrupt intr);
998 extern u8 s5p_hdmi_get_interrupts(void);
999 extern int s5p_hdmi_register_isr(hdmi_isr isr, u8 irq_num);
1000 extern int s5p_hpd_init(void);
1001 extern u8 s5p_hdmi_get_swhpd_status(void);
1002 extern u8 s5p_hdmi_get_hpd_status(void);
1003 extern void s5p_hdmi_swhpd_disable(void);
1004 extern void s5p_hdmi_hpd_gen(void);
1005 extern int __init tv_hdcp_init(void);
1006 extern int s5p_tv_clk_gate(bool on);
1007 extern int s5ptvfb_init_fbinfo(int id);
1008 extern int s5ptvfb_map_video_memory(struct fb_info *fb);
1009 extern int s5ptvfb_check_var(struct fb_var_screeninfo *var,
1010 struct fb_info *fb);
1011 extern int s5ptvfb_set_par(struct fb_info *fb);
1012 extern void s5ptvfb_set_lcd_info(struct s5p_tv_status *ctrl);
1013 extern int s5ptvfb_display_on(struct s5p_tv_status *ctrl);
1014 extern bool tv_if_set_disp(void);
1015 extern int s5p_hpd_get_state(void);
1016 extern void s5p_tv_kobject_uevent(struct work_struct *data);
1017 extern int s5ptvfb_alloc_framebuffer(void);
1018 extern int s5ptvfb_free_framebuffer(void);
1019 extern int s5ptvfb_register_framebuffer(void);
1020 extern int s5ptvfb_unregister_framebuffer(void);
1021 extern int s5ptvfb_unmap_video_memory(struct fb_info *fb);
1022 extern void s5p_tv_v4l2_init_param(void);
1023 extern int s5p_tv_clk_gate(bool on);
1024 extern int tv_phy_power(bool on);
OLDNEW
« no previous file with comments | « drivers/media/video/samsung/tv20/s5p_stda_video_layer.c ('k') | drivers/media/video/samsung/tv20/s5p_tv_base.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698