Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[pandora-kernel.git] / drivers / staging / msm / tvenc.h
1 /* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
2  *
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are met:
5  *     * Redistributions of source code must retain the above copyright
6  *       notice, this list of conditions and the following disclaimer.
7  *     * Redistributions in binary form must reproduce the above copyright
8  *       notice, this list of conditions and the following disclaimer in the
9  *       documentation and/or other materials provided with the distribution.
10  *     * Neither the name of Code Aurora nor
11  *       the names of its contributors may be used to endorse or promote
12  *       products derived from this software without specific prior written
13  *       permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  */
28
29 #ifndef TVENC_H
30 #define TVENC_H
31
32 #include <linux/kernel.h>
33 #include <linux/sched.h>
34 #include <linux/time.h>
35 #include <linux/init.h>
36 #include <linux/interrupt.h>
37 #include <linux/fb.h>
38
39 #include <mach/hardware.h>
40 #include <linux/io.h>
41
42 #include <asm/system.h>
43 #include <asm/mach-types.h>
44
45 #include "msm_fb_panel.h"
46
47 #define NTSC_M          0 /* North America, Korea */
48 #define NTSC_J          1 /* Japan */
49 #define PAL_BDGHIN      2 /* Non-argentina PAL-N */
50 #define PAL_M           3 /* PAL-M */
51 #define PAL_N           4 /* Argentina PAL-N */
52
53 /* 3.57954545 Mhz */
54 #define TVENC_CTL_TV_MODE_NTSC_M_PAL60  0
55 /* 3.57961149 Mhz */
56 #define TVENC_CTL_TV_MODE_PAL_M             BIT(0)
57 /*non-Argintina = 4.3361875 Mhz */
58 #define TVENC_CTL_TV_MODE_PAL_BDGHIN        BIT(1)
59 /*Argentina = 3.582055625 Mhz */
60 #define TVENC_CTL_TV_MODE_PAL_N             (BIT(1)|BIT(0))
61
62 #define TVENC_CTL_ENC_EN                    BIT(2)
63 #define TVENC_CTL_CC_EN                     BIT(3)
64 #define TVENC_CTL_CGMS_EN                   BIT(4)
65 #define TVENC_CTL_MACRO_EN                  BIT(5)
66 #define TVENC_CTL_Y_FILTER_W_NOTCH          BIT(6)
67 #define TVENC_CTL_Y_FILTER_WO_NOTCH         0
68 #define TVENC_CTL_Y_FILTER_EN               BIT(7)
69 #define TVENC_CTL_CR_FILTER_EN              BIT(8)
70 #define TVENC_CTL_CB_FILTER_EN              BIT(9)
71 #define TVENC_CTL_SINX_FILTER_EN            BIT(10)
72 #define TVENC_CTL_TEST_PATT_EN              BIT(11)
73 #define TVENC_CTL_OUTPUT_INV                BIT(12)
74 #define TVENC_CTL_PAL60_MODE                BIT(13)
75 #define TVENC_CTL_NTSCJ_MODE                BIT(14)
76 #define TVENC_CTL_TPG_CLRBAR                0
77 #define TVENC_CTL_TPG_MODRAMP               BIT(15)
78 #define TVENC_CTL_TPG_REDCLR                BIT(16)
79 #define TVENC_CTL_S_VIDEO_EN                BIT(19)
80
81 #ifdef TVENC_C
82 void *tvenc_base;
83 #else
84 extern void *tvenc_base;
85 #endif
86
87 #define TV_OUT(reg, v)  writel(v, tvenc_base + MSM_##reg)
88
89 #define MSM_TV_ENC_CTL                  0x00
90 #define MSM_TV_LEVEL                    0x04
91 #define MSM_TV_GAIN                     0x08
92 #define MSM_TV_OFFSET                   0x0c
93 #define MSM_TV_CGMS                     0x10
94 #define MSM_TV_SYNC_1                   0x14
95 #define MSM_TV_SYNC_2                   0x18
96 #define MSM_TV_SYNC_3                   0x1c
97 #define MSM_TV_SYNC_4                   0x20
98 #define MSM_TV_SYNC_5                   0x24
99 #define MSM_TV_SYNC_6                   0x28
100 #define MSM_TV_SYNC_7                   0x2c
101 #define MSM_TV_BURST_V1                 0x30
102 #define MSM_TV_BURST_V2                 0x34
103 #define MSM_TV_BURST_V3                 0x38
104 #define MSM_TV_BURST_V4                 0x3c
105 #define MSM_TV_BURST_H                  0x40
106 #define MSM_TV_SOL_REQ_ODD              0x44
107 #define MSM_TV_SOL_REQ_EVEN             0x48
108 #define MSM_TV_DAC_CTL                  0x4c
109 #define MSM_TV_TEST_MUX                 0x50
110 #define MSM_TV_TEST_MODE                0x54
111 #define MSM_TV_TEST_MISR_RESET          0x58
112 #define MSM_TV_TEST_EXPORT_MISR         0x5c
113 #define MSM_TV_TEST_MISR_CURR_VAL       0x60
114 #define MSM_TV_TEST_SOF_CFG             0x64
115 #define MSM_TV_DAC_INTF                 0x100
116
117 #endif /* TVENC_H */