linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/25] V4L/DVB updates
@ 2006-01-16  9:11 mchehab
  2006-01-16  9:11 ` [PATCH 04/25] Include missing MODULE_* macros mchehab
                   ` (24 more replies)
  0 siblings, 25 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel, torvalds; +Cc: linux-dvb-maintainer, video4linux-list, akpm

        This patch series is also available under v4l-dvb.git tree at:
                kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git

	Linus, please push these from master branch.

	It contains the following stuff:

   - Remove old MODULE_PARM in media/video/
   - bttv semaphore to mutex conversion
   - removed uneeded init on structs like static int foo=0
   - Include missing MODULE_* macros
   - Build cx88-alsa when CONFIG_VIDEO_CX88_ALSA is selected.
   - Updated MODULE_AUTHOR
   - Redesign tuners struct for maximum flexibility
   - Add support for Samsung tuner TCPN 2121P30A
   - disable all dvb tuner param_types until we need them
   - i2c ids for upd64031a saa717x upd64083 wm8739
   - Turn frame locked sound on, basic support for FM radio with TDA8275(a)
   - git dvb callbacks fix
   - cx88 Kconfig fixes for cx88-alsa
   - make some code static
   - Fix for lack of analog output on some cx88 boards
   - Semaphore to mutex conversion on drivers/media
   - Fix compilation with Alpha
   - Move tda988x options into tuner_params struct.
   - Separate tv & radio freqs, fix cb/freq transmit order for tuners that need this.
   - Return -EINVAL for unknown commands in msp3400 module.
   - fix some sound quality & distortion problems.
   - clean up some comments
   - tuner_params->tda988x is currently unused, so disable
   - Samsung TBMV30111IN has 6 entries
   - Added remote control support for pinnacle pctv

Cheers,
Mauro

---

 Documentation/video4linux/CARDLIST.tuner      |    1 
 drivers/media/dvb/bt8xx/bt878.c               |    2 
 drivers/media/dvb/dvb-core/dvbdev.c           |   22 
 drivers/media/dvb/dvb-usb/cxusb.c             |    2 
 drivers/media/dvb/frontends/dvb-pll.c         |    2 
 drivers/media/dvb/ttpci/av7110.c              |    4 
 drivers/media/dvb/ttpci/av7110_hw.c           |   40 
 drivers/media/dvb/ttpci/av7110_hw.h           |   12 
 drivers/media/video/Makefile                  |    3 
 drivers/media/video/arv.c                     |    6 
 drivers/media/video/bt832.c                   |    2 
 drivers/media/video/btcx-risc.c               |    2 
 drivers/media/video/bttv-cards.c              |    6 
 drivers/media/video/bttv-driver.c             |   87 -
 drivers/media/video/bttv-i2c.c                |    6 
 drivers/media/video/bttvp.h                   |    5 
 drivers/media/video/cx25840/cx25840-core.c    |    4 
 drivers/media/video/cx88/Kconfig              |    3 
 drivers/media/video/cx88/Makefile             |    1 
 drivers/media/video/cx88/cx88-alsa.c          |    9 
 drivers/media/video/cx88/cx88-core.c          |   15 
 drivers/media/video/cx88/cx88-tvaudio.c       |    8 
 drivers/media/video/cx88/cx88-vp3054-i2c.c    |    4 
 drivers/media/video/em28xx/em28xx-input.c     |   77 
 drivers/media/video/em28xx/em28xx-video.c     |    7 
 drivers/media/video/msp3400-driver.c          |   14 
 drivers/media/video/msp3400.h                 |    8 
 drivers/media/video/mt20xx.c                  |   12 
 drivers/media/video/planb.c                   |    4 
 drivers/media/video/saa6588.c                 |   10 
 drivers/media/video/saa711x.c                 |    2 
 drivers/media/video/saa7134/saa7134-cards.c   |    6 
 drivers/media/video/saa7134/saa7134-core.c    |   21 
 drivers/media/video/saa7134/saa7134-tvaudio.c |   11 
 drivers/media/video/tda8290.c                 |    4 
 drivers/media/video/tea5767.c                 |   18 
 drivers/media/video/tuner-core.c              |   85 -
 drivers/media/video/tuner-simple.c            |  794 ----------
 drivers/media/video/tuner-types.c             | 1406 ++++++++++++++++++
 drivers/media/video/tveeprom.c                |    2 
 drivers/media/video/tvp5150.c                 |    2 
 drivers/media/video/v4l2-common.c             |    1 
 drivers/media/video/videodev.c                |   25 
 include/linux/i2c-id.h                        |    4 
 include/media/tuner-types.h                   |   73 
 include/media/tuner.h                         |   10 
 include/media/v4l2-common.h                   |    7 
 47 files changed, 1870 insertions(+), 979 deletions(-)


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 04/25] Include missing MODULE_* macros
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 03/25] removed uneeded init on structs like static int foo=0 mchehab
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Mauro Carvalho Chehab


From: Mauro Carvalho Chehab <mchehab@infradead.org>

- Include missing MODULE_* macros.
- Fixed cx88_vp3054_i2c: module license 'unspecified' taints kernel.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/cx88/cx88-vp3054-i2c.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-vp3054-i2c.c b/drivers/media/video/cx88/cx88-vp3054-i2c.c
index 372cd29..751a754 100644
--- a/drivers/media/video/cx88/cx88-vp3054-i2c.c
+++ b/drivers/media/video/cx88/cx88-vp3054-i2c.c
@@ -32,6 +32,10 @@
 #include "cx88-vp3054-i2c.h"
 
 
