V4L/DVB (7705): pvrusb2: Enable OnAir digital operation
[deliverable/linux.git] / drivers / media / video / pvrusb2 / pvrusb2-devattr.c
1 /*
2 *
3 * $Id$
4 *
5 * Copyright (C) 2007 Mike Isely <isely@pobox.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22 /*
23
24 This source file should encompass ALL per-device type information for the
25 driver. To define a new device, add elements to the pvr2_device_table and
26 pvr2_device_desc structures.
27
28 */
29
30 #include "pvrusb2-devattr.h"
31 #include <linux/usb.h>
32 /* This is needed in order to pull in tuner type ids... */
33 #include <linux/i2c.h>
34 #include <media/tuner.h>
35 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
36 #include "pvrusb2-hdw-internal.h"
37 #include "lgdt330x.h"
38 #include "tuner-simple.h"
39 #endif
40
41
42 /*------------------------------------------------------------------------*/
43 /* Hauppauge PVR-USB2 Model 29xxx */
44
45 static const char *pvr2_client_29xxx[] = {
46 "msp3400",
47 "saa7115",
48 "tuner",
49 };
50
51 static const char *pvr2_fw1_names_29xxx[] = {
52 "v4l-pvrusb2-29xxx-01.fw",
53 };
54
55 static const struct pvr2_device_desc pvr2_device_29xxx = {
56 .description = "WinTV PVR USB2 Model Category 29xxx",
57 .shortname = "29xxx",
58 .client_modules.lst = pvr2_client_29xxx,
59 .client_modules.cnt = ARRAY_SIZE(pvr2_client_29xxx),
60 .fx2_firmware.lst = pvr2_fw1_names_29xxx,
61 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx),
62 .flag_has_hauppauge_rom = !0,
63 .flag_has_analogtuner = !0,
64 .flag_has_fmradio = !0,
65 .flag_has_composite = !0,
66 .flag_has_svideo = !0,
67 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
68 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
69 };
70
71
72
73 /*------------------------------------------------------------------------*/
74 /* Hauppauge PVR-USB2 Model 24xxx */
75
76 static const char *pvr2_client_24xxx[] = {
77 "cx25840",
78 "tuner",
79 "wm8775",
80 };
81
82 static const char *pvr2_fw1_names_24xxx[] = {
83 "v4l-pvrusb2-24xxx-01.fw",
84 };
85
86 static const struct pvr2_device_desc pvr2_device_24xxx = {
87 .description = "WinTV PVR USB2 Model Category 24xxx",
88 .shortname = "24xxx",
89 .client_modules.lst = pvr2_client_24xxx,
90 .client_modules.cnt = ARRAY_SIZE(pvr2_client_24xxx),
91 .fx2_firmware.lst = pvr2_fw1_names_24xxx,
92 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx),
93 .flag_has_cx25840 = !0,
94 .flag_has_wm8775 = !0,
95 .flag_has_hauppauge_rom = !0,
96 .flag_has_hauppauge_custom_ir = !0,
97 .flag_has_analogtuner = !0,
98 .flag_has_fmradio = !0,
99 .flag_has_composite = !0,
100 .flag_has_svideo = !0,
101 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
102 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
103 };
104
105
106
107 /*------------------------------------------------------------------------*/
108 /* GOTVIEW USB2.0 DVD2 */
109
110 static const char *pvr2_client_gotview_2[] = {
111 "cx25840",
112 "tuner",
113 };
114
115 static const struct pvr2_device_desc pvr2_device_gotview_2 = {
116 .description = "Gotview USB 2.0 DVD 2",
117 .shortname = "gv2",
118 .client_modules.lst = pvr2_client_gotview_2,
119 .client_modules.cnt = ARRAY_SIZE(pvr2_client_gotview_2),
120 .flag_has_cx25840 = !0,
121 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
122 .flag_has_analogtuner = !0,
123 .flag_has_composite = !0,
124 .flag_has_svideo = !0,
125 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
126 };
127
128
129
130 /*------------------------------------------------------------------------*/
131 /* GOTVIEW USB2.0 DVD Deluxe */
132
133 /* (same module list as gotview_2) */
134
135 static const struct pvr2_device_desc pvr2_device_gotview_2d = {
136 .description = "Gotview USB 2.0 DVD Deluxe",
137 .shortname = "gv2d",
138 .client_modules.lst = pvr2_client_gotview_2,
139 .client_modules.cnt = ARRAY_SIZE(pvr2_client_gotview_2),
140 .flag_has_cx25840 = !0,
141 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
142 .flag_has_analogtuner = !0,
143 .flag_has_composite = !0,
144 .flag_has_svideo = !0,
145 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
146 };
147
148
149
150 #ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_CREATOR
151 /*------------------------------------------------------------------------*/
152 /* OnAir Creator */
153
154 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
155 static struct lgdt330x_config pvr2_lgdt3303_config = {
156 .demod_address = 0x0e,
157 .demod_chip = LGDT3303,
158 .clock_polarity_flip = 1,
159 };
160
161 static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap)
162 {
163 adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3303_config,
164 &adap->channel.hdw->i2c_adap);
165 if (adap->fe)
166 return 0;
167
168 return -EIO;
169 }
170
171 static int pvr2_lgh06xf_attach(struct pvr2_dvb_adapter *adap)
172 {
173 dvb_attach(simple_tuner_attach, adap->fe,
174 &adap->channel.hdw->i2c_adap, 0x61,
175 TUNER_LG_TDVS_H06XF);
176
177 return 0;
178 }
179
180 struct pvr2_dvb_props pvr2_onair_creator_fe_props = {
181 .frontend_attach = pvr2_lgdt3303_attach,
182 .tuner_attach = pvr2_lgh06xf_attach,
183 };
184 #endif
185
186 static const char *pvr2_client_onair_creator[] = {
187 "saa7115",
188 "tuner",
189 "cs53l32a",
190 };
191
192 static const struct pvr2_device_desc pvr2_device_onair_creator = {
193 .description = "OnAir Creator Hybrid USB tuner",
194 .shortname = "oac",
195 .client_modules.lst = pvr2_client_onair_creator,
196 .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_creator),
197 .default_tuner_type = TUNER_LG_TDVS_H06XF,
198 .flag_has_analogtuner = !0,
199 .flag_has_composite = !0,
200 .flag_has_svideo = !0,
201 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
202 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
203 .default_std_mask = V4L2_STD_NTSC_M,
204 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
205 .dvb_props = &pvr2_onair_creator_fe_props,
206 #endif
207 };
208 #endif
209
210
211
212 #ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_USB2
213 /*------------------------------------------------------------------------*/
214 /* OnAir USB 2.0 */
215
216 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
217 static struct lgdt330x_config pvr2_lgdt3302_config = {
218 .demod_address = 0x0e,
219 .demod_chip = LGDT3302,
220 };
221
222 static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap)
223 {
224 adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3302_config,
225 &adap->channel.hdw->i2c_adap);
226 if (adap->fe)
227 return 0;
228
229 return -EIO;
230 }
231
232 static int pvr2_fcv1236d_attach(struct pvr2_dvb_adapter *adap)
233 {
234 dvb_attach(simple_tuner_attach, adap->fe,
235 &adap->channel.hdw->i2c_adap, 0x61,
236 TUNER_PHILIPS_FCV1236D);
237
238 return 0;
239 }
240
241 struct pvr2_dvb_props pvr2_onair_usb2_fe_props = {
242 .frontend_attach = pvr2_lgdt3302_attach,
243 .tuner_attach = pvr2_fcv1236d_attach,
244 };
245 #endif
246
247 static const char *pvr2_client_onair_usb2[] = {
248 "saa7115",
249 "tuner",
250 "cs53l32a",
251 };
252
253 static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
254 .description = "OnAir USB2 Hybrid USB tuner",
255 .shortname = "oa2",
256 .client_modules.lst = pvr2_client_onair_usb2,
257 .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_usb2),
258 .default_tuner_type = TUNER_PHILIPS_FCV1236D,
259 .flag_has_analogtuner = !0,
260 .flag_has_composite = !0,
261 .flag_has_svideo = !0,
262 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
263 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
264 .default_std_mask = V4L2_STD_NTSC_M,
265 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
266 .dvb_props = &pvr2_onair_usb2_fe_props,
267 #endif
268 };
269 #endif
270
271
272
273 /*------------------------------------------------------------------------*/
274 /* Hauppauge PVR-USB2 Model 73xxx */
275
276 static const char *pvr2_client_73xxx[] = {
277 "cx25840",
278 "tuner",
279 };
280
281 static const char *pvr2_fw1_names_73xxx[] = {
282 "v4l-pvrusb2-73xxx-01.fw",
283 };
284
285 static const struct pvr2_device_desc pvr2_device_73xxx = {
286 .description = "WinTV PVR USB2 Model Category 73xxx",
287 .shortname = "73xxx",
288 .client_modules.lst = pvr2_client_73xxx,
289 .client_modules.cnt = ARRAY_SIZE(pvr2_client_73xxx),
290 .fx2_firmware.lst = pvr2_fw1_names_73xxx,
291 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx),
292 .flag_has_cx25840 = !0,
293 .flag_has_hauppauge_rom = !0,
294 .flag_has_analogtuner = !0,
295 .flag_has_composite = !0,
296 .flag_has_svideo = !0,
297 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
298 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
299 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
300 };
301
302
303
304 /*------------------------------------------------------------------------*/
305 /* Hauppauge PVR-USB2 Model 75xxx */
306
307 static const char *pvr2_client_75xxx[] = {
308 "cx25840",
309 "tuner",
310 };
311
312 static const char *pvr2_fw1_names_75xxx[] = {
313 "v4l-pvrusb2-73xxx-01.fw",
314 };
315
316 static const struct pvr2_device_desc pvr2_device_75xxx = {
317 .description = "WinTV PVR USB2 Model Category 75xxx",
318 .shortname = "75xxx",
319 .client_modules.lst = pvr2_client_75xxx,
320 .client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx),
321 .fx2_firmware.lst = pvr2_fw1_names_75xxx,
322 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
323 .flag_has_cx25840 = !0,
324 .flag_has_hauppauge_rom = !0,
325 .flag_has_analogtuner = !0,
326 .flag_has_composite = !0,
327 .flag_has_svideo = !0,
328 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
329 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
330 .default_std_mask = V4L2_STD_NTSC_M,
331 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
332 };
333
334
335
336 /*------------------------------------------------------------------------*/
337
338 struct usb_device_id pvr2_device_table[] = {
339 { USB_DEVICE(0x2040, 0x2900),
340 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
341 { USB_DEVICE(0x2040, 0x2400),
342 .driver_info = (kernel_ulong_t)&pvr2_device_24xxx},
343 { USB_DEVICE(0x1164, 0x0622),
344 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2},
345 { USB_DEVICE(0x1164, 0x0602),
346 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2d},
347 #ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_CREATOR
348 { USB_DEVICE(0x11ba, 0x1003),
349 .driver_info = (kernel_ulong_t)&pvr2_device_onair_creator},
350 #endif
351 #ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_USB2
352 { USB_DEVICE(0x11ba, 0x1001),
353 .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2},
354 #endif
355 { USB_DEVICE(0x2040, 0x7300),
356 .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
357 { USB_DEVICE(0x2040, 0x7500),
358 .driver_info = (kernel_ulong_t)&pvr2_device_75xxx},
359 { USB_DEVICE(0x2040, 0x7501),
360 .driver_info = (kernel_ulong_t)&pvr2_device_75xxx},
361 { }
362 };
363
364 MODULE_DEVICE_TABLE(usb, pvr2_device_table);
365
366
367 /*
368 Stuff for Emacs to see, in order to encourage consistent editing style:
369 *** Local Variables: ***
370 *** mode: c ***
371 *** fill-column: 75 ***
372 *** tab-width: 8 ***
373 *** c-basic-offset: 8 ***
374 *** End: ***
375 */
This page took 0.042048 seconds and 5 git commands to generate.