From 0180bf32793f9fadf3b541ebb43d770e5c9d0274 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 26 Oct 2007 00:11:17 -0300 Subject: [PATCH 01/26] V4L/DVB (6390): Updates missing entries at CARDLIST.em28xx Signed-off-by: Mauro Carvalho Chehab --- Documentation/video4linux/CARDLIST.em28xx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index a3026689bbe..37f0e3cedf4 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx @@ -8,4 +8,7 @@ 7 -> Leadtek Winfast USB II (em2800) 8 -> Kworld USB2800 (em2800) 9 -> Pinnacle Dazzle DVC 90 (em2820/em2840) [2304:0207] + 10 -> Hauppauge WinTV HVR 900 (em2880) + 11 -> Terratec Hybrid XS (em2880) 12 -> Kworld PVR TV 2800 RF (em2820/em2840) + 13 -> Terratec Prodigy XS (em2880) From 35378434e739ac869d0146a47133a0f9d6fd2ee8 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Mon, 22 Oct 2007 17:44:54 -0300 Subject: [PATCH 02/26] V4L/DVB (6391): bttv: SPICT ioctl doesn't work with vlc The bttv driver instists that the depth specified in the call to VIDIOCSPICT match the pixel format specified in the same call. vlc doesn't set the depth field, which makes the SPICT ioctl always fail. The V4L1 standard is not clear on how most operation are supposed to work, and this is no exception. The depth field would appear to be entirely redundant, as the pixel format specifies a specific depth. It could be that this field was only meant for output from the *G*PICT ioctl and should be ignored in *S*PICT. This is in fact what the v4l1-compat wrapper does. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/bt8xx/bttv-driver.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 9feeb636ff9..56e43506fe1 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -2881,10 +2881,6 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, if (NULL == fmt) return -EINVAL; mutex_lock(&fh->cap.lock); - if (fmt->depth != pic->depth) { - retval = -EINVAL; - goto fh_unlock_and_return; - } if (fmt->flags & FORMAT_FLAGS_RAW) { /* VIDIOCMCAPTURE uses gbufsize, not RAW_BPL * RAW_LINES * 2. F1 is stored at offset 0, F2 From a8ab68bffe3fe7b8e9ff963ea321d283fc77ac5f Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Mon, 22 Oct 2007 17:44:55 -0300 Subject: [PATCH 03/26] V4L/DVB (6392): bttv: Update initial image size when set via V4L1 VIDIOCMCAPTURE The V4L1 spec says that the image size should be with with VIDIOCSWIN before requesting buffers with VIDIOCGMBUF and capturing into them with VIDIOCMCAPTURE. But it seems that many apps don't do this. They set the size using the fields in the VIDIOCMCAPTURE ioctl. The driver doesn't know what size to capture until it actually starts to capture. In particular, it doesn't know what size to capture until it has already mmap the captured buffers. Which is quite stupid. Why V4L1 has size and format fields for VIDIOCMCAPTURE I have no idea. Many drivers don't support this, including those using v4l1-compat. The bttv does, which is probably the only reason such broken software is so prevalent. But, the driver doesn't adjust its idea of what size is being captured when it is set this way. If you try to query the driver's current setting with v4l2-ctl, it won't be correct. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/bt8xx/bttv-driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 56e43506fe1..a88b56e6ca0 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -3113,6 +3113,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, vm->width,vm->height,field); if (0 != retval) goto fh_unlock_and_return; + btv->init.width = vm->width; + btv->init.height = vm->height; spin_lock_irqsave(&btv->s_lock,flags); buffer_queue(&fh->cap,&buf->vb); spin_unlock_irqrestore(&btv->s_lock,flags); From c303449741279fc9a108c80e0816f0c4ddca8c09 Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Tue, 23 Oct 2007 17:30:27 -0300 Subject: [PATCH 04/26] V4L/DVB (6394): Fix a cafe_ccic resume bug If the system is suspended while the camera is streaming, it will not continue streaming on resume. Save the state properly so that resume works. Signed-off-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cafe_ccic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c index b63cab33692..2567da7b09e 100644 --- a/drivers/media/video/cafe_ccic.c +++ b/drivers/media/video/cafe_ccic.c @@ -2232,13 +2232,16 @@ static int cafe_pci_suspend(struct pci_dev *pdev, pm_message_t state) { struct cafe_camera *cam = cafe_find_by_pdev(pdev); int ret; + enum cafe_state cstate; ret = pci_save_state(pdev); if (ret) return ret; + cstate = cam->state; /* HACK - stop_dma sets to idle */ cafe_ctlr_stop_dma(cam); cafe_ctlr_power_down(cam); pci_disable_device(pdev); + cam->state = cstate; return 0; } From bb8d56a4d8cad90825db0c12b55d66fde91dfa44 Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Tue, 23 Oct 2007 17:31:36 -0300 Subject: [PATCH 05/26] V4L/DVB (6395): cafe_ccic: Add a pointer to the data sheet Add a pointer to the (recently posted) Cafe data sheet. Signed-off-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cafe_ccic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c index 2567da7b09e..7ae499c9c54 100644 --- a/drivers/media/video/cafe_ccic.c +++ b/drivers/media/video/cafe_ccic.c @@ -3,6 +3,9 @@ * multifunction chip. Currently works with the Omnivision OV7670 * sensor. * + * The data sheet for this device can be found at: + * http://www.marvell.com/products/pcconn/88ALP01.jsp + * * Copyright 2006 One Laptop Per Child Association, Inc. * Copyright 2006-7 Jonathan Corbet * From dd7d5013cdad2efe7ddbb3f77728cfe0ce295e5b Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Wed, 24 Oct 2007 21:05:51 -0300 Subject: [PATCH 06/26] V4L/DVB (6402): s5h1409: Fix broken QAM support This patch enables QAM Annex-B support (US digital cable) for the s5h1409 VSB/QAM demodulator. Tested successfully with the mt2131 tuner, present on the following supported boards: Hauppauge WinTV-HVR-1250 Hauppauge WinTV-HVR-1800 Hauppauge WinTV-HVR-1800lp This patch is also known to work with an upcoming XC5000 tuner driver. Signed-off-by: Steven Toth Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/s5h1409.c | 96 ++++++++++++++++++++++++--- 1 file changed, 86 insertions(+), 10 deletions(-) diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c index 30e8a705fad..8dee7ec9456 100644 --- a/drivers/media/dvb/frontends/s5h1409.c +++ b/drivers/media/dvb/frontends/s5h1409.c @@ -42,6 +42,9 @@ struct s5h1409_state { fe_modulation_t current_modulation; u32 current_frequency; + + u32 is_qam_locked; + u32 qam_state; }; static int debug = 0; @@ -94,6 +97,7 @@ static struct init_tab { { 0xac, 0x1003, }, { 0xad, 0x103f, }, { 0xe2, 0x0100, }, + { 0xe3, 0x0000, }, { 0x28, 0x1010, }, { 0xb1, 0x000e, }, }; @@ -335,6 +339,8 @@ static int s5h1409_softreset(struct dvb_frontend* fe) s5h1409_writereg(state, 0xf5, 0); s5h1409_writereg(state, 0xf5, 1); + state->is_qam_locked = 0; + state->qam_state = 0; return 0; } @@ -349,6 +355,11 @@ static int s5h1409_set_if_freq(struct dvb_frontend* fe, int KHz) s5h1409_writereg(state, 0x87, 0x01be); s5h1409_writereg(state, 0x88, 0x0436); s5h1409_writereg(state, 0x89, 0x054d); + } else + if (KHz == 4000) { + s5h1409_writereg(state, 0x87, 0x014b); + s5h1409_writereg(state, 0x88, 0x0cb5); + s5h1409_writereg(state, 0x89, 0x03e2); } else { printk("%s() Invalid arg = %d KHz\n", __FUNCTION__, KHz); ret = -1; @@ -361,7 +372,7 @@ static int s5h1409_set_spectralinversion(struct dvb_frontend* fe, int inverted) { struct s5h1409_state* state = fe->demodulator_priv; - dprintk("%s()\n", __FUNCTION__); + dprintk("%s(%d)\n", __FUNCTION__, inverted); if(inverted == 1) return s5h1409_writereg(state, 0x1b, 0x1101); /* Inverted */ @@ -382,14 +393,10 @@ static int s5h1409_enable_modulation(struct dvb_frontend* fe, s5h1409_writereg(state, 0xf4, 0); break; case QAM_64: - dprintk("%s() QAM_64\n", __FUNCTION__); - s5h1409_writereg(state, 0xf4, 1); - s5h1409_writereg(state, 0x85, 0x100); - break; case QAM_256: - dprintk("%s() QAM_256\n", __FUNCTION__); + dprintk("%s() QAM_AUTO (64/256)\n", __FUNCTION__); s5h1409_writereg(state, 0xf4, 1); - s5h1409_writereg(state, 0x85, 0x101); + s5h1409_writereg(state, 0x85, 0x110); break; default: dprintk("%s() Invalid modulation\n", __FUNCTION__); @@ -423,7 +430,7 @@ static int s5h1409_set_gpio(struct dvb_frontend* fe, int enable) if (enable) return s5h1409_writereg(state, 0xe3, 0x1100); else - return s5h1409_writereg(state, 0xe3, 0); + return s5h1409_writereg(state, 0xe3, 0x1000); } static int s5h1409_sleep(struct dvb_frontend* fe, int enable) @@ -444,6 +451,66 @@ static int s5h1409_register_reset(struct dvb_frontend* fe) return s5h1409_writereg(state, 0xfa, 0); } +static void s5h1409_set_qam_amhum_mode(struct dvb_frontend *fe) +{ + struct s5h1409_state *state = fe->demodulator_priv; + u16 reg; + + if (state->is_qam_locked) + return; + + /* QAM EQ lock check */ + reg = s5h1409_readreg(state, 0xf0); + + if ((reg >> 13) & 0x1) { + + state->is_qam_locked = 1; + reg &= 0xff; + + s5h1409_writereg(state, 0x96, 0x00c); + if ((reg < 0x38) || (reg > 0x68) ) { + s5h1409_writereg(state, 0x93, 0x3332); + s5h1409_writereg(state, 0x9e, 0x2c37); + } else { + s5h1409_writereg(state, 0x93, 0x3130); + s5h1409_writereg(state, 0x9e, 0x2836); + } + + } else { + s5h1409_writereg(state, 0x96, 0x0008); + s5h1409_writereg(state, 0x93, 0x3332); + s5h1409_writereg(state, 0x9e, 0x2c37); + } +} + +static void s5h1409_set_qam_interleave_mode(struct dvb_frontend *fe) +{ + struct s5h1409_state *state = fe->demodulator_priv; + u16 reg, reg1, reg2; + + reg = s5h1409_readreg(state, 0xf1); + + /* Master lock */ + if ((reg >> 15) & 0x1) { + if (state->qam_state != 2) { + state->qam_state = 2; + reg1 = s5h1409_readreg(state, 0xb2); + reg2 = s5h1409_readreg(state, 0xad); + + s5h1409_writereg(state, 0x96, 0x20); + s5h1409_writereg(state, 0xad, + ( ((reg1 & 0xf000) >> 4) | (reg2 & 0xf0ff)) ); + s5h1409_writereg(state, 0xab, 0x1100); + } + } else { + if (state->qam_state != 1) { + state->qam_state = 1; + s5h1409_writereg(state, 0x96, 0x08); + s5h1409_writereg(state, 0xab, 0x1101); + } + } +} + /* Talk to the demod, set the FEC, GUARD, QAM settings etc */ static int s5h1409_set_frontend (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) @@ -458,12 +525,21 @@ static int s5h1409_set_frontend (struct dvb_frontend* fe, s5h1409_enable_modulation(fe, p->u.vsb.modulation); + /* Allow the demod to settle */ + msleep(100); + if (fe->ops.tuner_ops.set_params) { if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); fe->ops.tuner_ops.set_params(fe, p); if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); } + /* Optimize the demod for QAM */ + if (p->u.vsb.modulation != VSB_8) { + s5h1409_set_qam_amhum_mode(fe); + s5h1409_set_qam_interleave_mode(fe); + } + return 0; } @@ -495,8 +571,8 @@ static int s5h1409_init (struct dvb_frontend* fe) s5h1409_set_gpio(fe, state->config->gpio); s5h1409_softreset(fe); - /* Note: Leaving the I2C gate open here. */ - s5h1409_i2c_gate_ctrl(fe, 1); + /* Note: Leaving the I2C gate closed. */ + s5h1409_i2c_gate_ctrl(fe, 0); return 0; } From 195ccf67738f41eae557ba0322b33b15a39fd88f Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Wed, 24 Oct 2007 23:12:58 -0300 Subject: [PATCH 07/26] V4L/DVB (6403): mt2131: replace comma with semicolon fix Semicolon fix. Signed-off-by: Steven Toth Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/mt2131.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb/frontends/mt2131.c b/drivers/media/dvb/frontends/mt2131.c index 4b93931de4e..13cf1666817 100644 --- a/drivers/media/dvb/frontends/mt2131.c +++ b/drivers/media/dvb/frontends/mt2131.c @@ -116,7 +116,7 @@ static int mt2131_set_params(struct dvb_frontend *fe, f_lo1 = (f_lo1 / 250) * 250; f_lo2 = f_lo1 - freq - MT2131_IF2; - priv->frequency = (f_lo1 - f_lo2 - MT2131_IF2) * 1000, + priv->frequency = (f_lo1 - f_lo2 - MT2131_IF2) * 1000; /* Frequency LO1 = 16MHz * (DIV1 + NUM1/8192 ) */ num1 = f_lo1 * 64 / (MT2131_FREF / 128); From 387a299bdd9311fc8532fd8ab5109a35cee510af Mon Sep 17 00:00:00 2001 From: hermann pitton Date: Thu, 25 Oct 2007 21:26:53 -0300 Subject: [PATCH 08/26] V4L/DVB (6406): saa7134: fix analog audio in on medion md8800 quadro saa7134: fix analog audio in on medion md8800 quadro, aka CTX944 Signed-off-by: Hermann Pitton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/saa7134/saa7134-cards.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index a4c192fb4e4..4f3dad9ae6d 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c @@ -2996,11 +2996,11 @@ struct saa7134_board saa7134_boards[] = { },{ .name = name_comp1, .vmux = 0, - .amux = LINE2, + .amux = LINE1, },{ .name = name_svideo, .vmux = 8, - .amux = LINE2, + .amux = LINE1, }}, }, [SAA7134_BOARD_FLYDVBS_LR300] = { From 52c28d4b0a0849f608c1623f97d936a0d7ffbfea Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 26 Oct 2007 09:00:37 -0300 Subject: [PATCH 09/26] V4L/DVB (6407): planb: fix obvious interrupt handling bugs irq handlers have returned a return value for years now... catch up with the times. Also, ditch unneeded prototype. Signed-off-by: Jeff Garzik Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/planb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/video/planb.c b/drivers/media/video/planb.c index ce4b2f9791e..36047d4e70f 100644 --- a/drivers/media/video/planb.c +++ b/drivers/media/video/planb.c @@ -91,7 +91,6 @@ static void planb_close(struct video_device *); static int planb_ioctl(struct video_device *, unsigned int, void *); static int planb_init_done(struct video_device *); static int planb_mmap(struct video_device *, const char *, unsigned long); -static void planb_irq(int, void *); static void release_planb(void); int init_planbs(struct video_init *); @@ -1315,7 +1314,7 @@ cmd_tab_data_end: return c1; } -static void planb_irq(int irq, void *dev_id) +static irqreturn_t planb_irq(int irq, void *dev_id) { unsigned int stat, astat; struct planb *pb = (struct planb *)dev_id; @@ -1358,13 +1357,14 @@ static void planb_irq(int irq, void *dev_id) pb->frame_stat[fr] = GBUFFER_DONE; pb->grabbing--; wake_up_interruptible(&pb->capq); - return; + return IRQ_HANDLED; } /* incorrect interrupts? */ pb->intr_mask = PLANB_CLR_IRQ; out_le32(&pb->planb_base->intr_stat, PLANB_CLR_IRQ); printk(KERN_ERR "PlanB: IRQ lockup, cleared intrrupts" " unconditionally\n"); + return IRQ_HANDLED; } /******************************* @@ -2090,7 +2090,7 @@ static int init_planb(struct planb *pb) /* clear interrupt mask */ pb->intr_mask = PLANB_CLR_IRQ; - result = request_irq(pb->irq, planb_irq, 0, "PlanB", (void *)pb); + result = request_irq(pb->irq, planb_irq, 0, "PlanB", pb); if (result < 0) { if (result==-EINVAL) printk(KERN_ERR "PlanB: Bad irq number (%d) " From 04d934ff84f97970fa59980b0c327422b08cda50 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Wed, 24 Oct 2007 09:06:47 -0300 Subject: [PATCH 10/26] V4L/DVB (6432): tuner: fix CONFIG_TUNER_TEA5761=m This patch fixes CONFIG_TUNER_TEA5761=m broken by commit ca805d57cf5ea7482ed3da28653f30621249ee45. Signed-off-by: Adrian Bunk Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tuner-core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 6a777604f07..9e99f3636d3 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -30,7 +30,7 @@ /* standard i2c insmod options */ static unsigned short normal_i2c[] = { -#ifdef CONFIG_TUNER_TEA5761 +#if defined(CONFIG_TUNER_TEA5761) || (defined(CONFIG_TUNER_TEA5761_MODULE) && defined(MODULE)) 0x10, #endif 0x42, 0x43, 0x4a, 0x4b, /* tda8290 */ @@ -292,7 +292,6 @@ static void set_type(struct i2c_client *c, unsigned int type, } t->mode_mask = T_RADIO; break; -#ifdef CONFIG_TUNER_TEA5761 case TUNER_TEA5761: if (tea5761_attach(&t->fe, t->i2c.adapter, t->i2c.addr) == NULL) { t->type = TUNER_ABSENT; @@ -301,7 +300,6 @@ static void set_type(struct i2c_client *c, unsigned int type, } t->mode_mask = T_RADIO; break; -#endif case TUNER_PHILIPS_FMD1216ME_MK3: buffer[0] = 0x0b; buffer[1] = 0xdc; @@ -594,7 +592,6 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) /* autodetection code based on the i2c addr */ if (!no_autodetect) { switch (addr) { -#ifdef CONFIG_TUNER_TEA5761 case 0x10: if (tea5761_autodetection(t->i2c.adapter, t->i2c.addr) != EINVAL) { t->type = TUNER_TEA5761; @@ -606,7 +603,6 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) goto register_client; } break; -#endif case 0x42: case 0x43: case 0x4a: From 5efeb972942f3bfe2fce2b73db9579484625e270 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Mon, 29 Oct 2007 15:19:50 -0300 Subject: [PATCH 11/26] V4L/DVB (6478): ir-functions use input functions, should depend on INPUT Media ir-functions uses input_(*) functions so it should depend on the INPUT config symbol. drivers/built-in.o: In function `ir_input_key_event': ir-functions.c:(.text+0x10849a): undefined reference to `input_event' ir-functions.c:(.text+0x1084ac): undefined reference to `input_event' Signed-off-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab --- drivers/media/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig index dd9bd4310c8..1604f049040 100644 --- a/drivers/media/Kconfig +++ b/drivers/media/Kconfig @@ -151,6 +151,7 @@ config VIDEO_IR_I2C config VIDEO_IR tristate + depends on INPUT select VIDEO_IR_I2C if I2C config VIDEO_TVEEPROM From cb20630cefb382a360fcc9ea054e597596153f42 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Mon, 29 Oct 2007 15:19:55 -0300 Subject: [PATCH 12/26] V4L/DVB (6479): use input functions, should depend on INPUT All of these drivers select VIDEO_IR, which uses the input subsystem, so they should also depend on INPUT. Problem examples: drivers/built-in.o: In function `ir_input_key_event': ir-functions.c:(.text+0x10849a): undefined reference to `input_event' ir-functions.c:(.text+0x1084ac): undefined reference to `input_event' drivers/built-in.o: In function `saa7134_set_i2c_ir': (.text+0x11cc0a): undefined reference to `get_key_pinnacle_color' drivers/built-in.o: In function `saa7134_set_i2c_ir': (.text+0x11cc4f): undefined reference to `get_key_pinnacle_grey' drivers/built-in.o: In function `saa7134_input_fini': (.text+0x11cd8b): undefined reference to `input_unregister_device' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11d1fa): undefined reference to `input_allocate_device' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11d317): undefined reference to `input_register_device' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11d6ca): undefined reference to `input_free_device' drivers/built-in.o: In function `saa7134_set_i2c_ir': (.text+0x11c3f3): undefined reference to `ir_codes_hauppauge_new' drivers/built-in.o: In function `saa7134_set_i2c_ir': (.text+0x11c450): undefined reference to `ir_codes_pinnacle_color' drivers/built-in.o: In function `saa7134_set_i2c_ir': (.text+0x11c480): undefined reference to `ir_codes_purpletv' drivers/built-in.o: In function `saa7134_set_i2c_ir': (.text+0x11c495): undefined reference to `ir_codes_pinnacle_grey' drivers/built-in.o: In function `saa7134_ir_start': (.text+0x11c622): undefined reference to `ir_rc5_timer_end' drivers/built-in.o: In function `saa7134_ir_start': (.text+0x11c637): undefined reference to `ir_rc5_timer_keyup' drivers/built-in.o: In function `build_key': saa7134-input.c:(.text+0x11c769): undefined reference to `ir_extract_bits' saa7134-input.c:(.text+0x11c7ad): undefined reference to `ir_input_keydown' saa7134-input.c:(.text+0x11c7f0): undefined reference to `ir_input_keydown' saa7134-input.c:(.text+0x11c7f9): undefined reference to `ir_input_nokey' saa7134-input.c:(.text+0x11c806): undefined reference to `ir_input_nokey' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11ca07): undefined reference to `ir_codes_encore_enltv' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11caf6): undefined reference to `ir_input_init' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11cbf2): undefined reference to `ir_codes_avermedia' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11cc24): undefined reference to `ir_codes_pctv_sedna' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11cc53): undefined reference to `ir_codes_flydvb' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11cc85): undefined reference to `ir_codes_videomate_tv_pvr' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11ccb7): undefined reference to `ir_codes_pixelview' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11cce9): undefined reference to `ir_codes_eztv' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11cd1b): undefined reference to `ir_codes_manli' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11cda8): undefined reference to `ir_codes_cinergy' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11cdd7): undefined reference to `ir_codes_flyvideo' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11ce06): undefined reference to `ir_codes_asus_pc39' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11ce7d): undefined reference to `ir_codes_gotview7135' drivers/built-in.o: In function `saa7134_input_init1': (.text+0x11cee1): undefined reference to `ir_codes_proteus_2309' Signed-off-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/Kconfig | 2 +- drivers/media/video/cx23885/Kconfig | 2 +- drivers/media/video/cx88/Kconfig | 2 +- drivers/media/video/em28xx/Kconfig | 2 +- drivers/media/video/saa7134/Kconfig | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig index 6d53289b327..54b91f26ca6 100644 --- a/drivers/media/dvb/ttpci/Kconfig +++ b/drivers/media/dvb/ttpci/Kconfig @@ -84,7 +84,7 @@ config DVB_BUDGET config DVB_BUDGET_CI tristate "Budget cards with onboard CI connector" - depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 + depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 && INPUT select VIDEO_SAA7146 select DVB_STV0297 if !DVB_FE_CUSTOMISE select DVB_STV0299 if !DVB_FE_CUSTOMISE diff --git a/drivers/media/video/cx23885/Kconfig b/drivers/media/video/cx23885/Kconfig index 72004a07b2d..d8b1ccb4491 100644 --- a/drivers/media/video/cx23885/Kconfig +++ b/drivers/media/video/cx23885/Kconfig @@ -1,6 +1,6 @@ config VIDEO_CX23885 tristate "Conexant cx23885 (2388x successor) support" - depends on DVB_CORE && VIDEO_DEV && PCI && I2C + depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT select I2C_ALGOBIT select FW_LOADER select VIDEO_BTCX diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig index eeb5224ca10..ceb31d4a251 100644 --- a/drivers/media/video/cx88/Kconfig +++ b/drivers/media/video/cx88/Kconfig @@ -1,6 +1,6 @@ config VIDEO_CX88 tristate "Conexant 2388x (bt878 successor) support" - depends on VIDEO_DEV && PCI && I2C + depends on VIDEO_DEV && PCI && I2C && INPUT select I2C_ALGOBIT select FW_LOADER select VIDEO_BTCX diff --git a/drivers/media/video/em28xx/Kconfig b/drivers/media/video/em28xx/Kconfig index 5b6a4037160..c1127802ad9 100644 --- a/drivers/media/video/em28xx/Kconfig +++ b/drivers/media/video/em28xx/Kconfig @@ -1,6 +1,6 @@ config VIDEO_EM28XX tristate "Empia EM2800/2820/2840 USB video capture support" - depends on VIDEO_V4L1 && I2C + depends on VIDEO_V4L1 && I2C && INPUT select VIDEO_TUNER select VIDEO_TVEEPROM select VIDEO_IR diff --git a/drivers/media/video/saa7134/Kconfig b/drivers/media/video/saa7134/Kconfig index d6d8d660196..3aa8cb2b860 100644 --- a/drivers/media/video/saa7134/Kconfig +++ b/drivers/media/video/saa7134/Kconfig @@ -1,6 +1,6 @@ config VIDEO_SAA7134 tristate "Philips SAA7134 support" - depends on VIDEO_DEV && PCI && I2C + depends on VIDEO_DEV && PCI && I2C && INPUT select VIDEOBUF_DMA_SG select VIDEO_IR select VIDEO_TUNER From 26ac14e24f3c84ed7a619639c2027f03b52bd64b Mon Sep 17 00:00:00 2001 From: Oliver Endriss Date: Wed, 31 Oct 2007 00:39:48 -0300 Subject: [PATCH 13/26] V4L/DVB (6495): saa7146: saa7146_wait_for_debi_done fixes Two fixes for the 'saa7146_wait_for_debi_done' code: (a) Timeout did not work when the routine was called with interrupts disabled. (b) Reduce PCI I/O load caused by saa7146_wait_for_debi_done. Seems to be very important on fast machines! Based on code posted by Hartmut Birr @vdr-portal. Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/common/saa7146_core.c | 70 ++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 12 deletions(-) diff --git a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c index cb034ead95a..7d04a6fd1ac 100644 --- a/drivers/media/common/saa7146_core.c +++ b/drivers/media/common/saa7146_core.c @@ -59,43 +59,89 @@ void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data) } /* This DEBI code is based on the saa7146 Stradis driver by Nathan Laredo */ -int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop) +static inline int saa7146_wait_for_debi_done_sleep(struct saa7146_dev *dev, + unsigned long us1, unsigned long us2) { - unsigned long start; + unsigned long timeout; int err; /* wait for registers to be programmed */ - start = jiffies; + timeout = jiffies + usecs_to_jiffies(us1); while (1) { - err = time_after(jiffies, start + HZ/20); + err = time_after(jiffies, timeout); if (saa7146_read(dev, MC2) & 2) break; if (err) { - DEB_S(("timed out while waiting for registers getting programmed\n")); + printk(KERN_ERR "%s: %s timed out while waiting for " + "registers getting programmed\n", + dev->name, __FUNCTION__); return -ETIMEDOUT; } - if (nobusyloop) - msleep(1); + msleep(1); } /* wait for transfer to complete */ - start = jiffies; + timeout = jiffies + usecs_to_jiffies(us2); while (1) { - err = time_after(jiffies, start + HZ/4); + err = time_after(jiffies, timeout); if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S)) break; saa7146_read(dev, MC2); if (err) { - DEB_S(("timed out while waiting for transfer completion\n")); + DEB_S(("%s: %s timed out while waiting for transfer " + "completion\n", dev->name, __FUNCTION__)); return -ETIMEDOUT; } - if (nobusyloop) - msleep(1); + msleep(1); } return 0; } +static inline int saa7146_wait_for_debi_done_busyloop(struct saa7146_dev *dev, + unsigned long us1, unsigned long us2) +{ + unsigned long loops; + + /* wait for registers to be programmed */ + loops = us1; + while (1) { + if (saa7146_read(dev, MC2) & 2) + break; + if (!loops--) { + printk(KERN_ERR "%s: %s timed out while waiting for " + "registers getting programmed\n", + dev->name, __FUNCTION__); + return -ETIMEDOUT; + } + udelay(1); + } + + /* wait for transfer to complete */ + loops = us2 / 5; + while (1) { + if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S)) + break; + saa7146_read(dev, MC2); + if (!loops--) { + DEB_S(("%s: %s timed out while waiting for transfer " + "completion\n", dev->name, __FUNCTION__)); + return -ETIMEDOUT; + } + udelay(5); + } + + return 0; +} + +int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop) +{ + if (nobusyloop) + return saa7146_wait_for_debi_done_sleep(dev, 50000, 250000); + else + return saa7146_wait_for_debi_done_busyloop(dev, 50000, 250000); +} + /**************************************************************************** * general helper functions ****************************************************************************/ From 4a3625b22129d076a754bb366d0c31fa1b078317 Mon Sep 17 00:00:00 2001 From: Oliver Endriss Date: Wed, 31 Oct 2007 01:34:25 -0300 Subject: [PATCH 14/26] V4L/DVB (6498): ves1820: Change the acquisition range for clock recovery from 120 ppm to 240ppm Change the acquisition range for clock recovery from 120 ppm to 240ppm. Apparently, some cable providers in Germany are playing with their parameters, and the capture range of the ves1820 is too small to acquire a lock with the current setting... ;-( Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/ves1820.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c index 066b73b7569..60433b5011f 100644 --- a/drivers/media/dvb/frontends/ves1820.c +++ b/drivers/media/dvb/frontends/ves1820.c @@ -47,7 +47,7 @@ struct ves1820_state { static int verbose; static u8 ves1820_inittab[] = { - 0x69, 0x6A, 0x93, 0x12, 0x12, 0x46, 0x26, 0x1A, + 0x69, 0x6A, 0x93, 0x1A, 0x12, 0x46, 0x26, 0x1A, 0x43, 0x6A, 0xAA, 0xAA, 0x1E, 0x85, 0x43, 0x20, 0xE0, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, From 3de0e18b3a5860a296bcff3d94400f3b30b02c86 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Wed, 31 Oct 2007 01:50:47 -0300 Subject: [PATCH 15/26] V4L/DVB (6499): tda10021: Bit error counting fixed Bit error counting fixed for the tda10021. Signed-off-by: Hartmut Birr Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/tda10021.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c index 4cd9e82c466..5ee729846a9 100644 --- a/drivers/media/dvb/frontends/tda10021.c +++ b/drivers/media/dvb/frontends/tda10021.c @@ -301,6 +301,8 @@ static int tda10021_read_ber(struct dvb_frontend* fe, u32* ber) u32 _ber = tda10021_readreg(state, 0x14) | (tda10021_readreg(state, 0x15) << 8) | ((tda10021_readreg(state, 0x16) & 0x0f) << 16); + _tda10021_writereg(state, 0x10, (tda10021_readreg(state, 0x10) & ~0xc0) + | (tda10021_inittab[0x10] & 0xc0)); *ber = 10 * _ber; return 0; From 7cccccc33aa9ab7171ca05c0b59c62912509b23e Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Wed, 31 Oct 2007 01:57:58 -0300 Subject: [PATCH 16/26] V4L/DVB (6500): tda10021: Fix reported signal strength Fix reported signal strength value (higher value = higher signal strength). Signed-off-by: Hartmut Birr Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/tda10021.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c index 5ee729846a9..45137d2ebfb 100644 --- a/drivers/media/dvb/frontends/tda10021.c +++ b/drivers/media/dvb/frontends/tda10021.c @@ -312,7 +312,11 @@ static int tda10021_read_signal_strength(struct dvb_frontend* fe, u16* strength) { struct tda10021_state* state = fe->demodulator_priv; + u8 config = tda10021_readreg(state, 0x02); u8 gain = tda10021_readreg(state, 0x17); + if (config & 0x02) + /* the agc value is inverted */ + gain = ~gain; *strength = (gain << 8) | gain; return 0; From 85085ad7b2cc281a94bb406172ba938870863639 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Wed, 31 Oct 2007 02:04:16 -0300 Subject: [PATCH 17/26] V4L/DVB (6501): stv0297: Signal strength fixes Fixes the signal strength value (higher value = higher signal strength) and scales the value to the range of 0..ffff. The characteristic itself is wrong. To get proper values on a TT-C2300 in the range of 40..60% real signal strength, the values from the patch should be divide by two. The attached patch doesn't fix the characteristic. Signed-off-by: Hartmut Birr Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/stv0297.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c index 17e5cb561cd..7c23775f77d 100644 --- a/drivers/media/dvb/frontends/stv0297.c +++ b/drivers/media/dvb/frontends/stv0297.c @@ -358,11 +358,23 @@ static int stv0297_read_ber(struct dvb_frontend *fe, u32 * ber) static int stv0297_read_signal_strength(struct dvb_frontend *fe, u16 * strength) { struct stv0297_state *state = fe->demodulator_priv; - u8 STRENGTH[2]; - - stv0297_readregs(state, 0x41, STRENGTH, 2); - *strength = (STRENGTH[1] & 0x03) << 8 | STRENGTH[0]; + u8 STRENGTH[3]; + u16 tmp; + stv0297_readregs(state, 0x41, STRENGTH, 3); + tmp = (STRENGTH[1] & 0x03) << 8 | STRENGTH[0]; + if (STRENGTH[2] & 0x20) { + if (tmp < 0x200) + tmp = 0; + else + tmp = tmp - 0x200; + } else { + if (tmp > 0x1ff) + tmp = 0; + else + tmp = 0x1ff - tmp; + } + *strength = (tmp << 7) | (tmp >> 2); return 0; } From 4ed53a5af75d858bd224c2cdd7604e347a63218f Mon Sep 17 00:00:00 2001 From: Roel Kluin <12o3l@tiscali.nl> Date: Sun, 28 Oct 2007 22:15:33 -0300 Subject: [PATCH 18/26] V4L/DVB (6503): pvrusb2: Fix associativity logic error if(!x & y) should either be if(!(x & y)) or if(!x && y) I made changes as seemed appropriate, but please review this is against current git. Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/pvrusb2/pvrusb2-ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c index f569b00201d..46f156fb108 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c +++ b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c @@ -410,7 +410,7 @@ static int parse_mtoken(const char *ptr,unsigned int len, int msk; *valptr = 0; for (idx = 0, msk = 1; valid_bits; idx++, msk <<= 1) { - if (!msk & valid_bits) continue; + if (!(msk & valid_bits)) continue; valid_bits &= ~msk; if (!names[idx]) continue; slen = strlen(names[idx]); From f21daa41d19def8c0a1e9d9626f773447b8191f6 Mon Sep 17 00:00:00 2001 From: Mike Isely Date: Sun, 28 Oct 2007 22:19:53 -0300 Subject: [PATCH 19/26] V4L/DVB (6504): pvrusb2: Remove dead sysfs code The pvrusb2 driver's sysfs implementation had long since implemented a dummy hotplug function because at the time the kernel would oops without at least the empty function being present. Today - after numerous class interface changes in the kernel - this pvrusb2 change had been dutifully carried forward but an inspection of the kernel sources shows that it is no longer needed. So remove the dummy function and its reference. This also solves a recurring backwards compatibility issue in the pvrusb2 driver as the class interface has been getting thrashed in the kernel. Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 2ee3c3049e8..3c57a7d8200 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c @@ -905,13 +905,6 @@ struct pvr2_sysfs *pvr2_sysfs_create(struct pvr2_context *mp, } -static int pvr2_sysfs_hotplug(struct device *d, - struct kobj_uevent_env *env) -{ - /* Even though we don't do anything here, we still need this function - because sysfs will still try to call it. */ - return 0; -} struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) { @@ -922,7 +915,6 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) clp->class.name = "pvrusb2"; clp->class.class_release = pvr2_sysfs_class_release; clp->class.dev_release = pvr2_sysfs_release; - clp->class.dev_uevent = pvr2_sysfs_hotplug; if (class_register(&clp->class)) { pvr2_sysfs_trace( "Registration failed for pvr2_sysfs_class id=%p",clp); From 32d111a9f0e6de901667612d1b0c46bbfd5d37cb Mon Sep 17 00:00:00 2001 From: "Alexander E. Patrakov" Date: Wed, 31 Oct 2007 11:40:09 -0300 Subject: [PATCH 20/26] V4L/DVB (6506): saa7134-alsa: Fix mmap support Trent Piepho wrote: > I do not think the saa7134-alsa driver supports mmap. The cx88-alsa driver > also claimed to support mmap, but it never worked until I fixed it. It's > pretty clear that the code in saa7134-alsa was based on the same code as > cx88-alsa, so it's likely it has the same bug. You are right. The patch below (based on your cx88 patch, but I don't really understand it) fixes mmap support in saa7134-alsa for me. Recording via mmap (arecord -M -f S16_LE -c 2 -r 32000 -D hw:1) didn't work at all before, works now, tested for at least 20 minutes (but, unfortunately, with one overrun at least 0.719 ms long). Signed-off-by: Alexander E. Patrakov Acked-by: Takashi Iwai Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/saa7134/saa7134-alsa.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index c6f7279669c..b9c5cf7dc84 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c @@ -543,8 +543,10 @@ static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream, V4L functions, and force ALSA to use that as the DMA area */ substream->runtime->dma_area = dev->dmasound.dma.vmalloc; + substream->runtime->dma_bytes = dev->dmasound.bufsize; + substream->runtime->dma_addr = 0; - return 1; + return 0; } @@ -651,6 +653,17 @@ static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream) return 0; } +/* + * page callback (needed for mmap) + */ + +static struct page *snd_card_saa7134_page(struct snd_pcm_substream *substream, + unsigned long offset) +{ + void *pageptr = substream->runtime->dma_area + offset; + return vmalloc_to_page(pageptr); +} + /* * ALSA capture callbacks definition */ @@ -664,6 +677,7 @@ static struct snd_pcm_ops snd_card_saa7134_capture_ops = { .prepare = snd_card_saa7134_capture_prepare, .trigger = snd_card_saa7134_capture_trigger, .pointer = snd_card_saa7134_capture_pointer, + .page = snd_card_saa7134_page, }; /* From 6d35c8f648763299926d6e19de5334e15a9be7ab Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Thu, 1 Nov 2007 01:16:09 -0300 Subject: [PATCH 21/26] V4L/DVB (6514): em28xx: Include linux/mm.h This em28xx-video.c uses functions from this header, but doesn't include it. It depends on some v4l headers included two levels down including poll.h, which includes mm.h. These v4l headers might change, so it's best to include the headers needed directly. It also causes problems for the out of core build system's backward compatibility with older kernels, which is the real reason I bothered to create a patch for something that would otherwise be so minor that it would hardly be worth the trouble. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/em28xx/em28xx-video.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index a4c2a907124..2529c298b86 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include From 032c2028ac6829cbbbf2639e5e2861bf14f73b91 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 1 Nov 2007 21:33:38 -0300 Subject: [PATCH 22/26] V4L/DVB (6518): Fix tvp5150 default values Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tvp5150.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index e2f1c972754..25d0aef88ef 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c @@ -799,10 +799,10 @@ static inline void tvp5150_reset(struct i2c_client *c) tvp5150_write_inittab(c, tvp5150_init_enable); /* Initialize image preferences */ - tvp5150_write(c, TVP5150_BRIGHT_CTL, decoder->bright >> 8); - tvp5150_write(c, TVP5150_CONTRAST_CTL, decoder->contrast >> 8); - tvp5150_write(c, TVP5150_SATURATION_CTL, decoder->contrast >> 8); - tvp5150_write(c, TVP5150_HUE_CTL, (decoder->hue - 32768) >> 8); + tvp5150_write(c, TVP5150_BRIGHT_CTL, decoder->bright); + tvp5150_write(c, TVP5150_CONTRAST_CTL, decoder->contrast); + tvp5150_write(c, TVP5150_SATURATION_CTL, decoder->contrast); + tvp5150_write(c, TVP5150_HUE_CTL, decoder->hue); tvp5150_set_std(c, decoder->norm); }; @@ -1077,10 +1077,10 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter, core->norm = V4L2_STD_ALL; /* Default is autodetect */ core->route.input = TVP5150_COMPOSITE1; core->enable = 1; - core->bright = 32768; - core->contrast = 32768; - core->hue = 32768; - core->sat = 32768; + core->bright = 128; + core->contrast = 128; + core->hue = 0; + core->sat = 128; if (rv) { kfree(c); From 8c6da5c41e39abc8d775a14f3bea28bec6c76d69 Mon Sep 17 00:00:00 2001 From: Ludovico Cavedon Date: Fri, 2 Nov 2007 16:37:32 -0300 Subject: [PATCH 23/26] V4L/DVB (6531): Fix a regression caused by commit 153962364dc6fa4a24571885fbe76506d8968610 From: Ludovico Cavedon Signed-off-by: Ludovico Cavedon Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/em28xx/em28xx-i2c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c index 997d067e32e..5f477d19de4 100644 --- a/drivers/media/video/em28xx/em28xx-i2c.c +++ b/drivers/media/video/em28xx/em28xx-i2c.c @@ -418,6 +418,7 @@ static int attach_inform(struct i2c_client *client) switch (client->addr << 1) { case 0x43: case 0x4b: + case 0x86: { struct tuner_setup tun_setup; From fe51f819bcbaa1fe94291f4bbe2a6a40c1653b54 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 2 Nov 2007 16:46:28 -0300 Subject: [PATCH 24/26] V4L/DVB (6532): Add the remaining addresses for tda9887 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/em28xx/em28xx-i2c.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c index 5f477d19de4..e3a4aa7a9df 100644 --- a/drivers/media/video/em28xx/em28xx-i2c.c +++ b/drivers/media/video/em28xx/em28xx-i2c.c @@ -416,9 +416,10 @@ static int attach_inform(struct i2c_client *client) struct em28xx *dev = client->adapter->algo_data; switch (client->addr << 1) { - case 0x43: - case 0x4b: case 0x86: + case 0x84: + case 0x96: + case 0x94: { struct tuner_setup tun_setup; From ac72fed79fbbdb35882b393401584435c9fc37ac Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Sun, 4 Nov 2007 06:28:51 -0300 Subject: [PATCH 25/26] V4L/DVB (6547): V4L: remove PCI from VIDEO_VIVI depends vivi.c is a virtual driver that builds without PCI and should run on non-pci hardware. Signed-off-by: Brandon Philips Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 2e571eb9313..c9f14bfc854 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig @@ -363,7 +363,7 @@ endmenu # encoder / decoder chips config VIDEO_VIVI tristate "Virtual Video Driver" - depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 && PCI + depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 select VIDEOBUF_VMALLOC default n ---help--- From 4f663bdc65307e38401aa3b787a7a7569f28b920 Mon Sep 17 00:00:00 2001 From: Mike Isely Date: Sat, 3 Nov 2007 00:06:42 -0300 Subject: [PATCH 26/26] V4L/DVB (6548): pvrusb2: Fix oops on module removal The pvrusb2 driver is tearing down its sysfs related pieces in the incorrect order. This leaves dangling pointers which causes the kernel device core to oops. The problem has been present virtually forever but became malignant with the changeover to the way of handling /sys/class. Fix is just to make sure we don't tear down the class structure until AFTER the driver instances are deregistered. Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/pvrusb2/pvrusb2-main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/pvrusb2/pvrusb2-main.c b/drivers/media/video/pvrusb2/pvrusb2-main.c index ca9e2789c8c..11b3b2e84b9 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-main.c +++ b/drivers/media/video/pvrusb2/pvrusb2-main.c @@ -136,14 +136,13 @@ static int __init pvr_init(void) static void __exit pvr_exit(void) { - pvr2_trace(PVR2_TRACE_INIT,"pvr_exit"); + usb_deregister(&pvr_driver); + #ifdef CONFIG_VIDEO_PVRUSB2_SYSFS pvr2_sysfs_class_destroy(class_ptr); #endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */ - - usb_deregister(&pvr_driver); } module_init(pvr_init);