1/*
2 * Copyright (C) 2010 Texas Instruments Inc
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation version 2.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17#ifndef _VPBE_TYPES_H
18#define _VPBE_TYPES_H
19
20enum vpbe_version {
21	VPBE_VERSION_1 = 1,
22	VPBE_VERSION_2,
23	VPBE_VERSION_3,
24};
25
26/* vpbe_timing_type - Timing types used in vpbe device */
27enum vpbe_enc_timings_type {
28	VPBE_ENC_STD = 0x1,
29	VPBE_ENC_DV_TIMINGS = 0x4,
30	/* Used when set timings through FB device interface */
31	VPBE_ENC_TIMINGS_INVALID = 0x8,
32};
33
34/*
35 * struct vpbe_enc_mode_info
36 * @name: ptr to name string of the standard, "NTSC", "PAL" etc
37 * @std: standard or non-standard mode. 1 - standard, 0 - nonstandard
38 * @interlaced: 1 - interlaced, 0 - non interlaced/progressive
39 * @xres: x or horizontal resolution of the display
40 * @yres: y or vertical resolution of the display
41 * @fps: frame per second
42 * @left_margin: left margin of the display
43 * @right_margin: right margin of the display
44 * @upper_margin: upper margin of the display
45 * @lower_margin: lower margin of the display
46 * @hsync_len: h-sync length
47 * @vsync_len: v-sync length
48 * @flags: bit field: bit usage is documented below
49 *
50 * Description:
51 *  Structure holding timing and resolution information of a standard.
52 * Used by vpbe_device to set required non-standard timing in the
53 * venc when lcd controller output is connected to a external encoder.
54 * A table of timings is maintained in vpbe device to set this in
55 * venc when external encoder is connected to lcd controller output.
56 * Encoder may provide a g_dv_timings() API to override these values
57 * as needed.
58 *
59 *  Notes
60 *  ------
61 *  if_type should be used only by encoder manager and encoder.
62 *  flags usage
63 *     b0 (LSB) - hsync polarity, 0 - negative, 1 - positive
64 *     b1       - vsync polarity, 0 - negative, 1 - positive
65 *     b2       - field id polarity, 0 - negative, 1  - positive
66 */
67struct vpbe_enc_mode_info {
68	unsigned char *name;
69	enum vpbe_enc_timings_type timings_type;
70	v4l2_std_id std_id;
71	struct v4l2_dv_timings dv_timings;
72	unsigned int interlaced;
73	unsigned int xres;
74	unsigned int yres;
75	struct v4l2_fract aspect;
76	struct v4l2_fract fps;
77	unsigned int left_margin;
78	unsigned int right_margin;
79	unsigned int upper_margin;
80	unsigned int lower_margin;
81	unsigned int hsync_len;
82	unsigned int vsync_len;
83	unsigned int flags;
84};
85
86#endif
87