+MODULE_DESCRIPTION("driver for cx2388x VP3054 design");
+MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
+MODULE_LICENSE("GPL");
+
 /* ----------------------------------------------------------------------- */
 
 static void vp3054_bit_setscl(void *data, int state)


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 03/25] removed uneeded init on structs like static int foo=0
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
  2006-01-16  9:11 ` [PATCH 04/25] Include missing MODULE_* macros mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 01/25] Remove old MODULE_PARM in media/video/ mchehab
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Mauro Carvalho Chehab


From: Mauro Carvalho Chehab <mchehab@infradead.org>

- Static vars are equal to zero by default. Removed unnecessary =0 from them,
  saving some data space

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/dvb/bt8xx/bt878.c            |    2 +-
 drivers/media/dvb/ttpci/av7110.c           |    4 ++--
 drivers/media/video/bt832.c                |    2 +-
 drivers/media/video/btcx-risc.c            |    2 +-
 drivers/media/video/bttv-cards.c           |    6 +++---
 drivers/media/video/bttv-driver.c          |   27 +++++++++++++--------------
 drivers/media/video/bttv-i2c.c             |    6 +++---
 drivers/media/video/cx25840/cx25840-core.c |    2 +-
 drivers/media/video/cx88/cx88-alsa.c       |    4 ++--
 drivers/media/video/msp3400-driver.c       |   10 +++++-----
 drivers/media/video/saa7134/saa7134-core.c |    2 +-
 11 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/drivers/media/dvb/bt8xx/bt878.c b/drivers/media/dvb/bt8xx/bt878.c
index f295714..a04bb61 100644
--- a/drivers/media/dvb/bt8xx/bt878.c
+++ b/drivers/media/dvb/bt8xx/bt878.c
@@ -542,7 +542,7 @@ static struct pci_driver bt878_pci_drive
       .remove	= bt878_remove,
 };
 
-static int bt878_pci_driver_registered = 0;
+static int bt878_pci_driver_registered;
 
 /*******************************/
 /* Module management functions */
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index 327a808..2749490 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -81,7 +81,7 @@ static int adac = DVB_ADAC_TI;
 static int hw_sections;
 static int rgb_on;
 static int volume = 255;
-static int budgetpatch = 0;
+static int budgetpatch;
 
 module_param_named(debug, av7110_debug, int, 0644);
 MODULE_PARM_DESC(debug, "debug level (bitmask, default 0)");
@@ -103,7 +103,7 @@ MODULE_PARM_DESC(budgetpatch, "use budge
 
 static void restart_feeds(struct av7110 *av7110);
 
-static int av7110_num = 0;
+static int av7110_num;
 
 #define FE_FUNC_OVERRIDE(fe_func, av7110_copy, av7110_func) \
 {\
diff --git a/drivers/media/video/bt832.c b/drivers/media/video/bt832.c
index 07c78f1..cc54b62 100644
--- a/drivers/media/video/bt832.c
+++ b/drivers/media/video/bt832.c
@@ -43,7 +43,7 @@ static unsigned short normal_i2c[] = { I
 				       I2C_CLIENT_END };
 I2C_CLIENT_INSMOD;
 
-int debug    = 0;    /* debug output */
+int debug;    /* debug output */
 module_param(debug,            int, 0644);
 
 /* ---------------------------------------------------------------------- */
diff --git a/drivers/media/video/btcx-risc.c b/drivers/media/video/btcx-risc.c
index a48de3c..b4aca72 100644
--- a/drivers/media/video/btcx-risc.c
+++ b/drivers/media/video/btcx-risc.c
@@ -37,7 +37,7 @@ MODULE_DESCRIPTION("some code shared by 
 MODULE_AUTHOR("Gerd Knorr");
 MODULE_LICENSE("GPL");
 
-static unsigned int debug = 0;
+static unsigned int debug;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug,"debug messages, default is 0 (no)");
 
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c
index 65323e7..9749d6e 100644
--- a/drivers/media/video/bttv-cards.c
+++ b/drivers/media/video/bttv-cards.c
@@ -92,8 +92,8 @@ static void identify_by_eeprom(struct bt
 static int __devinit pvr_boot(struct bttv *btv);
 
 /* config variables */
-static unsigned int triton1=0;
-static unsigned int vsfx=0;
+static unsigned int triton1;
+static unsigned int vsfx;
 static unsigned int latency = UNSET;
 int no_overlay=-1;
 
@@ -106,7 +106,7 @@ static struct bttv  *master[BTTV_MAX] = 
 #ifdef MODULE
 static unsigned int autoload = 1;
 #else
-static unsigned int autoload = 0;
+static unsigned int autoload;
 #endif
 static unsigned int gpiomask = UNSET;
 static unsigned int audioall = UNSET;
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
index 0e69703..1c6cfe9 100644
--- a/drivers/media/video/bttv-driver.c
+++ b/drivers/media/video/bttv-driver.c
@@ -48,47 +48,46 @@
 unsigned int bttv_num;			/* number of Bt848s in use */
 struct bttv bttvs[BTTV_MAX];
 
-unsigned int bttv_debug = 0;
+unsigned int bttv_debug;
 unsigned int bttv_verbose = 1;
-unsigned int bttv_gpio = 0;
+unsigned int bttv_gpio;
 
 /* config variables */
 #ifdef __BIG_ENDIAN
 static unsigned int bigendian=1;
 #else
-static unsigned int bigendian=0;
+static unsigned int bigendian;
 #endif
 static unsigned int radio[BTTV_MAX];
-static unsigned int irq_debug = 0;
+static unsigned int irq_debug;
 static unsigned int gbuffers = 8;
 static unsigned int gbufsize = 0x208000;
 
 static int video_nr = -1;
 static int radio_nr = -1;
 static int vbi_nr = -1;
-static int debug_latency = 0;
+static int debug_latency;
 
-static unsigned int fdsr = 0;
+static unsigned int fdsr;
 
 /* options */
-static unsigned int combfilter  = 0;
-static unsigned int lumafilter  = 0;
+static unsigned int combfilter;
+static unsigned int lumafilter;
 static unsigned int automute    = 1;
-static unsigned int chroma_agc  = 0;
+static unsigned int chroma_agc;
 static unsigned int adc_crush   = 1;
 static unsigned int whitecrush_upper = 0xCF;
 static unsigned int whitecrush_lower = 0x7F;
-static unsigned int vcr_hack    = 0;
-static unsigned int irq_iswitch = 0;
+static unsigned int vcr_hack;
+static unsigned int irq_iswitch;
 static unsigned int uv_ratio    = 50;
-static unsigned int full_luma_range = 0;
-static unsigned int coring      = 0;
+static unsigned int full_luma_range;
+static unsigned int coring;
 extern int no_overlay;
 
 /* API features (turn on/off stuff for testing) */
 static unsigned int v4l2        = 1;
 
-
 /* insmod args */
 module_param(bttv_verbose,      int, 0644);
 module_param(bttv_gpio,         int, 0644);
diff --git a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c
index 748d630..614c120 100644
--- a/drivers/media/video/bttv-i2c.c
+++ b/drivers/media/video/bttv-i2c.c
@@ -41,9 +41,9 @@ static struct i2c_client bttv_i2c_client
 
 static int attach_inform(struct i2c_client *client);
 
-static int i2c_debug = 0;
-static int i2c_hw = 0;
-static int i2c_scan = 0;
+static int i2c_debug;
+static int i2c_hw;
+static int i2c_scan;
 module_param(i2c_debug, int, 0644);
 module_param(i2c_hw,    int, 0444);
 module_param(i2c_scan,  int, 0444);
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 1d75a42..0da744c 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");
 static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END };
 
 
-int cx25840_debug = 0;
+int cx25840_debug;
 
 module_param_named(debug,cx25840_debug, int, 0644);
 
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index 7695b52..fd8bc71 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -116,7 +116,7 @@ MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("{{Conexant,23881},"
 			"{{Conexant,23882},"
 			"{{Conexant,23883}");
-static unsigned int debug = 0;
+static unsigned int debug;
 module_param(debug,int,0644);
 MODULE_PARM_DESC(debug,"enable debug messages");
 
@@ -653,7 +653,7 @@ static void snd_cx88_dev_free(snd_card_t
  * Alsa Constructor - Component probe
  */
 
-static int devno=0;
+static int devno;
 static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
 				    snd_cx88_card_t **rchip)
 {
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index 9b05a0a..09ff25b 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -66,12 +66,12 @@ MODULE_LICENSE("GPL");
 
 /* module parameters */
 static int opmode   = OPMODE_AUTO;
-int msp_debug    = 0;    /* msp_debug output */
-int msp_once     = 0;    /* no continous stereo monitoring */
-int msp_amsound  = 0;    /* hard-wire AM sound at 6.5 Hz (france),
-			       the autoscan seems work well only with FM... */
+int msp_debug;		 /* msp_debug output */
+int msp_once;		 /* no continous stereo monitoring */
+int msp_amsound;	 /* hard-wire AM sound at 6.5 Hz (france),
+			    the autoscan seems work well only with FM... */
 int msp_standard = 1;    /* Override auto detect of audio msp_standard, if needed. */
-int msp_dolby    = 0;
+int msp_dolby;
 
 int msp_stereo_thresh = 0x190; /* a2 threshold for stereo/bilingual
 					(msp34xxg only) 0x00a0-0x03c0 */
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 3983a65..3dd42ef 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -140,7 +140,7 @@ static int pending_call(struct notifier_
 	return NOTIFY_DONE;
 }
 
-static int pending_registered=0;
+static int pending_registered;
 static struct notifier_block pending_notifier = {
 	.notifier_call = pending_call,
 };


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 01/25] Remove old MODULE_PARM in media/video/
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
  2006-01-16  9:11 ` [PATCH 04/25] Include missing MODULE_* macros mchehab
  2006-01-16  9:11 ` [PATCH 03/25] removed uneeded init on structs like static int foo=0 mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 02/25] bttv semaphore to mutex conversion mchehab
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm,
	Eric Sesterhenn / snakebyte, Mauro Carvalho Chehab


From: Eric Sesterhenn / snakebyte <snakebyte@gmx.de>

Changes MODULE_PARM usage to module_param

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/arv.c     |    6 +++---
 drivers/media/video/planb.c   |    4 ++--
 drivers/media/video/saa6588.c |   10 +++++-----
 drivers/media/video/saa711x.c |    2 +-
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/media/video/arv.c b/drivers/media/video/arv.c
index 7d5a068..994b75f 100644
--- a/drivers/media/video/arv.c
+++ b/drivers/media/video/arv.c
@@ -129,9 +129,9 @@ static unsigned char	yuv[MAX_AR_FRAME_BY
 static int freq = DEFAULT_FREQ;	/* BCLK: available 50 or 70 (MHz) */
 static int vga = 0;		/* default mode(0:QVGA mode, other:VGA mode) */
 static int vga_interlace = 0;	/* 0 is normal mode for, else interlace mode */
-MODULE_PARM(freq, "i");
-MODULE_PARM(vga, "i");
-MODULE_PARM(vga_interlace, "i");
+module_param(freq, int, 0);
+module_param(vga, int, 0);
+module_param(vga_interlace, int, 0);
 
 static int ar_initialize(struct video_device *dev);
 
diff --git a/drivers/media/video/planb.c b/drivers/media/video/planb.c
index b19c334..f3fc361 100644
--- a/drivers/media/video/planb.c
+++ b/drivers/media/video/planb.c
@@ -76,9 +76,9 @@ static volatile struct planb_registers *
 static int def_norm = PLANB_DEF_NORM;	/* default norm */
 static int video_nr = -1;
 
-MODULE_PARM(def_norm, "i");
+module_param(def_norm, int, 0);
 MODULE_PARM_DESC(def_norm, "Default startup norm (0=PAL, 1=NTSC, 2=SECAM)");
-MODULE_PARM(video_nr,"i");
+module_param(video_nr, int, 0);
 MODULE_LICENSE("GPL");
 
 
diff --git a/drivers/media/video/saa6588.c b/drivers/media/video/saa6588.c
index e70b17e..d17395c 100644
--- a/drivers/media/video/saa6588.c
+++ b/drivers/media/video/saa6588.c
@@ -50,15 +50,15 @@ static unsigned int rbds = 0;
 static unsigned int plvl = 0;
 static unsigned int bufblocks = 100;
 
-MODULE_PARM(debug, "i");
+module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "enable debug messages");
-MODULE_PARM(xtal, "i");
+module_param(xtal, int, 0);
 MODULE_PARM_DESC(xtal, "select oscillator frequency (0..3), default 0");
-MODULE_PARM(rbds, "i");
+module_param(rbds, int, 0);
 MODULE_PARM_DESC(rbds, "select mode, 0=RDS, 1=RBDS, default 0");
-MODULE_PARM(plvl, "i");
+module_param(plvl, int, 0);
 MODULE_PARM_DESC(plvl, "select pause level (0..3), default 0");
-MODULE_PARM(bufblocks, "i");
+module_param(bufblocks, int, 0);
 MODULE_PARM_DESC(bufblocks, "number of buffered blocks, default 100");
 
 MODULE_DESCRIPTION("v4l2 driver module for SAA6588 RDS decoder");
diff --git a/drivers/media/video/saa711x.c b/drivers/media/video/saa711x.c
index ae53063..6c161f2 100644
--- a/drivers/media/video/saa711x.c
+++ b/drivers/media/video/saa711x.c
@@ -52,7 +52,7 @@ MODULE_LICENSE("GPL");
 #include <linux/video_decoder.h>
 
 static int debug = 0;
-MODULE_PARM(debug, "i");
+module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, " Set the default Debug level.  Default: 0 (Off) - (0-1)");
 
 


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 02/25] bttv semaphore to mutex conversion
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (2 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 01/25] Remove old MODULE_PARM in media/video/ mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 07/25] Redesign tuners struct for maximum flexibility mchehab
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Ingo Molnar,
	Mauro Carvalho Chehab


From: Ingo Molnar <mingo@elte.hu>

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

build-tested.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/bttv-driver.c |   60 +++++++++++++++++++------------------
 drivers/media/video/bttvp.h       |    5 ++-
 2 files changed, 33 insertions(+), 32 deletions(-)

diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
index 1c6cfe9..aa4c4c5 100644
--- a/drivers/media/video/bttv-driver.c
+++ b/drivers/media/video/bttv-driver.c
@@ -684,16 +684,16 @@ int check_alloc_btres(struct bttv *btv, 
 		return 1;
 
 	/* is it free? */
-	down(&btv->reslock);
+	mutex_lock(&btv->reslock);
 	if (btv->resources & bit) {
 		/* no, someone else uses it */
-		up(&btv->reslock);
+		mutex_unlock(&btv->reslock);
 		return 0;
 	}
 	/* it's free, grab it */
 	fh->resources  |= bit;
 	btv->resources |= bit;
-	up(&btv->reslock);
+	mutex_unlock(&btv->reslock);
 	return 1;
 }
 
@@ -716,10 +716,10 @@ void free_btres(struct bttv *btv, struct
 		/* trying to free ressources not allocated by us ... */
 		printk("bttv: BUG! (btres)\n");
 	}
-	down(&btv->reslock);
+	mutex_lock(&btv->reslock);
 	fh->resources  &= ~bits;
 	btv->resources &= ~bits;
-	up(&btv->reslock);
+	mutex_unlock(&btv->reslock);
 }
 
 /* ----------------------------------------------------------------------- */
@@ -1536,12 +1536,12 @@ static int bttv_common_ioctls(struct btt
 	case VIDIOCSFREQ:
 	{
 		unsigned long *freq = arg;
-		down(&btv->lock);
+		mutex_lock(&btv->lock);
 		btv->freq=*freq;
 		bttv_call_i2c_clients(btv,VIDIOCSFREQ,freq);
 		if (btv->has_matchbox && btv->radio_user)
 			tea5757_set_freq(btv,*freq);
-		up(&btv->lock);
+		mutex_unlock(&btv->lock);
 		return 0;
 	}
 
@@ -1571,10 +1571,10 @@ static int bttv_common_ioctls(struct btt
 		if (v->mode >= BTTV_TVNORMS)
 			return -EINVAL;
 
-		down(&btv->lock);
+		mutex_lock(&btv->lock);
 		set_tvnorm(btv,v->mode);
 		bttv_call_i2c_clients(btv,cmd,v);
-		up(&btv->lock);
+		mutex_unlock(&btv->lock);
 		return 0;
 	}
 
@@ -1611,17 +1611,17 @@ static int bttv_common_ioctls(struct btt
 		if (v->norm >= BTTV_TVNORMS)
 			return -EINVAL;
 
-		down(&btv->lock);
+		mutex_lock(&btv->lock);
 		if (channel == btv->input &&
 		    v->norm == btv->tvnorm) {
 			/* nothing to do */
-			up(&btv->lock);
+			mutex_unlock(&btv->lock);
 			return 0;
 		}
 
 		btv->tvnorm = v->norm;
 		set_input(btv,v->channel);
-		up(&btv->lock);
+		mutex_unlock(&btv->lock);
 		return 0;
 	}
 
@@ -1634,14 +1634,14 @@ static int bttv_common_ioctls(struct btt
 		v->flags |= VIDEO_AUDIO_MUTABLE;
 		v->mode  = VIDEO_SOUND_MONO;
 
-		down(&btv->lock);
+		mutex_lock(&btv->lock);
 		bttv_call_i2c_clients(btv,cmd,v);
 
 		/* card specific hooks */
 		if (btv->audio_hook)
 			btv->audio_hook(btv,v,0);
 
-		up(&btv->lock);
+		mutex_unlock(&btv->lock);
 		return 0;
 	}
 	case VIDIOCSAUDIO:
@@ -1652,7 +1652,7 @@ static int bttv_common_ioctls(struct btt
 		if (audio >= bttv_tvcards[btv->c.type].audio_inputs)
 			return -EINVAL;
 
-		down(&btv->lock);
+		mutex_lock(&btv->lock);
 		audio_mux(btv, (v->flags&VIDEO_AUDIO_MUTE) ? AUDIO_MUTE : AUDIO_UNMUTE);
 		bttv_call_i2c_clients(btv,cmd,v);
 
@@ -1660,7 +1660,7 @@ static int bttv_common_ioctls(struct btt
 		if (btv->audio_hook)
 			btv->audio_hook(btv,v,1);
 
-		up(&btv->lock);
+		mutex_unlock(&btv->lock);
 		return 0;
 	}
 
@@ -1694,10 +1694,10 @@ static int bttv_common_ioctls(struct btt
 		if (i == BTTV_TVNORMS)
 			return -EINVAL;
 
-		down(&btv->lock);
+		mutex_lock(&btv->lock);
 		set_tvnorm(btv,i);
 		i2c_vidiocschan(btv);
-		up(&btv->lock);
+		mutex_unlock(&btv->lock);
 		return 0;
 	}
 	case VIDIOC_QUERYSTD:
@@ -1755,9 +1755,9 @@ static int bttv_common_ioctls(struct btt
 
 		if (*i > bttv_tvcards[btv->c.type].video_inputs)
 			return -EINVAL;
-		down(&btv->lock);
+		mutex_lock(&btv->lock);
 		set_input(btv,*i);
-		up(&btv->lock);
+		mutex_unlock(&btv->lock);
 		return 0;
 	}
 
@@ -1769,7 +1769,7 @@ static int bttv_common_ioctls(struct btt
 			return -EINVAL;
 		if (0 != t->index)
 			return -EINVAL;
-		down(&btv->lock);
+		mutex_lock(&btv->lock);
 		memset(t,0,sizeof(*t));
 		strcpy(t->name, "Television");
 		t->type       = V4L2_TUNER_ANALOG_TV;
@@ -1804,7 +1804,7 @@ static int bttv_common_ioctls(struct btt
 			}
 		}
 		/* FIXME: fill capability+audmode */
-		up(&btv->lock);
+		mutex_unlock(&btv->lock);
 		return 0;
 	}
 	case VIDIOC_S_TUNER:
@@ -1815,7 +1815,7 @@ static int bttv_common_ioctls(struct btt
 			return -EINVAL;
 		if (0 != t->index)
 			return -EINVAL;
-		down(&btv->lock);
+		mutex_lock(&btv->lock);
 		{
 			struct video_audio va;
 			memset(&va, 0, sizeof(struct video_audio));
@@ -1832,7 +1832,7 @@ static int bttv_common_ioctls(struct btt
 			if (btv->audio_hook)
 				btv->audio_hook(btv,&va,1);
 		}
-		up(&btv->lock);
+		mutex_unlock(&btv->lock);
 		return 0;
 	}
 
@@ -1853,12 +1853,12 @@ static int bttv_common_ioctls(struct btt
 			return -EINVAL;
 		if (unlikely (f->type != V4L2_TUNER_ANALOG_TV))
 			return -EINVAL;
-		down(&btv->lock);
+		mutex_lock(&btv->lock);
 		btv->freq = f->frequency;
 		bttv_call_i2c_clients(btv,VIDIOCSFREQ,&btv->freq);
 		if (btv->has_matchbox && btv->radio_user)
 			tea5757_set_freq(btv,btv->freq);
-		up(&btv->lock);
+		mutex_unlock(&btv->lock);
 		return 0;
 	}
 	case VIDIOC_LOG_STATUS:
@@ -3156,7 +3156,7 @@ static int radio_open(struct inode *inod
 		return -ENODEV;
 
 	dprintk("bttv%d: open called (radio)\n",btv->c.nr);
-	down(&btv->lock);
+	mutex_lock(&btv->lock);
 
 	btv->radio_user++;
 
@@ -3165,7 +3165,7 @@ static int radio_open(struct inode *inod
 	bttv_call_i2c_clients(btv,AUDC_SET_RADIO,&btv->tuner_type);
 	audio_mux(btv,AUDIO_RADIO);
 
-	up(&btv->lock);
+	mutex_unlock(&btv->lock);
 	return 0;
 }
 
@@ -3920,8 +3920,8 @@ static int __devinit bttv_probe(struct p
 	sprintf(btv->c.name,"bttv%d",btv->c.nr);
 
 	/* initialize structs / fill in defaults */
-	init_MUTEX(&btv->lock);
-	init_MUTEX(&btv->reslock);
+	mutex_init(&btv->lock);
+	mutex_init(&btv->reslock);
 	spin_lock_init(&btv->s_lock);
 	spin_lock_init(&btv->gpio_lock);
 	init_waitqueue_head(&btv->gpioq);
diff --git a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h
index dd00c20..9cb72f1 100644
--- a/drivers/media/video/bttvp.h
+++ b/drivers/media/video/bttvp.h
@@ -35,6 +35,7 @@
 #include <linux/videodev.h>
 #include <linux/pci.h>
 #include <linux/input.h>
+#include <linux/mutex.h>
 #include <asm/scatterlist.h>
 #include <asm/io.h>
 
@@ -309,9 +310,9 @@ struct bttv {
 
 	/* locking */
 	spinlock_t s_lock;
-	struct semaphore lock;
+	struct mutex lock;
 	int resources;
-	struct semaphore reslock;
+	struct mutex reslock;
 #ifdef VIDIOC_G_PRIORITY
 	struct v4l2_prio_state prio;
 #endif


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 06/25] Updated MODULE_AUTHOR
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (5 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 05/25] Build cx88-alsa when CONFIG_VIDEO_CX88_ALSA is selected mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 09/25] disable all dvb tuner param_types until we need them mchehab
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Michael Krufky,
	Mauro Carvalho Chehab


From: Michael Krufky <mkrufky@m1k.net>

- Updated MODULE_AUTHOR

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/dvb/dvb-usb/cxusb.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 18d1698..a7fb06f 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -691,6 +691,8 @@ module_init (cxusb_module_init);
 module_exit (cxusb_module_exit);
 
 MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
+MODULE_AUTHOR("Michael Krufky <mkrufky@m1k.net>");
+MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
 MODULE_DESCRIPTION("Driver for Conexant USB2.0 hybrid reference design");
 MODULE_VERSION("1.0-alpha");
 MODULE_LICENSE("GPL");


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 07/25] Redesign tuners struct for maximum flexibility
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (3 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 02/25] bttv semaphore to mutex conversion mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 05/25] Build cx88-alsa when CONFIG_VIDEO_CX88_ALSA is selected mchehab
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Michael Krufky,
	Mauro Carvalho Chehab


From: Michael Krufky <mkrufky@m1k.net>

- Tunertype struct redefined to allow one or more tuner_params structs
  per tuner definition, one for each video standard.
- Each tuner_params struct has an element containing an arbitrary
  amount of tuner_ranges.
  (this is needed for dvb tuners - to be handled later)
- A tuner_range may be referenced by multiple tuner_params structs.
  There are many duplicates in here. Reusing tuner_range structs,
  rather than defining new ones for each tuner, will cut down on
  memory usage, and is preferred when possible.
- tunertype struct contains an element, has_tda988x.
  We must set this for all tunertypes that contain a tda988x
  chip, and then we can remove this setting from the various
  card structs.
- Improves tuners array memory usage efficiency.
- Right now, all tuners are using the first tuner_params[] array element
  for analog mode. In the future, we will be merging similar tuner
  definitions together, such that each tuner definition will have a
  tuner_params struct for each available video standard. At that point,
  the tuner_params[] array element will be chosen based on the video
  standard in use.

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/Makefile       |    3 
 drivers/media/video/tuner-simple.c |  750 +-------------------
 drivers/media/video/tuner-types.c  | 1376 ++++++++++++++++++++++++++++++++++++
 include/media/tuner-types.h        |   41 +
 include/media/tuner.h              |    1 
 5 files changed, 1444 insertions(+), 727 deletions(-)

diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index dd24896..faf7283 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -8,7 +8,8 @@ bttv-objs	:=	bttv-driver.o bttv-cards.o 
 zoran-objs      :=	zr36120.o zr36120_i2c.o zr36120_mem.o
 zr36067-objs	:=	zoran_procfs.o zoran_device.o \
 			zoran_driver.o zoran_card.o
-tuner-objs	:=	tuner-core.o tuner-simple.o mt20xx.o tda8290.o tea5767.o
+tuner-objs	:=	tuner-core.o tuner-types.o tuner-simple.o \
+			mt20xx.o tda8290.o tea5767.o
 
 msp3400-objs	:=	msp3400-driver.o msp3400-kthreads.o
 
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index e5fb743..3879262 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -79,722 +79,16 @@ MODULE_PARM_DESC(offset,"Allows to speci
 #define TUNER_PLL_LOCKED   0x40
 #define TUNER_STEREO_MK3   0x04
 
-#define TUNER_MAX_RANGES   3
-
-/* ---------------------------------------------------------------------- */
-
-struct tunertype
-{
-	char *name;
-
-	int count;
-	struct {
-		unsigned short thresh;
-		unsigned char cb;
-	} ranges[TUNER_MAX_RANGES];
-	unsigned char config;
-};
-
-/*
- *	The floats in the tuner struct are computed at compile time
- *	by gcc and cast back to integers. Thus we don't violate the
- *	"no float in kernel" rule.
+#define TUNER_PARAM_ANALOG 0  /* to be removed */
+/* FIXME:
+ * Right now, all tuners are using the first tuner_params[] array element
+ * for analog mode. In the future, we will be merging similar tuner
+ * definitions together, such that each tuner definition will have a
+ * tuner_params struct for each available video standard. At that point,
+ * TUNER_PARAM_ANALOG will be removed, and the tuner_params[] array
+ * element will be chosen based on the video standard in use.
+ *
  */
-static struct tunertype tuners[] = {
-	/* 0-9 */
-	[TUNER_TEMIC_PAL] = { /* TEMIC PAL */
-		.name   = "Temic PAL (4002 FH5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 140.25 /*MHz*/, 0x02, },
-			{ 16 * 463.25 /*MHz*/, 0x04, },
-			{ 16 * 999.99        , 0x01, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_PAL_I] = { /* Philips PAL_I */
-		.name   = "Philips PAL_I (FI1246 and compatibles)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 140.25 /*MHz*/, 0xa0, },
-			{ 16 * 463.25 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_NTSC] = { /* Philips NTSC */
-		.name   = "Philips NTSC (FI1236,FM1236 and compatibles)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 157.25 /*MHz*/, 0xa0, },
-			{ 16 * 451.25 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_SECAM] = { /* Philips SECAM */
-		.name   = "Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 168.25 /*MHz*/, 0xa7, },
-			{ 16 * 447.25 /*MHz*/, 0x97, },
-			{ 16 * 999.99        , 0x37, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_ABSENT] = { /* Tuner Absent */
-		.name   = "NoTuner",
-		.count  = 1,
-		.ranges = {
-			{ 0, 0x00, },
-		},
-		.config = 0x00,
-	},
-	[TUNER_PHILIPS_PAL] = { /* Philips PAL */
-		.name   = "Philips PAL_BG (FI1216 and compatibles)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 168.25 /*MHz*/, 0xa0, },
-			{ 16 * 447.25 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEMIC_NTSC] = { /* TEMIC NTSC */
-		.name   = "Temic NTSC (4032 FY5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 157.25 /*MHz*/, 0x02, },
-			{ 16 * 463.25 /*MHz*/, 0x04, },
-			{ 16 * 999.99        , 0x01, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEMIC_PAL_I] = { /* TEMIC PAL_I */
-		.name   = "Temic PAL_I (4062 FY5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0x02, },
-			{ 16 * 450.00 /*MHz*/, 0x04, },
-			{ 16 * 999.99        , 0x01, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEMIC_4036FY5_NTSC] = { /* TEMIC NTSC */
-		.name   = "Temic NTSC (4036 FY5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 157.25 /*MHz*/, 0xa0, },
-			{ 16 * 463.25 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_ALPS_TSBH1_NTSC] = { /* TEMIC NTSC */
-		.name   = "Alps HSBH1",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 137.25 /*MHz*/, 0x01, },
-			{ 16 * 385.25 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-
-	/* 10-19 */
-	[TUNER_ALPS_TSBE1_PAL] = { /* TEMIC PAL */
-		.name   = "Alps TSBE1",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 137.25 /*MHz*/, 0x01, },
-			{ 16 * 385.25 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_ALPS_TSBB5_PAL_I] = { /* Alps PAL_I */
-		.name   = "Alps TSBB5",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 133.25 /*MHz*/, 0x01, },
-			{ 16 * 351.25 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_ALPS_TSBE5_PAL] = { /* Alps PAL */
-		.name   = "Alps TSBE5",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 133.25 /*MHz*/, 0x01, },
-			{ 16 * 351.25 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_ALPS_TSBC5_PAL] = { /* Alps PAL */
-		.name   = "Alps TSBC5",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 133.25 /*MHz*/, 0x01, },
-			{ 16 * 351.25 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEMIC_4006FH5_PAL] = { /* TEMIC PAL */
-		.name   = "Temic PAL_BG (4006FH5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0xa0, },
-			{ 16 * 450.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_ALPS_TSHC6_NTSC] = { /* Alps NTSC */
-		.name   = "Alps TSCH6",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 137.25 /*MHz*/, 0x14, },
-			{ 16 * 385.25 /*MHz*/, 0x12, },
-			{ 16 * 999.99        , 0x11, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEMIC_PAL_DK] = { /* TEMIC PAL */
-		.name   = "Temic PAL_DK (4016 FY5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 168.25 /*MHz*/, 0xa0, },
-			{ 16 * 456.25 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_NTSC_M] = { /* Philips NTSC */
-		.name   = "Philips NTSC_M (MK2)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0xa0, },
-			{ 16 * 454.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEMIC_4066FY5_PAL_I] = { /* TEMIC PAL_I */
-		.name   = "Temic PAL_I (4066 FY5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 169.00 /*MHz*/, 0xa0, },
-			{ 16 * 454.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEMIC_4006FN5_MULTI_PAL] = { /* TEMIC PAL */
-		.name   = "Temic PAL* auto (4006 FN5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 169.00 /*MHz*/, 0xa0, },
-			{ 16 * 454.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-
-	/* 20-29 */
-	[TUNER_TEMIC_4009FR5_PAL] = { /* TEMIC PAL */
-		.name   = "Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 141.00 /*MHz*/, 0xa0, },
-			{ 16 * 464.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEMIC_4039FR5_NTSC] = { /* TEMIC NTSC */
-		.name   = "Temic NTSC (4039 FR5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 158.00 /*MHz*/, 0xa0, },
-			{ 16 * 453.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEMIC_4046FM5] = { /* TEMIC PAL */
-		.name   = "Temic PAL/SECAM multi (4046 FM5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 169.00 /*MHz*/, 0xa0, },
-			{ 16 * 454.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_PAL_DK] = { /* Philips PAL */
-		.name   = "Philips PAL_DK (FI1256 and compatibles)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0xa0, },
-			{ 16 * 450.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_FQ1216ME] = { /* Philips PAL */
-		.name   = "Philips PAL/SECAM multi (FQ1216ME)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0xa0, },
-			{ 16 * 450.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_LG_PAL_I_FM] = { /* LGINNOTEK PAL_I */
-		.name   = "LG PAL_I+FM (TAPC-I001D)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0xa0, },
-			{ 16 * 450.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_LG_PAL_I] = { /* LGINNOTEK PAL_I */
-		.name   = "LG PAL_I (TAPC-I701D)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0xa0, },
-			{ 16 * 450.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_LG_NTSC_FM] = { /* LGINNOTEK NTSC */
-		.name   = "LG NTSC+FM (TPI8NSR01F)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 210.00 /*MHz*/, 0xa0, },
-			{ 16 * 497.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_LG_PAL_FM] = { /* LGINNOTEK PAL */
-		.name   = "LG PAL_BG+FM (TPI8PSB01D)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0xa0, },
-			{ 16 * 450.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_LG_PAL] = { /* LGINNOTEK PAL */
-		.name   = "LG PAL_BG (TPI8PSB11D)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0xa0, },
-			{ 16 * 450.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-
-	/* 30-39 */
-	[TUNER_TEMIC_4009FN5_MULTI_PAL_FM] = { /* TEMIC PAL */
-		.name   = "Temic PAL* auto + FM (4009 FN5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 141.00 /*MHz*/, 0xa0, },
-			{ 16 * 464.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_SHARP_2U5JF5540_NTSC] = { /* SHARP NTSC */
-		.name   = "SHARP NTSC_JP (2U5JF5540)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 137.25 /*MHz*/, 0x01, },
-			{ 16 * 317.25 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_Samsung_PAL_TCPM9091PD27] = { /* Samsung PAL */
-		.name   = "Samsung PAL TCPM9091PD27",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 169 /*MHz*/, 0xa0, },
-			{ 16 * 464 /*MHz*/, 0x90, },
-			{ 16 * 999.99     , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_MT2032] = { /* Microtune PAL|NTSC */
-		.name   = "MT20xx universal",
-	  /* see mt20xx.c for details */ },
-	[TUNER_TEMIC_4106FH5] = { /* TEMIC PAL */
-		.name   = "Temic PAL_BG (4106 FH5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 141.00 /*MHz*/, 0xa0, },
-			{ 16 * 464.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEMIC_4012FY5] = { /* TEMIC PAL */
-		.name   = "Temic PAL_DK/SECAM_L (4012 FY5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 140.25 /*MHz*/, 0x02, },
-			{ 16 * 463.25 /*MHz*/, 0x04, },
-			{ 16 * 999.99        , 0x01, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEMIC_4136FY5] = { /* TEMIC NTSC */
-		.name   = "Temic NTSC (4136 FY5)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 158.00 /*MHz*/, 0xa0, },
-			{ 16 * 453.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_LG_PAL_NEW_TAPC] = { /* LGINNOTEK PAL */
-		.name   = "LG PAL (newer TAPC series)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0x01, },
-			{ 16 * 450.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_FM1216ME_MK3] = { /* Philips PAL */
-		.name   = "Philips PAL/SECAM multi (FM1216ME MK3)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 158.00 /*MHz*/, 0x01, },
-			{ 16 * 442.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_LG_NTSC_NEW_TAPC] = { /* LGINNOTEK NTSC */
-		.name   = "LG NTSC (newer TAPC series)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0x01, },
-			{ 16 * 450.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-
-	/* 40-49 */
-	[TUNER_HITACHI_NTSC] = { /* HITACHI NTSC */
-		.name   = "HITACHI V7-J180AT",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0x01, },
-			{ 16 * 450.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_PAL_MK] = { /* Philips PAL */
-		.name   = "Philips PAL_MK (FI1216 MK)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 140.25 /*MHz*/, 0x01, },
-			{ 16 * 463.25 /*MHz*/, 0xc2, },
-			{ 16 * 999.99        , 0xcf, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_ATSC] = { /* Philips ATSC */
-		.name   = "Philips 1236D ATSC/NTSC dual in",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 157.25 /*MHz*/, 0xa0, },
-			{ 16 * 454.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_FM1236_MK3] = { /* Philips NTSC */
-		.name   = "Philips NTSC MK3 (FM1236MK3 or FM1236/F)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0x01, },
-			{ 16 * 442.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_4IN1] = { /* Philips NTSC */
-		.name   = "Philips 4 in 1 (ATI TV Wonder Pro/Conexant)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0x01, },
-			{ 16 * 442.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_MICROTUNE_4049FM5] = { /* Microtune PAL */
-		.name   = "Microtune 4049 FM5",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 141.00 /*MHz*/, 0xa0, },
-			{ 16 * 464.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PANASONIC_VP27] = { /* Panasonic NTSC */
-		.name   = "Panasonic VP27s/ENGE4324D",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0x01, },
-			{ 16 * 454.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0xce,
-	},
-	[TUNER_LG_NTSC_TAPE] = { /* LGINNOTEK NTSC */
-		.name   = "LG NTSC (TAPE series)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0x01, },
-			{ 16 * 442.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TNF_8831BGFF] = { /* Philips PAL */
-		.name   = "Tenna TNF 8831 BGFF)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 161.25 /*MHz*/, 0xa0, },
-			{ 16 * 463.25 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_MICROTUNE_4042FI5] = { /* Microtune NTSC */
-		.name   = "Microtune 4042 FI5 ATSC/NTSC dual in",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 162.00 /*MHz*/, 0xa2, },
-			{ 16 * 457.00 /*MHz*/, 0x94, },
-			{ 16 * 999.99        , 0x31, },
-		},
-		.config = 0x8e,
-	},
-
-	/* 50-59 */
-	[TUNER_TCL_2002N] = { /* TCL NTSC */
-		.name   = "TCL 2002N",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 172.00 /*MHz*/, 0x01, },
-			{ 16 * 448.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_FM1256_IH3] = { /* Philips PAL */
-		.name   = "Philips PAL/SECAM_D (FM 1256 I-H3)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0x01, },
-			{ 16 * 442.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_THOMSON_DTT7610] = { /* THOMSON ATSC */
-		.name   = "Thomson DTT 7610 (ATSC/NTSC)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 157.25 /*MHz*/, 0x39, },
-			{ 16 * 454.00 /*MHz*/, 0x3a, },
-			{ 16 * 999.99        , 0x3c, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_FQ1286] = { /* Philips NTSC */
-		.name   = "Philips FQ1286",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0x41, },
-			{ 16 * 454.00 /*MHz*/, 0x42, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_TDA8290] = { /* Philips PAL|NTSC */
-		.name   = "tda8290+75",
-	  /* see tda8290.c for details */ },
-	[TUNER_TCL_2002MB] = { /* TCL PAL */
-		.name   = "TCL 2002MB",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 170.00 /*MHz*/, 0x01, },
-			{ 16 * 450.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0xce,
-	},
-	[TUNER_PHILIPS_FQ1216AME_MK4] = { /* Philips PAL */
-		.name   = "Philips PAL/SECAM multi (FQ1216AME MK4)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0x01, },
-			{ 16 * 442.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0xce,
-	},
-	[TUNER_PHILIPS_FQ1236A_MK4] = { /* Philips NTSC */
-		.name   = "Philips FQ1236A MK4",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0x01, },
-			{ 16 * 442.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_YMEC_TVF_8531MF] = { /* Philips NTSC */
-		.name   = "Ymec TVision TVF-8531MF/8831MF/8731MF",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0xa0, },
-			{ 16 * 454.00 /*MHz*/, 0x90, },
-			{ 16 * 999.99        , 0x30, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_YMEC_TVF_5533MF] = { /* Philips NTSC */
-		.name   = "Ymec TVision TVF-5533MF",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0x01, },
-			{ 16 * 454.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0x8e,
-	},
-
-	/* 60-69 */
-	[TUNER_THOMSON_DTT761X] = { /* THOMSON ATSC */
-		/* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */
-		.name   = "Thomson DTT 761X (ATSC/NTSC)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 145.25 /*MHz*/, 0x39, },
-			{ 16 * 415.25 /*MHz*/, 0x3a, },
-			{ 16 * 999.99        , 0x3c, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TENA_9533_DI] = { /* Philips PAL */
-		.name   = "Tena TNF9533-D/IF/TNF9533-B/DF",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.25 /*MHz*/, 0x01, },
-			{ 16 * 464.25 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_TEA5767] = { /* Philips RADIO */
-		.name   = "Philips TEA5767HN FM Radio",
-	  /* see tea5767.c for details */},
-	[TUNER_PHILIPS_FMD1216ME_MK3] = { /* Philips PAL */
-		.name   = "Philips FMD1216ME MK3 Hybrid Tuner",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0x51, },
-			{ 16 * 442.00 /*MHz*/, 0x52, },
-			{ 16 * 999.99        , 0x54, },
-		},
-		.config = 0x86,
-	},
-	[TUNER_LG_TDVS_H062F] = { /* LGINNOTEK ATSC */
-		.name   = "LG TDVS-H062F/TUA6034",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0x01 },
-			{ 16 * 455.00 /*MHz*/, 0x02 },
-			{ 16 * 999.99        , 0x04 },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_YMEC_TVF66T5_B_DFF] = { /* Philips PAL */
-		.name   = "Ymec TVF66T5-B/DFF",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.25 /*MHz*/, 0x01, },
-			{ 16 * 464.25 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_LG_NTSC_TALN_MINI] = { /* LGINNOTEK NTSC */
-		.name   = "LG NTSC (TALN mini series)",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 137.25 /*MHz*/, 0x01, },
-			{ 16 * 373.25 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x08, },
-		},
-		.config = 0x8e,
-	},
-	[TUNER_PHILIPS_TD1316] = { /* Philips PAL */
-		.name   = "Philips TD1316 Hybrid Tuner",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 160.00 /*MHz*/, 0xa1, },
-			{ 16 * 442.00 /*MHz*/, 0xa2, },
-			{ 16 * 999.99        , 0xa4, },
-		},
-		.config = 0xc8,
-	},
-	[TUNER_PHILIPS_TUV1236D] = { /* Philips ATSC */
-		.name   = "Philips TUV1236D ATSC/NTSC dual in",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 157.25 /*MHz*/, 0x01, },
-			{ 16 * 454.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0xce,
-	},
-	[TUNER_TNF_5335MF] = { /* Philips NTSC */
-		.name   = "Tena TNF 5335 MF",
-		.count  = 3,
-		.ranges = {
-			{ 16 * 157.25 /*MHz*/, 0x01, },
-			{ 16 * 454.00 /*MHz*/, 0x02, },
-			{ 16 * 999.99        , 0x04, },
-		},
-		.config = 0x8e,
-	},
-};
-
-unsigned const int tuner_count = ARRAY_SIZE(tuners);
 
 /* ---------------------------------------------------------------------- */
 
@@ -843,15 +137,17 @@ static void default_set_tv_freq(struct i
 	u16 div;
 	struct tunertype *tun;
 	unsigned char buffer[4];
-	int rc, IFPCoff, i;
+	int rc, IFPCoff, i, j;
 
 	tun = &tuners[t->type];
-	for (i = 0; i < tun->count; i++) {
-		if (freq > tun->ranges[i].thresh)
+	j = TUNER_PARAM_ANALOG;
+
+	for (i = 0; i < tun->params[j].count; i++) {
+		if (freq > tun->params[j].ranges[i].limit)
 			continue;
 		break;
 	}
-	config = tun->ranges[i].cb;
+	config = tun->params[j].ranges[i].cb;
 	/*  i == 0 -> VHF_LO  */
 	/*  i == 1 -> VHF_HI  */
 	/*  i == 2 -> UHF     */
@@ -914,7 +210,7 @@ static void default_set_tv_freq(struct i
 
 	case TUNER_MICROTUNE_4042FI5:
 		/* Set the charge pump for fast tuning */
-		tun->config |= TUNER_CHARGE_PUMP;
+		tun->params[j].config |= TUNER_CHARGE_PUMP;
 		break;
 
 	case TUNER_PHILIPS_TUV1236D:
@@ -989,14 +285,14 @@ static void default_set_tv_freq(struct i
 					div);
 
 	if (t->type == TUNER_PHILIPS_SECAM && freq < t->freq) {
-		buffer[0] = tun->config;
+		buffer[0] = tun->params[j].config;
 		buffer[1] = config;
 		buffer[2] = (div>>8) & 0x7f;
 		buffer[3] = div      & 0xff;
 	} else {
 		buffer[0] = (div>>8) & 0x7f;
 		buffer[1] = div      & 0xff;
-		buffer[2] = tun->config;
+		buffer[2] = tun->params[j].config;
 		buffer[3] = config;
 	}
 	tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
@@ -1024,10 +320,10 @@ static void default_set_tv_freq(struct i
 		}
 
 		/* Set the charge pump for optimized phase noise figure */
-		tun->config &= ~TUNER_CHARGE_PUMP;
+		tun->params[j].config &= ~TUNER_CHARGE_PUMP;
 		buffer[0] = (div>>8) & 0x7f;
 		buffer[1] = div      & 0xff;
-		buffer[2] = tun->config;
+		buffer[2] = tun->params[j].config;
 		buffer[3] = config;
 		tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
 		       buffer[0],buffer[1],buffer[2],buffer[3]);
@@ -1043,11 +339,13 @@ static void default_set_radio_freq(struc
 	struct tuner *t = i2c_get_clientdata(c);
 	unsigned char buffer[4];
 	unsigned div;
-	int rc;
+	int rc, j;
 
 	tun = &tuners[t->type];
+	j = TUNER_PARAM_ANALOG;
+
 	div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */
-	buffer[2] = (tun->config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */
+	buffer[2] = (tun->params[j].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */
 
 	switch (t->type) {
 	case TUNER_TENA_9533_DI:
diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c
new file mode 100644
index 0000000..de9d492
--- /dev/null
+++ b/drivers/media/video/tuner-types.c
@@ -0,0 +1,1376 @@
+/*
+ *
+ * i2c tv tuner chip device type database.
+ *
+ */
+
+#include <linux/i2c.h>
+#include <media/tuner.h>
+#include <media/tuner-types.h>
+
+/* ---------------------------------------------------------------------- */
+
+/*
+ *	The floats in the tuner struct are computed at compile time
+ *	by gcc and cast back to integers. Thus we don't violate the
+ *	"no float in kernel" rule.
+ *
+ *	A tuner_range may be referenced by multiple tuner_params structs.
+ *	There are many duplicates in here. Reusing tuner_range structs,
+ *	rather than defining new ones for each tuner, will cut down on
+ *	memory usage, and is preferred when possible.
+ *
+ *	Each tuner_params array may contain one or more elements, one
+ *	for each video standard.
+ *
+ *	FIXME: Some tuner_range definitions are duplicated, and
+ *	should be eliminated.
+ *
+ *	FIXME: tunertype struct contains an element, has_tda988x.
+ *	We must set this for all tunertypes that contain a tda988x
+ *	chip, and then we can remove this setting from the various
+ *	card structs.
+ */
+
+/* 0-9 */
+/* ------------ TUNER_TEMIC_PAL - TEMIC PAL ------------ */
+
+static struct tuner_range tuner_temic_pal_ranges[] = {
+	{ 16 * 140.25 /*MHz*/, 0x02, },
+	{ 16 * 463.25 /*MHz*/, 0x04, },
+	{ 16 * 999.99        , 0x01, },
+};
+
+static struct tuner_params tuner_temic_pal_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_PAL_I - Philips PAL_I ------------ */
+
+static struct tuner_range tuner_philips_pal_i_ranges[] = {
+	{ 16 * 140.25 /*MHz*/, 0xa0, },
+	{ 16 * 463.25 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_philips_pal_i_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_philips_pal_i_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_pal_i_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_NTSC - Philips NTSC ------------ */
+
+static struct tuner_range tuner_philips_ntsc_ranges[] = {
+	{ 16 * 157.25 /*MHz*/, 0xa0, },
+	{ 16 * 451.25 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_philips_ntsc_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_philips_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_SECAM - Philips SECAM ------------ */
+
+static struct tuner_range tuner_philips_secam_ranges[] = {
+	{ 16 * 168.25 /*MHz*/, 0xa7, },
+	{ 16 * 447.25 /*MHz*/, 0x97, },
+	{ 16 * 999.99        , 0x37, },
+};
+
+static struct tuner_params tuner_philips_secam_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_SECAM,
+		.ranges = tuner_philips_secam_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_secam_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_PAL - Philips PAL ------------ */
+
+static struct tuner_range tuner_philips_pal_ranges[] = {
+	{ 16 * 168.25 /*MHz*/, 0xa0, },
+	{ 16 * 447.25 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_philips_pal_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_philips_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_NTSC - TEMIC NTSC ------------ */
+
+static struct tuner_range tuner_temic_ntsc_ranges[] = {
+	{ 16 * 157.25 /*MHz*/, 0x02, },
+	{ 16 * 463.25 /*MHz*/, 0x04, },
+	{ 16 * 999.99        , 0x01, },
+};
+
+static struct tuner_params tuner_temic_ntsc_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_temic_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_PAL_I - TEMIC PAL_I ------------ */
+
+static struct tuner_range tuner_temic_pal_i_ranges[] = {
+	{ 16 * 170.00 /*MHz*/, 0x02, },
+	{ 16 * 450.00 /*MHz*/, 0x04, },
+	{ 16 * 999.99        , 0x01, },
+};
+
+static struct tuner_params tuner_temic_pal_i_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_pal_i_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_pal_i_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_4036FY5_NTSC - TEMIC NTSC ------------ */
+
+static struct tuner_range tuner_temic_4036fy5_ntsc_ranges[] = {
+	{ 16 * 157.25 /*MHz*/, 0xa0, },
+	{ 16 * 463.25 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_temic_4036fy5_ntsc_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_temic_4036fy5_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_4036fy5_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_ALPS_TSBH1_NTSC - TEMIC NTSC ------------ */
+
+static struct tuner_range tuner_alps_tsb_1_ranges[] = {
+	{ 16 * 137.25 /*MHz*/, 0x01, },
+	{ 16 * 385.25 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x08, },
+};
+
+static struct tuner_params tuner_alps_tsbh1_ntsc_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_alps_tsb_1_ranges,
+		.count  = ARRAY_SIZE(tuner_alps_tsb_1_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* 10-19 */
+/* ------------ TUNER_ALPS_TSBE1_PAL - TEMIC PAL ------------ */
+
+static struct tuner_params tuner_alps_tsb_1_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_alps_tsb_1_ranges,
+		.count  = ARRAY_SIZE(tuner_alps_tsb_1_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_ALPS_TSBB5_PAL_I - Alps PAL_I ------------ */
+
+static struct tuner_range tuner_alps_tsb_5_pal_ranges[] = {
+	{ 16 * 133.25 /*MHz*/, 0x01, },
+	{ 16 * 351.25 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x08, },
+};
+
+static struct tuner_params tuner_alps_tsbb5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_alps_tsb_5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_alps_tsb_5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_ALPS_TSBE5_PAL - Alps PAL ------------ */
+
+static struct tuner_params tuner_alps_tsbe5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_alps_tsb_5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_alps_tsb_5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_ALPS_TSBC5_PAL - Alps PAL ------------ */
+
+static struct tuner_params tuner_alps_tsbc5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_alps_tsb_5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_alps_tsb_5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_4006FH5_PAL - TEMIC PAL ------------ */
+
+static struct tuner_range tuner_temic_4006fh5_pal_ranges[] = {
+	{ 16 * 170.00 /*MHz*/, 0xa0, },
+	{ 16 * 450.00 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_temic_4006fh5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_4006fh5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_4006fh5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_ALPS_TSHC6_NTSC - Alps NTSC ------------ */
+
+static struct tuner_range tuner_alps_tshc6_ntsc_ranges[] = {
+	{ 16 * 137.25 /*MHz*/, 0x14, },
+	{ 16 * 385.25 /*MHz*/, 0x12, },
+	{ 16 * 999.99        , 0x11, },
+};
+
+static struct tuner_params tuner_alps_tshc6_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_alps_tshc6_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_alps_tshc6_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_PAL_DK - TEMIC PAL ------------ */
+
+static struct tuner_range tuner_temic_pal_dk_ranges[] = {
+	{ 16 * 168.25 /*MHz*/, 0xa0, },
+	{ 16 * 456.25 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_temic_pal_dk_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_pal_dk_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_pal_dk_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_NTSC_M - Philips NTSC ------------ */
+
+static struct tuner_range tuner_philips_ntsc_m_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0xa0, },
+	{ 16 * 454.00 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_philips_ntsc_m_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_philips_ntsc_m_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_ntsc_m_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_4066FY5_PAL_I - TEMIC PAL_I ------------ */
+
+static struct tuner_range tuner_temic_40x6f_5_pal_ranges[] = {
+	{ 16 * 169.00 /*MHz*/, 0xa0, },
+	{ 16 * 454.00 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_temic_4066fy5_pal_i_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_40x6f_5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_40x6f_5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_4006FN5_MULTI_PAL - TEMIC PAL ------------ */
+
+static struct tuner_params tuner_temic_4006fn5_multi_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_40x6f_5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_40x6f_5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* 20-29 */
+/* ------------ TUNER_TEMIC_4009FR5_PAL - TEMIC PAL ------------ */
+
+static struct tuner_range tuner_temic_4009f_5_pal_ranges[] = {
+	{ 16 * 141.00 /*MHz*/, 0xa0, },
+	{ 16 * 464.00 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_temic_4009f_5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_4009f_5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_4039FR5_NTSC - TEMIC NTSC ------------ */
+
+static struct tuner_range tuner_temic_4039fr5_ntsc_ranges[] = {
+	{ 16 * 158.00 /*MHz*/, 0xa0, },
+	{ 16 * 453.00 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_temic_4039fr5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_temic_4039fr5_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_4039fr5_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_4046FM5 - TEMIC PAL ------------ */
+
+static struct tuner_range tuner_temic_4046fm5_pal_ranges[] = {
+	{ 16 * 169.00 /*MHz*/, 0xa0, },
+	{ 16 * 454.00 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_temic_4046fm5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_4046fm5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_4046fm5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_PAL_DK - Philips PAL ------------ */
+
+static struct tuner_range tuner_lg_pal_ranges[] = {
+	{ 16 * 170.00 /*MHz*/, 0xa0, },
+	{ 16 * 450.00 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_philips_pal_dk_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_lg_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_FQ1216ME - Philips PAL ------------ */
+
+static struct tuner_params tuner_philips_fq1216me_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_lg_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_LG_PAL_I_FM - LGINNOTEK PAL_I ------------ */
+
+static struct tuner_params tuner_lg_pal_i_fm_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_lg_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_LG_PAL_I - LGINNOTEK PAL_I ------------ */
+
+static struct tuner_params tuner_lg_pal_i_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_lg_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_LG_NTSC_FM - LGINNOTEK NTSC ------------ */
+
+static struct tuner_range tuner_lg_ntsc_fm_ranges[] = {
+	{ 16 * 210.00 /*MHz*/, 0xa0, },
+	{ 16 * 497.00 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_lg_ntsc_fm_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_lg_ntsc_fm_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_ntsc_fm_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_LG_PAL_FM - LGINNOTEK PAL ------------ */
+
+static struct tuner_params tuner_lg_pal_fm_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_lg_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_LG_PAL - LGINNOTEK PAL ------------ */
+
+static struct tuner_params tuner_lg_pal_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_lg_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* 30-39 */
+/* ------------ TUNER_TEMIC_4009FN5_MULTI_PAL_FM - TEMIC PAL ------------ */
+
+static struct tuner_params tuner_temic_4009_fn5_multi_pal_fm_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_4009f_5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_SHARP_2U5JF5540_NTSC - SHARP NTSC ------------ */
+
+static struct tuner_range tuner_sharp_2u5jf5540_ntsc_ranges[] = {
+	{ 16 * 137.25 /*MHz*/, 0x01, },
+	{ 16 * 317.25 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x08, },
+};
+
+static struct tuner_params tuner_sharp_2u5jf5540_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_sharp_2u5jf5540_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_sharp_2u5jf5540_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_Samsung_PAL_TCPM9091PD27 - Samsung PAL ------------ */
+
+static struct tuner_range tuner_samsung_pal_tcpm9091pd27_ranges[] = {
+	{ 16 * 169 /*MHz*/, 0xa0, },
+	{ 16 * 464 /*MHz*/, 0x90, },
+	{ 16 * 999.99     , 0x30, },
+};
+
+static struct tuner_params tuner_samsung_pal_tcpm9091pd27_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_samsung_pal_tcpm9091pd27_ranges,
+		.count  = ARRAY_SIZE(tuner_samsung_pal_tcpm9091pd27_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_4106FH5 - TEMIC PAL ------------ */
+
+static struct tuner_params tuner_temic_4106fh5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_4009f_5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_4012FY5 - TEMIC PAL ------------ */
+
+static struct tuner_range tuner_temic_4012fy5_pal_ranges[] = {
+	{ 16 * 140.25 /*MHz*/, 0x02, },
+	{ 16 * 463.25 /*MHz*/, 0x04, },
+	{ 16 * 999.99        , 0x01, },
+};
+
+static struct tuner_params tuner_temic_4012fy5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_4012fy5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_4012fy5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TEMIC_4136FY5 - TEMIC NTSC ------------ */
+
+static struct tuner_range tuner_temic_4136_fy5_ntsc_ranges[] = {
+	{ 16 * 158.00 /*MHz*/, 0xa0, },
+	{ 16 * 453.00 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_temic_4136_fy5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_temic_4136_fy5_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_4136_fy5_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_LG_PAL_NEW_TAPC - LGINNOTEK PAL ------------ */
+
+static struct tuner_range tuner_lg_new_tapc_ranges[] = {
+	{ 16 * 170.00 /*MHz*/, 0x01, },
+	{ 16 * 450.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x08, },
+};
+
+static struct tuner_params tuner_lg_pal_new_tapc_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_lg_new_tapc_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_new_tapc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_FM1216ME_MK3 - Philips PAL ------------ */
+
+static struct tuner_range tuner_fm1216me_mk3_pal_ranges[] = {
+	{ 16 * 158.00 /*MHz*/, 0x01, },
+	{ 16 * 442.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x04, },
+};
+
+static struct tuner_params tuner_fm1216me_mk3_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_fm1216me_mk3_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_fm1216me_mk3_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_LG_NTSC_NEW_TAPC - LGINNOTEK NTSC ------------ */
+
+static struct tuner_params tuner_lg_ntsc_new_tapc_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_lg_new_tapc_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_new_tapc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* 40-49 */
+/* ------------ TUNER_HITACHI_NTSC - HITACHI NTSC ------------ */
+
+static struct tuner_params tuner_hitachi_ntsc_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_lg_new_tapc_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_new_tapc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_PAL_MK - Philips PAL ------------ */
+
+static struct tuner_range tuner_philips_pal_mk_pal_ranges[] = {
+	{ 16 * 140.25 /*MHz*/, 0x01, },
+	{ 16 * 463.25 /*MHz*/, 0xc2, },
+	{ 16 * 999.99        , 0xcf, },
+};
+
+static struct tuner_params tuner_philips_pal_mk_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_philips_pal_mk_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_pal_mk_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_ATSC - Philips ATSC ------------ */
+
+static struct tuner_range tuner_philips_atsc_ranges[] = {
+	{ 16 * 157.25 /*MHz*/, 0xa0, },
+	{ 16 * 454.00 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_philips_atsc_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_philips_atsc_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_atsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_FM1236_MK3 - Philips NTSC ------------ */
+
+static struct tuner_range tuner_fm1236_mk3_ntsc_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0x01, },
+	{ 16 * 442.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x04, },
+};
+
+static struct tuner_params tuner_fm1236_mk3_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_fm1236_mk3_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_fm1236_mk3_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_4IN1 - Philips NTSC ------------ */
+
+static struct tuner_range tuner_philips_4in1_ntsc_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0x01, },
+	{ 16 * 442.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x04, },
+};
+
+static struct tuner_params tuner_philips_4in1_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_philips_4in1_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_4in1_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_MICROTUNE_4049FM5 - Microtune PAL ------------ */
+
+static struct tuner_params tuner_microtune_4049_fm5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_temic_4009f_5_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PANASONIC_VP27 - Panasonic NTSC ------------ */
+
+static struct tuner_range tuner_panasonic_vp27_ntsc_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0x01, },
+	{ 16 * 454.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x08, },
+};
+
+static struct tuner_params tuner_panasonic_vp27_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_panasonic_vp27_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_panasonic_vp27_ntsc_ranges),
+		.config = 0xce,
+	},
+};
+
+/* ------------ TUNER_LG_NTSC_TAPE - LGINNOTEK NTSC ------------ */
+
+static struct tuner_range tuner_lg_ntsc_tape_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0x01, },
+	{ 16 * 442.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x04, },
+};
+
+static struct tuner_params tuner_lg_ntsc_tape_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_lg_ntsc_tape_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_ntsc_tape_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TNF_8831BGFF - Philips PAL ------------ */
+
+static struct tuner_range tuner_tnf_8831bgff_pal_ranges[] = {
+	{ 16 * 161.25 /*MHz*/, 0xa0, },
+	{ 16 * 463.25 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_tnf_8831bgff_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_tnf_8831bgff_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_tnf_8831bgff_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_MICROTUNE_4042FI5 - Microtune NTSC ------------ */
+
+static struct tuner_range tuner_microtune_4042fi5_ntsc_ranges[] = {
+	{ 16 * 162.00 /*MHz*/, 0xa2, },
+	{ 16 * 457.00 /*MHz*/, 0x94, },
+	{ 16 * 999.99        , 0x31, },
+};
+
+static struct tuner_params tuner_microtune_4042fi5_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_microtune_4042fi5_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_microtune_4042fi5_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* 50-59 */
+/* ------------ TUNER_TCL_2002N - TCL NTSC ------------ */
+
+static struct tuner_range tuner_tcl_2002n_ntsc_ranges[] = {
+	{ 16 * 172.00 /*MHz*/, 0x01, },
+	{ 16 * 448.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x08, },
+};
+
+static struct tuner_params tuner_tcl_2002n_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_tcl_2002n_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_tcl_2002n_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_FM1256_IH3 - Philips PAL ------------ */
+
+static struct tuner_range tuner_philips_fm1256_ih3_pal_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0x01, },
+	{ 16 * 442.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x04, },
+};
+
+static struct tuner_params tuner_philips_fm1256_ih3_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_philips_fm1256_ih3_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_fm1256_ih3_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_THOMSON_DTT7610 - THOMSON ATSC ------------ */
+
+static struct tuner_range tuner_thomson_dtt7610_ntsc_ranges[] = {
+	{ 16 * 157.25 /*MHz*/, 0x39, },
+	{ 16 * 454.00 /*MHz*/, 0x3a, },
+	{ 16 * 999.99        , 0x3c, },
+};
+
+static struct tuner_params tuner_thomson_dtt7610_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_thomson_dtt7610_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_thomson_dtt7610_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_FQ1286 - Philips NTSC ------------ */
+
+static struct tuner_range tuner_philips_fq1286_ntsc_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0x41, },
+	{ 16 * 454.00 /*MHz*/, 0x42, },
+	{ 16 * 999.99        , 0x04, },
+};
+
+static struct tuner_params tuner_philips_fq1286_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_philips_fq1286_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_fq1286_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TCL_2002MB - TCL PAL ------------ */
+
+static struct tuner_range tuner_tcl_2002mb_pal_ranges[] = {
+	{ 16 * 170.00 /*MHz*/, 0x01, },
+	{ 16 * 450.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x08, },
+};
+
+static struct tuner_params tuner_tcl_2002mb_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_tcl_2002mb_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_tcl_2002mb_pal_ranges),
+		.config = 0xce,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_FQ1216AME_MK4 - Philips PAL ------------ */
+
+static struct tuner_range tuner_philips_fq12_6a___mk4_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0x01, },
+	{ 16 * 442.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x04, },
+};
+
+static struct tuner_params tuner_philips_fq1216ame_mk4_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_philips_fq12_6a___mk4_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_fq12_6a___mk4_ranges),
+		.config = 0xce,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_FQ1236A_MK4 - Philips NTSC ------------ */
+
+static struct tuner_params tuner_philips_fq1236a_mk4_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_philips_fq12_6a___mk4_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_fq12_6a___mk4_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_YMEC_TVF_8531MF - Philips NTSC ------------ */
+
+static struct tuner_range tuner_ymec_tvf_8531mf_ntsc_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0xa0, },
+	{ 16 * 454.00 /*MHz*/, 0x90, },
+	{ 16 * 999.99        , 0x30, },
+};
+
+static struct tuner_params tuner_ymec_tvf_8531mf_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_ymec_tvf_8531mf_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_ymec_tvf_8531mf_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_YMEC_TVF_5533MF - Philips NTSC ------------ */
+
+static struct tuner_range tuner_ymec_tvf_5533mf_ntsc_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0x01, },
+	{ 16 * 454.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x04, },
+};
+
+static struct tuner_params tuner_ymec_tvf_5533mf_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_ymec_tvf_5533mf_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_ymec_tvf_5533mf_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* 60-69 */
+/* ------------ TUNER_THOMSON_DTT761X - THOMSON ATSC ------------ */
+/* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */
+
+static struct tuner_range tuner_thomson_dtt761x_ntsc_ranges[] = {
+	{ 16 * 145.25 /*MHz*/, 0x39, },
+	{ 16 * 415.25 /*MHz*/, 0x3a, },
+	{ 16 * 999.99        , 0x3c, },
+};
+
+
+static struct tuner_params tuner_thomson_dtt761x_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_thomson_dtt761x_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_thomson_dtt761x_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_TENA_9533_DI - Philips PAL ------------ */
+
+static struct tuner_range tuner_tuner_tena_9533_di_pal_ranges[] = {
+	{ 16 * 160.25 /*MHz*/, 0x01, },
+	{ 16 * 464.25 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x04, },
+};
+
+static struct tuner_params tuner_tena_9533_di_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_tuner_tena_9533_di_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_tuner_tena_9533_di_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_FMD1216ME_MK3 - Philips PAL ------------ */
+
+static struct tuner_range tuner_philips_fmd1216me_mk3_pal_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0x51, },
+	{ 16 * 442.00 /*MHz*/, 0x52, },
+	{ 16 * 999.99        , 0x54, },
+};
+
+
+static struct tuner_params tuner_tuner_philips_fmd1216me_mk3_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_philips_fmd1216me_mk3_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_pal_ranges),
+		.config = 0x86,
+	},
+};
+
+
+/* ------------ TUNER_LG_TDVS_H062F - INFINEON ATSC ------------ */
+
+static struct tuner_range tuner_tua6034_ntsc_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0x01 },
+	{ 16 * 455.00 /*MHz*/, 0x02 },
+	{ 16 * 999.99        , 0x04 },
+};
+
+
+static struct tuner_params tuner_tua6034_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_tua6034_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_tua6034_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_YMEC_TVF66T5_B_DFF - Philips PAL ------------ */
+
+static struct tuner_range tuner_ymec_tvf66t5_b_dff_pal_ranges[] = {
+	{ 16 * 160.25 /*MHz*/, 0x01, },
+	{ 16 * 464.25 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x08, },
+};
+
+static struct tuner_params tuner_ymec_tvf66t5_b_dff_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_ymec_tvf66t5_b_dff_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_ymec_tvf66t5_b_dff_pal_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_LG_NTSC_TALN_MINI - LGINNOTEK NTSC ------------ */
+
+static struct tuner_range tuner_lg_taln_mini_ntsc_ranges[] = {
+	{ 16 * 137.25 /*MHz*/, 0x01, },
+	{ 16 * 373.25 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x08, },
+};
+
+static struct tuner_params tuner_lg_taln_mini_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_lg_taln_mini_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_lg_taln_mini_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_TD1316 - Philips PAL ------------ */
+
+static struct tuner_range tuner_philips_td1316_pal_ranges[] = {
+	{ 16 * 160.00 /*MHz*/, 0xa1, },
+	{ 16 * 442.00 /*MHz*/, 0xa2, },
+	{ 16 * 999.99        , 0xa4, },
+};
+
+static struct tuner_params tuner_philips_td1316_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_philips_td1316_pal_ranges,
+		.count  = ARRAY_SIZE(tuner_philips_td1316_pal_ranges),
+		.config = 0xc8,
+	},
+};
+
+/* ------------ TUNER_PHILIPS_TUV1236D - Philips ATSC ------------ */
+
+static struct tuner_range tuner_tuv1236d_ntsc_ranges[] = {
+	{ 16 * 157.25 /*MHz*/, 0x01, },
+	{ 16 * 454.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x04, },
+};
+
+
+static struct tuner_params tuner_tuner_tuv1236d_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_tuv1236d_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_tuv1236d_ntsc_ranges),
+		.config = 0xce,
+	},
+};
+
+/* ------------ TUNER_TNF_5335MF - Philips NTSC ------------ */
+
+static struct tuner_range tuner_tnf_5335mf_ntsc_ranges[] = {
+	{ 16 * 157.25 /*MHz*/, 0x01, },
+	{ 16 * 454.00 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x04, },
+};
+
+static struct tuner_params tuner_tnf_5335mf_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_tnf_5335mf_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_tnf_5335mf_ntsc_ranges),
+		.config = 0x8e,
+	},
+};
+
+/* --------------------------------------------------------------------- */
+
+struct tunertype tuners[] = {
+	/* 0-9 */
+	[TUNER_TEMIC_PAL] = { /* TEMIC PAL */
+		.name   = "Temic PAL (4002 FH5)",
+		.params = tuner_temic_pal_params,
+	},
+	[TUNER_PHILIPS_PAL_I] = { /* Philips PAL_I */
+		.name   = "Philips PAL_I (FI1246 and compatibles)",
+		.params = tuner_philips_pal_i_params,
+	},
+	[TUNER_PHILIPS_NTSC] = { /* Philips NTSC */
+		.name   = "Philips NTSC (FI1236,FM1236 and compatibles)",
+		.params = tuner_philips_ntsc_params,
+	},
+	[TUNER_PHILIPS_SECAM] = { /* Philips SECAM */
+		.name   = "Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)",
+		.params = tuner_philips_secam_params,
+	},
+	[TUNER_ABSENT] = { /* Tuner Absent */
+		.name   = "NoTuner",
+	},
+	[TUNER_PHILIPS_PAL] = { /* Philips PAL */
+		.name   = "Philips PAL_BG (FI1216 and compatibles)",
+		.params = tuner_philips_pal_params,
+	},
+	[TUNER_TEMIC_NTSC] = { /* TEMIC NTSC */
+		.name   = "Temic NTSC (4032 FY5)",
+		.params = tuner_temic_ntsc_params,
+	},
+	[TUNER_TEMIC_PAL_I] = { /* TEMIC PAL_I */
+		.name   = "Temic PAL_I (4062 FY5)",
+		.params = tuner_temic_pal_i_params,
+	},
+	[TUNER_TEMIC_4036FY5_NTSC] = { /* TEMIC NTSC */
+		.name   = "Temic NTSC (4036 FY5)",
+		.params = tuner_temic_4036fy5_ntsc_params,
+	},
+	[TUNER_ALPS_TSBH1_NTSC] = { /* TEMIC NTSC */
+		.name   = "Alps HSBH1",
+		.params = tuner_alps_tsbh1_ntsc_params,
+	},
+
+	/* 10-19 */
+	[TUNER_ALPS_TSBE1_PAL] = { /* TEMIC PAL */
+		.name   = "Alps TSBE1",
+		.params = tuner_alps_tsb_1_params,
+	},
+	[TUNER_ALPS_TSBB5_PAL_I] = { /* Alps PAL_I */
+		.name   = "Alps TSBB5",
+		.params = tuner_alps_tsbb5_params,
+	},
+	[TUNER_ALPS_TSBE5_PAL] = { /* Alps PAL */
+		.name   = "Alps TSBE5",
+		.params = tuner_alps_tsbe5_params,
+	},
+	[TUNER_ALPS_TSBC5_PAL] = { /* Alps PAL */
+		.name   = "Alps TSBC5",
+		.params = tuner_alps_tsbc5_params,
+	},
+	[TUNER_TEMIC_4006FH5_PAL] = { /* TEMIC PAL */
+		.name   = "Temic PAL_BG (4006FH5)",
+		.params = tuner_temic_4006fh5_params,
+	},
+	[TUNER_ALPS_TSHC6_NTSC] = { /* Alps NTSC */
+		.name   = "Alps TSCH6",
+		.params = tuner_alps_tshc6_params,
+	},
+	[TUNER_TEMIC_PAL_DK] = { /* TEMIC PAL */
+		.name   = "Temic PAL_DK (4016 FY5)",
+		.params = tuner_temic_pal_dk_params,
+	},
+	[TUNER_PHILIPS_NTSC_M] = { /* Philips NTSC */
+		.name   = "Philips NTSC_M (MK2)",
+		.params = tuner_philips_ntsc_m_params,
+	},
+	[TUNER_TEMIC_4066FY5_PAL_I] = { /* TEMIC PAL_I */
+		.name   = "Temic PAL_I (4066 FY5)",
+		.params = tuner_temic_4066fy5_pal_i_params,
+	},
+	[TUNER_TEMIC_4006FN5_MULTI_PAL] = { /* TEMIC PAL */
+		.name   = "Temic PAL* auto (4006 FN5)",
+		.params = tuner_temic_4006fn5_multi_params,
+	},
+
+	/* 20-29 */
+	[TUNER_TEMIC_4009FR5_PAL] = { /* TEMIC PAL */
+		.name   = "Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)",
+		.params = tuner_temic_4009f_5_params,
+	},
+	[TUNER_TEMIC_4039FR5_NTSC] = { /* TEMIC NTSC */
+		.name   = "Temic NTSC (4039 FR5)",
+		.params = tuner_temic_4039fr5_params,
+	},
+	[TUNER_TEMIC_4046FM5] = { /* TEMIC PAL */
+		.name   = "Temic PAL/SECAM multi (4046 FM5)",
+		.params = tuner_temic_4046fm5_params,
+	},
+	[TUNER_PHILIPS_PAL_DK] = { /* Philips PAL */
+		.name   = "Philips PAL_DK (FI1256 and compatibles)",
+		.params = tuner_philips_pal_dk_params,
+	},
+	[TUNER_PHILIPS_FQ1216ME] = { /* Philips PAL */
+		.name   = "Philips PAL/SECAM multi (FQ1216ME)",
+		.params = tuner_philips_fq1216me_params,
+	},
+	[TUNER_LG_PAL_I_FM] = { /* LGINNOTEK PAL_I */
+		.name   = "LG PAL_I+FM (TAPC-I001D)",
+		.params = tuner_lg_pal_i_fm_params,
+	},
+	[TUNER_LG_PAL_I] = { /* LGINNOTEK PAL_I */
+		.name   = "LG PAL_I (TAPC-I701D)",
+		.params = tuner_lg_pal_i_params,
+	},
+	[TUNER_LG_NTSC_FM] = { /* LGINNOTEK NTSC */
+		.name   = "LG NTSC+FM (TPI8NSR01F)",
+		.params = tuner_lg_ntsc_fm_params,
+	},
+	[TUNER_LG_PAL_FM] = { /* LGINNOTEK PAL */
+		.name   = "LG PAL_BG+FM (TPI8PSB01D)",
+		.params = tuner_lg_pal_fm_params,
+	},
+	[TUNER_LG_PAL] = { /* LGINNOTEK PAL */
+		.name   = "LG PAL_BG (TPI8PSB11D)",
+		.params = tuner_lg_pal_params,
+	},
+
+	/* 30-39 */
+	[TUNER_TEMIC_4009FN5_MULTI_PAL_FM] = { /* TEMIC PAL */
+		.name   = "Temic PAL* auto + FM (4009 FN5)",
+		.params = tuner_temic_4009_fn5_multi_pal_fm_params,
+	},
+	[TUNER_SHARP_2U5JF5540_NTSC] = { /* SHARP NTSC */
+		.name   = "SHARP NTSC_JP (2U5JF5540)",
+		.params = tuner_sharp_2u5jf5540_params,
+	},
+	[TUNER_Samsung_PAL_TCPM9091PD27] = { /* Samsung PAL */
+		.name   = "Samsung PAL TCPM9091PD27",
+		.params = tuner_samsung_pal_tcpm9091pd27_params,
+	},
+	[TUNER_MT2032] = { /* Microtune PAL|NTSC */
+		.name   = "MT20xx universal",
+		/* see mt20xx.c for details */ },
+	[TUNER_TEMIC_4106FH5] = { /* TEMIC PAL */
+		.name   = "Temic PAL_BG (4106 FH5)",
+		.params = tuner_temic_4106fh5_params,
+	},
+	[TUNER_TEMIC_4012FY5] = { /* TEMIC PAL */
+		.name   = "Temic PAL_DK/SECAM_L (4012 FY5)",
+		.params = tuner_temic_4012fy5_params,
+	},
+	[TUNER_TEMIC_4136FY5] = { /* TEMIC NTSC */
+		.name   = "Temic NTSC (4136 FY5)",
+		.params = tuner_temic_4136_fy5_params,
+	},
+	[TUNER_LG_PAL_NEW_TAPC] = { /* LGINNOTEK PAL */
+		.name   = "LG PAL (newer TAPC series)",
+		.params = tuner_lg_pal_new_tapc_params,
+	},
+	[TUNER_PHILIPS_FM1216ME_MK3] = { /* Philips PAL */
+		.name   = "Philips PAL/SECAM multi (FM1216ME MK3)",
+		.params = tuner_fm1216me_mk3_params,
+	},
+	[TUNER_LG_NTSC_NEW_TAPC] = { /* LGINNOTEK NTSC */
+		.name   = "LG NTSC (newer TAPC series)",
+		.params = tuner_lg_ntsc_new_tapc_params,
+	},
+
+	/* 40-49 */
+	[TUNER_HITACHI_NTSC] = { /* HITACHI NTSC */
+		.name   = "HITACHI V7-J180AT",
+		.params = tuner_hitachi_ntsc_params,
+	},
+	[TUNER_PHILIPS_PAL_MK] = { /* Philips PAL */
+		.name   = "Philips PAL_MK (FI1216 MK)",
+		.params = tuner_philips_pal_mk_params,
+	},
+	[TUNER_PHILIPS_ATSC] = { /* Philips ATSC */
+		.name   = "Philips 1236D ATSC/NTSC dual in",
+		.params = tuner_philips_atsc_params,
+	},
+	[TUNER_PHILIPS_FM1236_MK3] = { /* Philips NTSC */
+		.name   = "Philips NTSC MK3 (FM1236MK3 or FM1236/F)",
+		.params = tuner_fm1236_mk3_params,
+	},
+	[TUNER_PHILIPS_4IN1] = { /* Philips NTSC */
+		.name   = "Philips 4 in 1 (ATI TV Wonder Pro/Conexant)",
+		.params = tuner_philips_4in1_params,
+	},
+	[TUNER_MICROTUNE_4049FM5] = { /* Microtune PAL */
+		.name   = "Microtune 4049 FM5",
+		.params = tuner_microtune_4049_fm5_params,
+	},
+	[TUNER_PANASONIC_VP27] = { /* Panasonic NTSC */
+		.name   = "Panasonic VP27s/ENGE4324D",
+		.params = tuner_panasonic_vp27_params,
+	},
+	[TUNER_LG_NTSC_TAPE] = { /* LGINNOTEK NTSC */
+		.name   = "LG NTSC (TAPE series)",
+		.params = tuner_lg_ntsc_tape_params,
+	},
+	[TUNER_TNF_8831BGFF] = { /* Philips PAL */
+		.name   = "Tenna TNF 8831 BGFF)",
+		.params = tuner_tnf_8831bgff_params,
+	},
+	[TUNER_MICROTUNE_4042FI5] = { /* Microtune NTSC */
+		.name   = "Microtune 4042 FI5 ATSC/NTSC dual in",
+		.params = tuner_microtune_4042fi5_params,
+	},
+
+	/* 50-59 */
+	[TUNER_TCL_2002N] = { /* TCL NTSC */
+		.name   = "TCL 2002N",
+		.params = tuner_tcl_2002n_params,
+	},
+	[TUNER_PHILIPS_FM1256_IH3] = { /* Philips PAL */
+		.name   = "Philips PAL/SECAM_D (FM 1256 I-H3)",
+		.params = tuner_philips_fm1256_ih3_params,
+	},
+	[TUNER_THOMSON_DTT7610] = { /* THOMSON ATSC */
+		.name   = "Thomson DTT 7610 (ATSC/NTSC)",
+		.params = tuner_thomson_dtt7610_params,
+	},
+	[TUNER_PHILIPS_FQ1286] = { /* Philips NTSC */
+		.name   = "Philips FQ1286",
+		.params = tuner_philips_fq1286_params,
+	},
+	[TUNER_PHILIPS_TDA8290] = { /* Philips PAL|NTSC */
+		.name   = "tda8290+75",
+		/* see tda8290.c for details */ },
+	[TUNER_TCL_2002MB] = { /* TCL PAL */
+		.name   = "TCL 2002MB",
+		.params = tuner_tcl_2002mb_params,
+	},
+	[TUNER_PHILIPS_FQ1216AME_MK4] = { /* Philips PAL */
+		.name   = "Philips PAL/SECAM multi (FQ1216AME MK4)",
+		.params = tuner_philips_fq1216ame_mk4_params,
+	},
+	[TUNER_PHILIPS_FQ1236A_MK4] = { /* Philips NTSC */
+		.name   = "Philips FQ1236A MK4",
+		.params = tuner_philips_fq1236a_mk4_params,
+	},
+	[TUNER_YMEC_TVF_8531MF] = { /* Philips NTSC */
+		.name   = "Ymec TVision TVF-8531MF/8831MF/8731MF",
+		.params = tuner_ymec_tvf_8531mf_params,
+	},
+	[TUNER_YMEC_TVF_5533MF] = { /* Philips NTSC */
+		.name   = "Ymec TVision TVF-5533MF",
+		.params = tuner_ymec_tvf_5533mf_params,
+	},
+
+	/* 60-69 */
+	[TUNER_THOMSON_DTT761X] = { /* THOMSON ATSC */
+		/* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */
+		.name   = "Thomson DTT 761X (ATSC/NTSC)",
+		.params = tuner_thomson_dtt761x_params,
+	},
+	[TUNER_TENA_9533_DI] = { /* Philips PAL */
+		.name   = "Tena TNF9533-D/IF/TNF9533-B/DF",
+		.params = tuner_tena_9533_di_params,
+	},
+	[TUNER_TEA5767] = { /* Philips RADIO */
+		.name   = "Philips TEA5767HN FM Radio",
+		/* see tea5767.c for details */
+	},
+	[TUNER_PHILIPS_FMD1216ME_MK3] = { /* Philips PAL */
+		.name   = "Philips FMD1216ME MK3 Hybrid Tuner",
+		.params = tuner_tuner_philips_fmd1216me_mk3_params,
+	},
+	[TUNER_LG_TDVS_H062F] = { /* LGINNOTEK ATSC */
+		.name   = "LG TDVS-H062F/TUA6034",
+		.params = tuner_tua6034_params,
+	},
+	[TUNER_YMEC_TVF66T5_B_DFF] = { /* Philips PAL */
+		.name   = "Ymec TVF66T5-B/DFF",
+		.params = tuner_ymec_tvf66t5_b_dff_params,
+	},
+	[TUNER_LG_NTSC_TALN_MINI] = { /* LGINNOTEK NTSC */
+		.name   = "LG NTSC (TALN mini series)",
+		.params = tuner_lg_taln_mini_params,
+	},
+	[TUNER_PHILIPS_TD1316] = { /* Philips PAL */
+		.name   = "Philips TD1316 Hybrid Tuner",
+		.params = tuner_philips_td1316_params,
+	},
+	[TUNER_PHILIPS_TUV1236D] = { /* Philips ATSC */
+		.name   = "Philips TUV1236D ATSC/NTSC dual in",
+		.params = tuner_tuner_tuv1236d_params,
+	},
+	[TUNER_TNF_5335MF] = { /* Philips NTSC */
+		.name   = "Tena TNF 5335 MF",
+		.params = tuner_tnf_5335mf_params,
+	},
+};
+
+unsigned const int tuner_count = ARRAY_SIZE(tuners);
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h
new file mode 100644
index 0000000..9f6e4a9
--- /dev/null
+++ b/include/media/tuner-types.h
@@ -0,0 +1,41 @@
+/*
+ * descriptions for simple tuners.
+ */
+
+#ifndef __TUNER_TYPES_H__
+#define __TUNER_TYPES_H__
+
+enum param_type {
+	TUNER_PARAM_TYPE_RADIO, \
+	TUNER_PARAM_TYPE_PAL, \
+	TUNER_PARAM_TYPE_SECAM, \
+	TUNER_PARAM_TYPE_NTSC, \
+	TUNER_PARAM_TYPE_ATSC, \
+	TUNER_PARAM_TYPE_DVBT, \
+	TUNER_PARAM_TYPE_DVBS, \
+	TUNER_PARAM_TYPE_DVBC
+};
+
+struct tuner_range {
+	unsigned short limit;
+	unsigned char cb;
+};
+
+struct tuner_params {
+	enum param_type type;
+	unsigned char config; /* to be moved into struct tuner_range for dvb-pll merge */
+
+	unsigned int count;
+	struct tuner_range *ranges;
+};
+
+struct tunertype {
+	char *name;
+	unsigned int has_tda988x:1;
+	struct tuner_params *params;
+};
+
+extern struct tunertype tuners[];
+extern unsigned const int tuner_count;
+
+#endif
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 27cbf08..c88b506 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -23,6 +23,7 @@
 #define _TUNER_H
 
 #include <linux/videodev2.h>
+#include <media/tuner-types.h>
 
 #define ADDR_UNSET (255)
 


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 05/25] Build cx88-alsa when CONFIG_VIDEO_CX88_ALSA is selected.
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (4 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 07/25] Redesign tuners struct for maximum flexibility mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 06/25] Updated MODULE_AUTHOR mchehab
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Michael Krufky,
	Mauro Carvalho Chehab


From: Michael Krufky <mkrufky@m1k.net>

- Build cx88-alsa when CONFIG_VIDEO_CX88_ALSA is selected.

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/cx88/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/cx88/Makefile b/drivers/media/video/cx88/Makefile
index e4b2134..6e5eaa2 100644
--- a/drivers/media/video/cx88/Makefile
+++ b/drivers/media/video/cx88/Makefile
@@ -5,6 +5,7 @@ cx8802-objs	:= cx88-mpeg.o
 
 obj-$(CONFIG_VIDEO_CX88) += cx88xx.o cx8800.o cx8802.o cx88-blackbird.o
 obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o cx88-vp3054-i2c.o
+obj-$(CONFIG_VIDEO_CX88_ALSA) += cx88-alsa.o
 
 EXTRA_CFLAGS += -I$(src)/..
 EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 09/25] disable all dvb tuner param_types until we need them
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (6 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 06/25] Updated MODULE_AUTHOR mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 10/25] i2c ids for upd64031a saa717x upd64083 wm8739 mchehab
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Michael Krufky,
	Mauro Carvalho Chehab


From: Michael Krufky <mkrufky@m1k.net>

- Add param_type dvbs2
- disable all dvb param_types, which will not
  be needed until we merge dvb-pll.

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 include/media/tuner-types.h |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h
index 9f6e4a9..64b16b1 100644
--- a/include/media/tuner-types.h
+++ b/include/media/tuner-types.h
@@ -9,11 +9,7 @@ enum param_type {
 	TUNER_PARAM_TYPE_RADIO, \
 	TUNER_PARAM_TYPE_PAL, \
 	TUNER_PARAM_TYPE_SECAM, \
-	TUNER_PARAM_TYPE_NTSC, \
-	TUNER_PARAM_TYPE_ATSC, \
-	TUNER_PARAM_TYPE_DVBT, \
-	TUNER_PARAM_TYPE_DVBS, \
-	TUNER_PARAM_TYPE_DVBC
+	TUNER_PARAM_TYPE_NTSC
 };
 
 struct tuner_range {


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 08/25] Add support for Samsung tuner TCPN 2121P30A
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (9 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 11/25] Turn frame locked sound on, basic support for FM radio with TDA8275(a) mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 14/25] make some code static mchehab
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Hans Verkuil,
	Mauro Carvalho Chehab


From: Hans Verkuil <hverkuil@xs4all.nl>

- Add support for Samsung tuner TCPN 2121P30A, used in
  Hauppauge PVR-500 cards.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 Documentation/video4linux/CARDLIST.tuner |    1 +
 drivers/media/video/tuner-types.c        |   24 ++++++++++++++++++++++++
 drivers/media/video/tveeprom.c           |    2 +-
 include/media/tuner.h                    |    1 +
 4 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner
index 0bf3d5b..f6d0cf7 100644
--- a/Documentation/video4linux/CARDLIST.tuner
+++ b/Documentation/video4linux/CARDLIST.tuner
@@ -68,3 +68,4 @@ tuner=66 - LG NTSC (TALN mini series)
 tuner=67 - Philips TD1316 Hybrid Tuner
 tuner=68 - Philips TUV1236D ATSC/NTSC dual in
 tuner=69 - Tena TNF 5335 MF
+tuner=70 - Samsung TCPN 2121P30A
diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c
index de9d492..32c9be4 100644
--- a/drivers/media/video/tuner-types.c
+++ b/drivers/media/video/tuner-types.c
@@ -1077,6 +1077,24 @@ static struct tuner_params tuner_tnf_533
 	},
 };
 
+/* 70-79 */
+/* ------------ TUNER_SAMSUNG_TCPN_2121P30A - Samsung NTSC ------------ */
+
+static struct tuner_range tuner_samsung_tcpn_2121p30a_ntsc_ranges[] = {
+	{ 16 * 175.75 /*MHz*/, 0x01, },
+	{ 16 * 410.25 /*MHz*/, 0x02, },
+	{ 16 * 999.99        , 0x08, },
+};
+
+static struct tuner_params tuner_samsung_tcpn_2121p30a_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_NTSC,
+		.ranges = tuner_samsung_tcpn_2121p30a_ntsc_ranges,
+		.count  = ARRAY_SIZE(tuner_samsung_tcpn_2121p30a_ntsc_ranges),
+		.config = 0xce,
+	},
+};
+
 /* --------------------------------------------------------------------- */
 
 struct tunertype tuners[] = {
@@ -1371,6 +1389,12 @@ struct tunertype tuners[] = {
 		.name   = "Tena TNF 5335 MF",
 		.params = tuner_tnf_5335mf_params,
 	},
+
+	/* 70-79 */
+	[TUNER_SAMSUNG_TCPN_2121P30A] = { /* Samsung NTSC */
+		.name   = "Samsung TCPN 2121P30A",
+		.params = tuner_samsung_tcpn_2121p30a_params,
+	},
 };
 
 unsigned const int tuner_count = ARRAY_SIZE(tuners);
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index 5e71a35..582551b 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -190,7 +190,7 @@ hauppauge_tuner[] =
 	{ TUNER_LG_PAL_NEW_TAPC, "TCL 2002MI 3"},
 	{ TUNER_TCL_2002N,     "TCL 2002N 6A"},
 	{ TUNER_PHILIPS_FM1236_MK3, "Philips FQ1236 MK3"},
-	{ TUNER_ABSENT,        "Samsung TCPN 2121P30A"},
+	{ TUNER_SAMSUNG_TCPN_2121P30A, "Samsung TCPN 2121P30A"},
 	{ TUNER_ABSENT,        "Samsung TCPE 4121P30A"},
 	{ TUNER_PHILIPS_FM1216ME_MK3, "TCL MFPE05 2"},
 	/* 90-99 */
diff --git a/include/media/tuner.h b/include/media/tuner.h
index c88b506..a1d6378 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -115,6 +115,7 @@
 
 #define TUNER_PHILIPS_TUV1236D		68	/* ATI HDTV Wonder */
 #define TUNER_TNF_5335MF                69	/* Sabrent Bt848   */
+#define TUNER_SAMSUNG_TCPN_2121P30A     70 	/* Hauppauge PVR-500MCE NTSC */
 
 /* tv card specific */
 #define TDA9887_PRESENT 		(1<<0)


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 10/25] i2c ids for upd64031a saa717x upd64083 wm8739
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (7 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 09/25] disable all dvb tuner param_types until we need them mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 11/25] Turn frame locked sound on, basic support for FM radio with TDA8275(a) mchehab
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Tyler Trafford,
	Mauro Carvalho Chehab


From: Tyler Trafford <tatrafford@comcast.net>

- Add i2c ids for drivers: upd64031a saa717x upd64083 wm8739

Signed-off-by: Tyler Trafford <tatrafford@comcast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 include/linux/i2c-id.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 6ff2d36..474c8f4 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -104,6 +104,10 @@
 #define I2C_DRIVERID_AKITAIOEXP	74	/* IO Expander on Sharp SL-C1000 */
 #define I2C_DRIVERID_INFRARED	75	/* I2C InfraRed on Video boards */
 #define I2C_DRIVERID_TVP5150	76	/* TVP5150 video decoder        */
+#define I2C_DRIVERID_WM8739	77	/* wm8739 audio processor	*/
+#define I2C_DRIVERID_UPD64083	78	/* upd64083 video processor	*/
+#define I2C_DRIVERID_UPD64031A	79	/* upd64031a video processor	*/
+#define I2C_DRIVERID_SAA717X	80	/* saa717x video encoder	*/
 
 #define I2C_DRIVERID_I2CDEV	900
 #define I2C_DRIVERID_ARP        902    /* SMBus ARP Client              */


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 11/25] Turn frame locked sound on, basic support for FM radio with TDA8275(a)
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (8 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 10/25] i2c ids for upd64031a saa717x upd64083 wm8739 mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 08/25] Add support for Samsung tuner TCPN 2121P30A mchehab
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Hartmut Hackmann,
	Mauro Carvalho Chehab


From: Hartmut Hackmann <hartmut.hackmann@t-online.de>

- Enabled audio PLL. This is mandatory for NICAM sound
- modify FM IF frequency to 5.5MHz for SAA7133/35 if tuner is tda8290

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/saa7134/saa7134-cards.c   |    6 ++++++
 drivers/media/video/saa7134/saa7134-tvaudio.c |   11 ++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 275d06a..c64718a 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -2515,6 +2515,7 @@ struct saa7134_board saa7134_boards[] = 
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
 		.mpeg           = SAA7134_MPEG_DVB,
+		.gpiomask       = 1 << 21,
 		.inputs = {{
 			.name   = name_tv,
 			.vmux   = 1,
@@ -2529,6 +2530,11 @@ struct saa7134_board saa7134_boards[] = 
 			.vmux   = 8,
 			.amux   = LINE1,
 		}},
+		.radio = {
+			.name   = name_radio,
+			.amux   = TV,
+			.gpio   = 0x0200000,
+		},
 	},
 	[SAA7134_BOARD_MSI_TVATANYWHERE_PLUS] = {
 		.name           = "MSI TV@Anywhere plus",
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
index 9326842..afa4dcb 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -180,8 +180,8 @@ static void tvaudio_init(struct saa7134_
 	saa_writeb(SAA7134_AUDIO_CLOCK0,      clock        & 0xff);
 	saa_writeb(SAA7134_AUDIO_CLOCK1,     (clock >>  8) & 0xff);
 	saa_writeb(SAA7134_AUDIO_CLOCK2,     (clock >> 16) & 0xff);
-	// frame locked audio was reported not to be reliable
-	saa_writeb(SAA7134_AUDIO_PLL_CTRL,   0x02);
+	/* frame locked audio is mandatory for NICAM */
+	saa_writeb(SAA7134_AUDIO_PLL_CTRL,   0x01);
 
 	saa_writeb(SAA7134_NICAM_ERROR_LOW,  0x14);
 	saa_writeb(SAA7134_NICAM_ERROR_HIGH, 0x50);
@@ -809,7 +809,12 @@ static int tvaudio_thread_ddep(void *dat
 			dprintk("ddep override: %s\n",stdres[audio_ddep]);
 		} else if (&card(dev).radio == dev->input) {
 			dprintk("FM Radio\n");
-			norms = (0x0f << 2) | 0x01;
+			if (dev->tuner_type == TUNER_PHILIPS_TDA8290) {
+				norms = (0x11 << 2) | 0x01;
+				saa_dsp_writel(dev, 0x42c >> 2, 0x729555);
+			} else {
+				norms = (0x0f << 2) | 0x01;
+			}
 		} else {
 			/* (let chip) scan for sound carrier */
 			norms = 0;


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 12/25] git dvb callbacks fix
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (11 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 14/25] make some code static mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 13/25] cx88 Kconfig fixes for cx88-alsa mchehab
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Mauro Carvalho Chehab


From: Andrew Morton <akpm@osdl.org>

- Not sure what went wrong here, but SND_PCI_PM_CALLBACKS got deleted.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/cx88/cx88-alsa.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index fd8bc71..e649f67 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -805,7 +805,6 @@ static struct pci_driver cx88_audio_pci_
 	.id_table = cx88_audio_pci_tbl,
 	.probe    = cx88_audio_initdev,
 	.remove   = cx88_audio_finidev,
-	SND_PCI_PM_CALLBACKS
 };
 
 /****************************************************************************


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 13/25] cx88 Kconfig fixes for cx88-alsa
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (12 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 12/25] git dvb callbacks fix mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16 21:10   ` Adrian Bunk
  2006-01-16  9:11 ` [PATCH 16/25] Semaphore to mutex conversion on drivers/media mchehab
                   ` (10 subsequent siblings)
  24 siblings, 1 reply; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Mauro Carvalho Chehab


