1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 cx231xx-pcb-cfg.h - driver for Conexant
4 Cx23100/101/102 USB video capture devices
6 Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
10 #ifndef _PCB_CONFIG_H_
11 #define _PCB_CONFIG_H_
13 #include <linux/init.h>
14 #include <linux/module.h>
16 /***************************************************************************
18 ***************************************************************************/
19 #define CLASS_DEFAULT 0xFF
21 enum VENDOR_REQUEST_TYPE
{
38 /* Set/Get Register Control/Status */
39 VRT_SET_REGISTER
= 0xC,
40 VRT_GET_REGISTER
= 0xD,
42 /* Get Extended Compat ID Descriptor */
43 VRT_GET_EXTCID_DESC
= 0xFF,
46 enum BYTE_ENABLE_MASK
{
47 ENABLE_ONE_BYTE
= 0x1,
48 ENABLE_TWE_BYTE
= 0x3,
49 ENABLE_THREE_BYTE
= 0x7,
50 ENABLE_FOUR_BYTE
= 0xF,
53 #define SPEED_MASK 0x1
55 FULL_SPEED
= 0x0, /* 0: full speed */
56 HIGH_SPEED
= 0x1 /* 1: high speed */
61 NO_TS_PORT
= 0x0, /* 2'b00: Neither port used. PCB not a Hybrid,
62 only offers Analog TV or Video */
63 TS1_PORT
= 0x4, /* 2'b10: TS1 Input (Hybrid mode :
64 Digital or External Analog/Compressed source) */
65 TS1_TS2_PORT
= 0x6, /* 2'b11: TS1 & TS2 Inputs
66 (Dual inputs from Digital and/or
67 External Analog/Compressed sources) */
68 TS1_EXT_CLOCK
= 0x6, /* 2'b11: TS1 & TS2 as selector
70 TS1VIP_TS2_PORT
= 0x2 /* 2'b01: TS1 used as 656/VIP Output,
71 TS2 Input (from Compressor) */
76 NO_EXTERNAL_AV
= 0x0, /* 0: No External A/V inputs
77 (no need for i2s block),
78 Analog Tuner must be present */
79 EXTERNAL_AV
= 0x8 /* 1: External A/V inputs
80 present (requires i2s blk) */
85 DIF_TUNER
= 0x30, /* 2'b11: IF Tuner (requires use of DIF) */
86 BASEBAND_SOUND
= 0x20, /* 2'b10: Baseband Composite &
87 Sound-IF Signals present */
88 NO_TUNER
= 0x10 /* 2'b0x: No Analog Tuner present */
91 #define PWR_SEL_MASK 0x40
93 SELF_POWER
= 0x0, /* 0: self power */
94 BUS_POWER
= 0x40 /* 1: bus power */
102 #define BO_0_MASK 0x80
104 AVDEC_DISABLE
= 0x0, /* 0: A/V Decoder Disabled */
105 AVDEC_ENABLE
= 0x80 /* 1: A/V Decoder Enabled */
108 #define BO_1_MASK 0x100
110 #define BUSPOWER_MASK 0xC4 /* for Polaris spec 0.8 */
111 #define SELFPOWER_MASK 0x86
113 /***************************************************************************/
114 #define NOT_DECIDE_YET 0xFE
115 #define NOT_SUPPORTED 0xFF
117 /***************************************************************************
118 * for mod field use *
119 ***************************************************************************/
120 #define MOD_DIGITAL 0x1
121 #define MOD_ANALOG 0x2
123 #define MOD_EXTERNAL 0x8
124 #define CAP_ALL_MOD 0x0f
126 /***************************************************************************
128 ***************************************************************************/
129 #define SOURCE_DIGITAL 0x1
130 #define SOURCE_ANALOG 0x2
131 #define SOURCE_DIF 0x4
132 #define SOURCE_EXTERNAL 0x8
133 #define SOURCE_TS_BDA 0x10
134 #define SOURCE_TS_ENCODE 0x20
135 #define SOURCE_TS_EXTERNAL 0x40
137 /***************************************************************************
138 * interface information define *
139 ***************************************************************************/
140 struct INTERFACE_INFO
{
146 u8 vanc_index
; /* VBI */
147 u8 hanc_index
; /* Sliced CC */
151 enum INDEX_INTERFACE_INFO
{
152 INDEX_INTERRUPT
= 0x0,
162 /***************************************************************************
163 * configuration information define *
164 ***************************************************************************/
167 struct INTERFACE_INFO interface_info
;
172 u8 type
; /* bus power or self power,
173 self power--0, bus_power--1 */
174 u8 speed
; /* usb speed, 2.0--1, 1.1--0 */
175 u8 mode
; /* digital , anlog, dif or external A/V */
176 u32 ts1_source
; /* three source -- BDA,External,encode */
179 u8 digital_index
; /* bus-power used */
180 u8 analog_index
; /* bus-power used */
181 u8 dif_index
; /* bus-power used */
182 u8 external_index
; /* bus-power used */
183 u8 config_num
; /* current config num, 0,1,2,
184 for self-power, always 0 */
185 struct CONFIG_INFO hs_config_info
[3];
186 struct CONFIG_INFO fs_config_info
[3];
189 enum INDEX_PCB_CONFIG
{
190 INDEX_SELFPOWER_DIGITAL_ONLY
= 0x0,
191 INDEX_SELFPOWER_DUAL_DIGITAL
,
192 INDEX_SELFPOWER_ANALOG_ONLY
,
193 INDEX_SELFPOWER_DUAL
,
194 INDEX_SELFPOWER_TRIPLE
,
195 INDEX_SELFPOWER_COMPRESSOR
,
196 INDEX_BUSPOWER_DIGITAL_ONLY
,
197 INDEX_BUSPOWER_ANALOG_ONLY
,
198 INDEX_BUSPOWER_DIF_ONLY
,
199 INDEX_BUSPOWER_EXTERNAL_ONLY
,
200 INDEX_BUSPOWER_EXTERNAL_ANALOG
,
201 INDEX_BUSPOWER_EXTERNAL_DIF
,
202 INDEX_BUSPOWER_EXTERNAL_DIGITAL
,
203 INDEX_BUSPOWER_DIGITAL_ANALOG
,
204 INDEX_BUSPOWER_DIGITAL_DIF
,
205 INDEX_BUSPOWER_DIGITAL_ANALOG_EXTERNAL
,
206 INDEX_BUSPOWER_DIGITAL_DIF_EXTERNAL
,
209 /***************************************************************************/
212 int initialize_cx231xx(struct cx231xx
*p_dev
);