Commit c94f751f authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] 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.
Signed-off-by: default avatarGerd Knorr <kraxel@bytesex.org>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent df91ad2a
/*
$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)");
/* ---------------------------------------------------------- */
......
/*
$Id: bttv-cards.c,v 1.29 2004/10/13 10:39:00 kraxel Exp $
$Id: bttv-cards.c,v 1.32 2004/11/07 13:17:14 kraxel Exp $
bttv-cards.c
......@@ -106,53 +106,31 @@ static unsigned int audioall = UNSET;
static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
/* insmod options */
MODULE_PARM(triton1,"i");
module_param(triton1, int, 0444);
module_param(vsfx, int, 0444);
module_param(no_overlay, int, 0444);
module_param(latency, int, 0444);
module_param(gpiomask, int, 0444);
module_param(audioall, int, 0444);
module_param(autoload, int, 0444);
module_param_array(card, int, NULL, 0444);
module_param_array(pll, int, NULL, 0444);
module_param_array(tuner, int, NULL, 0444);
module_param_array(svhs, int, NULL, 0444);
module_param_array(remote, int, NULL, 0444);
module_param_array(audiomux, int, NULL, 0444);
MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
"[enable bug compatibility for triton1 + others]");
MODULE_PARM(vsfx,"i");
MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
"[yet another chipset flaw workaround]");
MODULE_PARM(no_overlay,"i");
MODULE_PARM(latency,"i");
MODULE_PARM_DESC(latency,"pci latency timer");
MODULE_PARM(card,"1-" __stringify(BTTV_MAX) "i");
MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
MODULE_PARM(pll,"1-" __stringify(BTTV_MAX) "i");
MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
MODULE_PARM(tuner,"1-" __stringify(BTTV_MAX) "i");
MODULE_PARM_DESC(tuner,"specify installed tuner type");
MODULE_PARM(autoload,"i");
MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
MODULE_PARM(svhs,"1-" __stringify(BTTV_MAX) "i");
MODULE_PARM(remote,"1-" __stringify(BTTV_MAX) "i");
MODULE_PARM(gpiomask,"i");
MODULE_PARM(audioall,"i");
MODULE_PARM(audiomux,"1-6i");
/* kernel args */
#ifndef MODULE
static int __init p_card(char *str) { return bttv_parse(str,BTTV_MAX,card); }
static int __init p_pll(char *str) { return bttv_parse(str,BTTV_MAX,pll); }
static int __init p_tuner(char *str) { return bttv_parse(str,BTTV_MAX,tuner); }
__setup("bttv.card=", p_card);
__setup("bttv.pll=", p_pll);
__setup("bttv.tuner=", p_tuner);
int __init bttv_parse(char *str, int max, int *vals)
{
int i,number,res = 2;
for (i = 0; res == 2 && i < max; i++) {
res = get_option(&str,&number);
if (res)
vals[i] = number;
}
return 1;
}
#endif
/* ----------------------------------------------------------------------- */
/* list of card IDs for bt878+ cards */
......@@ -184,7 +162,6 @@ static struct CARD {
{ 0xd01810fc, BTTV_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
{ 0x001211bd, BTTV_PINNACLE, "Pinnacle PCTV" },
{ 0x001c11bd, BTTV_PINNACLESAT, "Pinnacle PCTV Sat" },
// some cards ship with byteswapped IDs ...
{ 0x1200bd11, BTTV_PINNACLE, "Pinnacle PCTV [bswap]" },
{ 0xff00bd11, BTTV_PINNACLE, "Pinnacle PCTV [bswap]" },
......@@ -194,6 +171,7 @@ static struct CARD {
{ 0x3060121a, BTTV_STB2, "3Dfx VoodooTV 100/ STB OEM" },
{ 0x3000144f, BTTV_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
{ 0xa005144f, BTTV_MAGICTVIEW063, "CPH06X TView99-Card" },
{ 0x3002144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
{ 0x3005144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
{ 0x5000144f, BTTV_MAGICTVIEW061, "Askey CPH050" },
......@@ -306,6 +284,7 @@ static struct CARD {
// DVB cards (using pci function .1 for mpeg data xfer)
{ 0x01010071, BTTV_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
{ 0x07611461, BTTV_AVDVBT_761, "AverMedia AverTV DVB-T" },
{ 0x001c11bd, BTTV_PINNACLESAT, "Pinnacle PCTV Sat" },
{ 0x002611bd, BTTV_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
{ 0x00011822, BTTV_TWINHAN_DST, "Twinhan VisionPlus DVB-T" },
{ 0xfc00270f, BTTV_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
......@@ -1670,6 +1649,7 @@ struct tvcard bttv_tvcards[] = {
.needs_tvaudio = 0,
.pll = PLL_28,
.no_gpioirq = 1,
.has_dvb = 1,
},{
.name = "Formac ProTV II (bt878)",
.video_inputs = 4,
......@@ -2084,9 +2064,7 @@ struct tvcard bttv_tvcards[] = {
.pll = PLL_28,
.has_dvb = 1,
.no_gpioirq = 1,
#if 0 /* untested */
.has_remote = 1,
#endif
},{
/* ---- card 0x7c ---------------------------------- */
/* Matt Jesson <dvb@jesson.eclipse.co.uk> */
......@@ -2969,40 +2947,6 @@ static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
return 0;
}
#if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE)
/* old 2.4.x way -- via soundcore's mod_firmware_load */
static char *firm_altera = "/usr/lib/video4linux/hcwamc.rbf";
MODULE_PARM(firm_altera,"s");
MODULE_PARM_DESC(firm_altera,"WinTV/PVR firmware "
"(driver CD => unzip pvr45xxx.exe => hcwamc.rbf)");
extern int mod_firmware_load(const char *fn, char **fp);
int __devinit pvr_boot(struct bttv *btv)
{
u32 microlen;
u8 *micro;
int result;
microlen = mod_firmware_load(firm_altera, (char**) &micro);
if (!microlen) {
printk(KERN_WARNING "bttv%d: altera firmware not found [%s]\n",
btv->c.nr, firm_altera);
return -1;
}
printk(KERN_INFO "bttv%d: uploading altera firmware [%s] ...\n",
btv->c.nr, firm_altera);
result = pvr_altera_load(btv, micro, microlen);
printk(KERN_INFO "bttv%d: ... upload %s\n",
btv->c.nr, (result < 0) ? "failed" : "ok");
vfree(micro);
return result;
}
#else
/* new 2.5.x way -- via hotplug firmware loader */
int __devinit pvr_boot(struct bttv *btv)
{
const struct firmware *fw_entry;
......@@ -3020,7 +2964,6 @@ int __devinit pvr_boot(struct bttv *btv)
release_firmware(fw_entry);
return rc;
}
#endif
/* ----------------------------------------------------------------------- */
/* some osprey specific stuff */
......
This diff is collapsed.
/*
$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
......
/*
$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_sw_template;
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_algo_bit_template = {
};
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_hw_template = {
.client_unregister = detach_inform,
};
/* ----------------------------------------------------------------------- */
/* I2C functions - common stuff */
static int attach_inform(struct i2c_client *client)
{
struct bttv *btv = i2c_get_adapdata(client->adapter);
......
/*
$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 bttv_buffer *buf, int lines)
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, struct videobuf_buffer *vb,
}
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 videobuf_buffer *vb)
}
}
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);
......
......@@ -230,9 +230,6 @@ extern void bttv_init_card2(struct bttv *btv);
extern void tea5757_set_freq(struct bttv *btv, unsigned short freq);
extern void bttv_tda9880_setnorm(struct bttv *btv, int norm);
/* kernel cmd line parse helper */
extern int bttv_parse(char *str, int max, int *vals);
/* extra tweaks for some chipsets */
extern void bttv_check_chipset(void);
extern int bttv_handle_chipset(struct bttv *btv);
......
/*
$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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment