Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cx231xx-pcb-cfg.h
Go to the documentation of this file.
1 /*
2  cx231xx-pcb-cfg.h - driver for Conexant
3  Cx23100/101/102 USB video capture devices
4 
5  Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21 
22 #ifndef _PCB_CONFIG_H_
23 #define _PCB_CONFIG_H_
24 
25 #include <linux/init.h>
26 #include <linux/module.h>
27 
28 /***************************************************************************
29  * Class Information *
30 ***************************************************************************/
31 #define CLASS_DEFAULT 0xFF
32 
34  /* Set/Get I2C */
35  VRT_SET_I2C0 = 0x0,
36  VRT_SET_I2C1 = 0x1,
37  VRT_SET_I2C2 = 0x2,
38  VRT_GET_I2C0 = 0x4,
39  VRT_GET_I2C1 = 0x5,
40  VRT_GET_I2C2 = 0x6,
41 
42  /* Set/Get GPIO */
43  VRT_SET_GPIO = 0x8,
44  VRT_GET_GPIO = 0x9,
45 
46  /* Set/Get GPIE */
47  VRT_SET_GPIE = 0xA,
48  VRT_GET_GPIE = 0xB,
49 
50  /* Set/Get Register Control/Status */
53 
54  /* Get Extended Compat ID Descriptor */
56 };
57 
63 };
64 
65 #define SPEED_MASK 0x1
66 enum USB_SPEED{
67  FULL_SPEED = 0x0, /* 0: full speed */
68  HIGH_SPEED = 0x1 /* 1: high speed */
69 };
70 
72  FALSE = 0,
73  TRUE = 1
74 };
75 
76 #define TS_MASK 0x6
77 enum TS_PORT{
78  NO_TS_PORT = 0x0, /* 2'b00: Neither port used. PCB not a Hybrid,
79  only offers Analog TV or Video */
80  TS1_PORT = 0x4, /* 2'b10: TS1 Input (Hybrid mode :
81  Digital or External Analog/Compressed source) */
82  TS1_TS2_PORT = 0x6, /* 2'b11: TS1 & TS2 Inputs
83  (Dual inputs from Digital and/or
84  External Analog/Compressed sources) */
85  TS1_EXT_CLOCK = 0x6, /* 2'b11: TS1 & TS2 as selector
86  to external clock */
87  TS1VIP_TS2_PORT = 0x2 /* 2'b01: TS1 used as 656/VIP Output,
88  TS2 Input (from Compressor) */
89 };
90 
91 #define EAVP_MASK 0x8
93  NO_EXTERNAL_AV = 0x0, /* 0: No External A/V inputs
94  (no need for i2s blcok),
95  Analog Tuner must be present */
96  EXTERNAL_AV = 0x8 /* 1: External A/V inputs
97  present (requires i2s blk) */
98 };
99 
100 #define ATM_MASK 0x30
101 enum AT_MODE{
102  DIF_TUNER = 0x30, /* 2'b11: IF Tuner (requires use of DIF) */
103  BASEBAND_SOUND = 0x20, /* 2'b10: Baseband Composite &
104  Sound-IF Signals present */
105  NO_TUNER = 0x10 /* 2'b0x: No Analog Tuner present */
106 };
107 
108 #define PWR_SEL_MASK 0x40
110  SELF_POWER = 0x0, /* 0: self power */
111  BUS_POWER = 0x40 /* 1: bus power */
112 };
113 
117 };
118 
119 #define BO_0_MASK 0x80
121  AVDEC_DISABLE = 0x0, /* 0: A/V Decoder Disabled */
122  AVDEC_ENABLE = 0x80 /* 1: A/V Decoder Enabled */
123 };
124 
125 #define BO_1_MASK 0x100
126 
127 #define BUSPOWER_MASK 0xC4 /* for Polaris spec 0.8 */
128 #define SELFPOWER_MASK 0x86
129 
130 /***************************************************************************/
131 #define NOT_DECIDE_YET 0xFE
132 #define NOT_SUPPORTED 0xFF
133 
134 /***************************************************************************
135  * for mod field use *
136 ***************************************************************************/
137 #define MOD_DIGITAL 0x1
138 #define MOD_ANALOG 0x2
139 #define MOD_DIF 0x4
140 #define MOD_EXTERNAL 0x8
141 #define CAP_ALL_MOD 0x0f
142 
143 /***************************************************************************
144  * source define *
145 ***************************************************************************/
146 #define SOURCE_DIGITAL 0x1
147 #define SOURCE_ANALOG 0x2
148 #define SOURCE_DIF 0x4
149 #define SOURCE_EXTERNAL 0x8
150 #define SOURCE_TS_BDA 0x10
151 #define SOURCE_TS_ENCODE 0x20
152 #define SOURCE_TS_EXTERNAL 0x40
153 
154 /***************************************************************************
155  * interface information define *
156 ***************************************************************************/
163  u8 vanc_index; /* VBI */
164  u8 hanc_index; /* Sliced CC */
166 };
167 
177 };
178 
179 /***************************************************************************
180  * configuration information define *
181 ***************************************************************************/
182 struct CONFIG_INFO {
185 };
186 
187 struct pcb_config {
189  u8 type; /* bus power or self power,
190  self power--0, bus_power--1 */
191  u8 speed; /* usb speed, 2.0--1, 1.1--0 */
192  u8 mode; /* digital , anlog, dif or external A/V */
193  u32 ts1_source; /* three source -- BDA,External,encode */
196  u8 digital_index; /* bus-power used */
197  u8 analog_index; /* bus-power used */
198  u8 dif_index; /* bus-power used */
199  u8 external_index; /* bus-power used */
200  u8 config_num; /* current config num, 0,1,2,
201  for self-power, always 0 */
204 };
205 
224 };
225 
226 /***************************************************************************/
227 struct cx231xx;
228 
229 u32 initialize_cx231xx(struct cx231xx *p_dev);
230 
231 #endif