Skip to contentSkip to conversation

v4l: bttv update

PATCH In review Gerd Knorr 1 participant 1 message Nov 8, 2004 Media (V4L/DVB)

lore
Share & tools
lore

Gerd Knorr

author
#0 lore raw

PATCH 3/6 v4l: bttv update

This is an update for the bttv driver, changes:

* adapt to video-buf changes.
* convert to new-style insmod options.
* drop some obsolete junk.

---
 drivers/media/video/btcx-risc.c   |    4 
 drivers/media/video/bttv-cards.c  |   95 ++++------------------
 drivers/media/video/bttv-driver.c |  128 +++++++++++++-----------------
 drivers/media/video/bttv-gpio.c   |    2 
 drivers/media/video/bttv-i2c.c    |   25 +----
 drivers/media/video/bttv-vbi.c    |   29 +++---
 drivers/media/video/bttvp.h       |    2 
 7 files changed, 102 insertions(+), 183 deletions(-)
drivers/media/video/bttvp.h +1 -1
Index: linux-2004-11-05/drivers/media/video/bttvp.h
===================================================================
@@ -1,5 +1,5 @@
 /*
-    $Id: bttvp.h,v 1.11 2004/10/13 10:39:00 kraxel Exp $
+    $Id: bttvp.h,v 1.12 2004/10/25 11:26:36 kraxel Exp $
 
     bttv - Bt848 frame grabber driver
 
drivers/media/video/bttv-driver.c +57 -71

303 lines not on this page · raw message

drivers/media/video/bttv-cards.c +19 -76

158 lines not on this page · raw message

drivers/media/video/bttv-vbi.c +15 -14
Index: linux-2004-11-05/drivers/media/video/bttv-vbi.c
===================================================================
@@ -1,5 +1,5 @@
 /*
-    $Id: bttv-vbi.c,v 1.6 2004/10/13 10:39:00 kraxel Exp $
+    $Id: bttv-vbi.c,v 1.7 2004/11/07 13:17:15 kraxel Exp $
 
     bttv - Bt848 frame grabber driver
     vbi interface
@@ -37,9 +37,9 @@
 static unsigned int vbibufs = 4;
 static unsigned int vbi_debug = 0;
 
-MODULE_PARM(vbibufs,"i");
+module_param(vbibufs,   int, 0444);
+module_param(vbi_debug, int, 0644);
 MODULE_PARM_DESC(vbibufs,"number of vbi buffers, range 2-32, default 4");
-MODULE_PARM(vbi_debug,"i");
 MODULE_PARM_DESC(vbi_debug,"vbi code debug messages, default is 0 (no)");
 
 #ifdef dprintk
@@ -63,10 +63,10 @@ vbi_buffer_risc(struct bttv *btv, struct
 	return 0;
 }
 
-static int vbi_buffer_setup(void *priv,
+static int vbi_buffer_setup(struct videobuf_queue *q,
 			    unsigned int *count, unsigned int *size)
 {
-	struct bttv_fh *fh = priv;
+	struct bttv_fh *fh = q->priv_data;
 	struct bttv *btv = fh->btv;
 
 	if (0 == *count)
@@ -76,12 +76,13 @@ static int vbi_buffer_setup(void *priv,
 	return 0;
 }
 
-static int vbi_buffer_prepare(void *priv, struct videobuf_buffer *vb,
+static int vbi_buffer_prepare(struct videobuf_queue *q,
+			      struct videobuf_buffer *vb,
 			      enum v4l2_field field)
 {
-	struct bttv_fh *fh = priv;
+	struct bttv_fh *fh = q->priv_data;
 	struct bttv *btv = fh->btv;
-	struct bttv_buffer *buf = (struct bttv_buffer*)vb;
+	struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb);
 	int rc;
 
 	buf->vb.size = fh->lines * 2 * 2048;
@@ -107,11 +108,11 @@ static int vbi_buffer_prepare(void *priv
 }
 
 static void
-vbi_buffer_queue(void *priv, struct videobuf_buffer *vb)
+vbi_buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
 {
-	struct bttv_fh *fh = priv;
+	struct bttv_fh *fh = q->priv_data;
 	struct bttv *btv = fh->btv;
-	struct bttv_buffer *buf = (struct bttv_buffer*)vb;
+	struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb);
 
 	dprintk("queue %p\n",vb);
 	buf->vb.state = STATE_QUEUED;
@@ -122,11 +123,11 @@ vbi_buffer_queue(void *priv, struct vide
 	}
 }
 
-static void vbi_buffer_release(void *priv, struct videobuf_buffer *vb)
+static void vbi_buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
 {
-	struct bttv_fh *fh = priv;
+	struct bttv_fh *fh = q->priv_data;
 	struct bttv *btv = fh->btv;
-	struct bttv_buffer *buf = (struct bttv_buffer*)vb;
+	struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb);
 
 	dprintk("free %p\n",vb);
 	bttv_dma_free(fh->btv,buf);
drivers/media/video/bttv-gpio.c +1 -1
Index: linux-2004-11-05/drivers/media/video/bttv-gpio.c
===================================================================
@@ -1,5 +1,5 @@
 /*
-    $Id: bttv-gpio.c,v 1.4 2004/10/13 10:39:00 kraxel Exp $
+    $Id: bttv-gpio.c,v 1.6 2004/11/03 09:04:50 kraxel Exp $
 
     bttv-gpio.c  --  gpio sub drivers
 
drivers/media/video/bttv-i2c.c +7 -18
Index: linux-2004-11-05/drivers/media/video/bttv-i2c.c
===================================================================
@@ -1,5 +1,5 @@
 /*
-    $Id: bttv-i2c.c,v 1.11 2004/10/13 10:39:00 kraxel Exp $
+    $Id: bttv-i2c.c,v 1.13 2004/11/07 13:17:15 kraxel Exp $
 
     bttv-i2c.c  --  all the i2c code is here
 
@@ -37,19 +37,15 @@ static struct i2c_adapter bttv_i2c_adap_
 static struct i2c_adapter bttv_i2c_adap_hw_template;
 static struct i2c_client bttv_i2c_client_template;
 
-#ifndef I2C_PEC
-static void bttv_inc_use(struct i2c_adapter *adap);
-static void bttv_dec_use(struct i2c_adapter *adap);
-#endif
 static int attach_inform(struct i2c_client *client);
 static int detach_inform(struct i2c_client *client);
 
 static int i2c_debug = 0;
 static int i2c_hw = 0;
 static int i2c_scan = 0;
-MODULE_PARM(i2c_debug,"i");
-MODULE_PARM(i2c_hw,"i");
-MODULE_PARM(i2c_scan,"i");
+module_param(i2c_debug, int, 0644);
+module_param(i2c_hw,    int, 0444);
+module_param(i2c_scan,  int, 0444);
 MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time");
 
 /* ----------------------------------------------------------------------- */
