blob: adc501d3c287fe0f6ba8893abd58d06603440873 [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 *
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
21/*
22
23This source file should encompass ALL per-device type information for the
24driver. To define a new device, add elements to the pvr2_device_table and
25pvr2_device_desc structures.
26
27*/
28
29#include "pvrusb2-devattr.h"
30#include <linux/usb.h>
Paul Gortmaker7a707b82011-07-03 14:03:12 -040031#include <linux/module.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"
Michael Krufky087886e2008-03-28 05:49:36 -030038#include "s5h1409.h"
Michael Krufky4aef8fd2008-04-25 04:19:02 -030039#include "s5h1411.h"
Michael Krufky95814bc2008-04-19 15:36:51 -030040#include "tda10048.h"
Michael Krufky087886e2008-03-28 05:49:36 -030041#include "tda18271.h"
42#include "tda8290.h"
Michael Krufky906a4952008-03-28 05:47:47 -030043#include "tuner-simple.h"
44#endif
Mike Isely989eb152007-11-26 01:53:12 -030045
Mike Isely45427832007-12-08 17:11:13 -030046
Mike Iselyd130fa82007-12-08 17:20:06 -030047/*------------------------------------------------------------------------*/
48/* Hauppauge PVR-USB2 Model 29xxx */
Mike Isely989eb152007-11-26 01:53:12 -030049
Mike Iselydd5f3222009-03-07 02:07:12 -030050static const struct pvr2_device_client_desc pvr2_cli_29xxx[] = {
51 { .module_id = PVR2_CLIENT_ID_SAA7115 },
52 { .module_id = PVR2_CLIENT_ID_MSP3400 },
53 { .module_id = PVR2_CLIENT_ID_TUNER },
Mike Iselybb652422009-03-14 14:09:04 -030054 { .module_id = PVR2_CLIENT_ID_DEMOD },
Mike Isely989eb152007-11-26 01:53:12 -030055};
56
Tim Gardner740a3ea2012-07-26 14:57:07 -030057#define PVR2_FIRMWARE_29xxx "v4l-pvrusb2-29xxx-01.fw"
Mike Isely989eb152007-11-26 01:53:12 -030058static const char *pvr2_fw1_names_29xxx[] = {
Tim Gardner740a3ea2012-07-26 14:57:07 -030059 PVR2_FIRMWARE_29xxx,
Mike Isely989eb152007-11-26 01:53:12 -030060};
61
Mike Iselyd130fa82007-12-08 17:20:06 -030062static const struct pvr2_device_desc pvr2_device_29xxx = {
Mike Isely1d70c7f2009-11-25 02:55:38 -030063 .description = "WinTV PVR USB2 Model 29xxx",
Mike Isely989eb152007-11-26 01:53:12 -030064 .shortname = "29xxx",
Mike Iselydd5f3222009-03-07 02:07:12 -030065 .client_table.lst = pvr2_cli_29xxx,
66 .client_table.cnt = ARRAY_SIZE(pvr2_cli_29xxx),
Mike Isely989eb152007-11-26 01:53:12 -030067 .fx2_firmware.lst = pvr2_fw1_names_29xxx,
68 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx),
Mike Iselyaaf78842007-11-26 02:04:11 -030069 .flag_has_hauppauge_rom = !0,
Mike Isely1aaac602008-04-22 14:45:36 -030070 .flag_has_analogtuner = !0,
Mike Iselyd068c6e2008-04-22 14:45:36 -030071 .flag_has_fmradio = !0,
Mike Isely1aaac602008-04-22 14:45:36 -030072 .flag_has_composite = !0,
73 .flag_has_svideo = !0,
Mike Iselyf5174af2007-11-26 02:07:26 -030074 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Isely40381cb2008-04-22 14:45:42 -030075 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Isely27eab382009-04-06 01:51:38 -030076 .ir_scheme = PVR2_IR_SCHEME_29XXX,
Mike Iselyd130fa82007-12-08 17:20:06 -030077};
78
79
80
81/*------------------------------------------------------------------------*/
82/* Hauppauge PVR-USB2 Model 24xxx */
83
Mike Iselydd5f3222009-03-07 02:07:12 -030084static const struct pvr2_device_client_desc pvr2_cli_24xxx[] = {
85 { .module_id = PVR2_CLIENT_ID_CX25840 },
86 { .module_id = PVR2_CLIENT_ID_TUNER },
87 { .module_id = PVR2_CLIENT_ID_WM8775 },
Mike Iselybb652422009-03-14 14:09:04 -030088 { .module_id = PVR2_CLIENT_ID_DEMOD },
Mike Iselyd130fa82007-12-08 17:20:06 -030089};
90
Tim Gardner740a3ea2012-07-26 14:57:07 -030091#define PVR2_FIRMWARE_24xxx "v4l-pvrusb2-24xxx-01.fw"
Mike Iselyd130fa82007-12-08 17:20:06 -030092static const char *pvr2_fw1_names_24xxx[] = {
Tim Gardner740a3ea2012-07-26 14:57:07 -030093 PVR2_FIRMWARE_24xxx,
Mike Iselyd130fa82007-12-08 17:20:06 -030094};
95
96static const struct pvr2_device_desc pvr2_device_24xxx = {
Mike Isely1d70c7f2009-11-25 02:55:38 -030097 .description = "WinTV PVR USB2 Model 24xxx",
Mike Isely989eb152007-11-26 01:53:12 -030098 .shortname = "24xxx",
Mike Iselydd5f3222009-03-07 02:07:12 -030099 .client_table.lst = pvr2_cli_24xxx,
100 .client_table.cnt = ARRAY_SIZE(pvr2_cli_24xxx),
Mike Isely989eb152007-11-26 01:53:12 -0300101 .fx2_firmware.lst = pvr2_fw1_names_24xxx,
102 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx),
103 .flag_has_cx25840 = !0,
104 .flag_has_wm8775 = !0,
Mike Iselyaaf78842007-11-26 02:04:11 -0300105 .flag_has_hauppauge_rom = !0,
Mike Isely1aaac602008-04-22 14:45:36 -0300106 .flag_has_analogtuner = !0,
Mike Iselyd068c6e2008-04-22 14:45:36 -0300107 .flag_has_fmradio = !0,
Mike Isely1aaac602008-04-22 14:45:36 -0300108 .flag_has_composite = !0,
109 .flag_has_svideo = !0,
Mike Iselyf5174af2007-11-26 02:07:26 -0300110 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Isely40381cb2008-04-22 14:45:42 -0300111 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Isely31335b12008-07-25 19:35:31 -0300112 .ir_scheme = PVR2_IR_SCHEME_24XXX,
Mike Iselyd130fa82007-12-08 17:20:06 -0300113};
114
115
116
117/*------------------------------------------------------------------------*/
118/* GOTVIEW USB2.0 DVD2 */
119
Mike Iselydd5f3222009-03-07 02:07:12 -0300120static const struct pvr2_device_client_desc pvr2_cli_gotview_2[] = {
121 { .module_id = PVR2_CLIENT_ID_CX25840 },
122 { .module_id = PVR2_CLIENT_ID_TUNER },
Mike Iselyc641a182010-05-15 00:07:04 -0300123 { .module_id = PVR2_CLIENT_ID_DEMOD },
Mike Iselyd130fa82007-12-08 17:20:06 -0300124};
125
126static const struct pvr2_device_desc pvr2_device_gotview_2 = {
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300127 .description = "Gotview USB 2.0 DVD 2",
128 .shortname = "gv2",
Mike Iselydd5f3222009-03-07 02:07:12 -0300129 .client_table.lst = pvr2_cli_gotview_2,
130 .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2),
Mike Isely787f5ab2007-12-08 17:08:32 -0300131 .flag_has_cx25840 = !0,
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300132 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
Mike Isely1aaac602008-04-22 14:45:36 -0300133 .flag_has_analogtuner = !0,
Mike Isely1df59f02008-04-21 03:50:39 -0300134 .flag_has_fmradio = !0,
Mike Isely1aaac602008-04-22 14:45:36 -0300135 .flag_has_composite = !0,
136 .flag_has_svideo = !0,
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300137 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
Mike Isely989eb152007-11-26 01:53:12 -0300138};
139
Mike Iselyd130fa82007-12-08 17:20:06 -0300140
141
Mike Iselyfd1da782008-04-22 14:45:42 -0300142/*------------------------------------------------------------------------*/
143/* GOTVIEW USB2.0 DVD Deluxe */
144
145/* (same module list as gotview_2) */
146
147static const struct pvr2_device_desc pvr2_device_gotview_2d = {
148 .description = "Gotview USB 2.0 DVD Deluxe",
149 .shortname = "gv2d",
Mike Iselydd5f3222009-03-07 02:07:12 -0300150 .client_table.lst = pvr2_cli_gotview_2,
151 .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2),
Mike Iselyfd1da782008-04-22 14:45:42 -0300152 .flag_has_cx25840 = !0,
153 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
154 .flag_has_analogtuner = !0,
155 .flag_has_composite = !0,
156 .flag_has_svideo = !0,
157 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
158};
159
160
161
Mike Iselyd130fa82007-12-08 17:20:06 -0300162/*------------------------------------------------------------------------*/
Mike Isely43823c02011-03-13 20:37:11 -0300163/* Terratec Grabster AV400 */
164
165static const struct pvr2_device_client_desc pvr2_cli_av400[] = {
166 { .module_id = PVR2_CLIENT_ID_CX25840 },
167};
168
169static const struct pvr2_device_desc pvr2_device_av400 = {
170 .description = "Terratec Grabster AV400",
171 .shortname = "av400",
172 .flag_is_experimental = 1,
173 .client_table.lst = pvr2_cli_av400,
174 .client_table.cnt = ARRAY_SIZE(pvr2_cli_av400),
175 .flag_has_cx25840 = !0,
176 .flag_has_analogtuner = 0,
177 .flag_has_composite = !0,
178 .flag_has_svideo = !0,
179 .signal_routing_scheme = PVR2_ROUTING_SCHEME_AV400,
180};
181
182
183
184/*------------------------------------------------------------------------*/
Mike Iselyd130fa82007-12-08 17:20:06 -0300185/* OnAir Creator */
186
Michael Krufky906a4952008-03-28 05:47:47 -0300187#ifdef CONFIG_VIDEO_PVRUSB2_DVB
188static struct lgdt330x_config pvr2_lgdt3303_config = {
189 .demod_address = 0x0e,
190 .demod_chip = LGDT3303,
191 .clock_polarity_flip = 1,
192};
193
194static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap)
195{
196 adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3303_config,
197 &adap->channel.hdw->i2c_adap);
198 if (adap->fe)
199 return 0;
200
201 return -EIO;
202}
203
204static int pvr2_lgh06xf_attach(struct pvr2_dvb_adapter *adap)
205{
206 dvb_attach(simple_tuner_attach, adap->fe,
207 &adap->channel.hdw->i2c_adap, 0x61,
208 TUNER_LG_TDVS_H06XF);
209
210 return 0;
211}
212
Mike Isely69ea3c12009-03-07 02:08:58 -0300213static const struct pvr2_dvb_props pvr2_onair_creator_fe_props = {
Michael Krufky906a4952008-03-28 05:47:47 -0300214 .frontend_attach = pvr2_lgdt3303_attach,
215 .tuner_attach = pvr2_lgh06xf_attach,
216};
217#endif
218
Mike Iselydd5f3222009-03-07 02:07:12 -0300219static const struct pvr2_device_client_desc pvr2_cli_onair_creator[] = {
220 { .module_id = PVR2_CLIENT_ID_SAA7115 },
221 { .module_id = PVR2_CLIENT_ID_CS53L32A },
222 { .module_id = PVR2_CLIENT_ID_TUNER },
Mike Iselyd130fa82007-12-08 17:20:06 -0300223};
224
225static const struct pvr2_device_desc pvr2_device_onair_creator = {
226 .description = "OnAir Creator Hybrid USB tuner",
227 .shortname = "oac",
Mike Iselydd5f3222009-03-07 02:07:12 -0300228 .client_table.lst = pvr2_cli_onair_creator,
229 .client_table.cnt = ARRAY_SIZE(pvr2_cli_onair_creator),
Mike Iselyd130fa82007-12-08 17:20:06 -0300230 .default_tuner_type = TUNER_LG_TDVS_H06XF,
Mike Isely1aaac602008-04-22 14:45:36 -0300231 .flag_has_analogtuner = !0,
232 .flag_has_composite = !0,
233 .flag_has_svideo = !0,
Mike Isely72998b72008-04-03 04:51:19 -0300234 .flag_digital_requires_cx23416 = !0,
Mike Isely2a6b6272009-03-15 17:53:29 -0300235 .signal_routing_scheme = PVR2_ROUTING_SCHEME_ONAIR,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300236 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
Michael Krufkyf0910c72008-04-22 14:45:45 -0300237 .default_std_mask = V4L2_STD_NTSC_M,
Michael Krufky906a4952008-03-28 05:47:47 -0300238#ifdef CONFIG_VIDEO_PVRUSB2_DVB
239 .dvb_props = &pvr2_onair_creator_fe_props,
240#endif
Mike Iselyd130fa82007-12-08 17:20:06 -0300241};
Mike Iselyd130fa82007-12-08 17:20:06 -0300242
243
244
Mike Iselyd130fa82007-12-08 17:20:06 -0300245/*------------------------------------------------------------------------*/
246/* OnAir USB 2.0 */
247
Michael Krufky906a4952008-03-28 05:47:47 -0300248#ifdef CONFIG_VIDEO_PVRUSB2_DVB
249static struct lgdt330x_config pvr2_lgdt3302_config = {
250 .demod_address = 0x0e,
251 .demod_chip = LGDT3302,
252};
253
254static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap)
255{
256 adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3302_config,
257 &adap->channel.hdw->i2c_adap);
258 if (adap->fe)
259 return 0;
260
261 return -EIO;
262}
263
264static int pvr2_fcv1236d_attach(struct pvr2_dvb_adapter *adap)
265{
266 dvb_attach(simple_tuner_attach, adap->fe,
267 &adap->channel.hdw->i2c_adap, 0x61,
268 TUNER_PHILIPS_FCV1236D);
269
270 return 0;
271}
272
Mike Isely69ea3c12009-03-07 02:08:58 -0300273static const struct pvr2_dvb_props pvr2_onair_usb2_fe_props = {
Michael Krufky906a4952008-03-28 05:47:47 -0300274 .frontend_attach = pvr2_lgdt3302_attach,
275 .tuner_attach = pvr2_fcv1236d_attach,
276};
277#endif
278
Mike Iselydd5f3222009-03-07 02:07:12 -0300279static const struct pvr2_device_client_desc pvr2_cli_onair_usb2[] = {
280 { .module_id = PVR2_CLIENT_ID_SAA7115 },
281 { .module_id = PVR2_CLIENT_ID_CS53L32A },
282 { .module_id = PVR2_CLIENT_ID_TUNER },
Mike Iselyd130fa82007-12-08 17:20:06 -0300283};
284
285static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
286 .description = "OnAir USB2 Hybrid USB tuner",
287 .shortname = "oa2",
Mike Iselydd5f3222009-03-07 02:07:12 -0300288 .client_table.lst = pvr2_cli_onair_usb2,
289 .client_table.cnt = ARRAY_SIZE(pvr2_cli_onair_usb2),
Michael Krufkyab8b8702008-04-22 14:46:05 -0300290 .default_tuner_type = TUNER_PHILIPS_FCV1236D,
Mike Isely1aaac602008-04-22 14:45:36 -0300291 .flag_has_analogtuner = !0,
292 .flag_has_composite = !0,
293 .flag_has_svideo = !0,
Mike Isely72998b72008-04-03 04:51:19 -0300294 .flag_digital_requires_cx23416 = !0,
Mike Isely2a6b6272009-03-15 17:53:29 -0300295 .signal_routing_scheme = PVR2_ROUTING_SCHEME_ONAIR,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300296 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
Michael Krufkyf0910c72008-04-22 14:45:45 -0300297 .default_std_mask = V4L2_STD_NTSC_M,
Michael Krufky906a4952008-03-28 05:47:47 -0300298#ifdef CONFIG_VIDEO_PVRUSB2_DVB
299 .dvb_props = &pvr2_onair_usb2_fe_props,
300#endif
Mike Iselyd130fa82007-12-08 17:20:06 -0300301};
Mike Iselyd130fa82007-12-08 17:20:06 -0300302
303
304
305/*------------------------------------------------------------------------*/
Michael Krufky92c9d072008-03-15 23:59:29 -0300306/* Hauppauge PVR-USB2 Model 73xxx */
307
Michael Krufky95814bc2008-04-19 15:36:51 -0300308#ifdef CONFIG_VIDEO_PVRUSB2_DVB
309static struct tda10048_config hauppauge_tda10048_config = {
310 .demod_address = 0x10 >> 1,
311 .output_mode = TDA10048_PARALLEL_OUTPUT,
312 .fwbulkwritelen = TDA10048_BULKWRITE_50,
313 .inversion = TDA10048_INVERSION_ON,
Steven Toth08b83582009-05-15 21:04:56 -0300314 .dtv6_if_freq_khz = TDA10048_IF_3300,
315 .dtv7_if_freq_khz = TDA10048_IF_3800,
316 .dtv8_if_freq_khz = TDA10048_IF_4300,
Steven Tothc7470202009-05-02 11:09:08 -0300317 .clk_freq_khz = TDA10048_CLK_16000,
Steven Toth507a34f2009-05-05 19:31:42 -0300318 .disable_gate_access = 1,
Michael Krufky95814bc2008-04-19 15:36:51 -0300319};
320
321static struct tda829x_config tda829x_no_probe = {
322 .probe_tuner = TDA829X_DONT_PROBE,
323};
324
Michael Krufky9ab23932012-02-07 13:28:33 -0300325static struct tda18271_std_map hauppauge_tda18271_dvbt_std_map = {
326 .dvbt_6 = { .if_freq = 3300, .agc_mode = 3, .std = 4,
327 .if_lvl = 1, .rfagc_top = 0x37, },
328 .dvbt_7 = { .if_freq = 3800, .agc_mode = 3, .std = 5,
329 .if_lvl = 1, .rfagc_top = 0x37, },
330 .dvbt_8 = { .if_freq = 4300, .agc_mode = 3, .std = 6,
331 .if_lvl = 1, .rfagc_top = 0x37, },
332};
333
Michael Krufky95814bc2008-04-19 15:36:51 -0300334static struct tda18271_config hauppauge_tda18271_dvb_config = {
Michael Krufky9ab23932012-02-07 13:28:33 -0300335 .std_map = &hauppauge_tda18271_dvbt_std_map,
Michael Krufky95814bc2008-04-19 15:36:51 -0300336 .gate = TDA18271_GATE_ANALOG,
Michael Krufkya18eaf02009-08-29 17:47:01 -0300337 .output_opt = TDA18271_OUTPUT_LT_OFF,
Michael Krufky95814bc2008-04-19 15:36:51 -0300338};
339
340static int pvr2_tda10048_attach(struct pvr2_dvb_adapter *adap)
341{
342 adap->fe = dvb_attach(tda10048_attach, &hauppauge_tda10048_config,
343 &adap->channel.hdw->i2c_adap);
344 if (adap->fe)
345 return 0;
346
347 return -EIO;
348}
349
350static int pvr2_73xxx_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
351{
352 dvb_attach(tda829x_attach, adap->fe,
353 &adap->channel.hdw->i2c_adap, 0x42,
354 &tda829x_no_probe);
355 dvb_attach(tda18271_attach, adap->fe, 0x60,
356 &adap->channel.hdw->i2c_adap,
357 &hauppauge_tda18271_dvb_config);
358
359 return 0;
360}
361
Mike Isely69ea3c12009-03-07 02:08:58 -0300362static const struct pvr2_dvb_props pvr2_73xxx_dvb_props = {
Michael Krufky95814bc2008-04-19 15:36:51 -0300363 .frontend_attach = pvr2_tda10048_attach,
364 .tuner_attach = pvr2_73xxx_tda18271_8295_attach,
365};
366#endif
367
Mike Iselydd5f3222009-03-07 02:07:12 -0300368static const struct pvr2_device_client_desc pvr2_cli_73xxx[] = {
369 { .module_id = PVR2_CLIENT_ID_CX25840 },
370 { .module_id = PVR2_CLIENT_ID_TUNER,
371 .i2c_address_list = "\x42"},
Michael Krufky92c9d072008-03-15 23:59:29 -0300372};
373
Tim Gardner740a3ea2012-07-26 14:57:07 -0300374#define PVR2_FIRMWARE_73xxx "v4l-pvrusb2-73xxx-01.fw"
Michael Krufky92c9d072008-03-15 23:59:29 -0300375static const char *pvr2_fw1_names_73xxx[] = {
Tim Gardner740a3ea2012-07-26 14:57:07 -0300376 PVR2_FIRMWARE_73xxx,
Michael Krufky92c9d072008-03-15 23:59:29 -0300377};
378
379static const struct pvr2_device_desc pvr2_device_73xxx = {
Mike Isely1d70c7f2009-11-25 02:55:38 -0300380 .description = "WinTV HVR-1900 Model 73xxx",
Michael Krufky92c9d072008-03-15 23:59:29 -0300381 .shortname = "73xxx",
Mike Iselydd5f3222009-03-07 02:07:12 -0300382 .client_table.lst = pvr2_cli_73xxx,
383 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
Michael Krufky92c9d072008-03-15 23:59:29 -0300384 .fx2_firmware.lst = pvr2_fw1_names_73xxx,
385 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx),
386 .flag_has_cx25840 = !0,
387 .flag_has_hauppauge_rom = !0,
388 .flag_has_analogtuner = !0,
389 .flag_has_composite = !0,
390 .flag_has_svideo = !0,
Gary Francis75727462009-11-25 03:03:31 -0300391 .flag_fx2_16kb = !0,
Michael Krufky92c9d072008-03-15 23:59:29 -0300392 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
393 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
394 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Isely31335b12008-07-25 19:35:31 -0300395 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
Michael Krufky95814bc2008-04-19 15:36:51 -0300396#ifdef CONFIG_VIDEO_PVRUSB2_DVB
397 .dvb_props = &pvr2_73xxx_dvb_props,
398#endif
Michael Krufky92c9d072008-03-15 23:59:29 -0300399};
400
401
402
403/*------------------------------------------------------------------------*/
Michael Krufky11fcd472007-10-25 02:01:10 -0300404/* Hauppauge PVR-USB2 Model 75xxx */
405
Michael Krufky087886e2008-03-28 05:49:36 -0300406#ifdef CONFIG_VIDEO_PVRUSB2_DVB
407static struct s5h1409_config pvr2_s5h1409_config = {
408 .demod_address = 0x32 >> 1,
409 .output_mode = S5H1409_PARALLEL_OUTPUT,
410 .gpio = S5H1409_GPIO_OFF,
411 .qam_if = 4000,
412 .inversion = S5H1409_INVERSION_ON,
413 .status_mode = S5H1409_DEMODLOCKING,
414};
415
Michael Krufky4aef8fd2008-04-25 04:19:02 -0300416static struct s5h1411_config pvr2_s5h1411_config = {
417 .output_mode = S5H1411_PARALLEL_OUTPUT,
418 .gpio = S5H1411_GPIO_OFF,
419 .vsb_if = S5H1411_IF_44000,
420 .qam_if = S5H1411_IF_4000,
421 .inversion = S5H1411_INVERSION_ON,
422 .status_mode = S5H1411_DEMODLOCKING,
423};
424
Michael Krufky087886e2008-03-28 05:49:36 -0300425static struct tda18271_std_map hauppauge_tda18271_std_map = {
426 .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3,
427 .if_lvl = 6, .rfagc_top = 0x37, },
428 .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0,
429 .if_lvl = 6, .rfagc_top = 0x37, },
430};
431
432static struct tda18271_config hauppauge_tda18271_config = {
433 .std_map = &hauppauge_tda18271_std_map,
434 .gate = TDA18271_GATE_ANALOG,
Michael Krufkya18eaf02009-08-29 17:47:01 -0300435 .output_opt = TDA18271_OUTPUT_LT_OFF,
Michael Krufky087886e2008-03-28 05:49:36 -0300436};
437
438static int pvr2_s5h1409_attach(struct pvr2_dvb_adapter *adap)
439{
440 adap->fe = dvb_attach(s5h1409_attach, &pvr2_s5h1409_config,
441 &adap->channel.hdw->i2c_adap);
442 if (adap->fe)
443 return 0;
444
445 return -EIO;
446}
447
Michael Krufky4aef8fd2008-04-25 04:19:02 -0300448static int pvr2_s5h1411_attach(struct pvr2_dvb_adapter *adap)
449{
450 adap->fe = dvb_attach(s5h1411_attach, &pvr2_s5h1411_config,
451 &adap->channel.hdw->i2c_adap);
452 if (adap->fe)
453 return 0;
454
455 return -EIO;
456}
457
Michael Krufky087886e2008-03-28 05:49:36 -0300458static int pvr2_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
459{
460 dvb_attach(tda829x_attach, adap->fe,
461 &adap->channel.hdw->i2c_adap, 0x42,
462 &tda829x_no_probe);
463 dvb_attach(tda18271_attach, adap->fe, 0x60,
464 &adap->channel.hdw->i2c_adap,
465 &hauppauge_tda18271_config);
466
467 return 0;
468}
469
Mike Isely69ea3c12009-03-07 02:08:58 -0300470static const struct pvr2_dvb_props pvr2_750xx_dvb_props = {
Michael Krufky087886e2008-03-28 05:49:36 -0300471 .frontend_attach = pvr2_s5h1409_attach,
472 .tuner_attach = pvr2_tda18271_8295_attach,
473};
Michael Krufky4aef8fd2008-04-25 04:19:02 -0300474
Mike Isely69ea3c12009-03-07 02:08:58 -0300475static const struct pvr2_dvb_props pvr2_751xx_dvb_props = {
Michael Krufky4aef8fd2008-04-25 04:19:02 -0300476 .frontend_attach = pvr2_s5h1411_attach,
477 .tuner_attach = pvr2_tda18271_8295_attach,
478};
Michael Krufky087886e2008-03-28 05:49:36 -0300479#endif
480
Tim Gardner740a3ea2012-07-26 14:57:07 -0300481#define PVR2_FIRMWARE_75xxx "v4l-pvrusb2-73xxx-01.fw"
Michael Krufky11fcd472007-10-25 02:01:10 -0300482static const char *pvr2_fw1_names_75xxx[] = {
Tim Gardner740a3ea2012-07-26 14:57:07 -0300483 PVR2_FIRMWARE_75xxx,
Michael Krufky11fcd472007-10-25 02:01:10 -0300484};
485
Michael Krufkyc8812842008-03-28 05:48:44 -0300486static const struct pvr2_device_desc pvr2_device_750xx = {
Mike Isely1d70c7f2009-11-25 02:55:38 -0300487 .description = "WinTV HVR-1950 Model 750xx",
Michael Krufkyc8812842008-03-28 05:48:44 -0300488 .shortname = "750xx",
Mike Iselydd5f3222009-03-07 02:07:12 -0300489 .client_table.lst = pvr2_cli_73xxx,
490 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
Michael Krufkyc8812842008-03-28 05:48:44 -0300491 .fx2_firmware.lst = pvr2_fw1_names_75xxx,
492 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
493 .flag_has_cx25840 = !0,
494 .flag_has_hauppauge_rom = !0,
495 .flag_has_analogtuner = !0,
496 .flag_has_composite = !0,
497 .flag_has_svideo = !0,
Mike Iselyc21c2db2009-11-25 02:49:21 -0300498 .flag_fx2_16kb = !0,
Michael Krufkyc8812842008-03-28 05:48:44 -0300499 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
500 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
501 .default_std_mask = V4L2_STD_NTSC_M,
502 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Isely31335b12008-07-25 19:35:31 -0300503 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
Michael Krufky087886e2008-03-28 05:49:36 -0300504#ifdef CONFIG_VIDEO_PVRUSB2_DVB
505 .dvb_props = &pvr2_750xx_dvb_props,
506#endif
Michael Krufkyc8812842008-03-28 05:48:44 -0300507};
508
509static const struct pvr2_device_desc pvr2_device_751xx = {
Mike Isely1d70c7f2009-11-25 02:55:38 -0300510 .description = "WinTV HVR-1950 Model 751xx",
Michael Krufkyc8812842008-03-28 05:48:44 -0300511 .shortname = "751xx",
Mike Iselydd5f3222009-03-07 02:07:12 -0300512 .client_table.lst = pvr2_cli_73xxx,
513 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
Michael Krufky11fcd472007-10-25 02:01:10 -0300514 .fx2_firmware.lst = pvr2_fw1_names_75xxx,
515 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
516 .flag_has_cx25840 = !0,
517 .flag_has_hauppauge_rom = !0,
Mike Isely1aaac602008-04-22 14:45:36 -0300518 .flag_has_analogtuner = !0,
519 .flag_has_composite = !0,
520 .flag_has_svideo = !0,
Mike Iselyc21c2db2009-11-25 02:49:21 -0300521 .flag_fx2_16kb = !0,
Michael Krufky11fcd472007-10-25 02:01:10 -0300522 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300523 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
Michael Krufky11fcd472007-10-25 02:01:10 -0300524 .default_std_mask = V4L2_STD_NTSC_M,
Mike Isely40381cb2008-04-22 14:45:42 -0300525 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Isely31335b12008-07-25 19:35:31 -0300526 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
Michael Krufky4aef8fd2008-04-25 04:19:02 -0300527#ifdef CONFIG_VIDEO_PVRUSB2_DVB
528 .dvb_props = &pvr2_751xx_dvb_props,
529#endif
Michael Krufky11fcd472007-10-25 02:01:10 -0300530};
531
532
533
534/*------------------------------------------------------------------------*/
Mike Iselyd130fa82007-12-08 17:20:06 -0300535
536struct usb_device_id pvr2_device_table[] = {
537 { USB_DEVICE(0x2040, 0x2900),
538 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
Mike Iselyb675c052008-08-30 15:08:28 -0300539 { USB_DEVICE(0x2040, 0x2950), /* Logically identical to 2900 */
540 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
Mike Iselyd130fa82007-12-08 17:20:06 -0300541 { USB_DEVICE(0x2040, 0x2400),
542 .driver_info = (kernel_ulong_t)&pvr2_device_24xxx},
543 { USB_DEVICE(0x1164, 0x0622),
544 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2},
Mike Iselyfd1da782008-04-22 14:45:42 -0300545 { USB_DEVICE(0x1164, 0x0602),
546 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2d},
Mike Iselyd130fa82007-12-08 17:20:06 -0300547 { USB_DEVICE(0x11ba, 0x1003),
548 .driver_info = (kernel_ulong_t)&pvr2_device_onair_creator},
Mike Iselyd130fa82007-12-08 17:20:06 -0300549 { USB_DEVICE(0x11ba, 0x1001),
550 .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2},
Michael Krufky92c9d072008-03-15 23:59:29 -0300551 { USB_DEVICE(0x2040, 0x7300),
552 .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
Michael Krufky11fcd472007-10-25 02:01:10 -0300553 { USB_DEVICE(0x2040, 0x7500),
Michael Krufkyc8812842008-03-28 05:48:44 -0300554 .driver_info = (kernel_ulong_t)&pvr2_device_750xx},
Michael Krufkydd6e9462008-03-08 06:07:38 -0300555 { USB_DEVICE(0x2040, 0x7501),
Michael Krufkyc8812842008-03-28 05:48:44 -0300556 .driver_info = (kernel_ulong_t)&pvr2_device_751xx},
Mike Isely43823c02011-03-13 20:37:11 -0300557 { USB_DEVICE(0x0ccd, 0x0039),
558 .driver_info = (kernel_ulong_t)&pvr2_device_av400},
Mike Iselyd130fa82007-12-08 17:20:06 -0300559 { }
560};
Mike Isely989eb152007-11-26 01:53:12 -0300561
562MODULE_DEVICE_TABLE(usb, pvr2_device_table);
Tim Gardner740a3ea2012-07-26 14:57:07 -0300563MODULE_FIRMWARE(PVR2_FIRMWARE_29xxx);
564MODULE_FIRMWARE(PVR2_FIRMWARE_24xxx);
565MODULE_FIRMWARE(PVR2_FIRMWARE_73xxx);
566MODULE_FIRMWARE(PVR2_FIRMWARE_75xxx);
Mike Isely989eb152007-11-26 01:53:12 -0300567
568/*
569 Stuff for Emacs to see, in order to encourage consistent editing style:
570 *** Local Variables: ***
571 *** mode: c ***
572 *** fill-column: 75 ***
573 *** tab-width: 8 ***
574 *** c-basic-offset: 8 ***
575 *** End: ***
576 */