Path: blob/master/drivers/media/video/cx231xx/cx231xx-pcb-cfg.h
17988 views
/*1cx231xx-pcb-cfg.h - driver for Conexant2Cx23100/101/102 USB video capture devices34Copyright (C) 2008 <srinivasa.deevi at conexant dot com>56This program is free software; you can redistribute it and/or modify7it under the terms of the GNU General Public License as published by8the Free Software Foundation; either version 2 of the License, or9(at your option) any later version.1011This program is distributed in the hope that it will be useful,12but WITHOUT ANY WARRANTY; without even the implied warranty of13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14GNU General Public License for more details.1516You should have received a copy of the GNU General Public License17along with this program; if not, write to the Free Software18Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.19*/2021#ifndef _PCB_CONFIG_H_22#define _PCB_CONFIG_H_2324#include <linux/init.h>25#include <linux/module.h>2627/***************************************************************************28* Class Information *29***************************************************************************/30#define CLASS_DEFAULT 0xFF3132enum VENDOR_REQUEST_TYPE {33/* Set/Get I2C */34VRT_SET_I2C0 = 0x0,35VRT_SET_I2C1 = 0x1,36VRT_SET_I2C2 = 0x2,37VRT_GET_I2C0 = 0x4,38VRT_GET_I2C1 = 0x5,39VRT_GET_I2C2 = 0x6,4041/* Set/Get GPIO */42VRT_SET_GPIO = 0x8,43VRT_GET_GPIO = 0x9,4445/* Set/Get GPIE */46VRT_SET_GPIE = 0xA,47VRT_GET_GPIE = 0xB,4849/* Set/Get Register Control/Status */50VRT_SET_REGISTER = 0xC,51VRT_GET_REGISTER = 0xD,5253/* Get Extended Compat ID Descriptor */54VRT_GET_EXTCID_DESC = 0xFF,55};5657enum BYTE_ENABLE_MASK {58ENABLE_ONE_BYTE = 0x1,59ENABLE_TWE_BYTE = 0x3,60ENABLE_THREE_BYTE = 0x7,61ENABLE_FOUR_BYTE = 0xF,62};6364#define SPEED_MASK 0x165enum USB_SPEED{66FULL_SPEED = 0x0, /* 0: full speed */67HIGH_SPEED = 0x1 /* 1: high speed */68};6970enum _true_false{71FALSE = 0,72TRUE = 173};7475#define TS_MASK 0x676enum TS_PORT{77NO_TS_PORT = 0x0, /* 2'b00: Neither port used. PCB not a Hybrid,78only offers Analog TV or Video */79TS1_PORT = 0x4, /* 2'b10: TS1 Input (Hybrid mode :80Digital or External Analog/Compressed source) */81TS1_TS2_PORT = 0x6, /* 2'b11: TS1 & TS2 Inputs82(Dual inputs from Digital and/or83External Analog/Compressed sources) */84TS1_EXT_CLOCK = 0x6, /* 2'b11: TS1 & TS2 as selector85to external clock */86TS1VIP_TS2_PORT = 0x2 /* 2'b01: TS1 used as 656/VIP Output,87TS2 Input (from Compressor) */88};8990#define EAVP_MASK 0x891enum EAV_PRESENT{92NO_EXTERNAL_AV = 0x0, /* 0: No External A/V inputs93(no need for i2s blcok),94Analog Tuner must be present */95EXTERNAL_AV = 0x8 /* 1: External A/V inputs96present (requires i2s blk) */97};9899#define ATM_MASK 0x30100enum AT_MODE{101DIF_TUNER = 0x30, /* 2'b11: IF Tuner (requires use of DIF) */102BASEBAND_SOUND = 0x20, /* 2'b10: Baseband Composite &103Sound-IF Signals present */104NO_TUNER = 0x10 /* 2'b0x: No Analog Tuner present */105};106107#define PWR_SEL_MASK 0x40108enum POWE_TYPE{109SELF_POWER = 0x0, /* 0: self power */110BUS_POWER = 0x40 /* 1: bus power */111};112113enum USB_POWE_TYPE{114USB_SELF_POWER = 0,115USB_BUS_POWER116};117118#define BO_0_MASK 0x80119enum AVDEC_STATUS{120AVDEC_DISABLE = 0x0, /* 0: A/V Decoder Disabled */121AVDEC_ENABLE = 0x80 /* 1: A/V Decoder Enabled */122};123124#define BO_1_MASK 0x100125126#define BUSPOWER_MASK 0xC4 /* for Polaris spec 0.8 */127#define SELFPOWER_MASK 0x86128129/***************************************************************************/130#define NOT_DECIDE_YET 0xFE131#define NOT_SUPPORTED 0xFF132133/***************************************************************************134* for mod field use *135***************************************************************************/136#define MOD_DIGITAL 0x1137#define MOD_ANALOG 0x2138#define MOD_DIF 0x4139#define MOD_EXTERNAL 0x8140#define CAP_ALL_MOD 0x0f141142/***************************************************************************143* source define *144***************************************************************************/145#define SOURCE_DIGITAL 0x1146#define SOURCE_ANALOG 0x2147#define SOURCE_DIF 0x4148#define SOURCE_EXTERNAL 0x8149#define SOURCE_TS_BDA 0x10150#define SOURCE_TS_ENCODE 0x20151#define SOURCE_TS_EXTERNAL 0x40152153/***************************************************************************154* interface information define *155***************************************************************************/156struct INTERFACE_INFO {157u8 interrupt_index;158u8 ts1_index;159u8 ts2_index;160u8 audio_index;161u8 video_index;162u8 vanc_index; /* VBI */163u8 hanc_index; /* Sliced CC */164u8 ir_index;165};166167enum INDEX_INTERFACE_INFO{168INDEX_INTERRUPT = 0x0,169INDEX_TS1,170INDEX_TS2,171INDEX_AUDIO,172INDEX_VIDEO,173INDEX_VANC,174INDEX_HANC,175INDEX_IR,176};177178/***************************************************************************179* configuration information define *180***************************************************************************/181struct CONFIG_INFO {182u8 config_index;183struct INTERFACE_INFO interface_info;184};185186struct pcb_config {187u8 index;188u8 type; /* bus power or self power,189self power--0, bus_power--1 */190u8 speed; /* usb speed, 2.0--1, 1.1--0 */191u8 mode; /* digital , anlog, dif or external A/V */192u32 ts1_source; /* three source -- BDA,External,encode */193u32 ts2_source;194u32 analog_source;195u8 digital_index; /* bus-power used */196u8 analog_index; /* bus-power used */197u8 dif_index; /* bus-power used */198u8 external_index; /* bus-power used */199u8 config_num; /* current config num, 0,1,2,200for self-power, always 0 */201struct CONFIG_INFO hs_config_info[3];202struct CONFIG_INFO fs_config_info[3];203};204205enum INDEX_PCB_CONFIG{206INDEX_SELFPOWER_DIGITAL_ONLY = 0x0,207INDEX_SELFPOWER_DUAL_DIGITAL,208INDEX_SELFPOWER_ANALOG_ONLY,209INDEX_SELFPOWER_DUAL,210INDEX_SELFPOWER_TRIPLE,211INDEX_SELFPOWER_COMPRESSOR,212INDEX_BUSPOWER_DIGITAL_ONLY,213INDEX_BUSPOWER_ANALOG_ONLY,214INDEX_BUSPOWER_DIF_ONLY,215INDEX_BUSPOWER_EXTERNAL_ONLY,216INDEX_BUSPOWER_EXTERNAL_ANALOG,217INDEX_BUSPOWER_EXTERNAL_DIF,218INDEX_BUSPOWER_EXTERNAL_DIGITAL,219INDEX_BUSPOWER_DIGITAL_ANALOG,220INDEX_BUSPOWER_DIGITAL_DIF,221INDEX_BUSPOWER_DIGITAL_ANALOG_EXTERNAL,222INDEX_BUSPOWER_DIGITAL_DIF_EXTERNAL,223};224225/***************************************************************************/226struct cx231xx;227228u32 initialize_cx231xx(struct cx231xx *p_dev);229230#endif231232233