Skip to contentSkip to conversation

v4l: bttv driver update

PATCH In review Gerd Knorr 2 participants 3 messages Oct 7, 2003 – Oct 8, 2003 Media (V4L/DVB)

lore
Share & tools
lore

Gerd Knorr

author
#0 lore raw

PATCH 1/1 v4l: bttv driver update

Hi,

This patch updates the bttv driver. It depends on the videobuf patch. Changes:

* usual tv card list updates.
* sysfs adaptions.
* new, experimental i2c adapter code for bt878 chips (not used by default yet).
* various minor fixes.

Please apply,

Gerd

drivers/media/video/bt848.h +4 -1
diff -u linux-2.6.0-test6/drivers/media/video/bt848.h linux/drivers/media/video/bt848.h
@@ -282,13 +282,16 @@
 #define BT848_GPIO_DMA_CTL_FIFO_ENABLE (1<<0)
 
 #define BT848_I2C              0x110
+#define BT878_I2C_MODE         (1<<7)
+#define BT878_I2C_RATE         (1<<6)
+#define BT878_I2C_NOSTOP       (1<<5)
+#define BT878_I2C_NOSTART      (1<<4)
 #define BT848_I2C_DIV          (0xf<<4)
 #define BT848_I2C_SYNC         (1<<3)
 #define BT848_I2C_W3B	       (1<<2)
 #define BT848_I2C_SCL          (1<<1)
 #define BT848_I2C_SDA          (1<<0)
 
-
 #define BT848_RISC_STRT_ADD    0x114
 #define BT848_GPIO_OUT_EN      0x118
 #define BT848_GPIO_REG_INP     0x11C
drivers/media/video/btcx-risc.c +25 -33

70 lines not on this page · raw message

drivers/media/video/bttv-cards.c +166 -30

323 lines not on this page · raw message

drivers/media/video/bttv-driver.c +265 -115

738 lines not on this page · raw message

drivers/media/video/bttv-if.c +273 -33

365 lines not on this page · raw message

drivers/media/video/bttv-risc.c +20 -4
diff -u linux-2.6.0-test6/drivers/media/video/bttv-risc.c linux/drivers/media/video/bttv-risc.c
@@ -33,6 +33,8 @@
 
 #include "bttvp.h"
 
+#define VCR_HACK_LINES 4
+
 /* ---------------------------------------------------------- */
 /* risc code generators                                       */
 
@@ -62,6 +64,9 @@
 	/* scan lines */
 	sg = sglist;
 	for (line = 0; line < lines; line++) {
+		if ((btv->opt_vcr_hack) &&
+		    (line >= (lines - VCR_HACK_LINES)))
+			continue;
 		while (offset >= sg_dma_len(sg)) {
 			offset -= sg_dma_len(sg);
 			sg++;
@@ -136,6 +141,9 @@
 	usg = sglist;
 	vsg = sglist;
 	for (line = 0; line < ylines; line++) {
+		if ((btv->opt_vcr_hack) &&
+		    (line >= (ylines - VCR_HACK_LINES)))
+			continue;
 		switch (vshift) {
 		case 0:  chroma = 1;           break;
 		case 1:  chroma = !(line & 1); break;
@@ -219,8 +227,10 @@
 	instructions  = (ov->nclips + 1) *
 		((skip_even || skip_odd) ? ov->w.height>>1 :  ov->w.height);
 	instructions += 2;
-	if ((rc = btcx_riscmem_alloc(btv->dev,risc,instructions*8)) < 0)
+	if ((rc = btcx_riscmem_alloc(btv->dev,risc,instructions*8)) < 0) {
+		kfree(skips);
 		return rc;
+	}
 
 	/* sync instruction */
 	rp = risc->cpu;
@@ -228,12 +238,18 @@
 	*(rp++) = cpu_to_le32(0);
 
 	addr  = (unsigned long)btv->fbuf.base;
-	addr += btv->fbuf.bytesperline * ov->w.top;
-	addr += ((btv->fbuf.depth+7) >> 3) * ov->w.left;
+	addr += btv->fbuf.fmt.bytesperline * ov->w.top;
+	addr += (fmt->depth >> 3)          * ov->w.left;
 
 	/* scan lines */
 	for (maxy = -1, line = 0; line < ov->w.height;
-	     line++, addr += btv->fbuf.bytesperline) {
+	     line++, addr += btv->fbuf.fmt.bytesperline) {
+		if ((btv->opt_vcr_hack) &&
+		     (line >= (ov->w.height - VCR_HACK_LINES)))
+			continue;
+ 		if ((line%2) == 0  &&  skip_even)
+ 			continue;
+ 		if ((line%2) == 1  &&  skip_odd)
 		if ((line%2) == 0  &&  skip_even)
 			continue;
 		if ((line%2) == 1  &&  skip_odd)
drivers/media/video/bttv-vbi.c +1 -1
diff -u linux-2.6.0-test6/drivers/media/video/bttv-vbi.c linux/drivers/media/video/bttv-vbi.c
@@ -87,7 +87,7 @@
 		return -EINVAL;
 
 	if (STATE_NEEDS_INIT == buf->vb.state) {
-		if (0 != (rc = videobuf_iolock(btv->dev,&buf->vb)))
+		if (0 != (rc = videobuf_iolock(btv->dev, &buf->vb, NULL)))
 			goto fail;
 		if (0 != (rc = vbi_buffer_risc(btv,buf,fh->lines)))
 			goto fail;
drivers/media/video/bttv.h +5 -0
diff -u linux-2.6.0-test6/drivers/media/video/bttv.h linux/drivers/media/video/bttv.h
@@ -115,6 +115,8 @@
 #define BTTV_XGUARD         0x67
 #define BTTV_NEBULA_DIGITV  0x68
 #define BTTV_PV143          0x69
+#define BTTV_IVC100         0x6e
+#define BTTV_IVC120         0x6f
 
 /* i2c address list */
 #define I2C_TSA5522        0xc2
@@ -170,6 +172,9 @@
 	unsigned int needs_tvaudio:1;
 	unsigned int msp34xx_alt:1;
 
+	/* flag: video pci function is unused */
+	unsigned int no_video;
+
 	/* other settings */
 	unsigned int pll;
 #define PLL_NONE 0
drivers/media/video/bttvp.h +45 -7

133 lines not on this page · raw message

Signature · 1 line
You have a new virus in /var/mail/kraxel
#1 lore raw

Hi!

Quoted 10 lines

This patch updates the bttv driver. It depends on the videobuf patch. Changes:

* usual tv card list updates.
* sysfs adaptions.
* new, experimental i2c adapter code for bt878 chips (not used by default yet).
* various minor fixes.

Please apply,

Are those "IR remote using input layer" patches going in?
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
author
#2 lore raw
Quoted 3 lines
Quoted 1 line

Please apply,

Are those "IR remote using input layer" patches going in?

Not yet, probably with the next batch of updates.

Gerd

Signature · 1 line
You have a new virus in /var/mail/kraxel