diff options
-rw-r--r-- | linux/Documentation/video4linux/README.pvrusb2 (renamed from v4l_experimental/pvrusb2/README) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/Kconfig | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/Makefile | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/Kconfig | 13 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/Makefile | 11 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-audio.c (renamed from v4l_experimental/pvrusb2/pvrusb2-audio.c) | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-audio.h (renamed from v4l_experimental/pvrusb2/pvrusb2-audio.h) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-context.c (renamed from v4l_experimental/pvrusb2/pvrusb2-context.c) | 10 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-context.h (renamed from v4l_experimental/pvrusb2/pvrusb2-context.h) | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-debug.h (renamed from v4l_experimental/pvrusb2/pvrusb2-debug.h) | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c (renamed from v4l_experimental/pvrusb2/pvrusb2-debugifc.c) | 28 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.h (renamed from v4l_experimental/pvrusb2/pvrusb2-debugifc.h) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-demod.c (renamed from v4l_experimental/pvrusb2/pvrusb2-demod.c) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-demod.h (renamed from v4l_experimental/pvrusb2/pvrusb2-demod.h) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.c (renamed from v4l_experimental/pvrusb2/pvrusb2-eeprom.c) | 48 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.h (renamed from v4l_experimental/pvrusb2/pvrusb2-eeprom.h) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c (renamed from v4l_experimental/pvrusb2/pvrusb2-encoder.c) | 8 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-encoder.h (renamed from v4l_experimental/pvrusb2/pvrusb2-encoder.h) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h (renamed from v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h) | 18 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c (renamed from v4l_experimental/pvrusb2/pvrusb2-hdw.c) | 393 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h (renamed from v4l_experimental/pvrusb2/pvrusb2-hdw.h) | 38 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c (renamed from v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c) | 7 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c (renamed from v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.c) | 23 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h (renamed from v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.h) | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c (renamed from v4l_experimental/pvrusb2/pvrusb2-i2c-core.c) | 49 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h (renamed from v4l_experimental/pvrusb2/pvrusb2-i2c-core.h) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-io.c (renamed from v4l_experimental/pvrusb2/pvrusb2-io.c) | 20 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-io.h (renamed from v4l_experimental/pvrusb2/pvrusb2-io.h) | 8 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c (renamed from v4l_experimental/pvrusb2/pvrusb2-ioread.c) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h (renamed from v4l_experimental/pvrusb2/pvrusb2-ioread.h) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-main.c (renamed from v4l_experimental/pvrusb2/pvrusb2-main.c) | 17 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c (renamed from v4l_experimental/pvrusb2/pvrusb2-sysfs.c) | 19 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.h (renamed from v4l_experimental/pvrusb2/pvrusb2-sysfs.h) | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c (renamed from v4l_experimental/pvrusb2/pvrusb2-tuner.c) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-tuner.h (renamed from v4l_experimental/pvrusb2/pvrusb2-tuner.h) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-util.h (renamed from v4l_experimental/pvrusb2/pvrusb2-util.h) | 18 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c (renamed from v4l_experimental/pvrusb2/pvrusb2-v4l2.c) | 36 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.h (renamed from v4l_experimental/pvrusb2/pvrusb2-v4l2.h) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c (renamed from v4l_experimental/pvrusb2/pvrusb2-video-v4l.c) | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.h (renamed from v4l_experimental/pvrusb2/pvrusb2-video-v4l.h) | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2.h (renamed from v4l_experimental/pvrusb2/pvrusb2.h) | 2 | ||||
-rw-r--r-- | v4l/Make.config | 3 | ||||
-rw-r--r-- | v4l/Makefile | 7 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/.cvsignore | 7 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/Makefile | 10 |
45 files changed, 576 insertions, 275 deletions
diff --git a/v4l_experimental/pvrusb2/README b/linux/Documentation/video4linux/README.pvrusb2 index 073491307..c73a32c34 100644 --- a/v4l_experimental/pvrusb2/README +++ b/linux/Documentation/video4linux/README.pvrusb2 @@ -1,5 +1,5 @@ -$Id: README,v 1.2 2006/01/01 08:26:03 mcisely Exp $ +$Id$ Mike Isely <isely@pobox.com> pvrusb2 driver diff --git a/linux/drivers/media/video/Kconfig b/linux/drivers/media/video/Kconfig index f6889f771..7fb2e7ca5 100644 --- a/linux/drivers/media/video/Kconfig +++ b/linux/drivers/media/video/Kconfig @@ -324,6 +324,8 @@ source "drivers/media/video/cx88/Kconfig" source "drivers/media/video/em28xx/Kconfig" +source "drivers/media/video/pvrusb2/Kconfig" + config VIDEO_OVCAMCHIP tristate "OmniVision Camera Chip support" depends on VIDEO_DEV && I2C diff --git a/linux/drivers/media/video/Makefile b/linux/drivers/media/video/Makefile index 87b1ce6e2..02bd94f0f 100644 --- a/linux/drivers/media/video/Makefile +++ b/linux/drivers/media/video/Makefile @@ -45,6 +45,8 @@ obj-$(CONFIG_VIDEO_SAA7134) += ir-kbd-i2c.o saa7134/ obj-$(CONFIG_VIDEO_CX88) += cx88/ obj-$(CONFIG_VIDEO_EM28XX) += em28xx/ obj-$(CONFIG_VIDEO_EM28XX) += saa711x.o tvp5150.o +obj-$(CONFIG_VIDEO_PVRUSB2) += pvrusb2/ +obj-$(CONFIG_VIDEO_PVRUSB2) += msp3400.o obj-$(CONFIG_VIDEO_AUDIO_DECODER) += wm8775.o cs53l32a.o obj-$(CONFIG_VIDEO_OVCAMCHIP) += ovcamchip/ obj-$(CONFIG_VIDEO_CPIA2) += cpia2/ diff --git a/linux/drivers/media/video/pvrusb2/Kconfig b/linux/drivers/media/video/pvrusb2/Kconfig new file mode 100644 index 000000000..93b182c54 --- /dev/null +++ b/linux/drivers/media/video/pvrusb2/Kconfig @@ -0,0 +1,13 @@ +config VIDEO_PVRUSB2 + tristate "Hauppauge WinTV-PVR USB2 support" + depends on VIDEO_DEV && USB && I2C && EXPERIMENTAL + select FW_LOADER + select VIDEO_TUNER + select VIDEO_TVEEPROM + select VIDEO_DECODER + ---help--- + This is a video4linux driver for Conexant 23416 based + usb2 personal video recorder devices. + + To compile this driver as a module, choose M here: the + module will be called pvrusb2 diff --git a/linux/drivers/media/video/pvrusb2/Makefile b/linux/drivers/media/video/pvrusb2/Makefile new file mode 100644 index 000000000..c83742fb1 --- /dev/null +++ b/linux/drivers/media/video/pvrusb2/Makefile @@ -0,0 +1,11 @@ +pvrusb2-objs := pvrusb2-i2c-core.o pvrusb2-i2c-cmd-v4l2.o \ + pvrusb2-audio.o pvrusb2-i2c-chips-v4l2.o \ + pvrusb2-encoder.o pvrusb2-video-v4l.o \ + pvrusb2-eeprom.o pvrusb2-tuner.o pvrusb2-demod.o \ + pvrusb2-main.o pvrusb2-hdw.o pvrusb2-v4l2.o \ + pvrusb2-sysfs.o pvrusb2-context.o pvrusb2-io.o \ + pvrusb2-ioread.o pvrusb2-debugifc.o + +obj-$(CONFIG_VIDEO_PVRUSB2) += pvrusb2.o + +EXTRA_CFLAGS += -I$(src)/.. diff --git a/v4l_experimental/pvrusb2/pvrusb2-audio.c b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c index 067a686e0..7e2fab330 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-audio.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-audio.c,v 1.9 2006/01/23 07:00:31 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -155,7 +155,7 @@ static int msp3400_check(struct pvr2_msp3400_handler *ctxt) unsigned long msk; unsigned int idx; - for (idx = 0; idx < sizeof(msp3400_ops)/sizeof(msp3400_ops[0]); + for (idx = 0; idx < sizeof(msp3400_ops)/sizeof(msp3400_ops[0]); idx++) { msk = 1 << idx; if (ctxt->stale_mask & msk) continue; @@ -172,7 +172,7 @@ static void msp3400_update(struct pvr2_msp3400_handler *ctxt) unsigned long msk; unsigned int idx; - for (idx = 0; idx < sizeof(msp3400_ops)/sizeof(msp3400_ops[0]); + for (idx = 0; idx < sizeof(msp3400_ops)/sizeof(msp3400_ops[0]); idx++) { msk = 1 << idx; if (!(ctxt->stale_mask & msk)) continue; diff --git a/v4l_experimental/pvrusb2/pvrusb2-audio.h b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.h index 0a278927e..536339b68 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-audio.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-audio.h,v 1.2 2006/01/01 08:26:03 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> diff --git a/v4l_experimental/pvrusb2/pvrusb2-context.c b/linux/drivers/media/video/pvrusb2/pvrusb2-context.c index 1f8b400a0..0f0e14d01 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-context.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-context.c @@ -1,5 +1,5 @@ /* - * $Id: pvrusb2-context.c,v 1.3 2006/01/23 06:58:06 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -74,7 +74,9 @@ static void pvr2_context_setup(struct pvr2_context *mp) struct pvr2_context *pvr2_context_create( - struct usb_interface *intf,void (*setup_func)(struct pvr2_context *)) + struct usb_interface *intf, + const struct usb_device_id *devid, + void (*setup_func)(struct pvr2_context *)) { struct pvr2_context *mp = 0; mp = kmalloc(sizeof(*mp),GFP_KERNEL); @@ -83,7 +85,7 @@ struct pvr2_context *pvr2_context_create( pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr_main id=%p",mp); mp->setup_func = setup_func; mutex_init(&mp->mutex); - mp->hdw = pvr2_hdw_create(intf); + mp->hdw = pvr2_hdw_create(intf,devid); if (!mp->hdw) { pvr2_context_destroy(mp); mp = 0; @@ -183,7 +185,7 @@ void pvr2_channel_done(struct pvr2_channel *cp) int pvr2_channel_claim_stream(struct pvr2_channel *cp, - struct pvr2_context_stream *sp) + struct pvr2_context_stream *sp) { int code = 0; pvr2_context_enter(cp->mc_head); do { diff --git a/v4l_experimental/pvrusb2/pvrusb2-context.h b/linux/drivers/media/video/pvrusb2/pvrusb2-context.h index 229a8ef0e..873622a0f 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-context.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-context.h @@ -1,5 +1,5 @@ /* - * $Id: pvrusb2-context.h,v 1.3 2006/01/23 06:58:06 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -77,6 +77,7 @@ void pvr2_context_enter(struct pvr2_context *); void pvr2_context_exit(struct pvr2_context *); struct pvr2_context *pvr2_context_create(struct usb_interface *intf, + const struct usb_device_id *devid, void (*setup_func)(struct pvr2_context *)); void pvr2_context_disconnect(struct pvr2_context *); diff --git a/v4l_experimental/pvrusb2/pvrusb2-debug.h b/linux/drivers/media/video/pvrusb2/pvrusb2-debug.h index 70a143736..d95a8588e 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-debug.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-debug.h @@ -1,5 +1,5 @@ /* - * $Id: pvrusb2-debug.h,v 1.5 2006/01/14 22:09:52 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -22,7 +22,7 @@ extern int pvrusb2_debug; -#define pvr2_trace(msk, fmt, arg...) do {if(msk & pvrusb2_debug) printk(KERN_INFO "pvrusb2 " fmt "\n", ##arg); } while (0) +#define pvr2_trace(msk, fmt, arg...) do {if(msk & pvrusb2_debug) printk(KERN_INFO "pvrusb2: " fmt "\n", ##arg); } while (0) /* These are listed in *rough* order of decreasing usefulness and increasing noise level. */ diff --git a/v4l_experimental/pvrusb2/pvrusb2-debugifc.c b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c index f56b96f56..bcfe468eb 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-debugifc.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-debugifc.c,v 1.2 2006/01/01 08:26:03 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -41,7 +41,7 @@ static struct debugifc_mask_item mask_items[] = { static unsigned int debugifc_count_whitespace(const char *buf, - unsigned int count) + unsigned int count) { unsigned int scnt; char ch; @@ -58,7 +58,7 @@ static unsigned int debugifc_count_whitespace(const char *buf, static unsigned int debugifc_count_nonwhitespace(const char *buf, - unsigned int count) + unsigned int count) { unsigned int scnt; char ch; @@ -74,8 +74,8 @@ static unsigned int debugifc_count_nonwhitespace(const char *buf, static unsigned int debugifc_isolate_word(const char *buf,unsigned int count, - const char **wstrPtr, - unsigned int *wlenPtr) + const char **wstrPtr, + unsigned int *wlenPtr) { const char *wptr; unsigned int consume_cnt = 0; @@ -102,7 +102,7 @@ static unsigned int debugifc_isolate_word(const char *buf,unsigned int count, static int debugifc_parse_unsigned_number(const char *buf,unsigned int count, - u32 *num_ptr) + u32 *num_ptr) { u32 result = 0; u32 val; @@ -138,7 +138,7 @@ static int debugifc_parse_unsigned_number(const char *buf,unsigned int count, static int debugifc_match_keyword(const char *buf,unsigned int count, - const char *keyword) + const char *keyword) { unsigned int kl; if (!keyword) return 0; @@ -163,7 +163,7 @@ static unsigned long debugifc_find_mask(const char *buf,unsigned int count) static int debugifc_print_mask(char *buf,unsigned int sz, - unsigned long msk,unsigned long val) + unsigned long msk,unsigned long val) { struct debugifc_mask_item *mip; unsigned int idx; @@ -184,9 +184,9 @@ static int debugifc_print_mask(char *buf,unsigned int sz, } static unsigned int debugifc_parse_subsys_mask(const char *buf, - unsigned int count, - unsigned long *mskPtr, - unsigned long *valPtr) + unsigned int count, + unsigned long *mskPtr, + unsigned long *valPtr) { const char *wptr; unsigned int consume_cnt = 0; @@ -286,7 +286,7 @@ int pvr2_debugifc_print_info(struct pvr2_hdw *hdw,char *buf,unsigned int acnt) int pvr2_debugifc_print_status(struct pvr2_hdw *hdw, - char *buf,unsigned int acnt) + char *buf,unsigned int acnt) { int bcnt = 0; int ccnt; @@ -338,7 +338,7 @@ int pvr2_debugifc_print_status(struct pvr2_hdw *hdw, int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf, - unsigned int count) + unsigned int count) { const char *wptr; unsigned int wlen; @@ -444,7 +444,7 @@ int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf, int pvr2_debugifc_docmd(struct pvr2_hdw *hdw,const char *buf, - unsigned int count) + unsigned int count) { unsigned int bcnt = 0; int ret; diff --git a/v4l_experimental/pvrusb2/pvrusb2-debugifc.h b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.h index 59f4373d6..990b02d35 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-debugifc.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-debugifc.h,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * diff --git a/v4l_experimental/pvrusb2/pvrusb2-demod.c b/linux/drivers/media/video/pvrusb2/pvrusb2-demod.c index f7545b773..dca787dfa 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-demod.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-demod.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-demod.c,v 1.5 2006/01/22 03:48:34 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> diff --git a/v4l_experimental/pvrusb2/pvrusb2-demod.h b/linux/drivers/media/video/pvrusb2/pvrusb2-demod.h index 0067872ea..4c4e40ffb 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-demod.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-demod.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-demod.h,v 1.1 2006/01/01 08:26:03 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * diff --git a/v4l_experimental/pvrusb2/pvrusb2-eeprom.c b/linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.c index 9df9fd3eb..60ee45ca2 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-eeprom.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-eeprom.c,v 1.5 2006/01/14 19:09:50 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -86,21 +86,22 @@ */ -#define PVR_EEPROM_I2C_ADDR 0x50 - #include <media/tveeprom.h> -/* We seem to only be interested in the back half of the EEPROM */ +/* We seem to only be interested in the last 128 bytes of the EEPROM */ #define EEPROM_SIZE 128 -#define EEPROM_OFFS 128 /* Grab EEPROM contents, needed for direct method. */ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw) { struct i2c_msg msg[2]; u8 *eeprom; - u8 offs; + u8 iadd[2]; + u8 addr; + u16 eepromSize; + unsigned int offs; int ret; + int mode16 = 0; unsigned pcnt,tcnt; eeprom = kmalloc(EEPROM_SIZE,GFP_KERNEL); if (!eeprom) { @@ -110,11 +111,28 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw) return 0; } - msg[0].addr = PVR_EEPROM_I2C_ADDR; + trace_eeprom("Value for eeprom addr from controller was 0x%x", + hdw->eeprom_addr); + addr = hdw->eeprom_addr; + /* Seems that if the high bit is set, then the *real* eeprom + address is shifted right now bit position (noticed this in + newer PVR USB2 hardware) */ + if (addr & 0x80) addr >>= 1; + + /* FX2 documentation states that a 16bit-addressed eeprom is + expected if the I2C address is an odd number (yeah, this is + strange bit it's what they do) */ + mode16 = (addr & 1); + eepromSize = (mode16 ? 4096 : 256); + trace_eeprom("Examining %d byte eeprom at location 0x%x" + " using %d bit addressing",eepromSize,addr, + mode16 ? 16 : 8); + + msg[0].addr = addr; msg[0].flags = 0; - msg[0].len = 1; - msg[0].buf = &offs; - msg[1].addr = PVR_EEPROM_I2C_ADDR; + msg[0].len = mode16 ? 2 : 1; + msg[0].buf = iadd; + msg[1].addr = hdw->eeprom_addr; msg[1].flags = I2C_M_RD; /* We have to do the actual eeprom data fetch ourselves, because @@ -125,7 +143,13 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw) for (tcnt = 0; tcnt < EEPROM_SIZE; tcnt += pcnt) { pcnt = 16; if (pcnt + tcnt > EEPROM_SIZE) pcnt = EEPROM_SIZE-tcnt; - offs = tcnt + EEPROM_OFFS; + offs = tcnt + (eepromSize - EEPROM_SIZE); + if (mode16) { + iadd[0] = offs >> 8; + iadd[1] = offs; + } else { + iadd[0] = offs; + } msg[1].len = pcnt; msg[1].buf = eeprom+tcnt; if ((ret = i2c_transfer( @@ -163,7 +187,7 @@ int pvr2_eeprom_analyze(struct pvr2_hdw *hdw) { struct i2c_client fake_client; /* Newer version expects a useless client interface */ - fake_client.addr = PVR_EEPROM_I2C_ADDR; + fake_client.addr = hdw->eeprom_addr; fake_client.adapter = &hdw->i2c_adap; tveeprom_hauppauge_analog(&fake_client,&tvdata,eeprom); } diff --git a/v4l_experimental/pvrusb2/pvrusb2-eeprom.h b/linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.h index edc80b62e..061cecd91 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-eeprom.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-eeprom.h,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> diff --git a/v4l_experimental/pvrusb2/pvrusb2-encoder.c b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c index 046cd9f1f..97931d3c4 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-encoder.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-encoder.c,v 1.5 2006/01/14 20:11:08 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -147,7 +147,7 @@ static int pvr2_read_encoder_words(struct pvr2_hdw *hdw,int statusFl, static int pvr2_write_encoder_vcmd (struct pvr2_hdw *hdw, u8 cmd, - int args, ...) + int args, ...) { unsigned int poll_count; int ret = 0; @@ -308,14 +308,14 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw) the ivtv driver). But, if I leave them in, then mplayer goes nuts with xrun errors. So for now we don't do this. It sure would be nice to know what these are for. */ -#ifdef notdef +#if 0 ret |= pvr2_write_encoder_vcmd(hdw, 0xdc, 1, 5); ret |= pvr2_write_encoder_vcmd(hdw, 0xdc, 2, 3, 1); ret |= pvr2_write_encoder_vcmd(hdw, 0xdc, 1, 8); #endif /* Strange compared to ivtv data. */ -#ifdef notdef +#if 0 ret |= pvr2_write_encoder_vcmd(hdw, CX2341X_ENC_SET_NUM_VSYNC_LINES, 2, 0x0120, 0x0120); ret |= pvr2_write_encoder_vcmd(hdw, CX2341X_ENC_SET_NUM_VSYNC_LINES, 2, diff --git a/v4l_experimental/pvrusb2/pvrusb2-encoder.h b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.h index 4a35e8ac0..01b5a0b89 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-encoder.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-encoder.h,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h index c4b1cbdcd..1b161773b 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-hdw-internal.h,v 1.6 2006/01/23 06:58:06 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -93,6 +93,10 @@ struct pvr2_decoder_ctrl { #define FW1_STATE_RELOAD 3 #define FW1_STATE_OK 4 +/* Known major hardware variants, keyed from device ID */ +#define PVR2_HDW_TYPE_29XXX 0 +#define PVR2_HDW_TYPE_24XXX 1 + /* This structure contains all state data directly needed to manipulate the hardware (as opposed to complying with a kernel interface) */ @@ -101,6 +105,9 @@ struct pvr2_hdw { struct usb_device *usb_dev; struct usb_interface *usb_intf; + /* Device type, one of PVR2_HDW_TYPE_xxxxx */ + unsigned int hdw_type; + /* Video spigot */ struct pvr2_stream *vid_stream; @@ -176,6 +183,10 @@ struct pvr2_hdw { // Which subsystems are manipulated to enable streaming unsigned long subsys_stream_mask; + // True if there is a request to trigger logging of state in each + // module. + int log_requested; + /* Tuner / frequency control stuff */ unsigned int tuner_type; int tuner_updated; @@ -188,6 +199,9 @@ struct pvr2_hdw { be no v4l junk here). Probably a better way to do this. */ int v4l_minor_number; + /* Location of eeprom or a negative number if none */ + int eeprom_addr; + enum pvr2_config config; /* Information about what audio signal we're hearing */ @@ -200,7 +214,7 @@ struct pvr2_hdw { }; int pvr2_hdw_set_ctl_value_internal(struct pvr2_hdw *hdw, - unsigned int ctl_id,int value); + unsigned int ctl_id,int value); int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw); diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 20206cff9..b87651e5a 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-hdw.c,v 1.13 2006/01/23 06:58:06 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -35,6 +35,19 @@ #include "pvrusb2-encoder.h" #include "pvrusb2-debug.h" +struct usb_device_id pvr2_device_table[] = { + [PVR2_HDW_TYPE_29XXX] = { USB_DEVICE(0x2040, 0x2900) }, + [PVR2_HDW_TYPE_24XXX] = { USB_DEVICE(0x2040, 0x2400) }, + { } +}; + +MODULE_DEVICE_TABLE(usb, pvr2_device_table); + +static const char *pvr2_device_names[] = { + [PVR2_HDW_TYPE_29XXX] = "WinTV PVR USB2 Model Category 29xxxx", + [PVR2_HDW_TYPE_24XXX] = "WinTV PVR USB2 Model Category 24xxxx", +}; + static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = 0}; DECLARE_MUTEX(pvr2_unit_sem); @@ -43,14 +56,17 @@ static int initusbreset = 1; static int procreload = 0; static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 }; static int tolerance[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 }; +static int init_pause_msec = 0; module_param(ctlchg, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(ctlchg, "0=optimize ctl change 1=always accept new ctl value"); +module_param(init_pause_msec, int, S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(init_pause_msec, "hardware initialization settling delay"); module_param(initusbreset, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(initusbreset, "Do USB reset device on probe"); module_param(procreload, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(procreload, - "Attempt init failure recovery with firmware reload"); + "Attempt init failure recovery with firmware reload"); module_param_array(tuner, int, NULL, 0444); MODULE_PARM_DESC(tuner,"specify installed tuner type"); module_param_array(tolerance, int, NULL, 0444); @@ -70,10 +86,6 @@ MODULE_PARM_DESC(tolerance,"specify stream error tolerance"); /* size of a firmware chunk */ #define FIRMWARE_CHUNK_SIZE 0x2000 -/* Various files we will load with firmware_entry */ -#define FIRMWARE1_FILE "pvrusb2.f1" -#define FIRMWARE2_FILE "pvrusb2.f2" - typedef int (*pvr2_ctl_set_func)(struct pvr2_hdw *,int ctl_id,int val); typedef int (*pvr2_ctl_get_func)(struct pvr2_hdw *,int ctl_id); @@ -169,7 +181,7 @@ static int pvr2_ctl_get_subsys_mask(struct pvr2_hdw *hdw,int ctl_id); static int pvr2_ctl_set_subsys_mask(struct pvr2_hdw *hdw,int ctl_id,int val); static int pvr2_ctl_get_subsys_stream_mask(struct pvr2_hdw *hdw,int ctl_id); static int pvr2_ctl_set_subsys_stream_mask(struct pvr2_hdw *hdw,int ctl_id, - int val); + int val); static struct pvr2_ctl_def control_defs[PVR2_CID_COUNT] = { @@ -296,7 +308,7 @@ static struct pvr2_ctl_def control_defs[PVR2_CID_COUNT] = [PVR2_CID_FREQUENCY] = { .name = "Tuner Frequency (Hz)", .min_value = 55250000L, - .max_value = 801250000L, + .max_value = 850000000L, .default_value = 175250000L, }, [PVR2_CID_HRES] = { @@ -338,7 +350,7 @@ static struct pvr2_ctl_def control_defs[PVR2_CID_COUNT] = [PVR2_CID_CHANPROG_FREQ] = { .name = "Channel Program Frequency", .min_value = 55250000L, - .max_value = 801250000L, + .max_value = 850000000L, .skip_init = !0, .set_func = pvr2_ctl_set_chanprog_id, .get_func = pvr2_ctl_get_chanprog_id, @@ -421,6 +433,63 @@ int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw) } +/* Attempt to locate one of the given set of files. Messages are logged + appropriate to what has been found. The return value will be 0 or + greater on success (it will be the index of the file name found) and + fw_entry will be filled in. Otherwise a negative error is returned on + failure. If the return value is -ENOENT then no viable firmware file + could be located. */ +static int pvr2_locate_firmware(struct pvr2_hdw *hdw, + const struct firmware **fw_entry, + const char *fwtypename, + unsigned int fwcount, + const char *fwnames[]) +{ + unsigned int idx; + int ret = -EINVAL; + for (idx = 0; idx < fwcount; idx++) { + ret = request_firmware(fw_entry, + fwnames[idx], + &hdw->usb_dev->dev); + if (!ret) { + trace_firmware("Located %s firmware: %s;" + " uploading...", + fwtypename, + fwnames[idx]); + return idx; + } + if (ret == -ENOENT) continue; + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "request_firmware fatal error with code=%d",ret); + return ret; + } + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "***WARNING***" + " Device %s firmware" + " seems to be missing.", + fwtypename); + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Did you install the pvrusb2 firmware files" + " in their proper location?"); + if (fwcount == 1) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "request_firmware unable to locate %s file %s", + fwtypename,fwnames[0]); + } else { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "request_firmware unable to locate" + " one of the following %s files:", + fwtypename); + for (idx = 0; idx < fwcount; idx++) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "request_firmware: Failed to find %s", + fwnames[idx]); + } + } + return ret; +} + + /* * pvr2_upload_firmware1(). * @@ -438,27 +507,41 @@ int pvr2_upload_firmware1(struct pvr2_hdw *hdw) unsigned int pipe; int ret; u16 address; - const char *firmware_file = FIRMWARE1_FILE; - + static const char *fw_files_29xxx[] = { + "v4l-pvrusb2-29xxx-01.fw", + }; + static const char *fw_files_24xxx[] = { + "v4l-pvrusb2-24xxx-01.fw", + }; + static const struct { + const char **lst; + unsigned int cnt; + } fw_file_defs[] = { + [PVR2_HDW_TYPE_29XXX] = { + fw_files_29xxx, + sizeof(fw_files_29xxx)/sizeof(fw_files_29xxx[0]), + }, + [PVR2_HDW_TYPE_24XXX] = { + fw_files_24xxx, + sizeof(fw_files_24xxx)/sizeof(fw_files_24xxx[0]), + }, + }; hdw->fw1_state = FW1_STATE_FAILED; // default result trace_firmware("pvr2_upload_firmware1"); + ret = pvr2_locate_firmware(hdw,&fw_entry,"fx2 controller", + fw_file_defs[hdw->hdw_type].cnt, + fw_file_defs[hdw->hdw_type].lst); + if (ret < 0) { + if (ret == -ENOENT) hdw->fw1_state = FW1_STATE_MISSING; + return ret; + } + usb_settoggle(hdw->usb_dev, 0 & 0xf, !(0 & USB_DIR_IN), 0); usb_clear_halt(hdw->usb_dev, usb_sndbulkpipe(hdw->usb_dev, 0 & 0x7f)); pipe = usb_sndctrlpipe(hdw->usb_dev, 0); - ret = request_firmware(&fw_entry, firmware_file, &hdw->usb_dev->dev); - - if (ret) { - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "request_firmware failed for '%s' code=%d", - firmware_file,ret); - if (ret == -ENOENT) { - hdw->fw1_state = FW1_STATE_MISSING; - } - return ret; - } if (fw_entry->size != 0x2000){ pvr2_trace(PVR2_TRACE_ERROR_LEGS,"wrong fx2 firmware size"); @@ -519,9 +602,20 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) unsigned int pipe, fw_len, fw_done; int actual_length; int ret = 0; + int fwidx; + static const char *fw_files[] = { + "v4l-cx2341x-enc.fw", + }; trace_firmware("pvr2_upload_firmware2"); + ret = pvr2_locate_firmware(hdw,&fw_entry,"encoder", + sizeof(fw_files)/sizeof(fw_files[0]), + fw_files); + if (ret < 0) return ret; + fwidx = ret; + ret = 0; + /* First prepare firmware loading */ ret |= pvr2_hdw_cmd_soft_reset(hdw); ret |= pvr2_write_register(hdw, 0x0048, 0xffffffff); /*interrupt mask*/ @@ -546,34 +640,19 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) if (ret) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "firmware2 upload prep failed, ret=%d",ret); + release_firmware(fw_entry); return ret; } /* Now send firmware */ - ret = request_firmware(&fw_entry, FIRMWARE2_FILE, &hdw->usb_dev->dev); - - if (ret) { - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "request_firmware failed for '%s'", FIRMWARE2_FILE); - if (ret == -ENOENT) { - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "***WARNING***" - " Device encoder firmware" - " seems to be missing."); - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "Did you install the pvrusb2 firmware files" - " in their proper location?"); - } - return ret; - } - fw_len = fw_entry->size; if (fw_len % FIRMWARE_CHUNK_SIZE) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "size of %s must be a multiple of 8192B", - FIRMWARE2_FILE); + "size of %s firmware" + " must be a multiple of 8192B", + fw_files[fwidx]); release_firmware(fw_entry); return -1; } @@ -603,7 +682,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) } trace_firmware("upload of %s : %i / %i ", - FIRMWARE2_FILE,fw_done,fw_len); + fw_files[fwidx],fw_done,fw_len); kfree(fw_ptr); release_firmware(fw_entry); @@ -842,8 +921,8 @@ unsigned long pvr2_hdw_subsys_stream_get(struct pvr2_hdw *hdw) void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk, - unsigned long val) + unsigned long msk, + unsigned long val) { unsigned long val2; msk &= PVR2_SUBSYS_ALL; @@ -856,8 +935,8 @@ void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, void pvr2_hdw_subsys_stream_bit_chg(struct pvr2_hdw *hdw, - unsigned long msk, - unsigned long val) + unsigned long msk, + unsigned long val) { LOCK_TAKE(hdw->big_lock); do { pvr2_hdw_subsys_stream_bit_chg_no_lock(hdw,msk,val); @@ -906,7 +985,7 @@ int pvr2_hdw_set_streaming(struct pvr2_hdw *hdw,int enable_flag) int pvr2_hdw_set_stream_type_no_lock(struct pvr2_hdw *hdw, - enum pvr2_config config) + enum pvr2_config config) { unsigned long sm = hdw->subsys_enabled_mask; if (!hdw->flag_ok) return -EIO; @@ -952,10 +1031,55 @@ static unsigned int get_default_error_tolerance(struct pvr2_hdw *hdw) } +static int pvr2_hdw_check_firmware(struct pvr2_hdw *hdw) +{ + /* Try a harmless request to fetch the eeprom's address over + endpoint 1. See what happens. Only the full FX2 image can + respond to this. If this probe fails then likely the FX2 + firmware needs be loaded. */ + int result; + LOCK_TAKE(hdw->ctl_lock); do { + hdw->cmd_buffer[0] = 0xeb; + result = pvr2_send_request_ex(hdw,HZ*1,!0, + hdw->cmd_buffer,1, + hdw->cmd_buffer,1); + if (result < 0) break; + } while(0); LOCK_GIVE(hdw->ctl_lock); + if (result) { + pvr2_trace(PVR2_TRACE_INIT, + "Probe of device endpoint 1 result status %d", + result); + } else { + pvr2_trace(PVR2_TRACE_INIT, + "Probe of device endpoint 1 succeeded"); + } + return result == 0; +} + + static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw) { + int ret; unsigned int idx; - if (hdw->usb_intf->cur_altsetting->desc.bNumEndpoints == 0) { + int reloadFl = 0; + if (!reloadFl) { + reloadFl = (hdw->usb_intf->cur_altsetting->desc.bNumEndpoints + == 0); + if (reloadFl) { + pvr2_trace(PVR2_TRACE_INIT, + "USB endpoint config looks strange" + "; possibly firmware needs to be loaded"); + } + } + if (!reloadFl) { + reloadFl = !pvr2_hdw_check_firmware(hdw); + if (reloadFl) { + pvr2_trace(PVR2_TRACE_INIT, + "Check for FX2 firmware failed" + "; possibly firmware needs to be loaded"); + } + } + if (reloadFl) { if (pvr2_upload_firmware1(hdw) != 0) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Failure uploading firmware1"); @@ -987,8 +1111,16 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw) pvr2_reset_ctl_endpoints(hdw); if (!pvr2_hdw_dev_ok(hdw)) return; - pvr2_eeprom_analyze(hdw); + ret = pvr2_hdw_get_eeprom_addr(hdw); if (!pvr2_hdw_dev_ok(hdw)) return; + if (ret < 0) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Unable to determine location of eeprom, skipping"); + } else { + hdw->eeprom_addr = ret; + pvr2_eeprom_analyze(hdw); + if (!pvr2_hdw_dev_ok(hdw)) return; + } if (!get_default_tuner_type(hdw)) { pvr2_trace(PVR2_TRACE_INIT, @@ -1059,21 +1191,17 @@ int pvr2_hdw_setup(struct pvr2_hdw *hdw) " and reconnect."); break; } + pvr2_trace( + PVR2_TRACE_ERROR_LEGS, + "Device initialization was not successful."); if (hdw->fw1_state == FW1_STATE_MISSING) { pvr2_trace( PVR2_TRACE_ERROR_LEGS, - "***WARNING***" - " Device microcontroller firmware" - " seems to be missing."); - pvr2_trace( - PVR2_TRACE_ERROR_LEGS, - "Did you install the pvrusb2 firmware" - " files in their proper location?"); + "Giving up since device" + " microcontroller firmware" + " appears to be missing."); break; } - pvr2_trace( - PVR2_TRACE_ERROR_LEGS, - "Device initialization was not successful."); } if (procreload) { pvr2_trace( @@ -1099,22 +1227,37 @@ int pvr2_hdw_setup(struct pvr2_hdw *hdw) " in order to recover."); } } while (0); LOCK_GIVE(hdw->big_lock); + pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_setup(hdw=%p) end",hdw); return hdw->flag_init_ok; } /* Create and return a structure for interacting with the underlying hardware */ -struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf) +struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, + const struct usb_device_id *devid) { unsigned int idx,cnt1,cnt2; struct pvr2_hdw *hdw; + unsigned int hdw_type; __u8 ifnum; + hdw_type = devid - pvr2_device_table; + if (hdw_type >= + sizeof(pvr2_device_names)/sizeof(pvr2_device_names[0])) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Bogus device type of %u reported",hdw_type); + return 0; + } + hdw = kmalloc(sizeof(*hdw),GFP_KERNEL); - pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p",hdw); + pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"", + hdw,pvr2_device_names[hdw_type]); if (!hdw) goto fail; memset(hdw,0,sizeof(*hdw)); + hdw->hdw_type = hdw_type; + + hdw->eeprom_addr = -1; hdw->unit_number = -1; hdw->v4l_minor_number = -1; hdw->ctl_write_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL); @@ -1342,7 +1485,7 @@ int pvr2_hdw_get_ctl_max_value(struct pvr2_hdw *hdw,unsigned int ctl_id) /* Set current value for given control - normally this is just stored and the hardware isn't updated until the commit function is called. */ int pvr2_hdw_set_ctl_value_internal(struct pvr2_hdw *hdw, - unsigned int ctl_id,int value) + unsigned int ctl_id,int value) { if (ctl_id >= PVR2_CID_COUNT) return -EINVAL; if (value < control_defs[ctl_id].min_value) return -EINVAL; @@ -1377,8 +1520,8 @@ int pvr2_hdw_set_ctl_value(struct pvr2_hdw *hdw,unsigned int ctl_id,int value) /* Retrieve string name for a given control value (returns a null pointer for any invalid combinations). */ const char *pvr2_hdw_get_ctl_value_name(struct pvr2_hdw *hdw, - unsigned int ctl_id, - int value) + unsigned int ctl_id, + int value) { struct pvr2_ctl_def *cdef; if (ctl_id >= PVR2_CID_COUNT) return 0; @@ -1641,7 +1784,7 @@ static int pvr2_ctl_get_subsys_stream_mask(struct pvr2_hdw *hdw,int ctl_id) static int pvr2_ctl_set_subsys_stream_mask(struct pvr2_hdw *hdw,int ctl_id, - int val) + int val) { pvr2_hdw_subsys_stream_bit_chg_no_lock(hdw,~0,val); return 0; @@ -1697,6 +1840,16 @@ struct pvr2_stream *pvr2_hdw_get_video_stream(struct pvr2_hdw *hp) } +void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw) +{ + LOCK_TAKE(hdw->big_lock); do { + hdw->log_requested = !0; + pvr2_i2c_core_check_stale(hdw); + hdw->log_requested = 0; + pvr2_i2c_core_sync(hdw); + } while (0); LOCK_GIVE(hdw->big_lock); +} + void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, int enable_flag) { int ret; @@ -1757,7 +1910,7 @@ int pvr2_hdw_cpufw_get_enabled(struct pvr2_hdw *hdw) int pvr2_hdw_cpufw_get(struct pvr2_hdw *hdw,unsigned int offs, - char *buf,unsigned int cnt) + char *buf,unsigned int cnt) { int ret = -EINVAL; LOCK_TAKE(hdw->big_lock); do { @@ -1853,31 +2006,33 @@ static void pvr2_ctl_timeout(unsigned long data) } -int pvr2_send_request(struct pvr2_hdw *hdw, - void *write_data,unsigned int write_len, - void *read_data,unsigned int read_len) +int pvr2_send_request_ex(struct pvr2_hdw *hdw, + unsigned int timeout,int probe_fl, + void *write_data,unsigned int write_len, + void *read_data,unsigned int read_len) { unsigned int idx; - int status; + int status = 0; struct timer_list timer; if (!hdw->ctl_lock_held) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Attempted to execute control transfer" " without lock!!"); - status = -EINVAL; - goto done; + return -EDEADLK; } - if (!hdw->flag_ok) { + if ((!hdw->flag_ok) && !probe_fl) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Attempted to execute control transfer" " when device not ok"); return -EIO; } if (!(hdw->ctl_read_urb && hdw->ctl_write_urb)) { - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "Attempted to execute control transfer" - " when USB is disconnected"); - return -EIO; + if (!probe_fl) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Attempted to execute control transfer" + " when USB is disconnected"); + } + return -ENOTTY; } /* Ensure that we have sane parameters */ @@ -1921,7 +2076,7 @@ int pvr2_send_request(struct pvr2_hdw *hdw, hdw->ctl_write_pend_flag = 0; hdw->ctl_read_pend_flag = 0; init_timer(&timer); - timer.expires = jiffies + HZ*4; + timer.expires = jiffies + timeout; timer.data = (unsigned long)hdw; timer.function = pvr2_ctl_timeout; @@ -1952,6 +2107,7 @@ int pvr2_send_request(struct pvr2_hdw *hdw, "Failed to submit write-control" " URB status=%d",status); hdw->ctl_write_pend_flag = 0; + goto done; } } @@ -1978,6 +2134,7 @@ int pvr2_send_request(struct pvr2_hdw *hdw, "Failed to submit read-control" " URB status=%d",status); hdw->ctl_read_pend_flag = 0; + goto done; } } @@ -1999,6 +2156,10 @@ int pvr2_send_request(struct pvr2_hdw *hdw, if (hdw->ctl_timeout_flag) { status = -ETIMEDOUT; + if (!probe_fl) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Timed out control-write"); + } goto done; } @@ -2011,19 +2172,24 @@ int pvr2_send_request(struct pvr2_hdw *hdw, /* USB subsystem is reporting some kind of failure on the write */ status = hdw->ctl_write_urb->status; - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "control-write URB failure, status=%d", - status); + if (!probe_fl) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "control-write URB failure," + " status=%d", + status); + } goto done; } if (hdw->ctl_write_urb->actual_length < write_len) { /* Failed to write enough data */ status = -EIO; - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "control-write URB short," - " expected=%d got=%d", - write_len, - hdw->ctl_write_urb->actual_length); + if (!probe_fl) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "control-write URB short," + " expected=%d got=%d", + write_len, + hdw->ctl_write_urb->actual_length); + } goto done; } } @@ -2036,18 +2202,24 @@ int pvr2_send_request(struct pvr2_hdw *hdw, /* USB subsystem is reporting some kind of failure on the read */ status = hdw->ctl_read_urb->status; - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "control-read URB failure, status=%d", - status); + if (!probe_fl) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "control-read URB failure," + " status=%d", + status); + } goto done; } if (hdw->ctl_read_urb->actual_length < read_len) { /* Failed to read enough data */ status = -EIO; - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "control-read URB short," - " expected=%d got=%d", - read_len,hdw->ctl_read_urb->actual_length); + if (!probe_fl) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "control-read URB short," + " expected=%d got=%d", + read_len, + hdw->ctl_read_urb->actual_length); + } goto done; } /* Transfer retrieved data out from internal buffer */ @@ -2059,13 +2231,22 @@ int pvr2_send_request(struct pvr2_hdw *hdw, done: hdw->cmd_debug_state = 0; - if (status < 0) { + if ((status < 0) && (!probe_fl)) { pvr2_hdw_render_useless_unlocked(hdw); } return status; } +int pvr2_send_request(struct pvr2_hdw *hdw, + void *write_data,unsigned int write_len, + void *read_data,unsigned int read_len) +{ + return pvr2_send_request_ex(hdw,HZ*4,0, + write_data,write_len, + read_data,read_len); +} + int pvr2_write_register(struct pvr2_hdw *hdw, u16 reg, u32 data) { int ret; @@ -2177,6 +2358,13 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Failed to lock USB device ret=%d",ret); } + if (init_pause_msec) { + pvr2_trace(PVR2_TRACE_INFO, + "Waiting %u msec for hardware to settle", + init_pause_msec); + msleep(init_pause_msec); + } + } @@ -2247,7 +2435,7 @@ int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) void pvr2_hdw_get_debug_info(const struct pvr2_hdw *hdw, - struct pvr2_hdw_debug_info *ptr) + struct pvr2_hdw_debug_info *ptr) { ptr->big_lock_held = hdw->big_lock_held; ptr->ctl_lock_held = hdw->ctl_lock_held; @@ -2327,6 +2515,21 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val) } +int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) +{ + int result; + LOCK_TAKE(hdw->ctl_lock); do { + hdw->cmd_buffer[0] = 0xeb; + result = pvr2_send_request(hdw, + hdw->cmd_buffer,1, + hdw->cmd_buffer,1); + if (result < 0) break; + result = hdw->cmd_buffer[0]; + } while(0); LOCK_GIVE(hdw->ctl_lock); + return result; +} + + /* Stuff for Emacs to see, in order to encourage consistent editing style: *** Local Variables: *** diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h index d813d07d4..667c95a27 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-hdw.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-hdw.h,v 1.6 2006/01/14 21:11:17 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -145,7 +145,7 @@ #define PVR2_SUBSYS_ENC_RUN (1 << 4) #define PVR2_SUBSYS_CFG_ALL ( \ - PVR2_SUBSYS_ENC_FIRMWARE | \ + PVR2_SUBSYS_ENC_FIRMWARE | \ PVR2_SUBSYS_ENC_CFG ) #define PVR2_SUBSYS_RUN_ALL ( \ PVR2_SUBSYS_DIGITIZER_RUN | \ @@ -168,7 +168,8 @@ struct pvr2_hdw; /* Create and return a structure for interacting with the underlying hardware */ -struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf); +struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, + const struct usb_device_id *devid); /* Poll for background activity (if any) */ void pvr2_hdw_poll(struct pvr2_hdw *); @@ -235,7 +236,7 @@ const char *pvr2_hdw_get_ctl_name(struct pvr2_hdw *,unsigned int ctl_id); /* Retrieve string name for a given control value (returns a null pointer for any invalid combinations). */ const char *pvr2_hdw_get_ctl_value_name(struct pvr2_hdw *, - unsigned int ctl_id,int value); + unsigned int ctl_id,int value); /* Commit all control changes made up to this point */ int pvr2_hdw_commit_ctl(struct pvr2_hdw *); @@ -269,7 +270,7 @@ struct pvr2_stream *pvr2_hdw_get_video_stream(struct pvr2_hdw *); identified by bit positions within msk, and new state for each item is identified by corresponding bit positions within val. */ void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw, - unsigned long msk,unsigned long val); + unsigned long msk,unsigned long val); /* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,msk) */ void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk); @@ -284,7 +285,7 @@ unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *); /* Adjust mask of what get shut down when streaming is stopped. This is a debugging aid. */ void pvr2_hdw_subsys_stream_bit_chg(struct pvr2_hdw *hdw, - unsigned long msk,unsigned long val); + unsigned long msk,unsigned long val); /* Retrieve mask indicating which pieces of hardware are disabled when streaming is turned off. */ @@ -304,7 +305,7 @@ int pvr2_hdw_cpufw_get_enabled(struct pvr2_hdw *); value is the number of bytes retrieved or zero if we're past the end or an error otherwise (e.g. if firmware retrieval is not enabled). */ int pvr2_hdw_cpufw_get(struct pvr2_hdw *,unsigned int offs, - char *buf,unsigned int cnt); + char *buf,unsigned int cnt); /* Retrieve previously stored v4l minor device number */ int pvr2_hdw_v4l_get_minor_number(struct pvr2_hdw *); @@ -322,8 +323,17 @@ void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw); /* Issue a command and get a response from the device. LOTS of higher level stuff is built on this. */ -int pvr2_send_request(struct pvr2_hdw *, void *, unsigned int, - void *, unsigned int); +int pvr2_send_request(struct pvr2_hdw *, + void *write_ptr,unsigned int write_len, + void *read_ptr,unsigned int read_len); + +/* Issue a command and get a response from the device. This extended + version includes a probe flag (which if set means that device errors + should not be logged or treated as fatal) and a timeout in jiffies. + This can be used to non-lethally probe the health of endpoint 1. */ +int pvr2_send_request_ex(struct pvr2_hdw *,unsigned int timeout,int probe_fl, + void *write_ptr,unsigned int write_len, + void *read_ptr,unsigned int read_len); /* Slightly higher level device communication functions. */ int pvr2_write_register(struct pvr2_hdw *, u16, u32); @@ -353,6 +363,9 @@ int pvr2_hdw_cmd_soft_reset(struct pvr2_hdw *); /* Stop / start video stream transport */ int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl); +/* Find I2C address of eeprom */ +int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *); + /* Direct manipulation of GPIO bits */ int pvr2_hdw_gpio_get_dir(struct pvr2_hdw *hdw,u32 *); int pvr2_hdw_gpio_get_out(struct pvr2_hdw *hdw,u32 *); @@ -385,13 +398,18 @@ struct pvr2_hdw_debug_info { kind of locking and so it is not atomic and may yield inconsistent results. This is *purely* a debugging aid. */ void pvr2_hdw_get_debug_info(const struct pvr2_hdw *hdw, - struct pvr2_hdw_debug_info *); + struct pvr2_hdw_debug_info *); + +/* Cause modules to log their state once */ +void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw); /* Cause encoder firmware to be uploaded into the device. This is normally done autonomously, but the interface is exported here because it is also a debugging aid. */ int pvr2_upload_firmware2(struct pvr2_hdw *hdw); +/* List of device types that we can match */ +extern struct usb_device_id pvr2_device_table[]; #endif /* __PVRUSB2_HDW_H */ diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c index ff8d38063..2d97653d5 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-i2c-chips-v4l2.c,v 1.3 2006/01/22 03:55:03 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -37,6 +37,7 @@ #define OP_FREQ 3 #define OP_AUDIORATE 4 #define OP_SIZE 5 +#define OP_LOG 6 static const struct pvr2_i2c_op * const ops[] = { [OP_STANDARD] = &pvr2_i2c_op_v4l2_standard, @@ -44,6 +45,7 @@ static const struct pvr2_i2c_op * const ops[] = { [OP_VOLUME] = &pvr2_i2c_op_v4l2_volume, [OP_FREQ] = &pvr2_i2c_op_v4l2_frequency, [OP_SIZE] = &pvr2_i2c_op_v4l2_size, + [OP_LOG] = &pvr2_i2c_op_v4l2_log, }; void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) @@ -54,7 +56,8 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) (1 << OP_BCSH) | (1 << OP_VOLUME) | (1 << OP_FREQ) | - (1 << OP_SIZE)); + (1 << OP_SIZE) | + (1 << OP_LOG)); if (id == I2C_DRIVERID_MSP3400) { if (pvr2_i2c_msp3400_setup(hdw,cp)) { diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c index 92f2dfa6a..69864782b 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-i2c-cmd-v4l2.c,v 1.1 2006/01/01 08:26:03 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -218,6 +218,27 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size = { }; +static void do_log(struct pvr2_hdw *hdw) +{ + pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 do_log()"); + pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,0); + +} + + +static int check_log(struct pvr2_hdw *hdw) +{ + return hdw->log_requested != 0; +} + + +const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log = { + .check = check_log, + .update = do_log, + .name = "v4l2_log", +}; + + /* Stuff for Emacs to see, in order to encourage consistent editing style: *** Local Variables: *** diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.h b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h index 8c3945e93..fa0a3af7e 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-i2c-cmd-v4l2.h,v 1.1 2006/01/01 08:26:03 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -31,6 +31,7 @@ extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_bcsh; extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_volume; extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_frequency; extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size; +extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log; #endif /* __PVRUSB2_CMD_V4L2_H */ diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index b45463a2d..8ec637e5e 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-i2c-core.c,v 1.5 2006/01/23 06:58:06 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -39,19 +39,26 @@ module_param(i2c_scan, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */ - u8 i2c_addr, /* I2C address we're talking to */ - u8 *data, /* Data to write */ - u16 length) /* Size of data to write */ + u8 i2c_addr, /* I2C address we're talking to */ + u8 *data, /* Data to write */ + u16 length) /* Size of data to write */ { /* Return value - default 0 means success */ int ret; -#ifdef notdef +#if 0 trace_i2c("pvr2_i2c_write"); #endif if (!data) length = 0; - if (length > (sizeof(hdw->cmd_buffer) - 3)) return -ENOTSUPP; + if (length > (sizeof(hdw->cmd_buffer) - 3)) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Killing an I2C write to %u that is too large" + " (desired=%u limit=%u)", + i2c_addr, + length,(sizeof(hdw->cmd_buffer) - 3)); + return -ENOTSUPP; + } LOCK_TAKE(hdw->ctl_lock); @@ -80,7 +87,7 @@ static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */ } } } -#ifdef notdef +#if 0 trace_i2c("i2c_write(%d) len=%d ret=%d stat=%d",i2c_addr,length,ret, hdw->cmd_buffer[0]); #endif @@ -91,16 +98,16 @@ static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */ } static int pvr2_i2c_read(struct pvr2_hdw *hdw, /* Context */ - u8 i2c_addr, /* I2C address we're talking to */ - u8 *data, /* Data to write */ - u16 dlen, /* Size of data to write */ - u8 *res, /* Where to put data we read */ - u16 rlen) /* Amount of data to read */ + u8 i2c_addr, /* I2C address we're talking to */ + u8 *data, /* Data to write */ + u16 dlen, /* Size of data to write */ + u8 *res, /* Where to put data we read */ + u16 rlen) /* Amount of data to read */ { /* Return value - default 0 means success */ int ret; -#ifdef notdef +#if 0 trace_i2c("pvr2_i2c_read"); #endif @@ -138,7 +145,7 @@ static int pvr2_i2c_read(struct pvr2_hdw *hdw, /* Context */ } } -#ifdef notdef +#if 0 trace_i2c("i2c_read(%d) wlen=%d rlen=%d ret=%d stat=%d", i2c_addr,dlen,rlen,ret,hdw->cmd_buffer[0]); #endif @@ -160,8 +167,8 @@ static int pvr2_i2c_read(struct pvr2_hdw *hdw, /* Context */ /* This is a very, very limited I2C adapter implementation. We can only support what we actually know will work on the device... */ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, - struct i2c_msg msgs[], - int num) + struct i2c_msg msgs[], + int num) { int ret = -ENOTSUPP; struct pvr2_hdw *hdw = (struct pvr2_hdw *)(i2c_adap->algo_data); @@ -282,14 +289,14 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, } static int pvr2_i2c_control(struct i2c_adapter *adapter, - unsigned int cmd, unsigned long arg) + unsigned int cmd, unsigned long arg) { return 0; } static u32 pvr2_i2c_functionality(struct i2c_adapter *adap) { - return I2C_FUNC_SMBUS_EMUL; + return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C; } static int pvr2_i2c_core_singleton(struct i2c_client *cp, @@ -692,7 +699,7 @@ static int pvr2_i2c_detach_inform(struct i2c_client *client) static struct i2c_algorithm pvr2_i2c_algo_template = { #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) - .id = I2C_ALGO_BIT | I2C_HW_B_BT848, + .id = I2C_HW_B_BT848, #endif .master_xfer = pvr2_i2c_xfer, .algo_control = pvr2_i2c_control, @@ -702,11 +709,7 @@ static struct i2c_algorithm pvr2_i2c_algo_template = { static struct i2c_adapter pvr2_i2c_adap_template = { .owner = THIS_MODULE, .class = I2C_CLASS_TV_ANALOG, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) - .id = I2C_ALGO_BIT | I2C_HW_B_BT848, -#else .id = I2C_HW_B_BT848, -#endif .client_register = pvr2_i2c_attach_inform, .client_unregister = pvr2_i2c_detach_inform, }; diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-core.h b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h index 3e8f71962..e8af5b0ed 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-i2c-core.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-i2c-core.h,v 1.1 2006/01/01 08:26:03 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * diff --git a/v4l_experimental/pvrusb2/pvrusb2-io.c b/linux/drivers/media/video/pvrusb2/pvrusb2-io.c index d53c63785..a6bc3befe 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-io.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-io.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-io.c,v 1.3 2006/01/23 06:58:06 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -36,7 +36,7 @@ // #define SANITY_CHECK_BUFFERS -#ifdef notdef +#if 0 #define BUFFER_CHECK(bp) do { \ if ((bp)->signature != BUFFER_SIG) { \ pvr2_trace(PVR2_TRACE_ERROR_LEGS, \ @@ -44,7 +44,7 @@ (bp),__FILE__,__LINE__); \ pvr2_buffer_describe(bp,"BadSig"); \ BUG(); \ - } \ + } \ } while (0) #endif @@ -56,7 +56,7 @@ (bp),__FILE__,__LINE__); \ pvr2_buffer_describe(bp,"BadSig"); \ BUG(); \ - } \ + } \ } while (0) #else #define BUFFER_CHECK(bp) do {} while(0) @@ -278,8 +278,8 @@ static void pvr2_buffer_wipe(struct pvr2_buffer *bp) } static int pvr2_buffer_init(struct pvr2_buffer *bp, - struct pvr2_stream *sp, - unsigned int id) + struct pvr2_stream *sp, + unsigned int id) { memset(bp,0,sizeof(*bp)); bp->signature = BUFFER_SIG; @@ -508,8 +508,8 @@ void pvr2_stream_destroy(struct pvr2_stream *sp) } void pvr2_stream_setup(struct pvr2_stream *sp, - struct usb_device *dev, - int endpoint, + struct usb_device *dev, + int endpoint, unsigned int tolerance) { mutex_lock(&sp->mutex); do { @@ -521,8 +521,8 @@ void pvr2_stream_setup(struct pvr2_stream *sp, } void pvr2_stream_set_callback(struct pvr2_stream *sp, - pvr2_stream_callback func, - void *data) + pvr2_stream_callback func, + void *data) { unsigned long irq_flags; mutex_lock(&sp->mutex); do { diff --git a/v4l_experimental/pvrusb2/pvrusb2-io.h b/linux/drivers/media/video/pvrusb2/pvrusb2-io.h index 5dc72b1ef..65e11385b 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-io.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-io.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-io.h,v 1.2 2006/01/09 06:54:46 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -42,11 +42,11 @@ const char *pvr2_buffer_state_decode(enum pvr2_buffer_state); struct pvr2_stream *pvr2_stream_create(void); void pvr2_stream_destroy(struct pvr2_stream *); void pvr2_stream_setup(struct pvr2_stream *, - struct usb_device *dev,int endpoint, + struct usb_device *dev,int endpoint, unsigned int tolerance); void pvr2_stream_set_callback(struct pvr2_stream *, - pvr2_stream_callback func, - void *data); + pvr2_stream_callback func, + void *data); /* Query / set the nominal buffer count */ int pvr2_stream_get_buffer_count(struct pvr2_stream *); diff --git a/v4l_experimental/pvrusb2/pvrusb2-ioread.c b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c index 375dd8acb..4182d75b7 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-ioread.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-ioread.c,v 1.2 2006/01/23 06:58:06 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * diff --git a/v4l_experimental/pvrusb2/pvrusb2-ioread.h b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h index ec2a23325..e6205f123 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-ioread.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-ioread.h,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * diff --git a/v4l_experimental/pvrusb2/pvrusb2-main.c b/linux/drivers/media/video/pvrusb2/pvrusb2-main.c index 72b5132e6..c554671af 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-main.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-main.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-main.c,v 1.7 2006/01/22 03:51:19 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -62,11 +62,6 @@ MODULE_PARM_DESC(debug, "Debug trace mask"); static struct pvr2_sysfs_class *class_ptr = 0; -static struct usb_device_id pvr_table[] = { - { USB_DEVICE(0x2040, 0x2900) }, - { } -}; - static void pvr_setup_attach(struct pvr2_context *pvr) { /* Create association with v4l layer */ @@ -80,7 +75,7 @@ static int pvr_probe(struct usb_interface *intf, struct pvr2_context *pvr; /* Create underlying hardware interface */ - pvr = pvr2_context_create(intf,pvr_setup_attach); + pvr = pvr2_context_create(intf,devid,pvr_setup_attach); if (!pvr) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Failed to create hdw handler"); @@ -116,7 +111,7 @@ static struct usb_driver pvr_driver = { owner: THIS_MODULE, #endif name: "pvrusb2", - id_table: pvr_table, + id_table: pvr2_device_table, probe: pvr_probe, disconnect: pvr_disconnect }; @@ -166,7 +161,11 @@ static void __exit pvr_exit(void) module_init(pvr_init); module_exit(pvr_exit); -MODULE_DEVICE_TABLE (usb, pvr_table); +/* Mike Isely <mcisely@pobox.com> 11-Mar-2006: See pvrusb2-hdw.c for + MODULE_DEVICE_TABLE(). We have to declare that attribute there + because that's where the device table actually is now and it seems + that certain gcc configurations get angry if MODULE_DEVICE_TABLE() + is used on what ends up being an external symbol. */ MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); diff --git a/v4l_experimental/pvrusb2/pvrusb2-sysfs.c b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 7d17ee749..a9710b52c 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-sysfs.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-sysfs.c,v 1.2 2006/01/22 03:51:19 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -196,7 +196,7 @@ static ssize_t show_enum(int id,struct class_device *class_dev,char *buf) } static int store_val_any(int id,struct pvr2_sysfs *sfp, - const char *buf,unsigned int count) + const char *buf,unsigned int count) { int val,minval,maxval; int ch,ret; @@ -293,7 +293,7 @@ static int store_val_any(int id,struct pvr2_sysfs *sfp, } static int store_val_multi(int id,struct pvr2_sysfs *sfp, - const char *buf,unsigned int count) + const char *buf,unsigned int count) { unsigned int count2; int ret; @@ -311,7 +311,7 @@ static int store_val_multi(int id,struct pvr2_sysfs *sfp, } static ssize_t store_val_int(int id,struct class_device *class_dev, - const char *buf,size_t count) + const char *buf,size_t count) { struct pvr2_sysfs *sfp; int ret; @@ -322,7 +322,7 @@ static ssize_t store_val_int(int id,struct class_device *class_dev, } static ssize_t store_val_enum(int id,struct class_device *class_dev, - const char *buf,size_t count) + const char *buf,size_t count) { struct pvr2_sysfs *sfp; int ret; @@ -646,7 +646,7 @@ static ssize_t unit_number_show(struct class_device *class_dev,char *buf) static void class_dev_create(struct pvr2_sysfs *sfp, - struct pvr2_sysfs_class *class_ptr) + struct pvr2_sysfs_class *class_ptr) { struct usb_device *usb_dev; struct class_device *class_dev; @@ -707,7 +707,7 @@ static void pvr2_sysfs_internal_check(struct pvr2_channel *chp) struct pvr2_sysfs *pvr2_sysfs_create(struct pvr2_context *mp, - struct pvr2_sysfs_class *class_ptr) + struct pvr2_sysfs_class *class_ptr) { struct pvr2_sysfs *sfp; sfp = kmalloc(sizeof(*sfp),GFP_KERNEL); @@ -723,7 +723,7 @@ struct pvr2_sysfs *pvr2_sysfs_create(struct pvr2_context *mp, static int pvr2_sysfs_hotplug(struct class_device *cd,char **envp, - int numenvp,char *buf,int size) + int numenvp,char *buf,int size) { /* Even though we don't do anything here, we still need this function because sysfs will still try to call it. */ @@ -766,6 +766,7 @@ static ssize_t debuginfo_show(struct class_device *class_dev,char *buf) struct pvr2_sysfs *sfp; sfp = (struct pvr2_sysfs *)class_dev->class_data; if (!sfp) return -EINVAL; + pvr2_hdw_trigger_module_log(sfp->channel.hdw); return pvr2_debugifc_print_info(sfp->channel.hdw,buf,PAGE_SIZE); } @@ -780,7 +781,7 @@ static ssize_t debugcmd_show(struct class_device *class_dev,char *buf) static ssize_t debugcmd_store(struct class_device *class_dev, - const char *buf,size_t count) + const char *buf,size_t count) { struct pvr2_sysfs *sfp; int ret; diff --git a/v4l_experimental/pvrusb2/pvrusb2-sysfs.h b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.h index 20dcc3256..ff9373b47 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-sysfs.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-sysfs.h,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -32,7 +32,7 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void); void pvr2_sysfs_class_destroy(struct pvr2_sysfs_class *); struct pvr2_sysfs *pvr2_sysfs_create(struct pvr2_context *, - struct pvr2_sysfs_class *); + struct pvr2_sysfs_class *); #endif /* __PVRUSB2_SYSFS_H */ diff --git a/v4l_experimental/pvrusb2/pvrusb2-tuner.c b/linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c index 4a6f99177..f829c0acc 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-tuner.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-tuner.c,v 1.12 2006/01/22 03:48:34 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> diff --git a/v4l_experimental/pvrusb2/pvrusb2-tuner.h b/linux/drivers/media/video/pvrusb2/pvrusb2-tuner.h index 83d92d06d..556f12aa9 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-tuner.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-tuner.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-tuner.h,v 1.2 2006/01/01 08:26:03 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * diff --git a/v4l_experimental/pvrusb2/pvrusb2-util.h b/linux/drivers/media/video/pvrusb2/pvrusb2-util.h index e8c2cc940..e53aee416 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-util.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-util.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-util.h,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -23,18 +23,18 @@ #define PVR2_DECOMPOSE_LE(t,i,d) \ do { \ - (t)[i] = (d) & 0xff;\ - (t)[i+1] = ((d) >> 8) & 0xff;\ - (t)[i+2] = ((d) >> 16) & 0xff;\ - (t)[i+3] = ((d) >> 24) & 0xff;\ + (t)[i] = (d) & 0xff;\ + (t)[i+1] = ((d) >> 8) & 0xff;\ + (t)[i+2] = ((d) >> 16) & 0xff;\ + (t)[i+3] = ((d) >> 24) & 0xff;\ } while(0) #define PVR2_DECOMPOSE_BE(t,i,d) \ do { \ - (t)[i+3] = (d) & 0xff;\ - (t)[i+2] = ((d) >> 8) & 0xff;\ - (t)[i+1] = ((d) >> 16) & 0xff;\ - (t)[i] = ((d) >> 24) & 0xff;\ + (t)[i+3] = (d) & 0xff;\ + (t)[i+2] = ((d) >> 8) & 0xff;\ + (t)[i+1] = ((d) >> 16) & 0xff;\ + (t)[i] = ((d) >> 24) & 0xff;\ } while(0) #define PVR2_COMPOSE_LE(t,i) \ diff --git a/v4l_experimental/pvrusb2/pvrusb2-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 0a78a6646..017d30ad0 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-v4l2.c,v 1.9 2006/01/23 06:58:06 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -124,7 +124,7 @@ static struct v4l2_tuner pvr_v4l2_tuners[]= { .afc = 0, .reserved = {0,0,0,0} } -#ifdef notdef +#if 0 { .index = 1, .name = "Radio Tuner", @@ -306,7 +306,7 @@ static int cnv_cid_v4l2_pvr2(int id) return -1; } -#ifdef notdef +#if 0 static int cnv_cid_pvr2_v4l2(int id) { switch (id) { @@ -342,7 +342,7 @@ static int cnv_cid_pvr2_v4l2(int id) * */ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, void *arg) + unsigned int cmd, void *arg) { struct pvr2_v4l2_fh *fh = file->private_data; struct pvr2_v4l2 *vp = fh->vhead; @@ -839,6 +839,12 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, break; } + case VIDIOC_LOG_STATUS: + { + pvr2_hdw_trigger_module_log(hdw); + break; + } + default : ret = v4l_compat_translate_ioctl(inode,file,cmd, arg,pvr2_v4l2_do_ioctl); @@ -871,8 +877,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip) { pvr2_trace(PVR2_TRACE_INIT, - "Unregistering v4l video device (%s, minor=%d)", - pvr2_config_get_name(dip->config),dip->vdev->minor); + "unregistering device video%d [%s]", + dip->vdev->minor,pvr2_config_get_name(dip->config)); video_unregister_device(dip->vdev); } @@ -899,7 +905,7 @@ void pvr2_v4l2_internal_check(struct pvr2_channel *chp) int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) + unsigned int cmd, unsigned long arg) { /* Temporary hack : use ivtv api until a v4l2 one is available. */ @@ -1047,7 +1053,7 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh) static ssize_t pvr2_v4l2_read(struct file *file, - char __user *buff, size_t count, loff_t *ppos) + char __user *buff, size_t count, loff_t *ppos) { struct pvr2_v4l2_fh *fh = file->private_data; int ret; @@ -1159,10 +1165,10 @@ static struct video_device vdev_template = { static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, - struct pvr2_v4l2 *vp, - enum pvr2_config cfg) + struct pvr2_v4l2 *vp, + enum pvr2_config cfg) { -#ifdef notdef +#if 0 struct usb_device *usbdev; #endif int mindevnum; @@ -1171,7 +1177,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, dip->v4lp = vp; dip->config = cfg; -#ifdef notdef +#if 0 usbdev = pvr2_hdw_get_dev(vp->channel.mc_head->hdw); #endif @@ -1206,7 +1212,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, } memcpy(dip->vdev,&vdev_template,sizeof(vdev_template)); -#ifdef notdef +#if 0 /* ????? This relation may be problematic on a disconnect. Is this really needed? I can't seem to find a reason for it. This can't be a required thing - what if the video device being set @@ -1226,8 +1232,8 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, err("Failed to register pvrusb2 v4l video device"); } else { pvr2_trace(PVR2_TRACE_INIT, - "Registered pvrusb2 v4l device, minor=%d", - dip->vdev->minor); + "registered device video%d [%s]", + dip->vdev->minor,pvr2_config_get_name(dip->config)); } pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw, dip->vdev->minor); diff --git a/v4l_experimental/pvrusb2/pvrusb2-v4l2.h b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.h index 9dd446469..9a995e2d2 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-v4l2.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-v4l2.h,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * diff --git a/v4l_experimental/pvrusb2/pvrusb2-video-v4l.c b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c index f4948a7a7..d0bc3682b 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-video-v4l.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-video-v4l.c,v 1.10 2006/01/22 03:48:34 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -131,7 +131,7 @@ static int decoder_check(struct pvr2_v4l_decoder *ctxt) unsigned long msk; unsigned int idx; - for (idx = 0; idx < sizeof(decoder_ops)/sizeof(decoder_ops[0]); + for (idx = 0; idx < sizeof(decoder_ops)/sizeof(decoder_ops[0]); idx++) { msk = 1 << idx; if (ctxt->stale_mask & msk) continue; @@ -148,7 +148,7 @@ static void decoder_update(struct pvr2_v4l_decoder *ctxt) unsigned long msk; unsigned int idx; - for (idx = 0; idx < sizeof(decoder_ops)/sizeof(decoder_ops[0]); + for (idx = 0; idx < sizeof(decoder_ops)/sizeof(decoder_ops[0]); idx++) { msk = 1 << idx; if (!(ctxt->stale_mask & msk)) continue; diff --git a/v4l_experimental/pvrusb2/pvrusb2-video-v4l.h b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.h index b47e64791..1c0c98efb 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-video-v4l.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-video-v4l.h,v 1.3 2006/01/14 19:09:50 mcisely Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> diff --git a/v4l_experimental/pvrusb2/pvrusb2.h b/linux/drivers/media/video/pvrusb2/pvrusb2.h index f4e99ad3b..074533e9c 100644 --- a/v4l_experimental/pvrusb2/pvrusb2.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2.h,v 1.1 2005/11/14 13:31:24 mchehab Exp $ + * $Id$ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> diff --git a/v4l/Make.config b/v4l/Make.config index dace4f2c4..39c6a118c 100644 --- a/v4l/Make.config +++ b/v4l/Make.config @@ -20,7 +20,7 @@ CONFIG_VIDEO_ALSA := y CONFIG_VIDEO_ADV_DEBUG := y -CONFIG_VIDEO_PVRUSB2 := n +CONFIG_VIDEO_PVRUSB2 := m CONFIG_VIDEO_IVTV := n @@ -114,5 +114,4 @@ ifeq ($(CONFIG_DVB_CORE),m) endif CONFIG_VIDEO_IVTV := $(if $(wildcard $(src)/ivtv-svnversion.h),m) -CONFIG_VIDEO_PVRUSB2 := $(if $(wildcard $(src)/.pvrusb2-merge),m) CONFIG_VIDEO_CX88_IVTV := $(if $(wildcard $(src)/cx88-ivtv.c),m) diff --git a/v4l/Makefile b/v4l/Makefile index 626858fac..d9250f64a 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -356,11 +356,6 @@ qconfig:: links .version ./scripts/make_kconfig.pl /usr/src/linux-2.6.14 $(ARCH) $(KDIR)/scripts/kconfig/qconf Kconfig -pvrusb2:: - @echo creating pvrusb2 symbolic links... - @find ../v4l_experimental/pvrusb2 -name '*.[ch]' -type f -exec ln -sf '{}' . \; - @echo 'm' > .pvrusb2-merge - ivtv-checkout:: @if [ ! -d ivtv ]; then \ echo retrieving the latest ivtv sources from ivtvdriver.org; \ @@ -539,7 +534,7 @@ clean:: @find . -name '*.c' -type l -exec rm '{}' \; @find . -name '*.h' -type l -exec rm '{}' \; -rm -f *~ *.o *.ko .*.o.cmd .*.ko.cmd *.mod.c av7110_firm.h fdump \ - ivtv-svnversion.h .pvrusb2-merge \ + ivtv-svnversion.h \ Kconfig Kconfig.kern .config .config.cmd distclean:: clean diff --git a/v4l_experimental/pvrusb2/.cvsignore b/v4l_experimental/pvrusb2/.cvsignore deleted file mode 100644 index 88be5bcbc..000000000 --- a/v4l_experimental/pvrusb2/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -*.ko -*.o.flags -*.mod.c -.*.cmd -.version -.snapshot -.tmp_versions diff --git a/v4l_experimental/pvrusb2/Makefile b/v4l_experimental/pvrusb2/Makefile deleted file mode 100644 index 0c43d6977..000000000 --- a/v4l_experimental/pvrusb2/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -BUILD_DIR := $(shell pwd)/../.. - -all: - $(MAKE) -C $(BUILD_DIR) pvrusb2 - -install: - $(MAKE) -C $(BUILD_DIR) install - -%:: - $(MAKE) -C $(BUILD_DIR) $(MAKECMDGOALS) |