v4l: bttv driver update
PATCH 1/1 v4l: bttv driver update
This is a bttv driver update, changes:
* add support for a new card.
* add some debug code (bt878 risc disassembler).
* drop some obsolete i2c code.
Signed-off-by Gerd Knorr <[email protected]>
--- drivers/media/video/btcx-risc.c | 12 +- drivers/media/video/bttv-cards.c | 175 +++++++++++++++++++++++++++++- drivers/media/video/bttv-driver.c | 93 +++++++++++++-- drivers/media/video/bttv-gpio.c | 17 -- drivers/media/video/bttv-i2c.c | 15 -- drivers/media/video/bttv.h | 5 drivers/media/video/bttvp.h | 3 7 files changed, 263 insertions(+), 57 deletions(-)
drivers/media/video/bttv.h +2 -3
@@ -1,5 +1,5 @@/* -* $Id: bttv.h,v 1.15 2005/01/24 17:37:23 kraxel Exp $ +* $Id: bttv.h,v 1.17 2005/02/22 14:06:32 kraxel Exp $ * * bttv - Bt848 frame grabber driver *
@@ -134,6 +134,7 @@#define BTTV_APAC_VIEWCOMP 0x7f#define BTTV_DVICO_DVBT_LITE 0x80#define BTTV_TIBET_CS16 0x83 +#define BTTV_KODICOM_4400R 0x84/* i2c address list */ #define I2C_TSA5522 0xc2
@@ -302,8 +303,6 @@ struct bttv_sub_driver {struct device_driver drv;char wanted[BUS_ID_SIZE ];void (*gpio_irq)(struct bttv_sub_device *sub); -void (*i2c_info)(struct bttv_sub_device *sub, -struct i2c_client *client,int attach); };#define to_bttv_sub_drv (x) container_of((x), struct bttv_sub_driver, drv)
drivers/media/video/bttvp.h +1 -2
@@ -1,5 +1,5 @@/* -$Id: bttvp.h,v 1.16 2005/01/24 17:37:23 kraxel Exp $ +$Id: bttvp.h,v 1.17 2005/02/16 12:14:10 kraxel Exp $ bttv - Bt848 frame grabber driver
@@ -209,7 +209,6 @@ extern struct bus_type bttv_sub_bus_typeint bttv_sub_add_device (struct bttv_core *core,char *name);int bttv_sub_del_devices (struct bttv_core *core);void bttv_gpio_irq (struct bttv_core *core); -void bttv_i2c_info (struct bttv_core *core,struct i2c_client *client,int attach);/* ---------------------------------------------------------- */
drivers/media/video/bttv-cards.c +173 -2
221 lines not on this page · raw message
drivers/media/video/bttv-gpio.c +2 -15
@@ -1,5 +1,5 @@/* -$Id: bttv-gpio.c,v 1.6 2004/11/03 09:04:50 kraxel Exp $ +$Id: bttv-gpio.c,v 1.7 2005/02/16 12:14:10 kraxel Exp $ bttv-gpio.c -- gpio sub drivers
@@ -94,6 +94,7 @@ int bttv_sub_del_devices(struct bttv_corlist_for_each_safe (item,save,&core->subs) { sub = list_entry(item,struct bttv_sub_device,list); +list_del (&sub->list);device_unregister (&sub->dev); }return 0 ;
@@ -113,20 +114,6 @@ void bttv_gpio_irq(struct bttv_core *cor } } -void bttv_i2c_info (struct bttv_core *core,struct i2c_client *client,int attach) -{ -struct bttv_sub_driver *drv; -struct bttv_sub_device *dev; -struct list_head *item; - -list_for_each (item,&core->subs) { - dev = list_entry(item,struct bttv_sub_device,list); - drv =to_bttv_sub_drv (dev->dev.driver); -if (drv && drv->i2c_info) - drv->i2c_info (dev,client,attach); - } -} -/* ----------------------------------------------------------------------- */ /* external: sub-driver register/unregister */
drivers/media/video/bttv-i2c.c +1 -14
@@ -1,5 +1,5 @@/* -$Id: bttv-i2c.c,v 1.17 2004/12/14 15:33:30 kraxel Exp $ +$Id: bttv-i2c.c,v 1.18 2005/02/16 12:14:10 kraxel Exp $ bttv-i2c.c -- all the i2c code is here
@@ -39,7 +39,6 @@ static struct i2c_adapter bttv_i2c_adap_static struct i2c_client bttv_i2c_client_template;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 ;
@@ -112,7 +111,6 @@ static struct i2c_adapter bttv_i2c_adap_ I2C_DEVNAME("bt848"), .id = I2C_HW_B_BT848, .client_register = attach_inform, - .client_unregister = detach_inform, };/* ----------------------------------------------------------------------- */
@@ -290,7 +288,6 @@ static struct i2c_adapter bttv_i2c_adap_ .id = I2C_ALGO_BIT | I2C_HW_B_BT848 /* FIXME */, .algo = &bttv_algo, .client_register = attach_inform, - .client_unregister = detach_inform, };/* ----------------------------------------------------------------------- */
@@ -305,22 +302,12 @@ static int attach_inform(struct i2c_clieif (btv->pinnacle_id !=UNSET )bttv_call_i2c_clients (btv,AUDC_CONFIG_PINNACLE , &btv->pinnacle_id); -bttv_i2c_info (&btv->c, client,1 ); -if (bttv_debug)printk ("bttv%d: i2c attach [client=%s]\n" , btv->c.nr,i2c_clientname (client));return 0 ; } -static int detach_inform (struct i2c_client *client) -{ -struct bttv *btv =i2c_get_adapdata (client->adapter); - -bttv_i2c_info (&btv->c, client,0 ); -return 0 ; -} -void bttv_call_i2c_clients (struct bttv *btv,unsigned int cmd,void *arg) {if (0 != btv->i2c_rc)
drivers/media/video/btcx-risc.c +7 -5
@@ -1,5 +1,5 @@/* -$Id: btcx-risc.c,v 1.5 2004/12/10 12:33:39 kraxel Exp $ +$Id: btcx-risc.c,v 1.6 2005/02/21 13:57:59 kraxel Exp $ btcx-risc.c
@@ -52,12 +52,13 @@ void btcx_riscmem_free(struct pci_dev *p {if (NULL == risc->cpu)return ; -pci_free_consistent (pci, risc->size, risc->cpu, risc->dma); -memset (risc,0 ,sizeof (*risc));if (debug) { memcnt--; -printk ("btcx: riscmem free [%d]\n" ,memcnt); +printk ("btcx: riscmem free [%d] dma=%lx\n" , + memcnt, (unsigned long )risc->dma); } +pci_free_consistent (pci, risc->size, risc->cpu, risc->dma); +memset (risc,0 ,sizeof (*risc)); } int btcx_riscmem_alloc(struct pci_dev *pci,
@@ -78,7 +79,8 @@ int btcx_riscmem_alloc(struct pci_dev *p risc->size = size;if (debug) { memcnt++; -printk ("btcx: riscmem alloc size=%d [%d]\n" ,size,memcnt); +printk ("btcx: riscmem alloc [%d] dma=%lx cpu=%p size=%d\n" , + memcnt, (unsigned long )dma, cpu, size); } }memset (risc->cpu,0 ,risc->size);
drivers/media/video/bttv-driver.c +77 -16
109 lines not on this page · raw message
Signature · 1 line
#define printk(args...) fprintf(stderr, ## args)