10c0d06caSMauro Carvalho Chehab /* 20c0d06caSMauro Carvalho Chehab * 30c0d06caSMauro Carvalho Chehab * 40c0d06caSMauro Carvalho Chehab * Copyright (C) 2005 Mike Isely <isely@pobox.com> 50c0d06caSMauro Carvalho Chehab * 60c0d06caSMauro Carvalho Chehab * This program is free software; you can redistribute it and/or modify 70c0d06caSMauro Carvalho Chehab * it under the terms of the GNU General Public License as published by 80c0d06caSMauro Carvalho Chehab * the Free Software Foundation; either version 2 of the License 90c0d06caSMauro Carvalho Chehab * 100c0d06caSMauro Carvalho Chehab * This program is distributed in the hope that it will be useful, 110c0d06caSMauro Carvalho Chehab * but WITHOUT ANY WARRANTY; without even the implied warranty of 120c0d06caSMauro Carvalho Chehab * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 130c0d06caSMauro Carvalho Chehab * GNU General Public License for more details. 140c0d06caSMauro Carvalho Chehab * 150c0d06caSMauro Carvalho Chehab */ 160c0d06caSMauro Carvalho Chehab #ifndef __PVRUSB2_DEVATTR_H 170c0d06caSMauro Carvalho Chehab #define __PVRUSB2_DEVATTR_H 180c0d06caSMauro Carvalho Chehab 190c0d06caSMauro Carvalho Chehab #include <linux/mod_devicetable.h> 200c0d06caSMauro Carvalho Chehab #include <linux/videodev2.h> 210c0d06caSMauro Carvalho Chehab #ifdef CONFIG_VIDEO_PVRUSB2_DVB 220c0d06caSMauro Carvalho Chehab #include "pvrusb2-dvb.h" 230c0d06caSMauro Carvalho Chehab #endif 240c0d06caSMauro Carvalho Chehab 250c0d06caSMauro Carvalho Chehab /* 260c0d06caSMauro Carvalho Chehab 270c0d06caSMauro Carvalho Chehab This header defines structures used to describe attributes of a device. 280c0d06caSMauro Carvalho Chehab 290c0d06caSMauro Carvalho Chehab */ 300c0d06caSMauro Carvalho Chehab 310c0d06caSMauro Carvalho Chehab 320c0d06caSMauro Carvalho Chehab #define PVR2_CLIENT_ID_NULL 0 330c0d06caSMauro Carvalho Chehab #define PVR2_CLIENT_ID_MSP3400 1 340c0d06caSMauro Carvalho Chehab #define PVR2_CLIENT_ID_CX25840 2 350c0d06caSMauro Carvalho Chehab #define PVR2_CLIENT_ID_SAA7115 3 360c0d06caSMauro Carvalho Chehab #define PVR2_CLIENT_ID_TUNER 4 370c0d06caSMauro Carvalho Chehab #define PVR2_CLIENT_ID_CS53L32A 5 380c0d06caSMauro Carvalho Chehab #define PVR2_CLIENT_ID_WM8775 6 390c0d06caSMauro Carvalho Chehab #define PVR2_CLIENT_ID_DEMOD 7 400c0d06caSMauro Carvalho Chehab 410c0d06caSMauro Carvalho Chehab struct pvr2_device_client_desc { 420c0d06caSMauro Carvalho Chehab /* One ovr PVR2_CLIENT_ID_xxxx */ 430c0d06caSMauro Carvalho Chehab unsigned char module_id; 440c0d06caSMauro Carvalho Chehab 450c0d06caSMauro Carvalho Chehab /* Null-terminated array of I2C addresses to try in order 460c0d06caSMauro Carvalho Chehab initialize the module. It's safe to make this null terminated 470c0d06caSMauro Carvalho Chehab since we're never going to encounter an i2c device with an 480c0d06caSMauro Carvalho Chehab address of zero. If this is a null pointer or zero-length, 490c0d06caSMauro Carvalho Chehab then no I2C addresses have been specified, in which case we'll 500c0d06caSMauro Carvalho Chehab try some compiled in defaults for now. */ 510c0d06caSMauro Carvalho Chehab unsigned char *i2c_address_list; 520c0d06caSMauro Carvalho Chehab }; 530c0d06caSMauro Carvalho Chehab 540c0d06caSMauro Carvalho Chehab struct pvr2_device_client_table { 550c0d06caSMauro Carvalho Chehab const struct pvr2_device_client_desc *lst; 560c0d06caSMauro Carvalho Chehab unsigned char cnt; 570c0d06caSMauro Carvalho Chehab }; 580c0d06caSMauro Carvalho Chehab 590c0d06caSMauro Carvalho Chehab 600c0d06caSMauro Carvalho Chehab struct pvr2_string_table { 610c0d06caSMauro Carvalho Chehab const char **lst; 620c0d06caSMauro Carvalho Chehab unsigned int cnt; 630c0d06caSMauro Carvalho Chehab }; 640c0d06caSMauro Carvalho Chehab 650c0d06caSMauro Carvalho Chehab #define PVR2_ROUTING_SCHEME_HAUPPAUGE 0 660c0d06caSMauro Carvalho Chehab #define PVR2_ROUTING_SCHEME_GOTVIEW 1 670c0d06caSMauro Carvalho Chehab #define PVR2_ROUTING_SCHEME_ONAIR 2 680c0d06caSMauro Carvalho Chehab #define PVR2_ROUTING_SCHEME_AV400 3 69*dd60bf43SBrad Love #define PVR2_ROUTING_SCHEME_HAUP160XXX 4 700c0d06caSMauro Carvalho Chehab 710c0d06caSMauro Carvalho Chehab #define PVR2_DIGITAL_SCHEME_NONE 0 720c0d06caSMauro Carvalho Chehab #define PVR2_DIGITAL_SCHEME_HAUPPAUGE 1 730c0d06caSMauro Carvalho Chehab #define PVR2_DIGITAL_SCHEME_ONAIR 2 740c0d06caSMauro Carvalho Chehab 750c0d06caSMauro Carvalho Chehab #define PVR2_LED_SCHEME_NONE 0 760c0d06caSMauro Carvalho Chehab #define PVR2_LED_SCHEME_HAUPPAUGE 1 770c0d06caSMauro Carvalho Chehab 780c0d06caSMauro Carvalho Chehab #define PVR2_IR_SCHEME_NONE 0 790c0d06caSMauro Carvalho Chehab #define PVR2_IR_SCHEME_24XXX 1 /* FX2-controlled IR */ 800c0d06caSMauro Carvalho Chehab #define PVR2_IR_SCHEME_ZILOG 2 /* HVR-1950 style (must be taken out of reset) */ 810c0d06caSMauro Carvalho Chehab #define PVR2_IR_SCHEME_24XXX_MCE 3 /* 24xxx MCE device */ 820c0d06caSMauro Carvalho Chehab #define PVR2_IR_SCHEME_29XXX 4 /* Original 29xxx device */ 830c0d06caSMauro Carvalho Chehab 840c0d06caSMauro Carvalho Chehab /* This describes a particular hardware type (except for the USB device ID 850c0d06caSMauro Carvalho Chehab which must live in a separate structure due to environmental 860c0d06caSMauro Carvalho Chehab constraints). See the top of pvrusb2-hdw.c for where this is 870c0d06caSMauro Carvalho Chehab instantiated. */ 880c0d06caSMauro Carvalho Chehab struct pvr2_device_desc { 890c0d06caSMauro Carvalho Chehab /* Single line text description of hardware */ 900c0d06caSMauro Carvalho Chehab const char *description; 910c0d06caSMauro Carvalho Chehab 920c0d06caSMauro Carvalho Chehab /* Single token identifier for hardware */ 930c0d06caSMauro Carvalho Chehab const char *shortname; 940c0d06caSMauro Carvalho Chehab 950c0d06caSMauro Carvalho Chehab /* List of additional client modules we need to load */ 960c0d06caSMauro Carvalho Chehab struct pvr2_string_table client_modules; 970c0d06caSMauro Carvalho Chehab 980c0d06caSMauro Carvalho Chehab /* List of defined client modules we need to load */ 990c0d06caSMauro Carvalho Chehab struct pvr2_device_client_table client_table; 1000c0d06caSMauro Carvalho Chehab 1010c0d06caSMauro Carvalho Chehab /* List of FX2 firmware file names we should search; if empty then 1020c0d06caSMauro Carvalho Chehab FX2 firmware check / load is skipped and we assume the device 1030c0d06caSMauro Carvalho Chehab was initialized from internal ROM. */ 1040c0d06caSMauro Carvalho Chehab struct pvr2_string_table fx2_firmware; 1050c0d06caSMauro Carvalho Chehab 1060c0d06caSMauro Carvalho Chehab #ifdef CONFIG_VIDEO_PVRUSB2_DVB 1070c0d06caSMauro Carvalho Chehab /* callback functions to handle attachment of digital tuner & demod */ 1080c0d06caSMauro Carvalho Chehab const struct pvr2_dvb_props *dvb_props; 1090c0d06caSMauro Carvalho Chehab 1100c0d06caSMauro Carvalho Chehab #endif 1110c0d06caSMauro Carvalho Chehab /* Initial standard bits to use for this device, if not zero. 1120c0d06caSMauro Carvalho Chehab Anything set here is also implied as an available standard. 1130c0d06caSMauro Carvalho Chehab Note: This is ignored if overridden on the module load line via 1140c0d06caSMauro Carvalho Chehab the video_std module option. */ 1150c0d06caSMauro Carvalho Chehab v4l2_std_id default_std_mask; 1160c0d06caSMauro Carvalho Chehab 1170c0d06caSMauro Carvalho Chehab /* V4L tuner type ID to use with this device (only used if the 1180c0d06caSMauro Carvalho Chehab driver could not discover the type any other way). */ 1190c0d06caSMauro Carvalho Chehab int default_tuner_type; 1200c0d06caSMauro Carvalho Chehab 1210c0d06caSMauro Carvalho Chehab /* Signal routing scheme used by device, contains one of 1220c0d06caSMauro Carvalho Chehab PVR2_ROUTING_SCHEME_XXX. Schemes have to be defined as we 1230c0d06caSMauro Carvalho Chehab encounter them. This is an arbitrary integer scheme id; its 1240c0d06caSMauro Carvalho Chehab meaning is contained entirely within the driver and is 1250c0d06caSMauro Carvalho Chehab interpreted by logic which must send commands to the chip-level 1260c0d06caSMauro Carvalho Chehab drivers (search for things which touch this field). */ 1270c0d06caSMauro Carvalho Chehab unsigned char signal_routing_scheme; 1280c0d06caSMauro Carvalho Chehab 1290c0d06caSMauro Carvalho Chehab /* Indicates scheme for controlling device's LED (if any). The 1300c0d06caSMauro Carvalho Chehab driver will turn on the LED when streaming is underway. This 1310c0d06caSMauro Carvalho Chehab contains one of PVR2_LED_SCHEME_XXX. */ 1320c0d06caSMauro Carvalho Chehab unsigned char led_scheme; 1330c0d06caSMauro Carvalho Chehab 1340c0d06caSMauro Carvalho Chehab /* Control scheme to use if there is a digital tuner. This 1350c0d06caSMauro Carvalho Chehab contains one of PVR2_DIGITAL_SCHEME_XXX. This is an arbitrary 1360c0d06caSMauro Carvalho Chehab integer scheme id; its meaning is contained entirely within the 1370c0d06caSMauro Carvalho Chehab driver and is interpreted by logic which must control the 1380c0d06caSMauro Carvalho Chehab streaming pathway (search for things which touch this field). */ 1390c0d06caSMauro Carvalho Chehab unsigned char digital_control_scheme; 1400c0d06caSMauro Carvalho Chehab 1410c0d06caSMauro Carvalho Chehab /* If set, we don't bother trying to load cx23416 firmware. */ 1420c0d06caSMauro Carvalho Chehab unsigned int flag_skip_cx23416_firmware:1; 1430c0d06caSMauro Carvalho Chehab 1440c0d06caSMauro Carvalho Chehab /* If set, the encoder must be healthy in order for digital mode to 1450c0d06caSMauro Carvalho Chehab work (otherwise we assume that digital streaming will work even 1460c0d06caSMauro Carvalho Chehab if we fail to locate firmware for the encoder). If the device 1470c0d06caSMauro Carvalho Chehab doesn't support digital streaming then this flag has no 1480c0d06caSMauro Carvalho Chehab effect. */ 1490c0d06caSMauro Carvalho Chehab unsigned int flag_digital_requires_cx23416:1; 1500c0d06caSMauro Carvalho Chehab 1510c0d06caSMauro Carvalho Chehab /* Device has a hauppauge eeprom which we can interrogate. */ 1520c0d06caSMauro Carvalho Chehab unsigned int flag_has_hauppauge_rom:1; 1530c0d06caSMauro Carvalho Chehab 1540c0d06caSMauro Carvalho Chehab /* Device does not require a powerup command to be issued. */ 1550c0d06caSMauro Carvalho Chehab unsigned int flag_no_powerup:1; 1560c0d06caSMauro Carvalho Chehab 1570c0d06caSMauro Carvalho Chehab /* Device has a cx25840 - this enables special additional logic to 1580c0d06caSMauro Carvalho Chehab handle it. */ 1590c0d06caSMauro Carvalho Chehab unsigned int flag_has_cx25840:1; 1600c0d06caSMauro Carvalho Chehab 1610c0d06caSMauro Carvalho Chehab /* Device has a wm8775 - this enables special additional logic to 1620c0d06caSMauro Carvalho Chehab ensure that it is found. */ 1630c0d06caSMauro Carvalho Chehab unsigned int flag_has_wm8775:1; 1640c0d06caSMauro Carvalho Chehab 1650c0d06caSMauro Carvalho Chehab /* Indicate IR scheme of hardware. If not set, then it is assumed 1660c0d06caSMauro Carvalho Chehab that IR can work without any help from the driver. */ 1670c0d06caSMauro Carvalho Chehab unsigned int ir_scheme:3; 1680c0d06caSMauro Carvalho Chehab 1690c0d06caSMauro Carvalho Chehab /* These bits define which kinds of sources the device can handle. 1700c0d06caSMauro Carvalho Chehab Note: Digital tuner presence is inferred by the 1710c0d06caSMauro Carvalho Chehab digital_control_scheme enumeration. */ 1720c0d06caSMauro Carvalho Chehab unsigned int flag_has_fmradio:1; /* Has FM radio receiver */ 1730c0d06caSMauro Carvalho Chehab unsigned int flag_has_analogtuner:1; /* Has analog tuner */ 1740c0d06caSMauro Carvalho Chehab unsigned int flag_has_composite:1; /* Has composite input */ 1750c0d06caSMauro Carvalho Chehab unsigned int flag_has_svideo:1; /* Has s-video input */ 1760c0d06caSMauro Carvalho Chehab unsigned int flag_fx2_16kb:1; /* 16KB FX2 firmware OK here */ 1770c0d06caSMauro Carvalho Chehab 1780c0d06caSMauro Carvalho Chehab /* If this driver is considered experimental, i.e. not all aspects 1790c0d06caSMauro Carvalho Chehab are working correctly and/or it is untested, mark that fact 1800c0d06caSMauro Carvalho Chehab with this flag. */ 1810c0d06caSMauro Carvalho Chehab unsigned int flag_is_experimental:1; 1820c0d06caSMauro Carvalho Chehab }; 1830c0d06caSMauro Carvalho Chehab 1840c0d06caSMauro Carvalho Chehab extern struct usb_device_id pvr2_device_table[]; 1850c0d06caSMauro Carvalho Chehab 1860c0d06caSMauro Carvalho Chehab #endif /* __PVRUSB2_HDW_INTERNAL_H */ 187