V4L/DVB (8475): pvrusb2: Cosmetic macro fix (benign)
[safe/jmp/linux-2.6] / drivers / media / video / pvrusb2 / pvrusb2-devattr.h
1 /*
2  *
3  *
4  *  Copyright (C) 2005 Mike Isely <isely@pobox.com>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  */
20 #ifndef __PVRUSB2_DEVATTR_H
21 #define __PVRUSB2_DEVATTR_H
22
23 #include <linux/mod_devicetable.h>
24 #include <linux/videodev2.h>
25 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
26 #include "pvrusb2-dvb.h"
27 #endif
28
29 /*
30
31   This header defines structures used to describe attributes of a device.
32
33 */
34
35
36 struct pvr2_string_table {
37         const char **lst;
38         unsigned int cnt;
39 };
40
41 #define PVR2_ROUTING_SCHEME_HAUPPAUGE 0
42 #define PVR2_ROUTING_SCHEME_GOTVIEW 1
43
44 #define PVR2_DIGITAL_SCHEME_NONE 0
45 #define PVR2_DIGITAL_SCHEME_HAUPPAUGE 1
46 #define PVR2_DIGITAL_SCHEME_ONAIR 2
47
48 #define PVR2_LED_SCHEME_NONE 0
49 #define PVR2_LED_SCHEME_HAUPPAUGE 1
50
51 #define PVR2_IR_SCHEME_NONE 0
52 #define PVR2_IR_SCHEME_24XXX 1
53 #define PVR2_IR_SCHEME_ZILOG 2
54
55 /* This describes a particular hardware type (except for the USB device ID
56    which must live in a separate structure due to environmental
57    constraints).  See the top of pvrusb2-hdw.c for where this is
58    instantiated. */
59 struct pvr2_device_desc {
60         /* Single line text description of hardware */
61         const char *description;
62
63         /* Single token identifier for hardware */
64         const char *shortname;
65
66         /* List of additional client modules we need to load */
67         struct pvr2_string_table client_modules;
68
69         /* List of FX2 firmware file names we should search; if empty then
70            FX2 firmware check / load is skipped and we assume the device
71            was initialized from internal ROM. */
72         struct pvr2_string_table fx2_firmware;
73
74 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
75         /* callback functions to handle attachment of digital tuner & demod */
76         struct pvr2_dvb_props *dvb_props;
77
78 #endif
79         /* Initial standard bits to use for this device, if not zero.
80            Anything set here is also implied as an available standard.
81            Note: This is ignored if overridden on the module load line via
82            the video_std module option. */
83         v4l2_std_id default_std_mask;
84
85         /* V4L tuner type ID to use with this device (only used if the
86            driver could not discover the type any other way). */
87         int default_tuner_type;
88
89         /* Signal routing scheme used by device, contains one of
90            PVR2_ROUTING_SCHEME_XXX.  Schemes have to be defined as we
91            encounter them.  This is an arbitrary integer scheme id; its
92            meaning is contained entirely within the driver and is
93            interpreted by logic which must send commands to the chip-level
94            drivers (search for things which touch this field). */
95         unsigned char signal_routing_scheme;
96
97         /* Indicates scheme for controlling device's LED (if any).  The
98            driver will turn on the LED when streaming is underway.  This
99            contains one of PVR2_LED_SCHEME_XXX. */
100         unsigned char led_scheme;
101
102         /* Control scheme to use if there is a digital tuner.  This
103            contains one of PVR2_DIGITAL_SCHEME_XXX.  This is an arbitrary
104            integer scheme id; its meaning is contained entirely within the
105            driver and is interpreted by logic which must control the
106            streaming pathway (search for things which touch this field). */
107         unsigned char digital_control_scheme;
108
109         /* If set, we don't bother trying to load cx23416 firmware. */
110         unsigned int flag_skip_cx23416_firmware:1;
111
112         /* If set, the encoder must be healthy in order for digital mode to
113            work (otherwise we assume that digital streaming will work even
114            if we fail to locate firmware for the encoder).  If the device
115            doesn't support digital streaming then this flag has no
116            effect. */
117         unsigned int flag_digital_requires_cx23416:1;
118
119         /* Device has a hauppauge eeprom which we can interrogate. */
120         unsigned int flag_has_hauppauge_rom:1;
121
122         /* Device does not require a powerup command to be issued. */
123         unsigned int flag_no_powerup:1;
124
125         /* Device has a cx25840 - this enables special additional logic to
126            handle it. */
127         unsigned int flag_has_cx25840:1;
128
129         /* Device has a wm8775 - this enables special additional logic to
130            ensure that it is found. */
131         unsigned int flag_has_wm8775:1;
132
133         /* Indicate any specialized IR scheme that might need to be
134            supported by this driver.  If not set, then it is assumed that
135            IR can work without help from the driver (which is frequently
136            the case).  This is otherwise set to one of
137            PVR2_IR_SCHEME_xxxx.  For "xxxx", the value "24XXX" indicates a
138            Hauppauge 24xxx class device which has an FPGA-hosted IR
139            receiver that can only be reached via FX2 command codes.  In
140            that case the pvrusb2 driver will emulate the behavior of the
141            older 29xxx device's IR receiver (a "virtual" I2C chip) in terms
142            of those command codes.  For the value "ZILOG", we're dealing
143            with an IR chip that must be taken out of reset via another FX2
144            command code (which is the case for HVR-1950 devices). */
145         unsigned int ir_scheme:2;
146
147         /* These bits define which kinds of sources the device can handle.
148            Note: Digital tuner presence is inferred by the
149            digital_control_scheme enumeration. */
150         unsigned int flag_has_fmradio:1;       /* Has FM radio receiver */
151         unsigned int flag_has_analogtuner:1;   /* Has analog tuner */
152         unsigned int flag_has_composite:1;     /* Has composite input */
153         unsigned int flag_has_svideo:1;        /* Has s-video input */
154 };
155
156 extern struct usb_device_id pvr2_device_table[];
157
158 #endif /* __PVRUSB2_HDW_INTERNAL_H */
159
160 /*
161   Stuff for Emacs to see, in order to encourage consistent editing style:
162   *** Local Variables: ***
163   *** mode: c ***
164   *** fill-column: 75 ***
165   *** tab-width: 8 ***
166   *** c-basic-offset: 8 ***
167   *** End: ***
168   */