blob: 6794862bbb194d6dce658ad10ececa913a133c49 [file] [log] [blame]
Mike Isely989eb152007-11-26 01:53:12 -03001/*
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
24This source file should encompass ALL per-device type information for the
25driver. To define a new device, add elements to the pvr2_device_table and
26pvr2_device_desc structures.
27
28*/
29
30#include "pvrusb2-devattr.h"
31#include <linux/usb.h>
Mike Isely6a540252007-12-02 23:51:34 -030032/* This is needed in order to pull in tuner type ids... */
Mike Isely9e2e3ae2007-11-26 02:14:23 -030033#include <linux/i2c.h>
Mike Isely9e2e3ae2007-11-26 02:14:23 -030034#include <media/tuner.h>
Michael Krufky906a4952008-03-28 05:47:47 -030035#ifdef CONFIG_VIDEO_PVRUSB2_DVB
36#include "pvrusb2-hdw-internal.h"
37#include "lgdt330x.h"
38#include "tuner-simple.h"
39#endif
Mike Isely989eb152007-11-26 01:53:12 -030040
Mike Isely45427832007-12-08 17:11:13 -030041
Mike Iselyd130fa82007-12-08 17:20:06 -030042/*------------------------------------------------------------------------*/
43/* Hauppauge PVR-USB2 Model 29xxx */
Mike Isely989eb152007-11-26 01:53:12 -030044
Mike Isely989eb152007-11-26 01:53:12 -030045static const char *pvr2_client_29xxx[] = {
46 "msp3400",
47 "saa7115",
48 "tuner",
49};
50
Mike Isely989eb152007-11-26 01:53:12 -030051static const char *pvr2_fw1_names_29xxx[] = {
52 "v4l-pvrusb2-29xxx-01.fw",
53};
54
Mike Iselyd130fa82007-12-08 17:20:06 -030055static const struct pvr2_device_desc pvr2_device_29xxx = {
Mike Iselye7f677f2008-03-16 01:13:17 -030056 .description = "WinTV PVR USB2 Model Category 29xxx",
Mike Isely989eb152007-11-26 01:53:12 -030057 .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),
Mike Iselyaaf78842007-11-26 02:04:11 -030062 .flag_has_hauppauge_rom = !0,
Mike Isely1aaac602008-04-22 14:45:36 -030063 .flag_has_analogtuner = !0,
Mike Iselyd068c6e2008-04-22 14:45:36 -030064 .flag_has_fmradio = !0,
Mike Isely1aaac602008-04-22 14:45:36 -030065 .flag_has_composite = !0,
66 .flag_has_svideo = !0,
Mike Iselyf5174af2007-11-26 02:07:26 -030067 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Isely40381cb2008-04-22 14:45:42 -030068 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Iselyd130fa82007-12-08 17:20:06 -030069};
70
71
72
73/*------------------------------------------------------------------------*/
74/* Hauppauge PVR-USB2 Model 24xxx */
75
76static const char *pvr2_client_24xxx[] = {
77 "cx25840",
78 "tuner",
79 "wm8775",
80};
81
82static const char *pvr2_fw1_names_24xxx[] = {
83 "v4l-pvrusb2-24xxx-01.fw",
84};
85
86static const struct pvr2_device_desc pvr2_device_24xxx = {
Mike Iselye7f677f2008-03-16 01:13:17 -030087 .description = "WinTV PVR USB2 Model Category 24xxx",
Mike Isely989eb152007-11-26 01:53:12 -030088 .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,
Mike Iselyaaf78842007-11-26 02:04:11 -030095 .flag_has_hauppauge_rom = !0,
Mike Isely056d1a82007-11-26 02:09:42 -030096 .flag_has_hauppauge_custom_ir = !0,
Mike Isely1aaac602008-04-22 14:45:36 -030097 .flag_has_analogtuner = !0,
Mike Iselyd068c6e2008-04-22 14:45:36 -030098 .flag_has_fmradio = !0,
Mike Isely1aaac602008-04-22 14:45:36 -030099 .flag_has_composite = !0,
100 .flag_has_svideo = !0,
Mike Iselyf5174af2007-11-26 02:07:26 -0300101 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Isely40381cb2008-04-22 14:45:42 -0300102 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Iselyd130fa82007-12-08 17:20:06 -0300103};
104
105
106
107/*------------------------------------------------------------------------*/
108/* GOTVIEW USB2.0 DVD2 */
109
110static const char *pvr2_client_gotview_2[] = {
111 "cx25840",
112 "tuner",
113};
114
115static const struct pvr2_device_desc pvr2_device_gotview_2 = {
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300116 .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),
Mike Isely787f5ab2007-12-08 17:08:32 -0300120 .flag_has_cx25840 = !0,
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300121 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
Mike Isely1aaac602008-04-22 14:45:36 -0300122 .flag_has_analogtuner = !0,
123 .flag_has_composite = !0,
124 .flag_has_svideo = !0,
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300125 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
Mike Isely989eb152007-11-26 01:53:12 -0300126};
127
Mike Iselyd130fa82007-12-08 17:20:06 -0300128
129
Mike Iselyfd1da782008-04-22 14:45:42 -0300130/*------------------------------------------------------------------------*/
131/* GOTVIEW USB2.0 DVD Deluxe */
132
133/* (same module list as gotview_2) */
134
135static 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
Mike Iselyd130fa82007-12-08 17:20:06 -0300150#ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_CREATOR
151/*------------------------------------------------------------------------*/
152/* OnAir Creator */
153
Michael Krufky906a4952008-03-28 05:47:47 -0300154#ifdef CONFIG_VIDEO_PVRUSB2_DVB
155static struct lgdt330x_config pvr2_lgdt3303_config = {
156 .demod_address = 0x0e,
157 .demod_chip = LGDT3303,
158 .clock_polarity_flip = 1,
159};
160
161static 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
171static 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
180struct pvr2_dvb_props pvr2_onair_creator_fe_props = {
181 .frontend_attach = pvr2_lgdt3303_attach,
182 .tuner_attach = pvr2_lgh06xf_attach,
183};
184#endif
185
Mike Iselyd130fa82007-12-08 17:20:06 -0300186static const char *pvr2_client_onair_creator[] = {
187 "saa7115",
188 "tuner",
189 "cs53l32a",
190};
191
192static 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,
Mike Isely1aaac602008-04-22 14:45:36 -0300198 .flag_has_analogtuner = !0,
199 .flag_has_composite = !0,
200 .flag_has_svideo = !0,
Mike Iselyd130fa82007-12-08 17:20:06 -0300201 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300202 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
Michael Krufkyf0910c72008-04-22 14:45:45 -0300203 .default_std_mask = V4L2_STD_NTSC_M,
Michael Krufky906a4952008-03-28 05:47:47 -0300204#ifdef CONFIG_VIDEO_PVRUSB2_DVB
205 .dvb_props = &pvr2_onair_creator_fe_props,
206#endif
Mike Iselyd130fa82007-12-08 17:20:06 -0300207};
208#endif
209
210
211
212#ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_USB2
213/*------------------------------------------------------------------------*/
214/* OnAir USB 2.0 */
215
Michael Krufky906a4952008-03-28 05:47:47 -0300216#ifdef CONFIG_VIDEO_PVRUSB2_DVB
217static struct lgdt330x_config pvr2_lgdt3302_config = {
218 .demod_address = 0x0e,
219 .demod_chip = LGDT3302,
220};
221
222static 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
232static 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
241struct pvr2_dvb_props pvr2_onair_usb2_fe_props = {
242 .frontend_attach = pvr2_lgdt3302_attach,
243 .tuner_attach = pvr2_fcv1236d_attach,
244};
245#endif
246
Mike Iselyd130fa82007-12-08 17:20:06 -0300247static const char *pvr2_client_onair_usb2[] = {
248 "saa7115",
249 "tuner",
250 "cs53l32a",
251};
252
253static 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),
Michael Krufkyab8b8702008-04-22 14:46:05 -0300258 .default_tuner_type = TUNER_PHILIPS_FCV1236D,
Mike Isely1aaac602008-04-22 14:45:36 -0300259 .flag_has_analogtuner = !0,
260 .flag_has_composite = !0,
261 .flag_has_svideo = !0,
Mike Iselyd130fa82007-12-08 17:20:06 -0300262 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300263 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
Michael Krufkyf0910c72008-04-22 14:45:45 -0300264 .default_std_mask = V4L2_STD_NTSC_M,
Michael Krufky906a4952008-03-28 05:47:47 -0300265#ifdef CONFIG_VIDEO_PVRUSB2_DVB
266 .dvb_props = &pvr2_onair_usb2_fe_props,
267#endif
Mike Iselyd130fa82007-12-08 17:20:06 -0300268};
269#endif
270
271
272
273/*------------------------------------------------------------------------*/
Michael Krufky92c9d072008-03-15 23:59:29 -0300274/* Hauppauge PVR-USB2 Model 73xxx */
275
276static const char *pvr2_client_73xxx[] = {
277 "cx25840",
278 "tuner",
279};
280
281static const char *pvr2_fw1_names_73xxx[] = {
282 "v4l-pvrusb2-73xxx-01.fw",
283};
284
285static const struct pvr2_device_desc pvr2_device_73xxx = {
Mike Iselye7f677f2008-03-16 01:13:17 -0300286 .description = "WinTV PVR USB2 Model Category 73xxx",
Michael Krufky92c9d072008-03-15 23:59:29 -0300287 .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/*------------------------------------------------------------------------*/
Michael Krufky11fcd472007-10-25 02:01:10 -0300305/* Hauppauge PVR-USB2 Model 75xxx */
306
307static const char *pvr2_client_75xxx[] = {
308 "cx25840",
309 "tuner",
310};
311
312static const char *pvr2_fw1_names_75xxx[] = {
313 "v4l-pvrusb2-73xxx-01.fw",
314};
315
316static const struct pvr2_device_desc pvr2_device_75xxx = {
Mike Iselye7f677f2008-03-16 01:13:17 -0300317 .description = "WinTV PVR USB2 Model Category 75xxx",
Michael Krufky11fcd472007-10-25 02:01:10 -0300318 .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,
Mike Isely1aaac602008-04-22 14:45:36 -0300325 .flag_has_analogtuner = !0,
326 .flag_has_composite = !0,
327 .flag_has_svideo = !0,
Michael Krufky11fcd472007-10-25 02:01:10 -0300328 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300329 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
Michael Krufky11fcd472007-10-25 02:01:10 -0300330 .default_std_mask = V4L2_STD_NTSC_M,
Mike Isely40381cb2008-04-22 14:45:42 -0300331 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Michael Krufky11fcd472007-10-25 02:01:10 -0300332};
333
334
335
336/*------------------------------------------------------------------------*/
Mike Iselyd130fa82007-12-08 17:20:06 -0300337
338struct 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},
Mike Iselyfd1da782008-04-22 14:45:42 -0300345 { USB_DEVICE(0x1164, 0x0602),
346 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2d},
Mike Iselyd130fa82007-12-08 17:20:06 -0300347#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
Michael Krufky92c9d072008-03-15 23:59:29 -0300355 { USB_DEVICE(0x2040, 0x7300),
356 .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
Michael Krufky11fcd472007-10-25 02:01:10 -0300357 { USB_DEVICE(0x2040, 0x7500),
358 .driver_info = (kernel_ulong_t)&pvr2_device_75xxx},
Michael Krufkydd6e9462008-03-08 06:07:38 -0300359 { USB_DEVICE(0x2040, 0x7501),
360 .driver_info = (kernel_ulong_t)&pvr2_device_75xxx},
Mike Iselyd130fa82007-12-08 17:20:06 -0300361 { }
362};
Mike Isely989eb152007-11-26 01:53:12 -0300363
364MODULE_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 */