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