pvrusb2-devattr.c 11.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
/*
 *
 *  $Id$
 *
 *  Copyright (C) 2007 Mike Isely <isely@pobox.com>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

/*

This source file should encompass ALL per-device type information for the
driver.  To define a new device, add elements to the pvr2_device_table and
pvr2_device_desc structures.

*/

#include "pvrusb2-devattr.h"
#include <linux/usb.h>
32
/* This is needed in order to pull in tuner type ids... */
33 34
#include <linux/i2c.h>
#include <media/tuner.h>
35 36 37 38 39
#ifdef CONFIG_VIDEO_PVRUSB2_DVB
#include "pvrusb2-hdw-internal.h"
#include "lgdt330x.h"
#include "tuner-simple.h"
#endif
40

41

42 43
/*------------------------------------------------------------------------*/
/* Hauppauge PVR-USB2 Model 29xxx */
44 45 46 47 48 49 50 51 52 53 54

static const char *pvr2_client_29xxx[] = {
	"msp3400",
	"saa7115",
	"tuner",
};

static const char *pvr2_fw1_names_29xxx[] = {
		"v4l-pvrusb2-29xxx-01.fw",
};

55
static const struct pvr2_device_desc pvr2_device_29xxx = {
56
		.description = "WinTV PVR USB2 Model Category 29xxx",
57 58 59 60 61
		.shortname = "29xxx",
		.client_modules.lst = pvr2_client_29xxx,
		.client_modules.cnt = ARRAY_SIZE(pvr2_client_29xxx),
		.fx2_firmware.lst = pvr2_fw1_names_29xxx,
		.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 66
		.flag_has_composite = !0,
		.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 75 76 77 78 79 80 81 82 83 84 85 86
};



/*------------------------------------------------------------------------*/
/* Hauppauge PVR-USB2 Model 24xxx */

static const char *pvr2_client_24xxx[] = {
	"cx25840",
	"tuner",
	"wm8775",
};

static const char *pvr2_fw1_names_24xxx[] = {
		"v4l-pvrusb2-24xxx-01.fw",
};

static const struct pvr2_device_desc pvr2_device_24xxx = {
87
		.description = "WinTV PVR USB2 Model Category 24xxx",
88 89 90 91 92 93 94
		.shortname = "24xxx",
		.client_modules.lst = pvr2_client_24xxx,
		.client_modules.cnt = ARRAY_SIZE(pvr2_client_24xxx),
		.fx2_firmware.lst = pvr2_fw1_names_24xxx,
		.fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx),
		.flag_has_cx25840 = !0,
		.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 100
		.flag_has_composite = !0,
		.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 109 110 111 112 113 114 115
};



/*------------------------------------------------------------------------*/
/* GOTVIEW USB2.0 DVD2 */

static const char *pvr2_client_gotview_2[] = {
	"cx25840",
	"tuner",
};

static const struct pvr2_device_desc pvr2_device_gotview_2 = {
116 117 118 119
		.description = "Gotview USB 2.0 DVD 2",
		.shortname = "gv2",
		.client_modules.lst = pvr2_client_gotview_2,
		.client_modules.cnt = ARRAY_SIZE(pvr2_client_gotview_2),
120
		.flag_has_cx25840 = !0,
121
		.default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
122 123 124
		.flag_has_analogtuner = !0,
		.flag_has_composite = !0,
		.flag_has_svideo = !0,
125
		.signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
126 127 128 129
};



130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
/*------------------------------------------------------------------------*/
/* GOTVIEW USB2.0 DVD Deluxe */

/* (same module list as gotview_2) */

static const struct pvr2_device_desc pvr2_device_gotview_2d = {
		.description = "Gotview USB 2.0 DVD Deluxe",
		.shortname = "gv2d",
		.client_modules.lst = pvr2_client_gotview_2,
		.client_modules.cnt = ARRAY_SIZE(pvr2_client_gotview_2),
		.flag_has_cx25840 = !0,
		.default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
		.flag_has_analogtuner = !0,
		.flag_has_composite = !0,
		.flag_has_svideo = !0,
		.signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
};