From: Mauro Carvalho Chehab <mchehab@infradead.org>

- Cx88 alsa is experimental.
- Removed need of PCM OSS for an ALSA module.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/cx88/Kconfig |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig
index 76fcb4e..5330891 100644
--- a/drivers/media/video/cx88/Kconfig
+++ b/drivers/media/video/cx88/Kconfig
@@ -31,8 +31,7 @@ config VIDEO_CX88_DVB
 
 config VIDEO_CX88_ALSA
 	tristate "ALSA DMA audio support"
-	depends on VIDEO_CX88 && SND
-	select SND_PCM_OSS
+	depends on VIDEO_CX88 && SND && EXPERIMENTAL
 	---help---
 	  This is a video4linux driver for direct (DMA) audio on
 	  Conexant 2388x based TV cards.


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 14/25] make some code static
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (10 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 08/25] Add support for Samsung tuner TCPN 2121P30A mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 12/25] git dvb callbacks fix mchehab
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Adrian Bunk,
	Mauro Carvalho Chehab


From: Adrian Bunk <bunk@stusta.de>

- This patch makes some needlessly global code static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/cx25840/cx25840-core.c |    2 +-
 drivers/media/video/tvp5150.c              |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 0da744c..c66c2c1 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");
 static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END };
 
 
