/*1cx25840.h - definition for cx25840/1/2/3 inputs23Copyright (C) 2006 Hans Verkuil ([email protected])45This program is free software; you can redistribute it and/or modify6it under the terms of the GNU General Public License as published by7the Free Software Foundation; either version 2 of the License, or8(at your option) any later version.910This program is distributed in the hope that it will be useful,11but WITHOUT ANY WARRANTY; without even the implied warranty of12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13GNU General Public License for more details.1415You should have received a copy of the GNU General Public License16along with this program; if not, write to the Free Software17Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18*/1920#ifndef _CX25840_H_21#define _CX25840_H_2223/* Note that the cx25840 driver requires that the bridge driver calls the24v4l2_subdev's init operation in order to load the driver's firmware.25Without this the audio standard detection will fail and you will26only get mono.2728Since loading the firmware is often problematic when the driver is29compiled into the kernel I recommend postponing calling this function30until the first open of the video device. Another reason for31postponing it is that loading this firmware takes a long time (seconds)32due to the slow i2c bus speed. So it will speed up the boot process if33you can avoid loading the fw as long as the video device isn't used. */3435enum cx25840_video_input {36/* Composite video inputs In1-In8 */37CX25840_COMPOSITE1 = 1,38CX25840_COMPOSITE2,39CX25840_COMPOSITE3,40CX25840_COMPOSITE4,41CX25840_COMPOSITE5,42CX25840_COMPOSITE6,43CX25840_COMPOSITE7,44CX25840_COMPOSITE8,4546/* S-Video inputs consist of one luma input (In1-In8) ORed with one47chroma input (In5-In8) */48CX25840_SVIDEO_LUMA1 = 0x10,49CX25840_SVIDEO_LUMA2 = 0x20,50CX25840_SVIDEO_LUMA3 = 0x30,51CX25840_SVIDEO_LUMA4 = 0x40,52CX25840_SVIDEO_LUMA5 = 0x50,53CX25840_SVIDEO_LUMA6 = 0x60,54CX25840_SVIDEO_LUMA7 = 0x70,55CX25840_SVIDEO_LUMA8 = 0x80,56CX25840_SVIDEO_CHROMA4 = 0x400,57CX25840_SVIDEO_CHROMA5 = 0x500,58CX25840_SVIDEO_CHROMA6 = 0x600,59CX25840_SVIDEO_CHROMA7 = 0x700,60CX25840_SVIDEO_CHROMA8 = 0x800,6162/* S-Video aliases for common luma/chroma combinations */63CX25840_SVIDEO1 = 0x510,64CX25840_SVIDEO2 = 0x620,65CX25840_SVIDEO3 = 0x730,66CX25840_SVIDEO4 = 0x840,6768/* Allow frames to specify specific input configurations */69CX25840_VIN1_CH1 = 0x80000000,70CX25840_VIN2_CH1 = 0x80000001,71CX25840_VIN3_CH1 = 0x80000002,72CX25840_VIN4_CH1 = 0x80000003,73CX25840_VIN5_CH1 = 0x80000004,74CX25840_VIN6_CH1 = 0x80000005,75CX25840_VIN7_CH1 = 0x80000006,76CX25840_VIN8_CH1 = 0x80000007,77CX25840_VIN4_CH2 = 0x80000000,78CX25840_VIN5_CH2 = 0x80000010,79CX25840_VIN6_CH2 = 0x80000020,80CX25840_NONE_CH2 = 0x80000030,81CX25840_VIN7_CH3 = 0x80000000,82CX25840_VIN8_CH3 = 0x80000040,83CX25840_NONE0_CH3 = 0x80000080,84CX25840_NONE1_CH3 = 0x800000c0,85CX25840_SVIDEO_ON = 0x80000100,86CX25840_COMPONENT_ON = 0x80000200,87};8889enum cx25840_audio_input {90/* Audio inputs: serial or In4-In8 */91CX25840_AUDIO_SERIAL,92CX25840_AUDIO4 = 4,93CX25840_AUDIO5,94CX25840_AUDIO6,95CX25840_AUDIO7,96CX25840_AUDIO8,97};9899enum cx25840_io_pin {100CX25840_PIN_DVALID_PRGM0 = 0,101CX25840_PIN_FIELD_PRGM1,102CX25840_PIN_HRESET_PRGM2,103CX25840_PIN_VRESET_HCTL_PRGM3,104CX25840_PIN_IRQ_N_PRGM4,105CX25840_PIN_IR_TX_PRGM6,106CX25840_PIN_IR_RX_PRGM5,107CX25840_PIN_GPIO0_PRGM8,108CX25840_PIN_GPIO1_PRGM9,109CX25840_PIN_SA_SDIN, /* Alternate GP Input only */110CX25840_PIN_SA_SDOUT, /* Alternate GP Input only */111CX25840_PIN_PLL_CLK_PRGM7,112CX25840_PIN_CHIP_SEL_VIPCLK, /* Output only */113};114115enum cx25840_io_pad {116/* Output pads */117CX25840_PAD_DEFAULT = 0,118CX25840_PAD_ACTIVE,119CX25840_PAD_VACTIVE,120CX25840_PAD_CBFLAG,121CX25840_PAD_VID_DATA_EXT0,122CX25840_PAD_VID_DATA_EXT1,123CX25840_PAD_GPO0,124CX25840_PAD_GPO1,125CX25840_PAD_GPO2,126CX25840_PAD_GPO3,127CX25840_PAD_IRQ_N,128CX25840_PAD_AC_SYNC,129CX25840_PAD_AC_SDOUT,130CX25840_PAD_PLL_CLK,131CX25840_PAD_VRESET,132CX25840_PAD_RESERVED,133/* Pads for PLL_CLK output only */134CX25840_PAD_XTI_X5_DLL,135CX25840_PAD_AUX_PLL,136CX25840_PAD_VID_PLL,137CX25840_PAD_XTI,138/* Input Pads */139CX25840_PAD_GPI0,140CX25840_PAD_GPI1,141CX25840_PAD_GPI2,142CX25840_PAD_GPI3,143};144145enum cx25840_io_pin_strength {146CX25840_PIN_DRIVE_MEDIUM = 0,147CX25840_PIN_DRIVE_SLOW,148CX25840_PIN_DRIVE_FAST,149};150151enum cx23885_io_pin {152CX23885_PIN_IR_RX_GPIO19,153CX23885_PIN_IR_TX_GPIO20,154CX23885_PIN_I2S_SDAT_GPIO21,155CX23885_PIN_I2S_WCLK_GPIO22,156CX23885_PIN_I2S_BCLK_GPIO23,157CX23885_PIN_IRQ_N_GPIO16,158};159160enum cx23885_io_pad {161CX23885_PAD_IR_RX,162CX23885_PAD_GPIO19,163CX23885_PAD_IR_TX,164CX23885_PAD_GPIO20,165CX23885_PAD_I2S_SDAT,166CX23885_PAD_GPIO21,167CX23885_PAD_I2S_WCLK,168CX23885_PAD_GPIO22,169CX23885_PAD_I2S_BCLK,170CX23885_PAD_GPIO23,171CX23885_PAD_IRQ_N,172CX23885_PAD_GPIO16,173};174175/* pvr150_workaround activates a workaround for a hardware bug that is176present in Hauppauge PVR-150 (and possibly PVR-500) cards that have177certain NTSC tuners (tveeprom tuner model numbers 85, 99 and 112). The178audio autodetect fails on some channels for these models and the workaround179is to select the audio standard explicitly. Many thanks to Hauppauge for180providing this information.181This platform data only needs to be supplied by the ivtv driver. */182struct cx25840_platform_data {183int pvr150_workaround;184};185186#endif187188189