150
#ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_CREATOR
151 152 153
/*------------------------------------------------------------------------*/
/* OnAir Creator */

154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
#ifdef CONFIG_VIDEO_PVRUSB2_DVB
static struct lgdt330x_config pvr2_lgdt3303_config = {
	.demod_address       = 0x0e,
	.demod_chip          = LGDT3303,
	.clock_polarity_flip = 1,
};

static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap)
{
	adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3303_config,
			      &adap->channel.hdw->i2c_adap);
	if (adap->fe)
		return 0;

	return -EIO;
}

static int pvr2_lgh06xf_attach(struct pvr2_dvb_adapter *adap)
{
	dvb_attach(simple_tuner_attach, adap->fe,
		   &adap->channel.hdw->i2c_adap, 0x61,
		   TUNER_LG_TDVS_H06XF);

	return 0;
}

struct pvr2_dvb_props pvr2_onair_creator_fe_props = {
	.frontend_attach = pvr2_lgdt3303_attach,
	.tuner_attach    = pvr2_lgh06xf_attach,
};
#endif

186 187 188 189 190 191 192
static const char *pvr2_client_onair_creator[] = {
	"saa7115",
	"tuner",
	"cs53l32a",
};

static const struct pvr2_device_desc pvr2_device_onair_creator = {
193 194
		.description = "OnAir Creator Hybrid USB tuner",
		.shortname = "oac",
195 196
		.client_modules.lst = pvr2_client_onair_creator,
		.client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_creator),
197
		.default_tuner_type = TUNER_LG_TDVS_H06XF,
198 199 200
		.flag_has_analogtuner = !0,
		.flag_has_composite = !0,
		.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 205 206
#ifdef CONFIG_VIDEO_PVRUSB2_DVB
		.dvb_props = &pvr2_onair_creator_fe_props,
#endif
207
};
208
#endif
209 210 211



212
#ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_USB2
213 214 215
/*------------------------------------------------------------------------*/
/* OnAir USB 2.0 */

216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
#ifdef CONFIG_VIDEO_PVRUSB2_DVB
static struct lgdt330x_config pvr2_lgdt3302_config = {
	.demod_address       = 0x0e,
	.demod_chip          = LGDT3302,
};

static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap)
{
	adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3302_config,
			      &adap->channel.hdw->i2c_adap);
	if (adap->fe)
		return 0;

	return -EIO;
}

static int pvr2_fcv1236d_attach(struct pvr2_dvb_adapter *adap)
{
	dvb_attach(simple_tuner_attach, adap->fe,
		   &adap->channel.hdw->i2c_adap, 0x61,
		   TUNER_PHILIPS_FCV1236D);

	return 0;
}

struct pvr2_dvb_props pvr2_onair_usb2_fe_props = {
	.frontend_attach = pvr2_lgdt3302_attach,
	.tuner_attach    = pvr2_fcv1236d_attach,
};
#endif

247 248 249 250 251 252 253
static const char *pvr2_client_onair_usb2[] = {
	"saa7115",
	"tuner",
	"cs53l32a",
};

static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
254 255
		.description = "OnAir USB2 Hybrid USB tuner",
		.shortname = "oa2",
256 257
		.client_modules.lst = pvr2_client_onair_usb2,
		.client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_usb2),
258
		.default_tuner_type = TUNER_PHILIPS_FCV1236D,
259 260 261
		.flag_has_analogtuner = !0,
		.flag_has_composite = !0,
		.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 266 267
#ifdef CONFIG_VIDEO_PVRUSB2_DVB
		.dvb_props = &pvr2_onair_usb2_fe_props,
#endif
268
};
269 270 271
#endif


272

273 274 275 276 277 278 279 280 281 282 283 284 285
/*------------------------------------------------------------------------*/
/* Hauppauge PVR-USB2 Model 73xxx */

static const char *pvr2_client_73xxx[] = {
	"cx25840",
	"tuner",
};

static const char *pvr2_fw1_names_73xxx[] = {
		"v4l-pvrusb2-73xxx-01.fw",
};

