summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2006-02-26 16:32:39 -0600
committerMike Isely <isely@pobox.com>2006-02-26 16:32:39 -0600
commit5515ed4ac17ca06de145302b8888b9adb09ba32c (patch)
tree43de837baa127696b84b105649925f6fb00e8fbf
parent040c8edfcc4795d67033ce869eefef50f8cb3c1b (diff)
parent555a4680960f6297f0e4cdead5f8a48e3e3b9cfe (diff)
downloadmediapointer-dvb-s2-5515ed4ac17ca06de145302b8888b9adb09ba32c.tar.gz
mediapointer-dvb-s2-5515ed4ac17ca06de145302b8888b9adb09ba32c.tar.bz2
Merge from v4l-dvb master
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
-rw-r--r--linux/Documentation/video4linux/README.pvrusb2 (renamed from v4l_experimental/pvrusb2/README)2
-rw-r--r--linux/drivers/media/video/pvrusb2/Makefile11
-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)4
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-context.h (renamed from v4l_experimental/pvrusb2/pvrusb2-context.h)2
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-debug.h (renamed from v4l_experimental/pvrusb2/pvrusb2-debug.h)2
-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)4
-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)11
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c (renamed from v4l_experimental/pvrusb2/pvrusb2-hdw.c)218
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h (renamed from v4l_experimental/pvrusb2/pvrusb2-hdw.h)20
-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)41
-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)18
-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)2
-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)18
-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.config3
-rw-r--r--v4l/Makefile7
-rw-r--r--v4l_experimental/pvrusb2/.cvsignore7
-rw-r--r--v4l_experimental/pvrusb2/Makefile10
42 files changed, 365 insertions, 213 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/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..b8f7fb043 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>
*
@@ -183,7 +183,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..e721cc559 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>
*
diff --git a/v4l_experimental/pvrusb2/pvrusb2-debug.h b/linux/drivers/media/video/pvrusb2/pvrusb2-debug.h
index 70a143736..078f5f5a0 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>
*
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..6d797cb55 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;
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..b18906ea6 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>
*
@@ -176,6 +176,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 +192,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 +207,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..1ee2fcda4 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>
*
@@ -43,14 +43,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 +73,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 +168,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] =
{
@@ -421,6 +420,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 +494,26 @@ 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[] = {
+ "v4l-fx2-pvrusb2.fw",
+ };
hdw->fw1_state = FW1_STATE_FAILED; // default result
trace_firmware("pvr2_upload_firmware1");
+ ret = pvr2_locate_firmware(hdw,&fw_entry,"fx2 controller",
+ sizeof(fw_files)/sizeof(fw_files[0]),
+ fw_files);
+ 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 +574,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 +612,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 +654,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 +893,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 +907,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 +957,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;
@@ -954,6 +1005,7 @@ static unsigned int get_default_error_tolerance(struct pvr2_hdw *hdw)
static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
{
+ int ret;
unsigned int idx;
if (hdw->usb_intf->cur_altsetting->desc.bNumEndpoints == 0) {
if (pvr2_upload_firmware1(hdw) != 0) {
@@ -987,8 +1039,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 +1119,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,6 +1155,7 @@ 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;
}
@@ -1115,6 +1172,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf)
pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p",hdw);
if (!hdw) goto fail;
memset(hdw,0,sizeof(*hdw));
+ 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 +1400,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 +1435,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 +1699,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 +1755,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 +1825,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 {
@@ -1854,8 +1922,8 @@ 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)
+ void *write_data,unsigned int write_len,
+ void *read_data,unsigned int read_len)
{
unsigned int idx;
int status;
@@ -1999,6 +2067,8 @@ int pvr2_send_request(struct pvr2_hdw *hdw,
if (hdw->ctl_timeout_flag) {
status = -ETIMEDOUT;
+ pvr2_trace(PVR2_TRACE_ERROR_LEGS,
+ "Timed out control-write");
goto done;
}
@@ -2177,6 +2247,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 +2324,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 +2404,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..2f9c4cb6d 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 | \
@@ -235,7 +235,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 +269,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 +284,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 +304,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 *);
@@ -353,6 +353,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,7 +388,10 @@ 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
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..d3b223d09 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,9 +39,9 @@ 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;
@@ -51,7 +51,14 @@ static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */
#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);
@@ -91,11 +98,11 @@ 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;
@@ -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..b01975af4 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>
*
@@ -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..0003c7a07 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>
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..ba99db26c 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>
@@ -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);
@@ -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,8 +1165,8 @@ 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
struct usb_device *usbdev;
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 0dd4365ce..802c847a2 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
@@ -112,4 +112,3 @@ 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)
diff --git a/v4l/Makefile b/v4l/Makefile
index 1a34c6f24..d90e4b8ae 100644
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -345,11 +345,6 @@ all:: default
default:: links .version
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules
-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; \
@@ -523,7 +518,7 @@ rmmodules::
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
+ -rm -f *~ *.o *.ko .*.o.cmd .*.ko.cmd *.mod.c av7110_firm.h fdump ivtv-svnversion.h
distclean:: clean
-rm -f .version .*.o.flags .*.o.d
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)