-int cx25840_debug;
+static int cx25840_debug;
 
 module_param_named(debug,cx25840_debug, int, 0644);
 
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index e86b522..8713c4d 100644
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@ -634,7 +634,7 @@ struct i2c_vbi_ram_value {
 	unsigned char values[26];
 };
 
-struct i2c_vbi_ram_value vbi_ram_default[] =
+static struct i2c_vbi_ram_value vbi_ram_default[] =
 {
 	{0x010, /* WST SECAM 6 */
 		{ 0xaa, 0xaa, 0xff, 0xff , 0xe7, 0x2e, 0x20, 0x26, 0xe6, 0xb4, 0x0e, 0x0, 0x0, 0x0, 0x10, 0x0 }


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 17/25] Fix compilation with Alpha
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (15 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 15/25] Fix for lack of analog output on some cx88 boards mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 18/25] Move tda988x options into tuner_params struct mchehab
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Mauro Carvalho Chehab


From: Mauro Carvalho Chehab <mchehab@infradead.org>

- BOOT_SIZE name is also used at alpha and were breaking
compiling with allyesconfig.
- All BOOT_* renamed to AV7110_BOOT* to fix and keep names
with the same style.
Thanks to Andrew Morton for pointing this.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/dvb/ttpci/av7110_hw.c |   40 ++++++++++++++++++-----------------
 drivers/media/dvb/ttpci/av7110_hw.h |   12 +++++------
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c
index cb37745..b2e63e9 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/drivers/media/dvb/ttpci/av7110_hw.c
@@ -146,52 +146,52 @@ static int load_dram(struct av7110 *av71
 {
 	int i;
 	int blocks, rest;
-	u32 base, bootblock = BOOT_BLOCK;
+	u32 base, bootblock = AV7110_BOOT_BLOCK;
 
 	dprintk(4, "%p\n", av7110);
 
-	blocks = len / BOOT_MAX_SIZE;
-	rest = len % BOOT_MAX_SIZE;
+	blocks = len / AV7110_BOOT_MAX_SIZE;
+	rest = len % AV7110_BOOT_MAX_SIZE;
 	base = DRAM_START_CODE;
 
 	for (i = 0; i < blocks; i++) {
-		if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
+		if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
 			printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at block %d\n", i);
 			return -ETIMEDOUT;
 		}
 		dprintk(4, "writing DRAM block %d\n", i);
 		mwdebi(av7110, DEBISWAB, bootblock,
-		       ((char*)data) + i * BOOT_MAX_SIZE, BOOT_MAX_SIZE);
+		       ((char*)data) + i * AV7110_BOOT_MAX_SIZE, AV7110_BOOT_MAX_SIZE);
 		bootblock ^= 0x1400;
-		iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4);
-		iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, BOOT_MAX_SIZE, 2);
-		iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
-		base += BOOT_MAX_SIZE;
+		iwdebi(av7110, DEBISWAB, AV7110_BOOT_BASE, swab32(base), 4);
+		iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, AV7110_BOOT_MAX_SIZE, 2);
+		iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
+		base += AV7110_BOOT_MAX_SIZE;
 	}
 
 	if (rest > 0) {
-		if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
+		if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
 			printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at last block\n");
 			return -ETIMEDOUT;
 		}
 		if (rest > 4)
 			mwdebi(av7110, DEBISWAB, bootblock,
-			       ((char*)data) + i * BOOT_MAX_SIZE, rest);
+			       ((char*)data) + i * AV7110_BOOT_MAX_SIZE, rest);
 		else
 			mwdebi(av7110, DEBISWAB, bootblock,
-			       ((char*)data) + i * BOOT_MAX_SIZE - 4, rest + 4);
+			       ((char*)data) + i * AV7110_BOOT_MAX_SIZE - 4, rest + 4);
 