@@ -108,12 +104,7 @@ static struct i2c_algo_bit_data bttv_i2c
 };
 
 static struct i2c_adapter bttv_i2c_adap_sw_template = {
-#ifdef I2C_PEC
 	.owner             = THIS_MODULE,
-#else
-	.inc_use           = bttv_inc_use,
-	.dec_use           = bttv_dec_use,
-#endif
 #ifdef I2C_CLASS_TV_ANALOG
 	.class             = I2C_CLASS_TV_ANALOG,
 #endif
@@ -290,12 +281,7 @@ static struct i2c_algorithm bttv_algo = 
 };
 
 static struct i2c_adapter bttv_i2c_adap_hw_template = {
-#ifdef I2C_PEC
 	.owner         = THIS_MODULE,
-#else
-	.inc_use       = bttv_inc_use,
-	.dec_use       = bttv_dec_use,
-#endif
 #ifdef I2C_CLASS_TV_ANALOG
 	.class         = I2C_CLASS_TV_ANALOG,
 #endif
@@ -306,6 +292,9 @@ static struct i2c_adapter bttv_i2c_adap_
 	.client_unregister = detach_inform,
 };
 
+/* ----------------------------------------------------------------------- */
+/* I2C functions - common stuff                                            */
+
 static int attach_inform(struct i2c_client *client)
 {
         struct bttv *btv = i2c_get_adapdata(client->adapter);
drivers/media/video/btcx-risc.c +2 -2
Index: linux-2004-11-05/drivers/media/video/btcx-risc.c
===================================================================
@@ -1,5 +1,5 @@
 /*
-    $Id: btcx-risc.c,v 1.3 2004/10/13 10:39:00 kraxel Exp $
+    $Id: btcx-risc.c,v 1.4 2004/11/07 13:17:14 kraxel Exp $
 
     btcx-risc.c
 
@@ -38,7 +38,7 @@ MODULE_AUTHOR("Gerd Knorr");
 MODULE_LICENSE("GPL");
 
 static unsigned int debug = 0;
-MODULE_PARM(debug,"i");
+module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug,"debug messages, default is 0 (no)");
 
 /* ---------------------------------------------------------- */
Signature · 1 line
#define printk(args...) fprintf(stderr, ## args)