[PATCH] v4l: TVaudio cleanup and better debug messages
[deliverable/linux.git] / drivers / media / video / tveeprom.c
CommitLineData
1da177e4
LT
1/*
2 * tveeprom - eeprom decoder for tvcard configuration eeproms
3 *
4 * Data and decoding routines shamelessly borrowed from bttv-cards.c
5 * eeprom access routine shamelessly borrowed from bttv-if.c
6 * which are:
7
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
9 & Marcus Metzler (mocm@thp.uni-koeln.de)
10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
11
12 * Adjustments to fit a more general model and all bugs:
13
14 Copyright (C) 2003 John Klar <linpvr at projectplasma.com>
15
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30
31
32#include <linux/module.h>
33#include <linux/moduleparam.h>
34#include <linux/errno.h>
35#include <linux/kernel.h>
36#include <linux/init.h>
37#include <linux/types.h>
38#include <linux/videodev.h>
39#include <linux/i2c.h>
40
41#include <media/tuner.h>
42#include <media/tveeprom.h>
43
44MODULE_DESCRIPTION("i2c Hauppauge eeprom decoder driver");
45MODULE_AUTHOR("John Klar");
46MODULE_LICENSE("GPL");
47
48static int debug = 0;
49module_param(debug, int, 0644);
50MODULE_PARM_DESC(debug, "Debug level (0-2)");
51
52#define STRM(array,i) (i < sizeof(array)/sizeof(char*) ? array[i] : "unknown")
53
54#define dprintk(num, args...) \
55 do { \
56 if (debug >= num) \
57 printk(KERN_INFO "tveeprom: " args); \
58 } while (0)
59
60#define TVEEPROM_KERN_ERR(args...) printk(KERN_ERR "tveeprom: " args);
61#define TVEEPROM_KERN_INFO(args...) printk(KERN_INFO "tveeprom: " args);
62
63/* ----------------------------------------------------------------------- */
64/* some hauppauge specific stuff */
65
66static struct HAUPPAUGE_TUNER_FMT
67{
68 int id;
69 char *name;
70}
71hauppauge_tuner_fmt[] =
72{
73 { 0x00000000, "unknown1" },
74 { 0x00000000, "unknown2" },
75 { 0x00000007, "PAL(B/G)" },
76 { 0x00001000, "NTSC(M)" },
77 { 0x00000010, "PAL(I)" },