blob: 51b3312eaea13421097053e7955e2c1ac5128464 [file] [log] [blame]
Mike Isely989eb152007-11-26 01:53:12 -03001/*
2 *
Mike Isely989eb152007-11-26 01:53:12 -03003 *
4 * Copyright (C) 2007 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 *
Mike Isely989eb152007-11-26 01:53:12 -030015 */
16
17/*
18
19This source file should encompass ALL per-device type information for the
20driver. To define a new device, add elements to the pvr2_device_table and
21pvr2_device_desc structures.
22
23*/
24
25#include "pvrusb2-devattr.h"
26#include <linux/usb.h>
Paul Gortmaker7a707b82011-07-03 14:03:12 -040027#include <linux/module.h>
Mike Isely6a540252007-12-02 23:51:34 -030028/* This is needed in order to pull in tuner type ids... */
Mike Isely9e2e3ae2007-11-26 02:14:23 -030029#include <linux/i2c.h>
Mike Isely9e2e3ae2007-11-26 02:14:23 -030030#include <media/tuner.h>
Michael Krufky906a4952008-03-28 05:47:47 -030031#ifdef CONFIG_VIDEO_PVRUSB2_DVB
32#include "pvrusb2-hdw-internal.h"
33#include "lgdt330x.h"
Michael Krufky087886e2008-03-28 05:49:36 -030034#include "s5h1409.h"
Michael Krufky4aef8fd2008-04-25 04:19:02 -030035#include "s5h1411.h"
Michael Krufky95814bc2008-04-19 15:36:51 -030036#include "tda10048.h"
Michael Krufky087886e2008-03-28 05:49:36 -030037#include "tda18271.h"
38#include "tda8290.h"
Michael Krufky906a4952008-03-28 05:47:47 -030039#include "tuner-simple.h"
40#endif
Mike Isely989eb152007-11-26 01:53:12 -030041
Mike Isely45427832007-12-08 17:11:13 -030042
Mike Iselyd130fa82007-12-08 17:20:06 -030043/*------------------------------------------------------------------------*/
44/* Hauppauge PVR-USB2 Model 29xxx */
Mike Isely989eb152007-11-26 01:53:12 -030045
Mike Iselydd5f3222009-03-07 02:07:12 -030046static const struct pvr2_device_client_desc pvr2_cli_29xxx[] = {
47 { .module_id = PVR2_CLIENT_ID_SAA7115 },
48 { .module_id = PVR2_CLIENT_ID_MSP3400 },
49 { .module_id = PVR2_CLIENT_ID_TUNER },
Mike Iselybb652422009-03-14 14:09:04 -030050 { .module_id = PVR2_CLIENT_ID_DEMOD },
Mike Isely989eb152007-11-26 01:53:12 -030051};
52
Tim Gardner740a3ea2012-07-26 14:57:07 -030053#define PVR2_FIRMWARE_29xxx "v4l-pvrusb2-29xxx-01.fw"
Mike Isely989eb152007-11-26 01:53:12 -030054static const char *pvr2_fw1_names_29xxx[] = {
Tim Gardner740a3ea2012-07-26 14:57:07 -030055 PVR2_FIRMWARE_29xxx,
Mike Isely989eb152007-11-26 01:53:12 -030056};
57
Mike Iselyd130fa82007-12-08 17:20:06 -030058static const struct pvr2_device_desc pvr2_device_29xxx = {
Mike Isely1d70c7f2009-11-25 02:55:38 -030059 .description = "WinTV PVR USB2 Model 29xxx",
Mike Isely989eb152007-11-26 01:53:12 -030060 .shortname = "29xxx",
Mike Iselydd5f3222009-03-07 02:07:12 -030061 .client_table.lst = pvr2_cli_29xxx,
62 .client_table.cnt = ARRAY_SIZE(pvr2_cli_29xxx),
Mike Isely989eb152007-11-26 01:53:12 -030063 .fx2_firmware.lst = pvr2_fw1_names_29xxx,
64 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx),
Mike Iselyaaf78842007-11-26 02:04:11 -030065 .flag_has_hauppauge_rom = !0,
Mike Isely1aaac602008-04-22 14:45:36 -030066 .flag_has_analogtuner = !0,
Mike Iselyd068c6e2008-04-22 14:45:36 -030067 .flag_has_fmradio = !0,
Mike Isely1aaac602008-04-22 14:45:36 -030068 .flag_has_composite = !0,
69 .flag_has_svideo = !0,
Mike Iselyf5174af2007-11-26 02:07:26 -030070 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Isely40381cb2008-04-22 14:45:42 -030071 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Isely27eab382009-04-06 01:51:38 -030072 .ir_scheme = PVR2_IR_SCHEME_29XXX,
Mike Iselyd130fa82007-12-08 17:20:06 -030073};
74
75
76
77/*------------------------------------------------------------------------*/
78/* Hauppauge PVR-USB2 Model 24xxx */
79
Mike Iselydd5f3222009-03-07 02:07:12 -030080static const struct pvr2_device_client_desc pvr2_cli_24xxx[] = {
81 { .module_id = PVR2_CLIENT_ID_CX25840 },
82 { .module_id = PVR2_CLIENT_ID_TUNER },
83 { .module_id = PVR2_CLIENT_ID_WM8775 },
Mike Iselybb652422009-03-14 14:09:04 -030084 { .module_id = PVR2_CLIENT_ID_DEMOD },
Mike Iselyd130fa82007-12-08 17:20:06 -030085};
86
Tim Gardner740a3ea2012-07-26 14:57:07 -030087#define PVR2_FIRMWARE_24xxx "v4l-pvrusb2-24xxx-01.fw"
Mike Iselyd130fa82007-12-08 17:20:06 -030088static const char *pvr2_fw1_names_24xxx[] = {
Tim Gardner740a3ea2012-07-26 14:57:07 -030089 PVR2_FIRMWARE_24xxx,
Mike Iselyd130fa82007-12-08 17:20:06 -030090};
91
92static const struct pvr2_device_desc pvr2_device_24xxx = {
Mike Isely1d70c7f2009-11-25 02:55:38 -030093 .description = "WinTV PVR USB2 Model 24xxx",
Mike Isely989eb152007-11-26 01:53:12 -030094 .shortname = "24xxx",
Mike Iselydd5f3222009-03-07 02:07:12 -030095 .client_table.lst = pvr2_cli_24xxx,
96 .client_table.cnt = ARRAY_SIZE(pvr2_cli_24xxx),
Mike Isely989eb152007-11-26 01:53:12 -030097 .fx2_firmware.lst = pvr2_fw1_names_24xxx,
98 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx),
99 .flag_has_cx25840 = !0,
100 .flag_has_wm8775 = !0,
Mike Iselyaaf78842007-11-26 02:04:11 -0300101 .flag_has_hauppauge_rom = !0,
Mike Isely1aaac602008-04-22 14:45:36 -0300102 .flag_has_analogtuner = !0,
Mike Iselyd068c6e2008-04-22 14:45:36 -0300103 .flag_has_fmradio = !0,
Mike Isely1aaac602008-04-22 14:45:36 -0300104 .flag_has_composite = !0,
105 .flag_has_svideo = !0,
Mike Iselyf5174af2007-11-26 02:07:26 -0300106 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Isely40381cb2008-04-22 14:45:42 -0300107 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Isely31335b12008-07-25 19:35:31 -0300108 .ir_scheme = PVR2_IR_SCHEME_24XXX,
Mike Iselyd130fa82007-12-08 17:20:06 -0300109};
110
111
112
113/*------------------------------------------------------------------------*/
114/* GOTVIEW USB2.0 DVD2 */
115
Mike Iselydd5f3222009-03-07 02:07:12 -0300116static const struct pvr2_device_client_desc pvr2_cli_gotview_2[] = {
117 { .module_id = PVR2_CLIENT_ID_CX25840 },
118 { .module_id = PVR2_CLIENT_ID_TUNER },
Mike Iselyc641a182010-05-15 00:07:04 -0300119 { .module_id = PVR2_CLIENT_ID_DEMOD },
Mike Iselyd130fa82007-12-08 17:20:06 -0300120};
121
122static const struct pvr2_device_desc pvr2_device_gotview_2 = {
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300123 .description = "Gotview USB 2.0 DVD 2",
124 .shortname = "gv2",
Mike Iselydd5f3222009-03-07 02:07:12 -0300125 .client_table.lst = pvr2_cli_gotview_2,
126 .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2),
Mike Isely787f5ab2007-12-08 17:08:32 -0300127 .flag_has_cx25840 = !0,
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300128 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
Mike Isely1aaac602008-04-22 14:45:36 -0300129 .flag_has_analogtuner = !0,
Mike Isely1df59f02008-04-21 03:50:39 -0300130 .flag_has_fmradio = !0,
Mike Isely1aaac602008-04-22 14:45:36 -0300131 .flag_has_composite = !0,
132 .flag_has_svideo = !0,
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300133 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
Mike Isely989eb152007-11-26 01:53:12 -0300134};
135
Mike Iselyd130fa82007-12-08 17:20:06 -0300136
137
Mike Iselyfd1da782008-04-22 14:45:42 -0300138/*------------------------------------------------------------------------*/
139/* GOTVIEW USB2.0 DVD Deluxe */
140
141/* (same module list as gotview_2) */
142
143static const struct pvr2_device_desc pvr2_device_gotview_2d = {
144 .description = "Gotview USB 2.0 DVD Deluxe",
145 .shortname = "gv2d",
Mike Iselydd5f3222009-03-07 02:07:12 -0300146 .client_table.lst = pvr2_cli_gotview_2,
147 .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2),
Mike Iselyfd1da782008-04-22 14:45:42 -0300148 .flag_has_cx25840 = !0,
149 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
150 .flag_has_analogtuner = !0,
151 .flag_has_composite = !0,
152 .flag_has_svideo = !0,
153 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
154};
155
156
157
Mike Iselyd130fa82007-12-08 17:20:06 -0300158/*------------------------------------------------------------------------*/
Mike Isely43823c02011-03-13 20:37:11 -0300159/* Terratec Grabster AV400 */
160
161static const struct pvr2_device_client_desc pvr2_cli_av400[] = {
162 { .module_id = PVR2_CLIENT_ID_CX25840 },
163};
164
165static const struct pvr2_device_desc pvr2_device_av400 = {
166 .description = "Terratec Grabster AV400",
167 .shortname = "av400",
168 .flag_is_experimental = 1,
169 .client_table.lst = pvr2_cli_av400,
170 .client_table.cnt = ARRAY_SIZE(pvr2_cli_av400),
171 .flag_has_cx25840 = !0,
172 .flag_has_analogtuner = 0,
173 .flag_has_composite = !0,
174 .flag_has_svideo = !0,
175 .signal_routing_scheme = PVR2_ROUTING_SCHEME_AV400,
176};
177
178
179
180/*------------------------------------------------------------------------*/
Mike Iselyd130fa82007-12-08 17:20:06 -0300181/* OnAir Creator */
182
Michael Krufky906a4952008-03-28 05:47:47 -0300183#ifdef CONFIG_VIDEO_PVRUSB2_DVB
184static struct lgdt330x_config pvr2_lgdt3303_config = {
185 .demod_address = 0x0e,
186 .demod_chip = LGDT3303,
187 .clock_polarity_flip = 1,
188};
189
190static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap)
191{
192 adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3303_config,
193 &adap->channel.hdw->i2c_adap);
194 if (adap->fe)
195 return 0;
196
197 return -EIO;
198}
199
200static int pvr2_lgh06xf_attach(struct pvr2_dvb_adapter *adap)
201{
202 dvb_attach(simple_tuner_attach, adap->fe,
203 &adap->channel.hdw->i2c_adap, 0x61,
204 TUNER_LG_TDVS_H06XF);
205
206 return 0;
207}
208
Mike Isely69ea3c12009-03-07 02:08:58 -0300209static const struct pvr2_dvb_props pvr2_onair_creator_fe_props = {
Michael Krufky906a4952008-03-28 05:47:47 -0300210 .frontend_attach = pvr2_lgdt3303_attach,
211 .tuner_attach = pvr2_lgh06xf_attach,
212};
213#endif
214
Mike Iselydd5f3222009-03-07 02:07:12 -0300215static const struct pvr2_device_client_desc pvr2_cli_onair_creator[] = {
216 { .module_id = PVR2_CLIENT_ID_SAA7115 },
217 { .module_id = PVR2_CLIENT_ID_CS53L32A },
218 { .module_id = PVR2_CLIENT_ID_TUNER },
Mike Iselyd130fa82007-12-08 17:20:06 -0300219};
220
221static const struct pvr2_device_desc pvr2_device_onair_creator = {
222 .description = "OnAir Creator Hybrid USB tuner",
223 .shortname = "oac",
Mike Iselydd5f3222009-03-07 02:07:12 -0300224 .client_table.lst = pvr2_cli_onair_creator,
225 .client_table.cnt = ARRAY_SIZE(pvr2_cli_onair_creator),
Mike Iselyd130fa82007-12-08 17:20:06 -0300226 .default_tuner_type = TUNER_LG_TDVS_H06XF,
Mike Isely1aaac602008-04-22 14:45:36 -0300227 .flag_has_analogtuner = !0,
228 .flag_has_composite = !0,
229 .flag_has_svideo = !0,
Mike Isely72998b72008-04-03 04:51:19 -0300230 .flag_digital_requires_cx23416 = !0,
Mike Isely2a6b6272009-03-15 17:53:29 -0300231 .signal_routing_scheme = PVR2_ROUTING_SCHEME_ONAIR,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300232 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
Michael Krufkyf0910c72008-04-22 14:45:45 -0300233 .default_std_mask = V4L2_STD_NTSC_M,
Michael Krufky906a4952008-03-28 05:47:47 -0300234#ifdef CONFIG_VIDEO_PVRUSB2_DVB
235 .dvb_props = &pvr2_onair_creator_fe_props,
236#endif
Mike Iselyd130fa82007-12-08 17:20:06 -0300237};
Mike Iselyd130fa82007-12-08 17:20:06 -0300238
239
240
Mike Iselyd130fa82007-12-08 17:20:06 -0300241/*------------------------------------------------------------------------*/
242/* OnAir USB 2.0 */
243
Michael Krufky906a4952008-03-28 05:47:47 -0300244#ifdef CONFIG_VIDEO_PVRUSB2_DVB
245static struct lgdt330x_config pvr2_lgdt3302_config = {
246 .demod_address = 0x0e,
247 .demod_chip = LGDT3302,
248};
249
250static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap)
251{
252 adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3302_config,
253 &adap->channel.hdw->i2c_adap);
254 if (adap->fe)
255 return 0;
256
257 return -EIO;
258}
259
260static int pvr2_fcv1236d_attach(struct pvr2_dvb_adapter *adap)
261{
262 dvb_attach(simple_tuner_attach, adap->fe,
263 &adap->channel.hdw->i2c_adap, 0x61,
264 TUNER_PHILIPS_FCV1236D);
265
266 return 0;
267}
268
Mike Isely69ea3c12009-03-07 02:08:58 -0300269static const struct pvr2_dvb_props pvr2_onair_usb2_fe_props = {
Michael Krufky906a4952008-03-28 05:47:47 -0300270 .frontend_attach = pvr2_lgdt3302_attach,
271 .tuner_attach = pvr2_fcv1236d_attach,
272};
273#endif
274
Mike Iselydd5f3222009-03-07 02:07:12 -0300275static const struct pvr2_device_client_desc pvr2_cli_onair_usb2[] = {
276 { .module_id = PVR2_CLIENT_ID_SAA7115 },
277 { .module_id = PVR2_CLIENT_ID_CS53L32A },
278 { .module_id = PVR2_CLIENT_ID_TUNER },
Mike Iselyd130fa82007-12-08 17:20:06 -0300279};
280
281static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
282 .description = "OnAir USB2 Hybrid USB tuner",
283 .shortname = "oa2",
Mike Iselydd5f3222009-03-07 02:07:12 -0300284 .client_table.lst = pvr2_cli_onair_usb2,
285 .client_table.cnt = ARRAY_SIZE(pvr2_cli_onair_usb2),
Michael Krufkyab8b8702008-04-22 14:46:05 -0300286 .default_tuner_type = TUNER_PHILIPS_FCV1236D,
Mike Isely1aaac602008-04-22 14:45:36 -0300287 .flag_has_analogtuner = !0,
288 .flag_has_composite = !0,
289 .flag_has_svideo = !0,
Mike Isely72998b72008-04-03 04:51:19 -0300290 .flag_digital_requires_cx23416 = !0,
Mike Isely2a6b6272009-03-15 17:53:29 -0300291 .signal_routing_scheme = PVR2_ROUTING_SCHEME_ONAIR,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300292 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
Michael Krufkyf0910c72008-04-22 14:45:45 -0300293 .default_std_mask = V4L2_STD_NTSC_M,
Michael Krufky906a4952008-03-28 05:47:47 -0300294#ifdef CONFIG_VIDEO_PVRUSB2_DVB
295 .dvb_props = &pvr2_onair_usb2_fe_props,
296#endif
Mike Iselyd130fa82007-12-08 17:20:06 -0300297};
Mike Iselyd130fa82007-12-08 17:20:06 -0300298
299
300
301/*------------------------------------------------------------------------*/
Michael Krufky92c9d072008-03-15 23:59:29 -0300302/* Hauppauge PVR-USB2 Model 73xxx */
303
Michael Krufky95814bc2008-04-19 15:36:51 -0300304#ifdef CONFIG_VIDEO_PVRUSB2_DVB
305static struct tda10048_config hauppauge_tda10048_config = {
306 .demod_address = 0x10 >> 1,
307 .output_mode = TDA10048_PARALLEL_OUTPUT,
308 .fwbulkwritelen = TDA10048_BULKWRITE_50,
309 .inversion = TDA10048_INVERSION_ON,
Steven Toth08b83582009-05-15 21:04:56 -0300310 .dtv6_if_freq_khz = TDA10048_IF_3300,
311 .dtv7_if_freq_khz = TDA10048_IF_3800,
312 .dtv8_if_freq_khz = TDA10048_IF_4300,
Steven Tothc7470202009-05-02 11:09:08 -0300313 .clk_freq_khz = TDA10048_CLK_16000,
Steven Toth507a34f2009-05-05 19:31:42 -0300314 .disable_gate_access = 1,
Michael Krufky95814bc2008-04-19 15:36:51 -0300315};
316
317static struct tda829x_config tda829x_no_probe = {
318 .probe_tuner = TDA829X_DONT_PROBE,
319};
320
Michael Krufky9ab23932012-02-07 13:28:33 -0300321static struct tda18271_std_map hauppauge_tda18271_dvbt_std_map = {
322 .dvbt_6 = { .if_freq = 3300, .agc_mode = 3, .std = 4,
323 .if_lvl = 1, .rfagc_top = 0x37, },
324 .dvbt_7 = { .if_freq = 3800, .agc_mode = 3, .std = 5,
325 .if_lvl = 1, .rfagc_top = 0x37, },
326 .dvbt_8 = { .if_freq = 4300, .agc_mode = 3, .std = 6,
327 .if_lvl = 1, .rfagc_top = 0x37, },
328};
329
Michael Krufky95814bc2008-04-19 15:36:51 -0300330static struct tda18271_config hauppauge_tda18271_dvb_config = {
Michael Krufky9ab23932012-02-07 13:28:33 -0300331 .std_map = &hauppauge_tda18271_dvbt_std_map,
Michael Krufky95814bc2008-04-19 15:36:51 -0300332 .gate = TDA18271_GATE_ANALOG,
Michael Krufkya18eaf02009-08-29 17:47:01 -0300333 .output_opt = TDA18271_OUTPUT_LT_OFF,
Michael Krufky95814bc2008-04-19 15:36:51 -0300334};
335
336static int pvr2_tda10048_attach(struct pvr2_dvb_adapter *adap)
337{
338 adap->fe = dvb_attach(tda10048_attach, &hauppauge_tda10048_config,
339 &adap->channel.hdw->i2c_adap);
340 if (adap->fe)
341 return 0;
342
343 return -EIO;
344}
345
346static int pvr2_73xxx_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
347{
348 dvb_attach(tda829x_attach, adap->fe,
349 &adap->channel.hdw->i2c_adap, 0x42,
350 &tda829x_no_probe);
351 dvb_attach(tda18271_attach, adap->fe, 0x60,
352 &adap->channel.hdw->i2c_adap,
353 &hauppauge_tda18271_dvb_config);
354
355 return 0;
356}
357
Mike Isely69ea3c12009-03-07 02:08:58 -0300358static const struct pvr2_dvb_props pvr2_73xxx_dvb_props = {
Michael Krufky95814bc2008-04-19 15:36:51 -0300359 .frontend_attach = pvr2_tda10048_attach,
360 .tuner_attach = pvr2_73xxx_tda18271_8295_attach,
361};
362#endif
363
Mike Iselydd5f3222009-03-07 02:07:12 -0300364static const struct pvr2_device_client_desc pvr2_cli_73xxx[] = {
365 { .module_id = PVR2_CLIENT_ID_CX25840 },
366 { .module_id = PVR2_CLIENT_ID_TUNER,
367 .i2c_address_list = "\x42"},
Michael Krufky92c9d072008-03-15 23:59:29 -0300368};
369
Tim Gardner740a3ea2012-07-26 14:57:07 -0300370#define PVR2_FIRMWARE_73xxx "v4l-pvrusb2-73xxx-01.fw"
Michael Krufky92c9d072008-03-15 23:59:29 -0300371static const char *pvr2_fw1_names_73xxx[] = {
Tim Gardner740a3ea2012-07-26 14:57:07 -0300372 PVR2_FIRMWARE_73xxx,
Michael Krufky92c9d072008-03-15 23:59:29 -0300373};
374
375static const struct pvr2_device_desc pvr2_device_73xxx = {
Mike Isely1d70c7f2009-11-25 02:55:38 -0300376 .description = "WinTV HVR-1900 Model 73xxx",
Michael Krufky92c9d072008-03-15 23:59:29 -0300377 .shortname = "73xxx",
Mike Iselydd5f3222009-03-07 02:07:12 -0300378 .client_table.lst = pvr2_cli_73xxx,
379 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
Michael Krufky92c9d072008-03-15 23:59:29 -0300380 .fx2_firmware.lst = pvr2_fw1_names_73xxx,
381 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx),
382 .flag_has_cx25840 = !0,
383 .flag_has_hauppauge_rom = !0,
384 .flag_has_analogtuner = !0,
385 .flag_has_composite = !0,
386 .flag_has_svideo = !0,
Gary Francis75727462009-11-25 03:03:31 -0300387 .flag_fx2_16kb = !0,
Michael Krufky92c9d072008-03-15 23:59:29 -0300388 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
389 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
390 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Isely31335b12008-07-25 19:35:31 -0300391 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
Michael Krufky95814bc2008-04-19 15:36:51 -0300392#ifdef CONFIG_VIDEO_PVRUSB2_DVB
393 .dvb_props = &pvr2_73xxx_dvb_props,
394#endif
Michael Krufky92c9d072008-03-15 23:59:29 -0300395};
396
397
398
399/*------------------------------------------------------------------------*/
Michael Krufky11fcd472007-10-25 02:01:10 -0300400/* Hauppauge PVR-USB2 Model 75xxx */
401
Michael Krufky087886e2008-03-28 05:49:36 -0300402#ifdef CONFIG_VIDEO_PVRUSB2_DVB
403static struct s5h1409_config pvr2_s5h1409_config = {
404 .demod_address = 0x32 >> 1,
405 .output_mode = S5H1409_PARALLEL_OUTPUT,
406 .gpio = S5H1409_GPIO_OFF,
407 .qam_if = 4000,
408 .inversion = S5H1409_INVERSION_ON,
409 .status_mode = S5H1409_DEMODLOCKING,
410};
411
Michael Krufky4aef8fd2008-04-25 04:19:02 -0300412static struct s5h1411_config pvr2_s5h1411_config = {
413 .output_mode = S5H1411_PARALLEL_OUTPUT,
414 .gpio = S5H1411_GPIO_OFF,
415 .vsb_if = S5H1411_IF_44000,
416 .qam_if = S5H1411_IF_4000,
417 .inversion = S5H1411_INVERSION_ON,
418 .status_mode = S5H1411_DEMODLOCKING,
419};
420
Michael Krufky087886e2008-03-28 05:49:36 -0300421static struct tda18271_std_map hauppauge_tda18271_std_map = {
422 .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3,
423 .if_lvl = 6, .rfagc_top = 0x37, },
424 .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0,
425 .if_lvl = 6, .rfagc_top = 0x37, },
426};
427
428static struct tda18271_config hauppauge_tda18271_config = {
429 .std_map = &hauppauge_tda18271_std_map,
430 .gate = TDA18271_GATE_ANALOG,
Michael Krufkya18eaf02009-08-29 17:47:01 -0300431 .output_opt = TDA18271_OUTPUT_LT_OFF,
Michael Krufky087886e2008-03-28 05:49:36 -0300432};
433
434static int pvr2_s5h1409_attach(struct pvr2_dvb_adapter *adap)
435{
436 adap->fe = dvb_attach(s5h1409_attach, &pvr2_s5h1409_config,
437 &adap->channel.hdw->i2c_adap);
438 if (adap->fe)
439 return 0;
440
441 return -EIO;
442}
443
Michael Krufky4aef8fd2008-04-25 04:19:02 -0300444static int pvr2_s5h1411_attach(struct pvr2_dvb_adapter *adap)
445{
446 adap->fe = dvb_attach(s5h1411_attach, &pvr2_s5h1411_config,
447 &adap->channel.hdw->i2c_adap);
448 if (adap->fe)
449 return 0;
450
451 return -EIO;
452}
453
Michael Krufky087886e2008-03-28 05:49:36 -0300454static int pvr2_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
455{
456 dvb_attach(tda829x_attach, adap->fe,
457 &adap->channel.hdw->i2c_adap, 0x42,
458 &tda829x_no_probe);
459 dvb_attach(tda18271_attach, adap->fe, 0x60,
460 &adap->channel.hdw->i2c_adap,
461 &hauppauge_tda18271_config);
462
463 return 0;
464}
465
Mike Isely69ea3c12009-03-07 02:08:58 -0300466static const struct pvr2_dvb_props pvr2_750xx_dvb_props = {
Michael Krufky087886e2008-03-28 05:49:36 -0300467 .frontend_attach = pvr2_s5h1409_attach,
468 .tuner_attach = pvr2_tda18271_8295_attach,
469};
Michael Krufky4aef8fd2008-04-25 04:19:02 -0300470
Mike Isely69ea3c12009-03-07 02:08:58 -0300471static const struct pvr2_dvb_props pvr2_751xx_dvb_props = {
Michael Krufky4aef8fd2008-04-25 04:19:02 -0300472 .frontend_attach = pvr2_s5h1411_attach,
473 .tuner_attach = pvr2_tda18271_8295_attach,
474};
Michael Krufky087886e2008-03-28 05:49:36 -0300475#endif
476
Tim Gardner740a3ea2012-07-26 14:57:07 -0300477#define PVR2_FIRMWARE_75xxx "v4l-pvrusb2-73xxx-01.fw"
Michael Krufky11fcd472007-10-25 02:01:10 -0300478static const char *pvr2_fw1_names_75xxx[] = {
Tim Gardner740a3ea2012-07-26 14:57:07 -0300479 PVR2_FIRMWARE_75xxx,
Michael Krufky11fcd472007-10-25 02:01:10 -0300480};
481
Michael Krufkyc8812842008-03-28 05:48:44 -0300482static const struct pvr2_device_desc pvr2_device_750xx = {
Mike Isely1d70c7f2009-11-25 02:55:38 -0300483 .description = "WinTV HVR-1950 Model 750xx",
Michael Krufkyc8812842008-03-28 05:48:44 -0300484 .shortname = "750xx",
Mike Iselydd5f3222009-03-07 02:07:12 -0300485 .client_table.lst = pvr2_cli_73xxx,
486 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
Michael Krufkyc8812842008-03-28 05:48:44 -0300487 .fx2_firmware.lst = pvr2_fw1_names_75xxx,
488 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
489 .flag_has_cx25840 = !0,
490 .flag_has_hauppauge_rom = !0,
491 .flag_has_analogtuner = !0,
492 .flag_has_composite = !0,
493 .flag_has_svideo = !0,
Mike Iselyc21c2db2009-11-25 02:49:21 -0300494 .flag_fx2_16kb = !0,
Michael Krufkyc8812842008-03-28 05:48:44 -0300495 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
496 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
497 .default_std_mask = V4L2_STD_NTSC_M,
498 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Isely31335b12008-07-25 19:35:31 -0300499 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
Michael Krufky087886e2008-03-28 05:49:36 -0300500#ifdef CONFIG_VIDEO_PVRUSB2_DVB
501 .dvb_props = &pvr2_750xx_dvb_props,
502#endif
Michael Krufkyc8812842008-03-28 05:48:44 -0300503};
504
505static const struct pvr2_device_desc pvr2_device_751xx = {
Mike Isely1d70c7f2009-11-25 02:55:38 -0300506 .description = "WinTV HVR-1950 Model 751xx",
Michael Krufkyc8812842008-03-28 05:48:44 -0300507 .shortname = "751xx",
Mike Iselydd5f3222009-03-07 02:07:12 -0300508 .client_table.lst = pvr2_cli_73xxx,
509 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
Michael Krufky11fcd472007-10-25 02:01:10 -0300510 .fx2_firmware.lst = pvr2_fw1_names_75xxx,
511 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
512 .flag_has_cx25840 = !0,
513 .flag_has_hauppauge_rom = !0,
Mike Isely1aaac602008-04-22 14:45:36 -0300514 .flag_has_analogtuner = !0,
515 .flag_has_composite = !0,
516 .flag_has_svideo = !0,
Mike Iselyc21c2db2009-11-25 02:49:21 -0300517 .flag_fx2_16kb = !0,
Michael Krufky11fcd472007-10-25 02:01:10 -0300518 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300519 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
Michael Krufky11fcd472007-10-25 02:01:10 -0300520 .default_std_mask = V4L2_STD_NTSC_M,
Mike Isely40381cb2008-04-22 14:45:42 -0300521 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Isely31335b12008-07-25 19:35:31 -0300522 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
Michael Krufky4aef8fd2008-04-25 04:19:02 -0300523#ifdef CONFIG_VIDEO_PVRUSB2_DVB
524 .dvb_props = &pvr2_751xx_dvb_props,
525#endif
Michael Krufky11fcd472007-10-25 02:01:10 -0300526};
527
528
529
530/*------------------------------------------------------------------------*/
Mike Iselyd130fa82007-12-08 17:20:06 -0300531
532struct usb_device_id pvr2_device_table[] = {
533 { USB_DEVICE(0x2040, 0x2900),
534 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
Mike Iselyb675c052008-08-30 15:08:28 -0300535 { USB_DEVICE(0x2040, 0x2950), /* Logically identical to 2900 */
536 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
Mike Iselyd130fa82007-12-08 17:20:06 -0300537 { USB_DEVICE(0x2040, 0x2400),
538 .driver_info = (kernel_ulong_t)&pvr2_device_24xxx},
539 { USB_DEVICE(0x1164, 0x0622),
540 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2},
Mike Iselyfd1da782008-04-22 14:45:42 -0300541 { USB_DEVICE(0x1164, 0x0602),
542 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2d},
Mike Iselyd130fa82007-12-08 17:20:06 -0300543 { USB_DEVICE(0x11ba, 0x1003),
544 .driver_info = (kernel_ulong_t)&pvr2_device_onair_creator},
Mike Iselyd130fa82007-12-08 17:20:06 -0300545 { USB_DEVICE(0x11ba, 0x1001),
546 .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2},
Michael Krufky92c9d072008-03-15 23:59:29 -0300547 { USB_DEVICE(0x2040, 0x7300),
548 .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
Michael Krufky11fcd472007-10-25 02:01:10 -0300549 { USB_DEVICE(0x2040, 0x7500),
Michael Krufkyc8812842008-03-28 05:48:44 -0300550 .driver_info = (kernel_ulong_t)&pvr2_device_750xx},
Michael Krufkydd6e9462008-03-08 06:07:38 -0300551 { USB_DEVICE(0x2040, 0x7501),
Michael Krufkyc8812842008-03-28 05:48:44 -0300552 .driver_info = (kernel_ulong_t)&pvr2_device_751xx},
Mike Isely43823c02011-03-13 20:37:11 -0300553 { USB_DEVICE(0x0ccd, 0x0039),
554 .driver_info = (kernel_ulong_t)&pvr2_device_av400},
Mike Iselyd130fa82007-12-08 17:20:06 -0300555 { }
556};
Mike Isely989eb152007-11-26 01:53:12 -0300557
558MODULE_DEVICE_TABLE(usb, pvr2_device_table);
Tim Gardner740a3ea2012-07-26 14:57:07 -0300559MODULE_FIRMWARE(PVR2_FIRMWARE_29xxx);
560MODULE_FIRMWARE(PVR2_FIRMWARE_24xxx);
561MODULE_FIRMWARE(PVR2_FIRMWARE_73xxx);
562MODULE_FIRMWARE(PVR2_FIRMWARE_75xxx);