/*
* tm6000-cards.c - driver for TM5600/TM6000/TM6010 USB video capture devices
*
* Copyright (C) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
*
* 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 version 2
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/usb.h>
#include <linux/slab.h>
#include <media/v4l2-common.h>
#include <media/tuner.h>
#include <media/tvaudio.h>
#include <media/i2c-addr.h>
#include <media/rc-map.h>
#include "tm6000.h"
#include "tm6000-regs.h"
#include "tuner-xc2028.h"
#include "xc5000.h"
#define TM6000_BOARD_UNKNOWN 0
#define TM5600_BOARD_GENERIC 1
#define TM6000_BOARD_GENERIC 2
#define TM6010_BOARD_GENERIC 3
#define TM5600_BOARD_10MOONS_UT821 4
#define TM5600_BOARD_10MOONS_UT330 5
#define TM6000_BOARD_ADSTECH_DUAL_TV 6
#define TM6000_BOARD_FREECOM_AND_SIMILAR 7
#define TM6000_BOARD_ADSTECH_MINI_DUAL_TV 8
#define TM6010_BOARD_HAUPPAUGE_900H 9
#define TM6010_BOARD_BEHOLD_WANDER 10
#define TM6010_BOARD_BEHOLD_VOYAGER 11
#define TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE 12
#define TM6010_BOARD_TWINHAN_TU501 13
#define TM6010_BOARD_BEHOLD_WANDER_LITE 14
#define TM6010_BOARD_BEHOLD_VOYAGER_LITE 15
#define TM5600_BOARD_TERRATEC_GRABSTER 16
#define is_generic(model) ((model == TM6000_BOARD_UNKNOWN) || \
(model == TM5600_BOARD_GENERIC) || \
(model == TM6000_BOARD_GENERIC) || \
(model == TM6010_BOARD_GENERIC))
#define TM6000_MAXBOARDS 16
static unsigned int card[] = {[0 ... (TM6000_MAXBOARDS - 1)] = UNSET };
module_param_array(card, int, NULL, 0444);
static unsigned long tm6000_devused;
struct tm6000_board {
char *name;
char eename[16]; /* EEPROM name */
unsigned eename_size; /* size of EEPROM name */
unsigned eename_pos; /* Position where it appears at ROM */
struct tm6000_capabilities caps;
enum tm6000_devtype type; /* variant of the chipset */
int tuner_type; /* type of the tuner */
int tuner_addr; /* tuner address */
int demod_addr; /* demodulator address */