-		iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4);
-		iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, rest, 2);
-		iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
+		iwdebi(av7110, DEBISWAB, AV7110_BOOT_BASE, swab32(base), 4);
+		iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, rest, 2);
+		iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
 	}
-	if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
+	if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
 		printk(KERN_ERR "dvb-ttpci: load_dram(): timeout after last block\n");
 		return -ETIMEDOUT;
 	}
-	iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, 0, 2);
-	iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
-	if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BOOT_COMPLETE) < 0) {
+	iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, 0, 2);
+	iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
+	if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_AV7110_BOOT_COMPLETE) < 0) {
 		printk(KERN_ERR "dvb-ttpci: load_dram(): final handshake timeout\n");
 		return -ETIMEDOUT;
 	}
@@ -262,7 +262,7 @@ int av7110_bootarm(struct av7110 *av7110
 	//saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT);
 
 	mwdebi(av7110, DEBISWAB, DPRAM_BASE, bootcode, sizeof(bootcode));
-	iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
+	iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
 
 	if (saa7146_wait_for_debi_done(av7110->dev, 1)) {
 		printk(KERN_ERR "dvb-ttpci: av7110_bootarm(): "
diff --git a/drivers/media/dvb/ttpci/av7110_hw.h b/drivers/media/dvb/ttpci/av7110_hw.h
index 84b8329..4e173c6 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.h
+++ b/drivers/media/dvb/ttpci/av7110_hw.h
@@ -18,7 +18,7 @@ enum av7110_bootstate
 {
 	BOOTSTATE_BUFFER_EMPTY	= 0,
 	BOOTSTATE_BUFFER_FULL	= 1,
-	BOOTSTATE_BOOT_COMPLETE	= 2
+	BOOTSTATE_AV7110_BOOT_COMPLETE	= 2
 };
 
 enum av7110_type_rec_play_format
@@ -295,11 +295,11 @@ enum av7110_command_type {
 #define	DPRAM_BASE 0x4000
 
 /* boot protocol area */
-#define BOOT_STATE	(DPRAM_BASE + 0x3F8)
-#define BOOT_SIZE	(DPRAM_BASE + 0x3FA)
-#define BOOT_BASE	(DPRAM_BASE + 0x3FC)
-#define BOOT_BLOCK	(DPRAM_BASE + 0x400)
-#define BOOT_MAX_SIZE	0xc00
+#define AV7110_BOOT_STATE	(DPRAM_BASE + 0x3F8)
+#define AV7110_BOOT_SIZE	(DPRAM_BASE + 0x3FA)
+#define AV7110_BOOT_BASE	(DPRAM_BASE + 0x3FC)
+#define AV7110_BOOT_BLOCK	(DPRAM_BASE + 0x400)
+#define AV7110_BOOT_MAX_SIZE	0xc00
 
 /* firmware command protocol area */
 #define IRQ_STATE	(DPRAM_BASE + 0x0F4)


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 16/25] Semaphore to mutex conversion on drivers/media
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (13 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 13/25] cx88 Kconfig fixes for cx88-alsa mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 15/25] Fix for lack of analog output on some cx88 boards mchehab
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Ingo Molnar,
	Mauro Carvalho Chehab


From: Ingo Molnar <mingo@elte.hu>

- Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/dvb/dvb-core/dvbdev.c        |   22 +++++++++++-----------
 drivers/media/video/cx88/cx88-core.c       |   15 ++++++++-------
 drivers/media/video/em28xx/em28xx-video.c  |    7 ++++---
 drivers/media/video/saa7134/saa7134-core.c |   19 ++++++++++---------
 drivers/media/video/videodev.c             |   25 ++++++++++++-------------
 5 files changed, 45 insertions(+), 43 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index 06b696e..54f8b95 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -33,7 +33,7 @@
 #include <linux/device.h>
 #include <linux/fs.h>
 #include <linux/cdev.h>
-
+#include <linux/mutex.h>
 #include "dvbdev.h"
 
 static int dvbdev_debug;
@@ -44,7 +44,7 @@ MODULE_PARM_DESC(dvbdev_debug, "Turn on/
 #define dprintk if (dvbdev_debug) printk
 
 static LIST_HEAD(dvb_adapter_list);
-static DECLARE_MUTEX(dvbdev_register_lock);
+static DEFINE_MUTEX(dvbdev_register_lock);
 
 static const char * const dnames[] = {
 	"video", "audio", "sec", "frontend", "demux", "dvr", "ca",
@@ -202,11 +202,11 @@ int dvb_register_device(struct dvb_adapt
 	struct dvb_device *dvbdev;
 	int id;
 
-	if (down_interruptible (&dvbdev_register_lock))
+	if (mutex_lock_interruptible(&dvbdev_register_lock))
 		return -ERESTARTSYS;
 
 	if ((id = dvbdev_get_free_id (adap, type)) < 0) {
-		up (&dvbdev_register_lock);
+		mutex_unlock(&dvbdev_register_lock);
 		*pdvbdev = NULL;
 		printk ("%s: could get find free device id...\n", __FUNCTION__);
 		return -ENFILE;
@@ -215,11 +215,11 @@ int dvb_register_device(struct dvb_adapt
 	*pdvbdev = dvbdev = kmalloc(sizeof(struct dvb_device), GFP_KERNEL);
 
 	if (!dvbdev) {
-		up(&dvbdev_register_lock);
+		mutex_unlock(&dvbdev_register_lock);
 		return -ENOMEM;
 	}
 
-	up (&dvbdev_register_lock);
+	mutex_unlock(&dvbdev_register_lock);
 
 	memcpy(dvbdev, template, sizeof(struct dvb_device));
 	dvbdev->type = type;
@@ -289,11 +289,11 @@ int dvb_register_adapter(struct dvb_adap
 {
 	int num;
 
-	if (down_interruptible (&dvbdev_register_lock))
+	if (mutex_lock_interruptible(&dvbdev_register_lock))
 		return -ERESTARTSYS;
 
 	if ((num = dvbdev_get_free_adapter_num ()) < 0) {
-		up (&dvbdev_register_lock);
+		mutex_unlock(&dvbdev_register_lock);
 		return -ENFILE;
 	}
 
@@ -309,7 +309,7 @@ int dvb_register_adapter(struct dvb_adap
 
 	list_add_tail (&adap->list_head, &dvb_adapter_list);
 
-	up (&dvbdev_register_lock);
+	mutex_unlock(&dvbdev_register_lock);
 
 	return num;
 }
@@ -320,10 +320,10 @@ int dvb_unregister_adapter(struct dvb_ad
 {
 	devfs_remove("dvb/adapter%d", adap->num);
 
-	if (down_interruptible (&dvbdev_register_lock))
+	if (mutex_lock_interruptible(&dvbdev_register_lock))
 		return -ERESTARTSYS;
 	list_del (&adap->list_head);
-	up (&dvbdev_register_lock);
+	mutex_unlock(&dvbdev_register_lock);
 	return 0;
 }
 EXPORT_SYMBOL(dvb_unregister_adapter);
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index 194446f..8d6d6a6 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -32,6 +32,7 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/videodev2.h>
+#include <linux/mutex.h>
 
 #include "cx88.h"
 #include <media/v4l2-common.h>
@@ -75,7 +76,7 @@ MODULE_PARM_DESC(nocomb,"disable comb fi
 
 static unsigned int cx88_devcount;
 static LIST_HEAD(cx88_devlist);
-static DECLARE_MUTEX(devlist);
+static DEFINE_MUTEX(devlist);
 
 #define NO_SYNC_LINE (-1U)
 
@@ -1036,7 +1037,7 @@ struct cx88_core* cx88_core_get(struct p
 	struct list_head *item;
 	int i;
 
-	down(&devlist);
+	mutex_lock(&devlist);
 	list_for_each(item,&cx88_devlist) {
 		core = list_entry(item, struct cx88_core, devlist);
 		if (pci->bus->number != core->pci_bus)
@@ -1047,7 +1048,7 @@ struct cx88_core* cx88_core_get(struct p
 		if (0 != get_ressources(core,pci))
 			goto fail_unlock;
 		atomic_inc(&core->refcount);
-		up(&devlist);
+		mutex_unlock(&devlist);
 		return core;
 	}
 	core = kzalloc(sizeof(*core),GFP_KERNEL);
@@ -1122,13 +1123,13 @@ struct cx88_core* cx88_core_get(struct p
 	cx88_card_setup(core);
 	cx88_ir_init(core,pci);
 
-	up(&devlist);
+	mutex_unlock(&devlist);
 	return core;
 
 fail_free:
 	kfree(core);
 fail_unlock:
-	up(&devlist);
+	mutex_unlock(&devlist);
 	return NULL;
 }
 
@@ -1140,14 +1141,14 @@ void cx88_core_put(struct cx88_core *cor
 	if (!atomic_dec_and_test(&core->refcount))
 		return;
 
-	down(&devlist);
+	mutex_lock(&devlist);
 	cx88_ir_fini(core);
 	if (0 == core->i2c_rc)
 		i2c_bit_del_bus(&core->i2c_adap);
 	list_del(&core->devlist);
 	iounmap(core->lmmio);
 	cx88_devcount--;
-	up(&devlist);
+	mutex_unlock(&devlist);
 	kfree(core);
 }
 
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 3323dff..eea304f 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -29,6 +29,7 @@
 #include <linux/i2c.h>
 #include <linux/version.h>
 #include <linux/video_decoder.h>
+#include <linux/mutex.h>
 
 #include "em28xx.h"
 #include <media/tuner.h>
@@ -191,7 +192,7 @@ static struct v4l2_queryctrl saa711x_qct
 
 static struct usb_driver em28xx_usb_driver;
 
-static DECLARE_MUTEX(em28xx_sysfs_lock);
+static DEFINE_MUTEX(em28xx_sysfs_lock);
 static DECLARE_RWSEM(em28xx_disconnect);
 
 /*********************  v4l2 interface  ******************************************/
@@ -394,7 +395,7 @@ static int em28xx_v4l2_open(struct inode
 */
 static void em28xx_release_resources(struct em28xx *dev)
 {
-	down(&em28xx_sysfs_lock);
+	mutex_lock(&em28xx_sysfs_lock);
 
 	em28xx_info("V4L2 device /dev/video%d deregistered\n",
 		    dev->vdev->minor);
@@ -403,7 +404,7 @@ static void em28xx_release_resources(str
 /*	video_unregister_device(dev->vbi_dev); */
 	em28xx_i2c_unregister(dev);
 	usb_put_dev(dev->udev);
-	up(&em28xx_sysfs_lock);
+	mutex_unlock(&em28xx_sysfs_lock);
 }
 
 /*
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 3dd42ef..028904b 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -31,6 +31,7 @@
 #include <linux/sound.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
+#include <linux/mutex.h>
 
 #include "saa7134-reg.h"
 #include "saa7134.h"
@@ -84,7 +85,7 @@ MODULE_PARM_DESC(radio_nr, "radio device
 MODULE_PARM_DESC(tuner,    "tuner type");
 MODULE_PARM_DESC(card,     "card type");
 
-static DECLARE_MUTEX(devlist_lock);
+static DEFINE_MUTEX(devlist_lock);
 LIST_HEAD(saa7134_devlist);
 static LIST_HEAD(mops_list);
 static unsigned int saa7134_devcount;
@@ -969,13 +970,13 @@ static int __devinit saa7134_initdev(str
 	pci_set_drvdata(pci_dev,dev);
 	saa7134_devcount++;
 
-	down(&devlist_lock);
+	mutex_lock(&devlist_lock);
 	list_for_each(item,&mops_list) {
 		mops = list_entry(item, struct saa7134_mpeg_ops, next);
 		mpeg_ops_attach(mops, dev);
 	}
 	list_add_tail(&dev->devlist,&saa7134_devlist);
-	up(&devlist_lock);
+	mutex_unlock(&devlist_lock);
 
 	/* check for signal */
 	saa7134_irq_video_intl(dev);
@@ -1031,13 +1032,13 @@ static void __devexit saa7134_finidev(st
 	saa7134_hwfini(dev);
 
 	/* unregister */
-	down(&devlist_lock);
+	mutex_lock(&devlist_lock);
 	list_del(&dev->devlist);
 	list_for_each(item,&mops_list) {
 		mops = list_entry(item, struct saa7134_mpeg_ops, next);
 		mpeg_ops_detach(mops, dev);
 	}
-	up(&devlist_lock);
+	mutex_unlock(&devlist_lock);
 	saa7134_devcount--;
 
 	saa7134_i2c_unregister(dev);
@@ -1071,13 +1072,13 @@ int saa7134_ts_register(struct saa7134_m
 	struct list_head *item;
 	struct saa7134_dev *dev;
 
-	down(&devlist_lock);
+	mutex_lock(&devlist_lock);
 	list_for_each(item,&saa7134_devlist) {
 		dev = list_entry(item, struct saa7134_dev, devlist);
 		mpeg_ops_attach(ops, dev);
 	}
 	list_add_tail(&ops->next,&mops_list);
-	up(&devlist_lock);
+	mutex_unlock(&devlist_lock);
 	return 0;
 }
 
@@ -1086,13 +1087,13 @@ void saa7134_ts_unregister(struct saa713
 	struct list_head *item;
 	struct saa7134_dev *dev;
 
-	down(&devlist_lock);
+	mutex_lock(&devlist_lock);
 	list_del(&ops->next);
 	list_for_each(item,&saa7134_devlist) {
 		dev = list_entry(item, struct saa7134_dev, devlist);
 		mpeg_ops_detach(ops, dev);
 	}
-	up(&devlist_lock);
+	mutex_unlock(&devlist_lock);
 }
 
 EXPORT_SYMBOL(saa7134_ts_register);
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index d5be259..078880e 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -29,7 +29,6 @@
 #include <linux/devfs_fs_kernel.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
-#include <asm/semaphore.h>
 
 #include <linux/videodev.h>
 
@@ -83,7 +82,7 @@ static struct class video_class = {
  */
 
 static struct video_device *video_device[VIDEO_NUM_DEVICES];
-static DECLARE_MUTEX(videodev_lock);
+static DEFINE_MUTEX(videodev_lock);
 
 struct video_device* video_devdata(struct file *file)
 {
@@ -102,15 +101,15 @@ static int video_open(struct inode *inod
 
 	if(minor>=VIDEO_NUM_DEVICES)
 		return -ENODEV;
-	down(&videodev_lock);
+	mutex_lock(&videodev_lock);
 	vfl=video_device[minor];
 	if(vfl==NULL) {
-		up(&videodev_lock);
+		mutex_unlock(&videodev_lock);
 		request_module("char-major-%d-%d", VIDEO_MAJOR, minor);
-		down(&videodev_lock);
+		mutex_lock(&videodev_lock);
 		vfl=video_device[minor];
 		if (vfl==NULL) {
-			up(&videodev_lock);
+			mutex_unlock(&videodev_lock);
 			return -ENODEV;
 		}
 	}
@@ -123,7 +122,7 @@ static int video_open(struct inode *inod
 		file->f_op = fops_get(old_fops);
 	}
 	fops_put(old_fops);
-	up(&videodev_lock);
+	mutex_unlock(&videodev_lock);
 	return err;
 }
 
@@ -304,12 +303,12 @@ int video_register_device(struct video_d
 	}
 
 	/* pick a minor number */
-	down(&videodev_lock);
+	mutex_lock(&videodev_lock);
 	if (nr >= 0  &&  nr < end-base) {
 		/* use the one the driver asked for */
 		i = base+nr;
 		if (NULL != video_device[i]) {
-			up(&videodev_lock);
+			mutex_unlock(&videodev_lock);
 			return -ENFILE;
 		}
 	} else {
@@ -318,13 +317,13 @@ int video_register_device(struct video_d
 			if (NULL == video_device[i])
 				break;
 		if (i == end) {
-			up(&videodev_lock);
+			mutex_unlock(&videodev_lock);
 			return -ENFILE;
 		}
 	}
 	video_device[i]=vfd;
 	vfd->minor=i;
-	up(&videodev_lock);
+	mutex_unlock(&videodev_lock);
 
 	sprintf(vfd->devfs_name, "v4l/%s%d", name_base, i - base);
 	devfs_mk_cdev(MKDEV(VIDEO_MAJOR, vfd->minor),
@@ -362,14 +361,14 @@ int video_register_device(struct video_d
 
 void video_unregister_device(struct video_device *vfd)
 {
-	down(&videodev_lock);
+	mutex_lock(&videodev_lock);
 	if(video_device[vfd->minor]!=vfd)
 		panic("videodev: bad unregister");
 
 	devfs_remove(vfd->devfs_name);
 	video_device[vfd->minor]=NULL;
 	class_device_unregister(&vfd->class_dev);
-	up(&videodev_lock);
+	mutex_unlock(&videodev_lock);
 }
 
 


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 15/25] Fix for lack of analog output on some cx88 boards
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (14 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 16/25] Semaphore to mutex conversion on drivers/media mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 17/25] Fix compilation with Alpha mchehab
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm,
	Panagiotis Christeas, Mauro Carvalho Chehab


From: Panagiotis Christeas <p_christ@hol.gr>

- Workaround to fix a known regression at cx88-tvaudio.c
- provide a module parameter workaround to always enable
analog output.

Signed-off-by: Panagiotis Christeas <p_christ@hol.gr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/cx88/cx88-tvaudio.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c
index 24118e4..da8d97c 100644
--- a/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/drivers/media/video/cx88/cx88-tvaudio.c
@@ -60,6 +60,11 @@ static unsigned int audio_debug = 0;
 module_param(audio_debug, int, 0644);
 MODULE_PARM_DESC(audio_debug, "enable debug messages [audio]");
 
+static unsigned int always_analog = 0;
+module_param(always_analog,int,0644);
+MODULE_PARM_DESC(always_analog,"force analog audio out");
+
+
 #define dprintk(fmt, arg...)	if (audio_debug) \
 	printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg)
 
@@ -155,7 +160,8 @@ static void set_audio_finish(struct cx88
 		cx_write(AUD_I2SOUTPUTCNTL, 1);
 		cx_write(AUD_I2SCNTL, 0);
 		/* cx_write(AUD_APB_IN_RATE_ADJ, 0); */
-	} else {
+	}
+	if ((always_analog) || (!cx88_boards[core->board].blackbird)) {
 		ctl |= EN_DAC_ENABLE;
 		cx_write(AUD_CTL, ctl);
 	}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 18/25] Move tda988x options into tuner_params struct.
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (16 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 17/25] Fix compilation with Alpha mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 20/25] Return -EINVAL for unknown commands in msp3400 module mchehab
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Michael Krufky,
	Mauro Carvalho Chehab


From: Michael Krufky <mkrufky@m1k.net>

- Tda988x parameters should be defined per tuner_param_type,
for each tuner_params array member.

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 include/media/tuner-types.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h
index 64b16b1..7566931 100644
--- a/include/media/tuner-types.h
+++ b/include/media/tuner-types.h
@@ -19,6 +19,7 @@ struct tuner_range {
 
 struct tuner_params {
 	enum param_type type;
+	unsigned int tda988x;
 	unsigned char config; /* to be moved into struct tuner_range for dvb-pll merge */
 
 	unsigned int count;
@@ -27,7 +28,6 @@ struct tuner_params {
 
 struct tunertype {
 	char *name;
-	unsigned int has_tda988x:1;
 	struct tuner_params *params;
 };
 


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 19/25] Separate tv & radio freqs, fix cb/freq transmit order for tuners that need this.
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (18 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 20/25] Return -EINVAL for unknown commands in msp3400 module mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 21/25] fix some sound quality & distortion problems mchehab
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Hans Verkuil,
	Mauro Carvalho Chehab


From: Hans Verkuil <hverkuil@xs4all.nl>

- Moved MSP_SET_MATRIX to v4l2-common.h
- Fix typos and integer overflows in tea5767.c
- Split old freq field into a tv_freq and a radio_freq. Prevents
  that a radio tuner is initialized with a tv frequency or vice versa.
- When switching to radio mode initialize the tuner with the last
  used radio frequency (this was already done for the TV mode).
  As a result of these changes the tuner module now remembers the
  last set radio and TV frequencies, which is what you would expect
  to happen.
- Move out of range frequencies to the closest valid frequency as per
  v4l2 API spec.
- Fix incorrect initial radio frequency (multiplier is 16000, not 16)
- Add boundary check for out of range frequencies.
- Use new flag to check if the order of the CB and freq. depends on
  the last set frequency. That is needed for some tuners or you can
  get static as a result. The flag is added for those tuners where I know
  that the datasheet indicates that this is necessary.
- For this new check use the last set div value, not the last frequency
  as radio frequencies are always much higher due to the 16000 multiplier.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/msp3400.h      |    8 ---
 drivers/media/video/mt20xx.c       |   12 +++--
 drivers/media/video/tda8290.c      |    4 +-
 drivers/media/video/tea5767.c      |   18 ++++----
 drivers/media/video/tuner-core.c   |   85 ++++++++++++++++++++++--------------
 drivers/media/video/tuner-simple.c |   44 ++++++++++---------
 drivers/media/video/tuner-types.c  |    6 +++
 drivers/media/video/v4l2-common.c  |    1 
 include/media/tuner-types.h        |   18 ++++++++
 include/media/tuner.h              |    8 ++-
 include/media/v4l2-common.h        |    7 +++
 11 files changed, 129 insertions(+), 82 deletions(-)

diff --git a/drivers/media/video/msp3400.h b/drivers/media/video/msp3400.h
index 70a5ef8..a9ac57d 100644
--- a/drivers/media/video/msp3400.h
+++ b/drivers/media/video/msp3400.h
@@ -6,14 +6,6 @@
 
 /* ---------------------------------------------------------------------- */
 
-struct msp_matrix {
-  int input;
-  int output;
-};
-
-/* ioctl for MSP_SET_MATRIX will have to be registered */
-#define MSP_SET_MATRIX     _IOW('m',17,struct msp_matrix)
-
 /* This macro is allowed for *constants* only, gcc must calculate it
    at compile time.  Remember -- no floats in kernel mode */
 #define MSP_CARRIER(freq) ((int)((float)(freq / 18.432) * (1 << 24)))
diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c
index 0bf1caa..c7c9f3f 100644
--- a/drivers/media/video/mt20xx.c
+++ b/drivers/media/video/mt20xx.c
@@ -353,8 +353,8 @@ static int mt2032_init(struct i2c_client
 	} while (xok != 1 );
 	t->xogc=xogc;
 
-	t->tv_freq    = mt2032_set_tv_freq;
-	t->radio_freq = mt2032_set_radio_freq;
+	t->set_tv_freq    = mt2032_set_tv_freq;
+	t->set_radio_freq = mt2032_set_radio_freq;
 	return(1);
 }
 
@@ -481,8 +481,8 @@ static int mt2050_init(struct i2c_client
 	i2c_master_recv(c,buf,1);
 
 	tuner_dbg("mt2050: sro is %x\n",buf[0]);
-	t->tv_freq    = mt2050_set_tv_freq;
-	t->radio_freq = mt2050_set_radio_freq;
+	t->set_tv_freq    = mt2050_set_tv_freq;
+	t->set_radio_freq = mt2050_set_radio_freq;
 	return 0;
 }
 
@@ -494,8 +494,8 @@ int microtune_init(struct i2c_client *c)
 	int company_code;
 
 	memset(buf,0,sizeof(buf));
-	t->tv_freq    = NULL;
-	t->radio_freq = NULL;
+	t->set_tv_freq    = NULL;
+	t->set_radio_freq = NULL;
 	t->standby    = NULL;
 	if (t->std & V4L2_STD_525_60) {
 		tuner_dbg("pinnacle ntsc\n");
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index 2498b76..7b4fb28 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -567,8 +567,8 @@ int tda8290_init(struct i2c_client *c)
 	}
 	tuner_info("tuner: type set to %s\n", c->name);
 
-	t->tv_freq    = set_tv_freq;
-	t->radio_freq = set_radio_freq;
+	t->set_tv_freq    = set_tv_freq;
+	t->set_radio_freq = set_radio_freq;
 	t->has_signal = has_signal;
 	t->standby = standby;
 	t->tda827x_lpsel = 0;
diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c
index 921fe72..c2b98f8 100644
--- a/drivers/media/video/tea5767.c
+++ b/drivers/media/video/tea5767.c
@@ -62,7 +62,7 @@ extern int tuner_debug;
 
 #define TEA5767_PORT1_HIGH	0x01
 
-/* Forth register */
+/* Fourth register */
 #define TEA5767_PORT2_HIGH	0x80
 /* Chips stops working. Only I2C bus remains on */
 #define TEA5767_STDBY		0x40
@@ -85,7 +85,7 @@ extern int tuner_debug;
 /* If activate PORT 1 indicates SEARCH or else it is used as PORT1 */
 #define TEA5767_SRCH_IND	0x01
 
-/* Fiveth register */
+/* Fifth register */
 
 /* By activating, it will use Xtal at 13 MHz as reference for divider */
 #define TEA5767_PLLREF_ENABLE	0x80
@@ -109,13 +109,13 @@ extern int tuner_debug;
 #define TEA5767_STEREO_MASK	0x80
 #define TEA5767_IF_CNTR_MASK	0x7f
 
-/* Four register */
+/* Fourth register */
 #define TEA5767_ADC_LEVEL_MASK	0xf0
 
 /* should be 0 */
 #define TEA5767_CHIP_ID_MASK	0x0f
 
-/* Fiveth register */
+/* Fifth register */
 /* Reserved for future extensions */
 #define TEA5767_RESERVED_MASK	0xff
 
@@ -220,19 +220,19 @@ static void set_radio_freq(struct i2c_cl
 		tuner_dbg ("TEA5767 radio HIGH LO inject xtal @ 13 MHz\n");
 		buffer[2] |= TEA5767_HIGH_LO_INJECT;
 		buffer[4] |= TEA5767_PLLREF_ENABLE;
-		div = (frq * 4000 / 16 + 700000 + 225000 + 25000) / 50000;
+		div = (frq * (4000 / 16) + 700000 + 225000 + 25000) / 50000;
 		break;
 	case TEA5767_LOW_LO_13MHz:
 		tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 13 MHz\n");
 
 		buffer[4] |= TEA5767_PLLREF_ENABLE;
-		div = (frq * 4000 / 16 - 700000 - 225000 + 25000) / 50000;
+		div = (frq * (4000 / 16) - 700000 - 225000 + 25000) / 50000;
 		break;
 	case TEA5767_LOW_LO_32768:
 		tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 32,768 MHz\n");
 		buffer[3] |= TEA5767_XTAL_32768;
 		/* const 700=4000*175 Khz - to adjust freq to right value */
-		div = ((frq * 4000 / 16 - 700000 - 225000) + 16384) >> 15;
+		div = ((frq * (4000 / 16) - 700000 - 225000) + 16384) >> 15;
 		break;
 	case TEA5767_HIGH_LO_32768:
 	default:
@@ -350,8 +350,8 @@ int tea5767_tuner_init(struct i2c_client
 	tuner_info("type set to %d (%s)\n", t->type, "Philips TEA5767HN FM Radio");
 	strlcpy(c->name, "tea5767", sizeof(c->name));
 
-	t->tv_freq = set_tv_freq;
-	t->radio_freq = set_radio_freq;
+	t->set_tv_freq = set_tv_freq;
+	t->set_radio_freq = set_radio_freq;
 	t->has_signal = tea5767_signal;
 	t->is_stereo = tea5767_stereo;
 	t->standby = tea5767_standby;
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index f30ef79..2995b22 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -82,7 +82,7 @@ static void set_tv_freq(struct i2c_clien
 		tuner_warn ("tuner type not set\n");
 		return;
 	}
-	if (NULL == t->tv_freq) {
+	if (NULL == t->set_tv_freq) {
 		tuner_warn ("Tuner has no way to set tv freq\n");
 		return;
 	}
@@ -90,8 +90,14 @@ static void set_tv_freq(struct i2c_clien
 		tuner_dbg ("TV freq (%d.%02d) out of range (%d-%d)\n",
 			   freq / 16, freq % 16 * 100 / 16, tv_range[0],
 			   tv_range[1]);
+		/* V4L2 spec: if the freq is not possible then the closest
+		   possible value should be selected */
+		if (freq < tv_range[0] * 16)
+			freq = tv_range[0] * 16;
+		else
+			freq = tv_range[1] * 16;
 	}
-	t->tv_freq(c, freq);
+	t->set_tv_freq(c, freq);
 }
 
 static void set_radio_freq(struct i2c_client *c, unsigned int freq)
@@ -102,18 +108,23 @@ static void set_radio_freq(struct i2c_cl
 		tuner_warn ("tuner type not set\n");
 		return;
 	}
-	if (NULL == t->radio_freq) {
+	if (NULL == t->set_radio_freq) {
 		tuner_warn ("tuner has no way to set radio frequency\n");
 		return;
 	}
-	if (freq <= radio_range[0] * 16000 || freq >= radio_range[1] * 16000) {
+	if (freq < radio_range[0] * 16000 || freq > radio_range[1] * 16000) {
 		tuner_dbg ("radio freq (%d.%02d) out of range (%d-%d)\n",
 			   freq / 16000, freq % 16000 * 100 / 16000,
 			   radio_range[0], radio_range[1]);
+		/* V4L2 spec: if the freq is not possible then the closest
+		   possible value should be selected */
+		if (freq < radio_range[0] * 16000)
+			freq = radio_range[0] * 16000;
+		else
+			freq = radio_range[1] * 16000;
 	}
 
-	t->radio_freq(c, freq);
-	return;
+	t->set_radio_freq(c, freq);
 }
 
 static void set_freq(struct i2c_client *c, unsigned long freq)
@@ -125,15 +136,16 @@ static void set_freq(struct i2c_client *
 		tuner_dbg("radio freq set to %lu.%02lu\n",
 			  freq / 16000, freq % 16000 * 100 / 16000);
 		set_radio_freq(c, freq);
+		t->radio_freq = freq;
 		break;
 	case V4L2_TUNER_ANALOG_TV:
 	case V4L2_TUNER_DIGITAL_TV:
 		tuner_dbg("tv freq set to %lu.%02lu\n",
 			  freq / 16, freq % 16 * 100 / 16);
 		set_tv_freq(c, freq);
+		t->tv_freq = freq;
 		break;
 	}
-	t->freq = freq;
 }
 
 static void set_type(struct i2c_client *c, unsigned int type,
@@ -212,7 +224,7 @@ static void set_type(struct i2c_client *
 	if (t->mode_mask == T_UNINITIALIZED)
 		t->mode_mask = new_mode_mask;
 
-	set_freq(c, t->freq);
+	set_freq(c, (V4L2_TUNER_RADIO == t->mode) ? t->radio_freq : t->tv_freq);
 	tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n",
 		  c->adapter->name, c->driver->driver.name, c->addr << 1, type,
 		  t->mode_mask);
@@ -377,11 +389,11 @@ static void tuner_status(struct i2c_clie
 		default: p = "undefined"; break;
 	}
 	if (t->mode == V4L2_TUNER_RADIO) {
-		freq = t->freq / 16000;
-		freq_fraction = (t->freq % 16000) * 100 / 16000;
+		freq = t->radio_freq / 16000;
+		freq_fraction = (t->radio_freq % 16000) * 100 / 16000;
 	} else {
-		freq = t->freq / 16;
-		freq_fraction = (t->freq % 16) * 100 / 16;
+		freq = t->tv_freq / 16;
+		freq_fraction = (t->tv_freq % 16) * 100 / 16;
 	}
 	tuner_info("Tuner mode:      %s\n", p);
 	tuner_info("Frequency:       %lu.%02lu MHz\n", freq, freq_fraction);
@@ -456,7 +468,7 @@ static int tuner_attach(struct i2c_adapt
 				t->type = TUNER_TEA5767;
 				t->mode_mask = T_RADIO;
 				t->mode = T_STANDBY;
-				t->freq = 87.5 * 16; /* Sets freq to FM range */
+				t->radio_freq = 87.5 * 16000; /* Sets freq to FM range */
 				default_mode_mask &= ~T_RADIO;
 
 				goto register_client;
@@ -469,7 +481,8 @@ static int tuner_attach(struct i2c_adapt
 	if (default_mode_mask != T_UNINITIALIZED) {
 		tuner_dbg ("Setting mode_mask to 0x%02x\n", default_mode_mask);
 		t->mode_mask = default_mode_mask;
-		t->freq = 400 * 16; /* Sets freq to VHF High */
+		t->tv_freq = 400 * 16; /* Sets freq to VHF High */
+		t->radio_freq = 87.5 * 16000; /* Sets freq to FM range */
 		default_mode_mask = T_UNINITIALIZED;
 	}
 
@@ -565,16 +578,18 @@ static int tuner_command(struct i2c_clie
 		set_addr(client, (struct tuner_setup *)arg);
 		break;
 	case AUDC_SET_RADIO:
-		set_mode(client,t,V4L2_TUNER_RADIO, "AUDC_SET_RADIO");
+		if (set_mode(client, t, V4L2_TUNER_RADIO, "AUDC_SET_RADIO")
+				== EINVAL)
+			return 0;
+		if (t->radio_freq)
+			set_freq(client, t->radio_freq);
 		break;
 	case TUNER_SET_STANDBY:
-		{
-			if (check_mode(t, "TUNER_SET_STANDBY") == EINVAL)
-				return 0;
-			if (t->standby)
-				t->standby (client);
-			break;
-		}
+		if (check_mode(t, "TUNER_SET_STANDBY") == EINVAL)
+			return 0;
+		if (t->standby)
+			t->standby (client);
+		break;
 	case VIDIOCSAUDIO:
 		if (check_mode(t, "VIDIOCSAUDIO") == EINVAL)
 			return 0;
@@ -583,7 +598,6 @@ static int tuner_command(struct i2c_clie
 
 		/* Should be implemented, since bttv calls it */
 		tuner_dbg("VIDIOCSAUDIO not implemented.\n");
-
 		break;
 	/* --- v4l ioctls --- */
 	/* take care: bttv does userspace copying, we'll get a
@@ -609,8 +623,8 @@ static int tuner_command(struct i2c_clie
 			if (vc->norm < ARRAY_SIZE(map))
 				t->std = map[vc->norm];
 			tuner_fixup_std(t);
-			if (t->freq)
-				set_tv_freq(client, t->freq);
+			if (t->tv_freq)
+				set_tv_freq(client, t->tv_freq);
 			return 0;
 		}
 	case VIDIOCSFREQ:
@@ -684,15 +698,14 @@ static int tuner_command(struct i2c_clie
 
 			t->std = *id;
 			tuner_fixup_std(t);
-			if (t->freq)
-				set_freq(client, t->freq);
+			if (t->tv_freq)
+				set_freq(client, t->tv_freq);
 			break;
 		}
 	case VIDIOC_S_FREQUENCY:
 		{
 			struct v4l2_frequency *f = arg;
 
-			t->freq = f->frequency;
 			switch_v4l2();
 			if (V4L2_TUNER_RADIO == f->type &&
 			    V4L2_TUNER_RADIO != t->mode) {
@@ -700,7 +713,7 @@ static int tuner_command(struct i2c_clie
 					    == EINVAL)
 					return 0;
 			}
-			set_freq(client,t->freq);
+			set_freq(client,f->frequency);
 
 			break;
 		}
@@ -712,7 +725,8 @@ static int tuner_command(struct i2c_clie
 				return 0;
 			switch_v4l2();
 			f->type = t->mode;
-			f->frequency = t->freq;
+			f->frequency = (V4L2_TUNER_RADIO == t->mode) ?
+				t->radio_freq : t->tv_freq;
 			break;
 		}
 	case VIDIOC_G_TUNER:
@@ -763,7 +777,7 @@ static int tuner_command(struct i2c_clie
 
 			if (V4L2_TUNER_RADIO == t->mode) {
 				t->audmode = tuner->audmode;
-				set_radio_freq(client, t->freq);
+				set_radio_freq(client, t->radio_freq);
 			}
 			break;
 		}
@@ -791,8 +805,13 @@ static int tuner_resume(struct device *d
 	struct tuner *t = i2c_get_clientdata (c);
 
 	tuner_dbg ("resume\n");
-	if (t->freq)
-		set_freq(c, t->freq);
+	if (V4L2_TUNER_RADIO == t->mode) {
+		if (t->radio_freq)
+			set_freq(c, t->radio_freq);
+	} else {
+		if (t->tv_freq)
+			set_freq(c, t->tv_freq);
+	}
 	return 0;
 }
 
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index 3879262..37977ff 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -136,7 +136,7 @@ static void default_set_tv_freq(struct i
 	u8 config, tuneraddr;
 	u16 div;
 	struct tunertype *tun;
-	unsigned char buffer[4];
+	u8 buffer[4];
 	int rc, IFPCoff, i, j;
 
 	tun = &tuners[t->type];
@@ -147,6 +147,11 @@ static void default_set_tv_freq(struct i
 			continue;
 		break;
 	}
+	if (i == tun->params[j].count) {
+		tuner_dbg("TV frequency out of range (%d > %d)",
+				freq, tun->params[j].ranges[i - 1].limit);
+		freq = tun->params[j].ranges[--i].limit;
+	}
 	config = tun->params[j].ranges[i].cb;
 	/*  i == 0 -> VHF_LO  */
 	/*  i == 1 -> VHF_HI  */
@@ -239,20 +244,6 @@ static void default_set_tv_freq(struct i
 		break;
 	}
 
-	/*
-	 * Philips FI1216MK2 remark from specification :
-	 * for channel selection involving band switching, and to ensure
-	 * smooth tuning to the desired channel without causing
-	 * unnecessary charge pump action, it is recommended to consider
-	 * the difference between wanted channel frequency and the
-	 * current channel frequency.  Unnecessary charge pump action
-	 * will result in very low tuning voltage which may drive the
-	 * oscillator to extreme conditions.
-	 *
-	 * Progfou: specification says to send config data before
-	 * frequency in case (wanted frequency < current frequency).
-	 */
-
 	/* IFPCoff = Video Intermediate Frequency - Vif:
 		940  =16*58.75  NTSC/J (Japan)
 		732  =16*45.75  M/N STD
@@ -284,7 +275,7 @@ static void default_set_tv_freq(struct i
 					offset / 16, offset % 16 * 100 / 16,
 					div);
 
-	if (t->type == TUNER_PHILIPS_SECAM && freq < t->freq) {
+	if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) {
 		buffer[0] = tun->params[j].config;
 		buffer[1] = config;
 		buffer[2] = (div>>8) & 0x7f;
@@ -295,6 +286,7 @@ static void default_set_tv_freq(struct i
 		buffer[2] = tun->params[j].config;
 		buffer[3] = config;
 	}
+	t->last_div = div;
 	tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
 		  buffer[0],buffer[1],buffer[2],buffer[3]);
 
@@ -337,8 +329,8 @@ static void default_set_radio_freq(struc
 {
 	struct tunertype *tun;
 	struct tuner *t = i2c_get_clientdata(c);
-	unsigned char buffer[4];
-	unsigned div;
+	u8 buffer[4];
+	u16 div;
 	int rc, j;
 
 	tun = &tuners[t->type];
@@ -374,9 +366,19 @@ static void default_set_radio_freq(struc
 	}
 	buffer[0] = (div>>8) & 0x7f;
 	buffer[1] = div      & 0xff;
+	if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) {
+		buffer[0] = buffer[2];
+		buffer[1] = buffer[3];
+		buffer[2] = (div>>8) & 0x7f;
+		buffer[3] = div      & 0xff;
+	} else {
+		buffer[0] = (div>>8) & 0x7f;
+		buffer[1] = div      & 0xff;
+	}
 
 	tuner_dbg("radio 0x%02x 0x%02x 0x%02x 0x%02x\n",
 	       buffer[0],buffer[1],buffer[2],buffer[3]);
+	t->last_div = div;
 
 	if (4 != (rc = i2c_master_send(c,buffer,4)))
 		tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
@@ -390,10 +392,10 @@ int default_tuner_init(struct i2c_client
 		   t->type, tuners[t->type].name);
 	strlcpy(c->name, tuners[t->type].name, sizeof(c->name));
 
-	t->tv_freq    = default_set_tv_freq;
-	t->radio_freq = default_set_radio_freq;
+	t->set_tv_freq = default_set_tv_freq;
+	t->set_radio_freq = default_set_radio_freq;
 	t->has_signal = tuner_signal;
-	t->is_stereo  = tuner_stereo;
+	t->is_stereo = tuner_stereo;
 	t->standby = NULL;
 
 	return 0;
diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c
index 32c9be4..6fe7817 100644
--- a/drivers/media/video/tuner-types.c
+++ b/drivers/media/video/tuner-types.c
@@ -81,6 +81,7 @@ static struct tuner_params tuner_philips
 		.ranges = tuner_philips_ntsc_ranges,
 		.count  = ARRAY_SIZE(tuner_philips_ntsc_ranges),
 		.config = 0x8e,
+		.cb_first_if_lower_freq = 1,
 	},
 };
 
@@ -98,6 +99,7 @@ static struct tuner_params tuner_philips
 		.ranges = tuner_philips_secam_ranges,
 		.count  = ARRAY_SIZE(tuner_philips_secam_ranges),
 		.config = 0x8e,
+		.cb_first_if_lower_freq = 1,
 	},
 };
 
@@ -115,6 +117,7 @@ static struct tuner_params tuner_philips
 		.ranges = tuner_philips_pal_ranges,
 		.count  = ARRAY_SIZE(tuner_philips_pal_ranges),
 		.config = 0x8e,
+		.cb_first_if_lower_freq = 1,
 	},
 };
 
@@ -596,6 +599,7 @@ static struct tuner_params tuner_fm1216m
 		.ranges = tuner_fm1216me_mk3_pal_ranges,
 		.count  = ARRAY_SIZE(tuner_fm1216me_mk3_pal_ranges),
 		.config = 0x8e,
+		.cb_first_if_lower_freq = 1,
 	},
 };
 
@@ -670,6 +674,7 @@ static struct tuner_params tuner_fm1236_
 		.ranges = tuner_fm1236_mk3_ntsc_ranges,
 		.count  = ARRAY_SIZE(tuner_fm1236_mk3_ntsc_ranges),
 		.config = 0x8e,
+		.cb_first_if_lower_freq = 1,
 	},
 };
 
@@ -784,6 +789,7 @@ static struct tuner_params tuner_tcl_200
 		.ranges = tuner_tcl_2002n_ntsc_ranges,
 		.count  = ARRAY_SIZE(tuner_tcl_2002n_ntsc_ranges),
 		.config = 0x8e,
+		.cb_first_if_lower_freq = 1,
 	},
 };
 
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 5dbd7c1..cd2c447 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -306,6 +306,7 @@ static const char *v4l2_int_ioctls[] = {
 #endif
 	[_IOC_NR(AUDC_SET_RADIO)]              = "AUDC_SET_RADIO",
 	[_IOC_NR(AUDC_SET_INPUT)]              = "AUDC_SET_INPUT",
+	[_IOC_NR(MSP_SET_MATRIX)]              = "MSP_SET_MATRIX",
 
 	[_IOC_NR(TUNER_SET_TYPE_ADDR)]         = "TUNER_SET_TYPE_ADDR",
 	[_IOC_NR(TUNER_SET_STANDBY)]           = "TUNER_SET_STANDBY",
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h
index 7566931..b37d59d 100644
--- a/include/media/tuner-types.h
+++ b/include/media/tuner-types.h
@@ -20,6 +20,24 @@ struct tuner_range {
 struct tuner_params {
 	enum param_type type;
 	unsigned int tda988x;
+	/* Many Philips based tuners have a comment like this in their
+	 * datasheet:
+	 *
+	 *   For channel selection involving band switching, and to ensure
+	 *   smooth tuning to the desired channel without causing
+	 *   unnecessary charge pump action, it is recommended to consider
+	 *   the difference between wanted channel frequency and the
+	 *   current channel frequency.  Unnecessary charge pump action
+	 *   will result in very low tuning voltage which may drive the
+	 *   oscillator to extreme conditions.
+	 *
+	 * Set this flag to 1 if this tuner needs this check.
+	 *
+	 * I tested this for PAL by first setting the TV frequency to
+	 * 203 MHz and then switching to 96.6 MHz FM radio. The result was
+	 * static unless the control byte was sent first.
+	 */
+	unsigned int cb_first_if_lower_freq:1;
 	unsigned char config; /* to be moved into struct tuner_range for dvb-pll merge */
 
 	unsigned int count;
diff --git a/include/media/tuner.h b/include/media/tuner.h
index a1d6378..a5beeac 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -179,7 +179,9 @@ struct tuner {
 	unsigned int mode;
 	unsigned int mode_mask;	/* Combination of allowable modes */
 
-	unsigned int freq;	/* keep track of the current settings */
+	unsigned int tv_freq;	/* keep track of the current settings */
+	unsigned int radio_freq;
+	u16 	     last_div;
 	unsigned int audmode;
 	v4l2_std_id  std;
 
@@ -197,8 +199,8 @@ struct tuner {
 	unsigned int sgIF;
 
 	/* function ptrs */
-	void (*tv_freq)(struct i2c_client *c, unsigned int freq);
-	void (*radio_freq)(struct i2c_client *c, unsigned int freq);
+	void (*set_tv_freq)(struct i2c_client *c, unsigned int freq);
+	void (*set_radio_freq)(struct i2c_client *c, unsigned int freq);
 	int  (*has_signal)(struct i2c_client *c);
 	int  (*is_stereo)(struct i2c_client *c);
 	void (*standby)(struct i2c_client *c);
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index c74052a..d4030a7 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -120,6 +120,13 @@ enum v4l2_chip_ident {
 /* select from TV,radio,extern,MUTE */
 #define AUDC_SET_INPUT        _IOW('d',89,int)
 
+/* msp3400 ioctl: will be removed in the near future */
+struct msp_matrix {
+  int input;
+  int output;
+};
+#define MSP_SET_MATRIX     _IOW('m',17,struct msp_matrix)
+
 /* tuner ioctls */
 /* Sets tuner type and its I2C addr */
 #define TUNER_SET_TYPE_ADDR          _IOW('d',90,int)


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 20/25] Return -EINVAL for unknown commands in msp3400 module.
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (17 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 18/25] Move tda988x options into tuner_params struct mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 19/25] Separate tv & radio freqs, fix cb/freq transmit order for tuners that need this mchehab
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Hans Verkuil,
	Mauro Carvalho Chehab


From: Hans Verkuil <hverkuil@xs4all.nl>

- Return -EINVAL for unknown commands.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/msp3400-driver.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index 09ff25b..69ed369 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -1031,8 +1031,8 @@ static int msp_command(struct i2c_client
 	}
 
 	default:
-		/* nothing */
-		break;
+		/* unknown */
+		return -EINVAL;
 	}
 	return 0;
 }


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 21/25] fix some sound quality & distortion problems.
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (19 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 19/25] Separate tv & radio freqs, fix cb/freq transmit order for tuners that need this mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 22/25] clean up some comments mchehab
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Ricardo Cerqueira,
	Michael Krufky, Mauro Carvalho Chehab


From: Ricardo Cerqueira <v4l@cerqueira.org>

- Fix some sound quality & distortion problems.

Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/cx88/cx88-alsa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index e649f67..a2e36a1 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -333,10 +333,10 @@ static snd_pcm_hardware_t snd_cx88_digit
 	.channels_min = 1,
 	.channels_max = 2,
 	.buffer_bytes_max = (2*2048),
-	.period_bytes_min = 256,
+	.period_bytes_min = 2048,
 	.period_bytes_max = 2048,
 	.periods_min = 2,
-	.periods_max = 16,
+	.periods_max = 2,
 };
 
 /*


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 23/25] tuner_params->tda988x is currently unused, so disable
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (22 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 24/25] Samsung TBMV30111IN has 6 entries mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 25/25] Added remote control support for pinnacle pctv mchehab
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Michael Krufky,
	Mauro Carvalho Chehab


From: Michael Krufky <mkrufky@m1k.net>

- Tuner_params->tda988x is unused right now, so let's disable it for 2.6.16
- This is currently happening at the card level, but the plan
  is to move this configuration into the tuner_params configuration.

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 include/media/tuner-types.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h
index 9f0e9c1..15821ab 100644
--- a/include/media/tuner-types.h
+++ b/include/media/tuner-types.h
@@ -19,7 +19,6 @@ struct tuner_range {
 
 struct tuner_params {
 	enum param_type type;
-	unsigned int tda988x;
 	/* Many Philips based tuners have a comment like this in their
 	 * datasheet:
 	 *
@@ -31,7 +30,7 @@ struct tuner_params {
 	 *   will result in very low tuning voltage which may drive the
 	 *   oscillator to extreme conditions.
 	 *
-	 * Set cb_first_if_lower_freq to 1, if this check is 
+	 * Set cb_first_if_lower_freq to 1, if this check is
 	 * required for this tuner.
 	 *
 	 * I tested this for PAL by first setting the TV frequency to


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 24/25] Samsung TBMV30111IN has 6 entries
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (21 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 22/25] clean up some comments mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 23/25] tuner_params->tda988x is currently unused, so disable mchehab
  2006-01-16  9:11 ` [PATCH 25/25] Added remote control support for pinnacle pctv mchehab
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Michael Krufky,
	Mauro Carvalho Chehab


From: Michael Krufky <mkrufky@m1k.net>

- Samsung TBMV30111IN has 6 entries

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/dvb/frontends/dvb-pll.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 757075f..1b9934e 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -333,7 +333,7 @@ struct dvb_pll_desc dvb_pll_tbmv30111in 
 	.name = "Samsung TBMV30111IN",
 	.min = 54000000,
 	.max = 860000000,
-	.count = 4,
+	.count = 6,
 	.entries = {
 		{ 172000000, 44000000, 166666, 0xb4, 0x01 },
 		{ 214000000, 44000000, 166666, 0xb4, 0x02 },


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 22/25] clean up some comments
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (20 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 21/25] fix some sound quality & distortion problems mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-16  9:11 ` [PATCH 24/25] Samsung TBMV30111IN has 6 entries mchehab
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Michael Krufky,
	Mauro Carvalho Chehab


From: Michael Krufky <mkrufky@m1k.net>

- clean up some comments

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 include/media/tuner-types.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h
index b37d59d..9f0e9c1 100644
--- a/include/media/tuner-types.h
+++ b/include/media/tuner-types.h
@@ -31,7 +31,8 @@ struct tuner_params {
 	 *   will result in very low tuning voltage which may drive the
 	 *   oscillator to extreme conditions.
 	 *
-	 * Set this flag to 1 if this tuner needs this check.
+	 * Set cb_first_if_lower_freq to 1, if this check is 
+	 * required for this tuner.
 	 *
 	 * I tested this for PAL by first setting the TV frequency to
 	 * 203 MHz and then switching to 96.6 MHz FM radio. The result was


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 25/25] Added remote control support for pinnacle pctv
  2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
                   ` (23 preceding siblings ...)
  2006-01-16  9:11 ` [PATCH 23/25] tuner_params->tda988x is currently unused, so disable mchehab
@ 2006-01-16  9:11 ` mchehab
  2006-01-17 20:58   ` victorhom
  24 siblings, 1 reply; 29+ messages in thread
From: mchehab @ 2006-01-16  9:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-dvb-maintainer, video4linux-list, akpm, Markus Rechberger,
	Michael Krufky, Mauro Carvalho Chehab


From: Markus Rechberger <mrechberger@gmail.com>

- Added remote control support for pinnacle pctv

Signed-off-by: Markus Rechberger <mrechberger@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/em28xx/em28xx-input.c |   77 +++++++++++++++++++++++++++++
 1 files changed, 77 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index 9b94f77..30dfa53 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -76,6 +76,58 @@ static IR_KEYTAB_TYPE ir_codes_em_terrat
 	[ 0x40 ] = KEY_ZOOM,
 };
 
+static IR_KEYTAB_TYPE ir_codes_em_pinnacle_usb[IR_KEYTAB_SIZE] = {
+	[ 0x3a ] = KEY_KP0,
+	[ 0x31 ] = KEY_KP1,
+	[ 0x32 ] = KEY_KP2,
+	[ 0x33 ] = KEY_KP3,
+	[ 0x34 ] = KEY_KP4,
+	[ 0x35 ] = KEY_KP5,
+	[ 0x36 ] = KEY_KP6,
+	[ 0x37 ] = KEY_KP7,
+	[ 0x38 ] = KEY_KP8,
+	[ 0x39 ] = KEY_KP9,
+
+	[ 0x2f ] = KEY_POWER,
+
+	[ 0x2e ] = KEY_P,
+	[ 0x1f ] = KEY_L,
+	[ 0x2b ] = KEY_I,
+
+	[ 0x2d ] = KEY_ZOOM,
+	[ 0x1e ] = KEY_ZOOM,
+	[ 0x1b ] = KEY_VOLUMEUP,
+	[ 0x0f ] = KEY_VOLUMEDOWN,
+	[ 0x17 ] = KEY_CHANNELUP,
+	[ 0x1c ] = KEY_CHANNELDOWN,
+	[ 0x25 ] = KEY_INFO,
+
+	[ 0x3c ] = KEY_MUTE,
+
+	[ 0x3d ] = KEY_LEFT,
+	[ 0x3b ] = KEY_RIGHT,
+
+	[ 0x3f ] = KEY_UP,
+	[ 0x3e ] = KEY_DOWN,
+	[ 0x1a ] = KEY_PAUSE,
+
+	[ 0x1d ] = KEY_MENU,
+	[ 0x19 ] = KEY_PLAY,
+	[ 0x16 ] = KEY_REWIND,
+	[ 0x13 ] = KEY_FORWARD,
+	[ 0x15 ] = KEY_PAUSE,
+	[ 0x0e ] = KEY_REWIND,
+	[ 0x0d ] = KEY_PLAY,
+	[ 0x0b ] = KEY_STOP,
+	[ 0x07 ] = KEY_FORWARD,
+	[ 0x27 ] = KEY_RECORD,
+	[ 0x26 ] = KEY_TUNER,
+	[ 0x29 ] = KEY_TEXT,
+	[ 0x2a ] = KEY_MEDIA,
+	[ 0x18 ] = KEY_EPG,
+	[ 0x27 ] = KEY_RECORD,
+};
+
 /* ----------------------------------------------------------------------- */
 
 static int get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
@@ -138,6 +190,28 @@ static int get_key_em_haup(struct IR_i2c
 	return 1;
 }
 
+static int get_key_pinnacle_usb(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
+{
+	unsigned char buf[3];
+
+	/* poll IR chip */
+
+	if (3 != i2c_master_recv(&ir->c,buf,3)) {
+		dprintk("read error\n");
+		return -EIO;
+	}
+
+	dprintk("key %02x\n", buf[2]&0x3f);
+	if (buf[0]!=0x00){
+		return 0;
+	}
+
+	*ir_key = buf[2]&0x3f;
+	*ir_raw = buf[2]&0x3f;
+
+	return 1;
+}
+
 /* ----------------------------------------------------------------------- */
 void em28xx_set_ir(struct em28xx * dev,struct IR_i2c *ir)
 {
@@ -159,6 +233,9 @@ void em28xx_set_ir(struct em28xx * dev,s
 		snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM28XX Terratec)");
 		break;
 	case (EM2820_BOARD_PINNACLE_USB_2):
+		ir->ir_codes = ir_codes_em_pinnacle_usb;
+		ir->get_key = get_key_pinnacle_usb;
+		snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM28XX Pinnacle PCTV)");
 		break;
 	case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
 		ir->ir_codes = ir_codes_hauppauge_new;


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH 13/25] cx88 Kconfig fixes for cx88-alsa
  2006-01-16  9:11 ` [PATCH 13/25] cx88 Kconfig fixes for cx88-alsa mchehab
@ 2006-01-16 21:10   ` Adrian Bunk
  0 siblings, 0 replies; 29+ messages in thread
From: Adrian Bunk @ 2006-01-16 21:10 UTC (permalink / raw)
  To: mchehab; +Cc: linux-kernel, linux-dvb-maintainer, video4linux-list, akpm

On Mon, Jan 16, 2006 at 07:11:22AM -0200, mchehab@infradead.org wrote:
> 
> From: Mauro Carvalho Chehab <mchehab@infradead.org>
> 
> - Cx88 alsa is experimental.
> - Removed need of PCM OSS for an ALSA module.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
> ---
> 
>  drivers/media/video/cx88/Kconfig |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig
> index 76fcb4e..5330891 100644
> --- a/drivers/media/video/cx88/Kconfig
> +++ b/drivers/media/video/cx88/Kconfig
> @@ -31,8 +31,7 @@ config VIDEO_CX88_DVB
>  
>  config VIDEO_CX88_ALSA
>  	tristate "ALSA DMA audio support"
> -	depends on VIDEO_CX88 && SND
> -	select SND_PCM_OSS
> +	depends on VIDEO_CX88 && SND && EXPERIMENTAL
>  	---help---
>  	  This is a video4linux driver for direct (DMA) audio on
>  	  Conexant 2388x based TV cards.

This patch introduces a bug.

While select'ing SND_PCM_OSS isn't required, SND_PCM must be select'ed.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 25/25] Added remote control support for pinnacle pctv
  2006-01-17 20:58   ` victorhom
@ 2006-01-17 18:22     ` Markus Rechberger
  0 siblings, 0 replies; 29+ messages in thread
From: Markus Rechberger @ 2006-01-17 18:22 UTC (permalink / raw)
  To: homchenko, Linux and Kernel Video; +Cc: Video4linux-list, linux-kernel

Hi,

what kernel version do you use?
cat /proc/version

could you try to load the module with i2c_debug=2 and press several buttons.
Finally send me the logfile (no need to send it to the list).

Markus


On 1/17/06, victorhom <homchenko@ixx.ru> wrote:
> mchehab@infradead.org wrote
> >
> > From: Markus Rechberger <mrechberger@gmail.com>
> >
> Hi, Markus!
>
> Remote control is not working, sorry :(
>
> # cat /etc/modprobe.d/tv
> options em28xx tuner=63 ir_debug=1 i2c_scan=1 i2c_debug=1
> options tuner secam=d pal=d
>
> # modprobe em28xx
> # modprobe ir-kbd-i2c
> # dmesg
>
> tveeprom: module not supported by Novell, setting U taint flag.
> ir_common: module not supported by Novell, setting U taint flag.
> em28xx: module not supported by Novell, setting U taint flag.
> em28xx v4l2 driver version 0.0.1 loaded
> em28xx new video device (2304:0208): interface 0, class 255
> em28xx: Alternate settings: 8
> em28xx: Alternate setting 0, max size= 0
> em28xx: Alternate setting 1, max size= 1024
> em28xx: Alternate setting 2, max size= 1448
> em28xx: Alternate setting 3, max size= 2048
> em28xx: Alternate setting 4, max size= 2304
> em28xx: Alternate setting 5, max size= 2580
> em28xx: Alternate setting 6, max size= 2892
> em28xx: Alternate setting 7, max size= 3072
> saa711x: module not supported by Novell, setting U taint flag.
> saa711x: Ignoring new-style parameters in presence of obsolete ones
> tuner: module not supported by Novell, setting U taint flag.
> tda9887: module not supported by Novell, setting U taint flag.
> attach_inform: saa7113 detected.
> tuner 0-0063: chip found @ 0xc6 (em28xx #0)
> attach inform: detected I2C address c6
> tuner 0-0063: type set to 63 (Philips FMD1216ME MK3 Hybrid Tuner)
> tda9887 0-0043: chip found @ 0x86 (em28xx #0)
> em28xx #0: i2c eeprom 00: 1a eb 67 95 04 23 08 02 10 00 1e 03 98 2a 6a 2e
> em28xx #0: i2c eeprom 10: 00 00 06 57 6e 00 00 00 8e 00 00 00 07 00 00 00
> em28xx #0: i2c eeprom 20: 16 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
> em28xx #0: i2c eeprom 30: 00 00 20 40 20 80 02 20 10 01 00 00 00 00 00 00
> em28xx #0: i2c eeprom 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> em28xx #0: i2c eeprom 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> em28xx #0: i2c eeprom 60: 00 00 00 00 00 00 00 00 00 00 2e 03 50 00 69 00
> em28xx #0: i2c eeprom 70: 6e 00 6e 00 61 00 63 00 6c 00 65 00 20 00 53 00
> em28xx #0: i2c eeprom 80: 79 00 73 00 74 00 65 00 6d 00 73 00 20 00 47 00
> em28xx #0: i2c eeprom 90: 6d 00 62 00 48 00 00 00 2a 03 50 00 43 00 54 00
> em28xx #0: i2c eeprom a0: 56 00 20 00 55 00 53 00 42 00 32 00 20 00 50 00
> em28xx #0: i2c eeprom b0: 41 00 4c 00 2f 00 53 00 45 00 43 00 41 00 4d 00
> em28xx #0: i2c eeprom c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> em28xx #0: i2c eeprom d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> em28xx #0: i2c eeprom e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> em28xx #0: i2c eeprom f0: 00 00 00 00 00 00 00 00 0c 22 17 38 02 90 2b 3e
> EEPROM ID= 0x9567eb1a
> Vendor/Product ID= 2304:0208
> AC97 audio (5 sample rates)
> 500mA max power
> Table at 0x06, strings=0x2a98, 0x2e6a, 0x0000
> em28xx #0: found i2c device @ 0x4a [saa7113h]
> em28xx #0: found i2c device @ 0x86 [tda9887]
> em28xx #0: found i2c device @ 0x8e [remote IR sensor]
> em28xx #0: found i2c device @ 0xa0 [eeprom]
> em28xx #0: found i2c device @ 0xc6 [tuner (analog)]
> em28xx #0: V4L2 device registered as /dev/video0
> em28xx #0: Found Pinnacle PCTV USB 2
> usbcore: registered new driver em28xx
> ir_kbd_i2c: module not supported by Novell, setting U taint flag.
> attach_inform: IR detected ().
> ir-kbd-i2c: i2c IR (EM28XX Pinnacle PCTV) detected at i2c-0/0-0047/ir0
> [em28xx #0]
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 00
> i2c IR (EM28XX Pinnacle PCTV): unknown key: key=0x00 raw=0x00 down=1
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV): unknown key: key=0x00 raw=0x00 down=0
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> ...
> ...
>
> >From /var/log/messages:
>
> Jan 17 23:51:30 6-199 kernel: i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
> Jan 17 23:52:01 6-199 last message repeated 301 times
> Jan 17 23:53:02 6-199 last message repeated 610 times
> Jan 17 23:54:03 6-199 last message repeated 609 times
> Jan 17 23:55:04 6-199 last message repeated 610 times
> ...
>
> These 'key 3f' are received without touching any bytton on the remote.
> Pressing any key some times sometimes ( sorry my english :) turn a key UP
> (3f from your table).
>
> That's all.
>
> --
> Victor Homchenko
>
> --
> video4linux-list mailing list
> Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/video4linux-list
>


--
Markus Rechberger

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 25/25] Added remote control support for pinnacle pctv
  2006-01-16  9:11 ` [PATCH 25/25] Added remote control support for pinnacle pctv mchehab
@ 2006-01-17 20:58   ` victorhom
  2006-01-17 18:22     ` Markus Rechberger
  0 siblings, 1 reply; 29+ messages in thread
From: victorhom @ 2006-01-17 20:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Video4linux-list

mchehab@infradead.org wrote
> 
> From: Markus Rechberger <mrechberger@gmail.com>
> 
Hi, Markus!

Remote control is not working, sorry :(

# cat /etc/modprobe.d/tv
options em28xx tuner=63 ir_debug=1 i2c_scan=1 i2c_debug=1
options tuner secam=d pal=d

# modprobe em28xx
# modprobe ir-kbd-i2c
# dmesg

tveeprom: module not supported by Novell, setting U taint flag.
ir_common: module not supported by Novell, setting U taint flag.
em28xx: module not supported by Novell, setting U taint flag.
em28xx v4l2 driver version 0.0.1 loaded
em28xx new video device (2304:0208): interface 0, class 255
em28xx: Alternate settings: 8
em28xx: Alternate setting 0, max size= 0
em28xx: Alternate setting 1, max size= 1024
em28xx: Alternate setting 2, max size= 1448
em28xx: Alternate setting 3, max size= 2048
em28xx: Alternate setting 4, max size= 2304
em28xx: Alternate setting 5, max size= 2580
em28xx: Alternate setting 6, max size= 2892
em28xx: Alternate setting 7, max size= 3072
saa711x: module not supported by Novell, setting U taint flag.
saa711x: Ignoring new-style parameters in presence of obsolete ones
tuner: module not supported by Novell, setting U taint flag.
tda9887: module not supported by Novell, setting U taint flag.
attach_inform: saa7113 detected.
tuner 0-0063: chip found @ 0xc6 (em28xx #0)
attach inform: detected I2C address c6
tuner 0-0063: type set to 63 (Philips FMD1216ME MK3 Hybrid Tuner)
tda9887 0-0043: chip found @ 0x86 (em28xx #0)
em28xx #0: i2c eeprom 00: 1a eb 67 95 04 23 08 02 10 00 1e 03 98 2a 6a 2e
em28xx #0: i2c eeprom 10: 00 00 06 57 6e 00 00 00 8e 00 00 00 07 00 00 00
em28xx #0: i2c eeprom 20: 16 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
em28xx #0: i2c eeprom 30: 00 00 20 40 20 80 02 20 10 01 00 00 00 00 00 00
em28xx #0: i2c eeprom 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
em28xx #0: i2c eeprom 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
em28xx #0: i2c eeprom 60: 00 00 00 00 00 00 00 00 00 00 2e 03 50 00 69 00
em28xx #0: i2c eeprom 70: 6e 00 6e 00 61 00 63 00 6c 00 65 00 20 00 53 00
em28xx #0: i2c eeprom 80: 79 00 73 00 74 00 65 00 6d 00 73 00 20 00 47 00
em28xx #0: i2c eeprom 90: 6d 00 62 00 48 00 00 00 2a 03 50 00 43 00 54 00
em28xx #0: i2c eeprom a0: 56 00 20 00 55 00 53 00 42 00 32 00 20 00 50 00
em28xx #0: i2c eeprom b0: 41 00 4c 00 2f 00 53 00 45 00 43 00 41 00 4d 00
em28xx #0: i2c eeprom c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
em28xx #0: i2c eeprom d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
em28xx #0: i2c eeprom e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
em28xx #0: i2c eeprom f0: 00 00 00 00 00 00 00 00 0c 22 17 38 02 90 2b 3e
EEPROM ID= 0x9567eb1a
Vendor/Product ID= 2304:0208
AC97 audio (5 sample rates)
500mA max power
Table at 0x06, strings=0x2a98, 0x2e6a, 0x0000
em28xx #0: found i2c device @ 0x4a [saa7113h]
em28xx #0: found i2c device @ 0x86 [tda9887]
em28xx #0: found i2c device @ 0x8e [remote IR sensor]
em28xx #0: found i2c device @ 0xa0 [eeprom]
em28xx #0: found i2c device @ 0xc6 [tuner (analog)]
em28xx #0: V4L2 device registered as /dev/video0
em28xx #0: Found Pinnacle PCTV USB 2
usbcore: registered new driver em28xx
ir_kbd_i2c: module not supported by Novell, setting U taint flag.
attach_inform: IR detected ().
ir-kbd-i2c: i2c IR (EM28XX Pinnacle PCTV) detected at i2c-0/0-0047/ir0
[em28xx #0]
i2c IR (EM28XX Pinnacle PCTV)/ir: key 00
i2c IR (EM28XX Pinnacle PCTV): unknown key: key=0x00 raw=0x00 down=1
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV): unknown key: key=0x00 raw=0x00 down=0
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
...
...

>From /var/log/messages:

Jan 17 23:51:30 6-199 kernel: i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
Jan 17 23:52:01 6-199 last message repeated 301 times
Jan 17 23:53:02 6-199 last message repeated 610 times
Jan 17 23:54:03 6-199 last message repeated 609 times
Jan 17 23:55:04 6-199 last message repeated 610 times
...

These 'key 3f' are received without touching any bytton on the remote.
Pressing any key some times sometimes ( sorry my english :) turn a key UP
(3f from your table).

That's all.

-- 
Victor Homchenko


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2006-01-17 18:22 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-16  9:11 [PATCH 00/25] V4L/DVB updates mchehab
2006-01-16  9:11 ` [PATCH 04/25] Include missing MODULE_* macros mchehab
2006-01-16  9:11 ` [PATCH 03/25] removed uneeded init on structs like static int foo=0 mchehab
2006-01-16  9:11 ` [PATCH 01/25] Remove old MODULE_PARM in media/video/ mchehab
2006-01-16  9:11 ` [PATCH 02/25] bttv semaphore to mutex conversion mchehab
2006-01-16  9:11 ` [PATCH 07/25] Redesign tuners struct for maximum flexibility mchehab
2006-01-16  9:11 ` [PATCH 05/25] Build cx88-alsa when CONFIG_VIDEO_CX88_ALSA is selected mchehab
2006-01-16  9:11 ` [PATCH 06/25] Updated MODULE_AUTHOR mchehab
2006-01-16  9:11 ` [PATCH 09/25] disable all dvb tuner param_types until we need them mchehab
2006-01-16  9:11 ` [PATCH 10/25] i2c ids for upd64031a saa717x upd64083 wm8739 mchehab
2006-01-16  9:11 ` [PATCH 11/25] Turn frame locked sound on, basic support for FM radio with TDA8275(a) mchehab
2006-01-16  9:11 ` [PATCH 08/25] Add support for Samsung tuner TCPN 2121P30A mchehab
2006-01-16  9:11 ` [PATCH 14/25] make some code static mchehab
2006-01-16  9:11 ` [PATCH 12/25] git dvb callbacks fix mchehab
2006-01-16  9:11 ` [PATCH 13/25] cx88 Kconfig fixes for cx88-alsa mchehab
2006-01-16 21:10   ` Adrian Bunk
2006-01-16  9:11 ` [PATCH 16/25] Semaphore to mutex conversion on drivers/media mchehab
2006-01-16  9:11 ` [PATCH 15/25] Fix for lack of analog output on some cx88 boards mchehab
2006-01-16  9:11 ` [PATCH 17/25] Fix compilation with Alpha mchehab
2006-01-16  9:11 ` [PATCH 18/25] Move tda988x options into tuner_params struct mchehab
2006-01-16  9:11 ` [PATCH 20/25] Return -EINVAL for unknown commands in msp3400 module mchehab
2006-01-16  9:11 ` [PATCH 19/25] Separate tv & radio freqs, fix cb/freq transmit order for tuners that need this mchehab
2006-01-16  9:11 ` [PATCH 21/25] fix some sound quality & distortion problems mchehab
2006-01-16  9:11 ` [PATCH 22/25] clean up some comments mchehab
2006-01-16  9:11 ` [PATCH 24/25] Samsung TBMV30111IN has 6 entries mchehab
2006-01-16  9:11 ` [PATCH 23/25] tuner_params->tda988x is currently unused, so disable mchehab
2006-01-16  9:11 ` [PATCH 25/25] Added remote control support for pinnacle pctv mchehab
2006-01-17 20:58   ` victorhom
2006-01-17 18:22     ` Markus Rechberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).