static const struct pvr2_device_desc pvr2_device_73xxx = {
286
		.description = "WinTV PVR USB2 Model Category 73xxx",
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
		.shortname = "73xxx",
		.client_modules.lst = pvr2_client_73xxx,
		.client_modules.cnt = ARRAY_SIZE(pvr2_client_73xxx),
		.fx2_firmware.lst = pvr2_fw1_names_73xxx,
		.fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx),
		.flag_has_cx25840 = !0,
		.flag_has_hauppauge_rom = !0,
		.flag_has_analogtuner = !0,
		.flag_has_composite = !0,
		.flag_has_svideo = !0,
		.signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
		.digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
		.led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
};



304 305 306 307 308 309 310 311 312 313 314 315
/*------------------------------------------------------------------------*/
/* Hauppauge PVR-USB2 Model 75xxx */

static const char *pvr2_client_75xxx[] = {
	"cx25840",
	"tuner",
};

static const char *pvr2_fw1_names_75xxx[] = {
		"v4l-pvrusb2-73xxx-01.fw",
};

316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
static const struct pvr2_device_desc pvr2_device_750xx = {
		.description = "WinTV PVR USB2 Model Category 750xx",
		.shortname = "750xx",
		.client_modules.lst = pvr2_client_75xxx,
		.client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx),
		.fx2_firmware.lst = pvr2_fw1_names_75xxx,
		.fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
		.flag_has_cx25840 = !0,
		.flag_has_hauppauge_rom = !0,
		.flag_has_analogtuner = !0,
		.flag_has_composite = !0,
		.flag_has_svideo = !0,
		.signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
		.digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
		.default_std_mask = V4L2_STD_NTSC_M,
		.led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
};

static const struct pvr2_device_desc pvr2_device_751xx = {
		.description = "WinTV PVR USB2 Model Category 751xx",
		.shortname = "751xx",
337 338 339 340 341 342
		.client_modules.lst = pvr2_client_75xxx,
		.client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx),
		.fx2_firmware.lst = pvr2_fw1_names_75xxx,
		.fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
		.flag_has_cx25840 = !0,
		.flag_has_hauppauge_rom = !0,
343 344 345
		.flag_has_analogtuner = !0,
		.flag_has_composite = !0,
		.flag_has_svideo = !0,
346
		.signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
347
		.digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
348
		.default_std_mask = V4L2_STD_NTSC_M,
349
		.led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
350 351 352 353
};



354 355 356 357 358 359 360 361 362
/*------------------------------------------------------------------------*/

struct usb_device_id pvr2_device_table[] = {
	{ USB_DEVICE(0x2040, 0x2900),
	  .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
	{ USB_DEVICE(0x2040, 0x2400),
	  .driver_info = (kernel_ulong_t)&pvr2_device_24xxx},
	{ USB_DEVICE(0x1164, 0x0622),
	  .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2},
363 364
	{ USB_DEVICE(0x1164, 0x0602),
	  .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2d},
365 366 367 368 369 370 371 372
#ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_CREATOR
	{ USB_DEVICE(0x11ba, 0x1003),
	  .driver_info = (kernel_ulong_t)&pvr2_device_onair_creator},
#endif
#ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_USB2
	{ USB_DEVICE(0x11ba, 0x1001),
	  .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2},
#endif
373 374
	{ USB_DEVICE(0x2040, 0x7300),
	  .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
375
	{ USB_DEVICE(0x2040, 0x7500),
376
	  .driver_info = (kernel_ulong_t)&pvr2_device_750xx},
377
	{ USB_DEVICE(0x2040, 0x7501),
378
	  .driver_info = (kernel_ulong_t)&pvr2_device_751xx},
379 380
	{ }
};
381 382 383 384 385 386 387 388 389 390 391 392 393

MODULE_DEVICE_TABLE(usb, pvr2_device_table);


/*
  Stuff for Emacs to see, in order to encourage consistent editing style:
  *** Local Variables: ***
  *** mode: c ***
  *** fill-column: 75 ***
  *** tab-width: 8 ***
  *** c-basic-offset: 8 ***
  *** End: ***
  */