From fd3113e84e188781aa2935fbc4351d64ccdd171b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 31 Jul 2005 22:34:43 -0700 Subject: [PATCH] V4L: Miscellaneous fixes - Fixed some bttv card numbers. - BTTV and SAA7134 version numbers incremented to reflect changes. - pci_dma_supported() is called after pci_set_dma_mask() which already did check that for us. This patch removes the unneeded call to pci_dma_supported() at bttv-driver.c - Ensure a sufficient I2C bus idle time between 2 messages for saa7134-i2c.c - It is important to write at first to MO_GP3_IO for cx88-tvaudio.c - Use try_to_freeze() instead of refrigerator at msp3400.c - Recognizing the MFPE05-2 Tuner at tveeprom.c - Add new parameter to help identify radio chipsets at tuner module: show_i2c=1 will show 16 reading bytes from detected tuners. - BTTV does generate some Unimplemented IOCTL log at tuner module: 0x40046d11(dir=1,tp=0x6d,nr=17,sz=4) means that it is sending MSP3400 calls to non-msp3400 tuners. Warning eliminated. VIDIOSAUDIO is also called, so debug messages updated. It is still requiring IOCTL implementation. - Added two more tuners. - Add support for the SVideo input on the GDI Black Gold. Signed-off-by: Peter Missel Signed-off-by: Graham Bevan Signed-off-by: Torsten Seeboth Signed-off-by: Hartmut Hackmann Signed-off-by: Tobias Klauser Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/media/video/bttv-driver.c | 7 +------ drivers/media/video/bttv.h | 6 ++++-- drivers/media/video/bttvp.h | 4 ++-- drivers/media/video/cx88/cx88-cards.c | 5 ++++- drivers/media/video/cx88/cx88-video.c | 4 ++-- drivers/media/video/msp3400.c | 4 +--- drivers/media/video/saa7134/saa7134-i2c.c | 4 +++- drivers/media/video/saa7134/saa7134.h | 4 ++-- drivers/media/video/tea5767.c | 15 ++++++++------- drivers/media/video/tuner-core.c | 29 ++++++++++++++++++++++++++++- drivers/media/video/tuner-simple.c | 8 +++++++- drivers/media/video/tveeprom.c | 2 +- 12 files changed, 63 insertions(+), 29 deletions(-) (limited to 'drivers/media/video') diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c index 51a0f6d68e7..67f331eeeb1 100644 --- a/drivers/media/video/bttv-driver.c +++ b/drivers/media/video/bttv-driver.c @@ -1,5 +1,5 @@ /* - $Id: bttv-driver.c,v 1.42 2005/07/05 17:37:35 nsh Exp $ + $Id: bttv-driver.c,v 1.45 2005/07/20 19:43:24 mkrufky Exp $ bttv - Bt848 frame grabber driver @@ -3869,11 +3869,6 @@ static int __devinit bttv_probe(struct pci_dev *dev, pci_set_master(dev); pci_set_command(dev); pci_set_drvdata(dev,btv); - if (!pci_dma_supported(dev,0xffffffff)) { - printk("bttv%d: Oops: no 32bit PCI DMA ???\n", btv->c.nr); - result = -EIO; - goto fail1; - } pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); diff --git a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h index 191eaf1714b..f2af9e1454f 100644 --- a/drivers/media/video/bttv.h +++ b/drivers/media/video/bttv.h @@ -1,5 +1,5 @@ /* - * $Id: bttv.h,v 1.18 2005/05/24 23:41:42 nsh Exp $ + * $Id: bttv.h,v 1.22 2005/07/28 18:41:21 mchehab Exp $ * * bttv - Bt848 frame grabber driver * @@ -135,7 +135,9 @@ #define BTTV_DVICO_DVBT_LITE 0x80 #define BTTV_TIBET_CS16 0x83 #define BTTV_KODICOM_4400R 0x84 -#define BTTV_ADLINK_RTV24 0x85 +#define BTTV_ADLINK_RTV24 0x86 +#define BTTV_DVICO_FUSIONHDTV_5_LITE 0x87 +#define BTTV_ACORP_Y878F 0x88 /* i2c address list */ #define I2C_TSA5522 0xc2 diff --git a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h index f3293e4a15a..aab094bc243 100644 --- a/drivers/media/video/bttvp.h +++ b/drivers/media/video/bttvp.h @@ -1,5 +1,5 @@ /* - $Id: bttvp.h,v 1.19 2005/06/16 21:38:45 nsh Exp $ + $Id: bttvp.h,v 1.21 2005/07/15 21:44:14 mchehab Exp $ bttv - Bt848 frame grabber driver @@ -27,7 +27,7 @@ #define _BTTVP_H_ #include -#define BTTV_VERSION_CODE KERNEL_VERSION(0,9,15) +#define BTTV_VERSION_CODE KERNEL_VERSION(0,9,16) #include #include diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 3d0c784b376..293377a3972 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-cards.c,v 1.86 2005/07/14 03:06:43 mchehab Exp $ + * $Id: cx88-cards.c,v 1.90 2005/07/28 02:47:42 mkrufky Exp $ * * device driver for Conexant 2388x based TV cards * card-specific stuff. @@ -90,6 +90,9 @@ struct cx88_board cx88_boards[] = { .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, }}, }, [CX88_BOARD_PIXELVIEW] = { diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 5588a3aeecb..5f58c103198 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-video.c,v 1.80 2005/07/13 08:49:08 mchehab Exp $ + * $Id: cx88-video.c,v 1.82 2005/07/22 05:13:34 mkrufky Exp $ * * device driver for Conexant 2388x based TV cards * video4linux video interface @@ -758,10 +758,10 @@ static int video_open(struct inode *inode, struct file *file) struct cx88_core *core = dev->core; int board = core->board; dprintk(1,"video_open: setting radio device\n"); + cx_write(MO_GP3_IO, cx88_boards[board].radio.gpio3); cx_write(MO_GP0_IO, cx88_boards[board].radio.gpio0); cx_write(MO_GP1_IO, cx88_boards[board].radio.gpio1); cx_write(MO_GP2_IO, cx88_boards[board].radio.gpio2); - cx_write(MO_GP3_IO, cx88_boards[board].radio.gpio3); dev->core->tvaudio = WW_FM; cx88_set_tvaudio(core); cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1); diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index 6239254db27..62f1b8ddb98 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c @@ -741,11 +741,9 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout) schedule_timeout(msecs_to_jiffies(timeout)); } } - if (current->flags & PF_FREEZE) { - refrigerator (); - } remove_wait_queue(&msp->wq, &wait); + try_to_freeze(); return msp->restart; } diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c index 93dd6197854..1203b93a572 100644 --- a/drivers/media/video/saa7134/saa7134-i2c.c +++ b/drivers/media/video/saa7134/saa7134-i2c.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-i2c.c,v 1.19 2005/07/07 01:49:30 mkrufky Exp $ + * $Id: saa7134-i2c.c,v 1.22 2005/07/22 04:09:41 mkrufky Exp $ * * device driver for philips saa7134 based TV cards * i2c interface support @@ -300,6 +300,8 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap, status = i2c_get_status(dev); if (i2c_is_error(status)) goto err; + /* ensure that the bus is idle for at least one bit slot */ + msleep(1); d1printk("\n"); return num; diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index 6836c07794f..2af0cb2a731 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h @@ -1,5 +1,5 @@ /* - * $Id: saa7134.h,v 1.48 2005/07/01 08:22:24 nsh Exp $ + * $Id: saa7134.h,v 1.49 2005/07/13 17:25:25 mchehab Exp $ * * v4l2 device driver for philips saa7134 based TV cards * @@ -21,7 +21,7 @@ */ #include -#define SAA7134_VERSION_CODE KERNEL_VERSION(0,2,13) +#define SAA7134_VERSION_CODE KERNEL_VERSION(0,2,14) #include #include diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c index 4d27ac1b7fb..c8fd4204cd0 100644 --- a/drivers/media/video/tea5767.c +++ b/drivers/media/video/tea5767.c @@ -2,7 +2,7 @@ * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview * I2C address is allways 0xC0. * - * $Id: tea5767.c,v 1.21 2005/07/14 03:06:43 mchehab Exp $ + * $Id: tea5767.c,v 1.26 2005/07/27 12:00:36 mkrufky Exp $ * * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) * This code is placed under the terms of the GNU General Public License @@ -15,7 +15,6 @@ #include #include #include -#include #define PREFIX "TEA5767 " @@ -293,7 +292,7 @@ static int tea5767_stereo(struct i2c_client *c) int tea5767_autodetection(struct i2c_client *c) { - unsigned char buffer[5] = { 0xff, 0xff, 0xff, 0xff, 0xff }; + unsigned char buffer[7] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; int rc; struct tuner *t = i2c_get_clientdata(c); @@ -302,7 +301,7 @@ int tea5767_autodetection(struct i2c_client *c) return EINVAL; } - /* If all bytes are the same then it's a TV tuner and not a tea5767 chip. */ + /* If all bytes are the same then it's a TV tuner and not a tea5767 */ if (buffer[0] == buffer[1] && buffer[0] == buffer[2] && buffer[0] == buffer[3] && buffer[0] == buffer[4]) { tuner_warn("All bytes are equal. It is not a TEA5767\n"); @@ -318,6 +317,11 @@ int tea5767_autodetection(struct i2c_client *c) tuner_warn("Chip ID is not zero. It is not a TEA5767\n"); return EINVAL; } + /* It seems that tea5767 returns 0xff after the 5th byte */ + if ((buffer[5] != 0xff) || (buffer[6] != 0xff)) { + tuner_warn("Returned more than 5 bytes. It is not a TEA5767\n"); + return EINVAL; + } tuner_warn("TEA5767 detected.\n"); return 0; @@ -327,9 +331,6 @@ int tea5767_tuner_init(struct i2c_client *c) { struct tuner *t = i2c_get_clientdata(c); - if (tea5767_autodetection(c) == EINVAL) - return EINVAL; - tuner_info("type set to %d (%s)\n", t->type, "Philips TEA5767HN FM Radio"); strlcpy(c->name, "tea5767", sizeof(c->name)); diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index b25a9c08ac0..f0a579827a2 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -1,5 +1,5 @@ /* - * $Id: tuner-core.c,v 1.58 2005/07/14 03:06:43 mchehab Exp $ + * $Id: tuner-core.c,v 1.63 2005/07/28 18:19:55 mchehab Exp $ * * i2c tv tuner chip device driver * core core, i.e. kernel interfaces, registering and so on @@ -23,6 +23,8 @@ #include #include +#include "msp3400.h" + #define UNSET (-1U) /* standard i2c insmod options */ @@ -42,6 +44,9 @@ module_param(addr, int, 0444); static unsigned int no_autodetect = 0; module_param(no_autodetect, int, 0444); +static unsigned int show_i2c = 0; +module_param(show_i2c, int, 0444); + /* insmod options used at runtime => read/write */ unsigned int tuner_debug = 0; module_param(tuner_debug, int, 0644); @@ -320,6 +325,17 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); + if (show_i2c) { + unsigned char buffer[16]; + int i,rc; + + memset(buffer, 0, sizeof(buffer)); + rc = i2c_master_recv(&t->i2c, buffer, sizeof(buffer)); + printk("tuner-%04x I2C RECV = ",addr); + for (i=0;i Date: Sun, 31 Jul 2005 22:34:46 -0700 Subject: [PATCH] v4l: cx88 card support and documentation finishing touches Peter Missel: - Add support for the SVideo input on the GDI Black Gold. Mauro Carvalho Chehab: - Linux/version.h removed. Replaced by linux/utsname.h Michael Krufky: - Added analog support for DViCO FusionHDTV5 Gold. CC: Peter Missel Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Michael Krufky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/media/video/cx88/cx88-cards.c | 28 ++++++++++++++++++++++++++++ drivers/media/video/cx88/cx88.h | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'drivers/media/video') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 293377a3972..ebf02a7f81e 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -499,6 +499,9 @@ struct cx88_board cx88_boards[] = { .input = {{ .type = CX88_VMUX_DVB, .vmux = 0, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, }}, .dvb = 1, }, @@ -756,6 +759,27 @@ struct cx88_board cx88_boards[] = { }}, .dvb = 1, }, + [CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD] = { + .name = "DViCO FusionHDTV 5 Gold", + .tuner_type = TUNER_LG_TDVS_H062F, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + /* See DViCO FusionHDTV 3 Gold-Q for GPIO documentation. */ + .input = {{ + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x0f0d, + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x0f00, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x0f00, + }}, + }, }; const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); @@ -883,6 +907,10 @@ struct cx88_subid cx88_subids[] = { .subvendor = 0x153b, .subdevice = 0x1166, .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1, + },{ + .subvendor = 0x18ac, + .subdevice = 0xd500, + .card = CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD, }, }; const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index b008f7db6df..da65dc92787 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -1,5 +1,5 @@ /* - * $Id: cx88.h,v 1.69 2005/07/13 17:25:25 mchehab Exp $ + * $Id: cx88.h,v 1.70 2005/07/24 17:44:09 mkrufky Exp $ * * v4l2 device driver for cx2388x based TV cards * @@ -171,6 +171,7 @@ extern struct sram_channel cx88_sram_channels[]; #define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28 #define CX88_BOARD_ADSTECH_DVB_T_PCI 29 #define CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1 30 +#define CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD 31 enum cx88_itype { CX88_VMUX_COMPOSITE1 = 1, -- cgit v1.2.3 From 001abc93bf83f95737cd455b6ec875e6412f7d53 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 1 Aug 2005 21:11:38 -0700 Subject: [PATCH] v4l: bug fix to correct tea5767 autodetection This patch does correct radio chip autodetection to avoid misdetecting mt20xx microtune as tea5767 chip. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/media/video/tea5767.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'drivers/media/video') diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c index c8fd4204cd0..cebcc1fa68d 100644 --- a/drivers/media/video/tea5767.c +++ b/drivers/media/video/tea5767.c @@ -2,7 +2,7 @@ * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview * I2C address is allways 0xC0. * - * $Id: tea5767.c,v 1.26 2005/07/27 12:00:36 mkrufky Exp $ + * $Id: tea5767.c,v 1.27 2005/07/31 12:10:56 mchehab Exp $ * * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) * This code is placed under the terms of the GNU General Public License @@ -296,7 +296,7 @@ int tea5767_autodetection(struct i2c_client *c) int rc; struct tuner *t = i2c_get_clientdata(c); - if (5 != (rc = i2c_master_recv(c, buffer, 5))) { + if (7 != (rc = i2c_master_recv(c, buffer, 7))) { tuner_warn("It is not a TEA5767. Received %i bytes.\n", rc); return EINVAL; } @@ -323,6 +323,12 @@ int tea5767_autodetection(struct i2c_client *c) return EINVAL; } + /* It seems that tea5767 returns 0xff after the 5th byte */ + if ((buffer[5] != 0xff) || (buffer[6] != 0xff)) { + tuner_warn("Returned more than 5 bytes. It is not a TEA5767\n"); + return EINVAL; + } + tuner_warn("TEA5767 detected.\n"); return 0; } @@ -331,7 +337,8 @@ int tea5767_tuner_init(struct i2c_client *c) { struct tuner *t = i2c_get_clientdata(c); - tuner_info("type set to %d (%s)\n", t->type, "Philips TEA5767HN FM Radio"); + 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; -- cgit v1.2.3 From 4dcef52400fa6b9eb2de589300ae0151a1c65b3b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 4 Aug 2005 12:53:30 -0700 Subject: [PATCH] v4l: oopsfix for BTTV on badly behaved PCI chipsets no_overlay bttv parameter implemented to fix OOPS on some PCI chipsets (like some VIA) with these behaviors: 1) If pci_quicks does identify the chip as having troubles to handle PCI2PCI transfers, no_overlay defaults to 1. The user may force it to 0, to reenable (not recommended). 2) For newer chipsets not blacklisted, no_overlay=1 is provided as a workaround until PCI chipset included on /drivers/pci/quirks.c Thanks to Bodo Eggert <7eggert@gmx.de> Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/media/video/bttv-cards.c | 8 +++++--- drivers/media/video/bttv-driver.c | 28 ++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 7 deletions(-) (limited to 'drivers/media/video') diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c index 6c52fd0bb7d..a97b9b958ed 100644 --- a/drivers/media/video/bttv-cards.c +++ b/drivers/media/video/bttv-cards.c @@ -95,7 +95,7 @@ static int __devinit pvr_boot(struct bttv *btv); static unsigned int triton1=0; static unsigned int vsfx=0; static unsigned int latency = UNSET; -static unsigned int no_overlay=-1; +int no_overlay=-1; static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; @@ -4296,9 +4296,11 @@ void __devinit bttv_check_chipset(void) printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n"); if (pcipci_fail) { printk(KERN_WARNING "bttv: BT848 and your chipset may not work together.\n"); - if (UNSET == no_overlay) { - printk(KERN_WARNING "bttv: going to disable overlay.\n"); + if (!no_overlay) { + printk(KERN_WARNING "bttv: overlay will be disabled.\n"); no_overlay = 1; + } else { + printk(KERN_WARNING "bttv: overlay forced. Use this option at your own risk.\n"); } } if (UNSET != latency) diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c index 67f331eeeb1..eee9322ce21 100644 --- a/drivers/media/video/bttv-driver.c +++ b/drivers/media/video/bttv-driver.c @@ -1,5 +1,5 @@ /* - $Id: bttv-driver.c,v 1.45 2005/07/20 19:43:24 mkrufky Exp $ + $Id: bttv-driver.c,v 1.52 2005/08/04 00:55:16 mchehab Exp $ bttv - Bt848 frame grabber driver @@ -80,6 +80,7 @@ static unsigned int irq_iswitch = 0; static unsigned int uv_ratio = 50; static unsigned int full_luma_range = 0; static unsigned int coring = 0; +extern int no_overlay; /* API features (turn on/off stuff for testing) */ static unsigned int v4l2 = 1; @@ -2151,6 +2152,10 @@ static int bttv_s_fmt(struct bttv_fh *fh, struct bttv *btv, return 0; } case V4L2_BUF_TYPE_VIDEO_OVERLAY: + if (no_overlay > 0) { + printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n"); + return -EINVAL; + } return setup_window(fh, btv, &f->fmt.win, 1); case V4L2_BUF_TYPE_VBI_CAPTURE: retval = bttv_switch_type(fh,f->type); @@ -2224,9 +2229,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, /* others */ cap->type = VID_TYPE_CAPTURE| VID_TYPE_TUNER| - VID_TYPE_OVERLAY| VID_TYPE_CLIPPING| VID_TYPE_SCALES; + if (no_overlay <= 0) + cap->type |= VID_TYPE_OVERLAY; + cap->maxwidth = bttv_tvnorms[btv->tvnorm].swidth; cap->maxheight = bttv_tvnorms[btv->tvnorm].sheight; cap->minwidth = 48; @@ -2302,6 +2309,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, struct video_window *win = arg; struct v4l2_window w2; + if (no_overlay > 0) { + printk ("VIDIOCSWIN: no_overlay\n"); + return -EINVAL; + } + w2.field = V4L2_FIELD_ANY; w2.w.left = win->x; w2.w.top = win->y; @@ -2577,10 +2589,12 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, cap->version = BTTV_VERSION_CODE; cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | - V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; + if (no_overlay <= 0) + cap->capabilities |= V4L2_CAP_VIDEO_OVERLAY; + if (bttv_tvcards[btv->c.type].tuner != UNSET && bttv_tvcards[btv->c.type].tuner != TUNER_ABSENT) cap->capabilities |= V4L2_CAP_TUNER; @@ -3076,7 +3090,7 @@ static struct file_operations bttv_fops = static struct video_device bttv_video_template = { .name = "UNSET", - .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY| + .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER| VID_TYPE_CLIPPING|VID_TYPE_SCALES, .hardware = VID_HARDWARE_BT848, .fops = &bttv_fops, @@ -3756,6 +3770,12 @@ static void bttv_unregister_video(struct bttv *btv) /* register video4linux devices */ static int __devinit bttv_register_video(struct bttv *btv) { + if (no_overlay <= 0) { + bttv_video_template.type |= VID_TYPE_OVERLAY; + } else { + printk("bttv: Overlay support disabled.\n"); + } + /* video */ btv->video_dev = vdev_init(btv, &bttv_video_template, "video"); if (NULL == btv->video_dev) -- cgit v1.2.3 From 1963c907b21e140082d081b1c8f8c2154593c7d7 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Mon, 8 Aug 2005 09:22:43 -0700 Subject: [PATCH] dvb: lgdt330x frontend: some bug fixes & add lgdt3303 support - Structural changes within lgdt330x driver, framework now supports both chips... tested OK on lgdt3302 and lgdt3303. - Add LG/TUA6034 dvb_pll_desc for ATSC with LG TDVS-H062F & DViCO FusionHDTV5. - Fixed LGDT330X signal strength: For now, always set it to 0. - Corrected LGDT330X boundary condition error in read_snr: dB calculation. Signed-off-by: Mac Michaels Signed-off-by: Michael Krufky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/media/video/cx88/cx88-dvb.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'drivers/media/video') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index ef0e9a85c35..78d223257a6 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-dvb.c,v 1.54 2005/07/25 05:13:50 mkrufky Exp $ + * $Id: cx88-dvb.c,v 1.58 2005/08/07 09:24:08 mkrufky Exp $ * * device driver for Conexant 2388x based TV cards * MPEG Transport Stream (DVB) routines @@ -208,14 +208,26 @@ static struct or51132_config pchdtv_hd3000 = { #ifdef HAVE_LGDT330X static int lgdt330x_pll_set(struct dvb_frontend* fe, - struct dvb_frontend_parameters* params, - u8* pllbuf) + struct dvb_frontend_parameters* params) { struct cx8802_dev *dev= fe->dvb->priv; + u8 buf[4]; + struct i2c_msg msg = + { .addr = dev->core->pll_addr, .flags = 0, .buf = buf, .len = 4 }; + int err; - pllbuf[0] = dev->core->pll_addr; - dvb_pll_configure(dev->core->pll_desc, &pllbuf[1], - params->frequency, 0); + dvb_pll_configure(dev->core->pll_desc, buf, params->frequency, 0); + dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n", + __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]); + if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { + printk(KERN_WARNING "cx88-dvb: %s error " + "(addr %02x <- %02x, err = %i)\n", + __FUNCTION__, buf[0], buf[1], err); + if (err < 0) + return err; + else + return -EREMOTEIO; + } return 0; } @@ -244,6 +256,8 @@ static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured) static struct lgdt330x_config fusionhdtv_3_gold = { .demod_address = 0x0e, + .demod_chip = LGDT3302, + .serial_mpeg = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */ .pll_set = lgdt330x_pll_set, .set_ts_params = lgdt330x_set_ts_param, }; -- cgit v1.2.3