aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>2005-06-24 01:04:58 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:06:38 -0400
commit2d03e289ea4b13d78ce55f1ea0b0d45b8f1b34c3 (patch)
treeca3aa14521fa75fd435e1d37ba0b06322a39244b /drivers
parent3c1d0185db6a44b6304c404f4da1a1a98746ca46 (diff)
[PATCH] bttv update
This patch synchronizes current bttv support on V4L with linux kernel and adds support to Adlink RTV24 card. It is asked that *every* patch to V4L stuff to be first submitted to video4linux-list@redhat.com. From: "J.A. Magallon" <jamagallon@able.es> struct bttv defined after usage. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Peter Skipworth <pskipworth@clarityvi.com> Signed-off-by: Nickolay V Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/bttv-cards.c99
-rw-r--r--drivers/media/video/bttv-driver.c2
-rw-r--r--drivers/media/video/bttv-i2c.c2
-rw-r--r--drivers/media/video/bttv.h4
-rw-r--r--drivers/media/video/bttvp.h8
5 files changed, 63 insertions, 52 deletions
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c
index ca7c993fecb7..251092e7f19f 100644
--- a/drivers/media/video/bttv-cards.c
+++ b/drivers/media/video/bttv-cards.c
@@ -1,5 +1,5 @@
1/* 1/*
2 $Id: bttv-cards.c,v 1.47 2005/02/22 14:06:32 kraxel Exp $ 2 $Id: bttv-cards.c,v 1.49 2005/06/10 17:20:24 mchehab Exp $
3 3
4 bttv-cards.c 4 bttv-cards.c
5 5
@@ -2254,17 +2254,18 @@ struct tvcard bttv_tvcards[] = {
2254 .muxsel_hook = kodicom4400r_muxsel, 2254 .muxsel_hook = kodicom4400r_muxsel,
2255}, 2255},
2256{ 2256{
2257 /* ---- card 0x86---------------------------------- */ 2257 /* ---- card 0x85---------------------------------- */
2258 /* Michael Henson <mhenson@clarityvi.com> */ 2258 /* Michael Henson <mhenson@clarityvi.com> */
2259 /* Adlink RTV24 with special unlock codes */ 2259 /* Adlink RTV24 with special unlock codes */
2260 .name = "Adlink RTV24", 2260 .name = "Adlink RTV24",
2261 .video_inputs = 4, 2261 .video_inputs = 4,
2262 .audio_inputs = 1, 2262 .audio_inputs = 1,
2263 .tuner = 0, 2263 .tuner = 0,
2264 .svhs = 2, 2264 .svhs = 2,
2265 .muxsel = { 2, 3, 1, 0}, 2265 .muxsel = { 2, 3, 1, 0},
2266 .tuner_type = -1, 2266 .tuner_type = -1,
2267 .pll = PLL_28, 2267 .pll = PLL_28,
2268
2268}}; 2269}};
2269 2270
2270static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards); 2271static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
@@ -2650,6 +2651,10 @@ void __devinit bttv_init_card1(struct bttv *btv)
2650 case BTTV_AVDVBT_771: 2651 case BTTV_AVDVBT_771:
2651 btv->use_i2c_hw = 1; 2652 btv->use_i2c_hw = 1;
2652 break; 2653 break;
2654 case BTTV_ADLINK_RTV24:
2655 init_RTV24( btv );
2656 break;
2657
2653 } 2658 }
2654 if (!bttv_tvcards[btv->c.type].has_dvb) 2659 if (!bttv_tvcards[btv->c.type].has_dvb)
2655 bttv_reset_audio(btv); 2660 bttv_reset_audio(btv);
@@ -2762,9 +2767,6 @@ void __devinit bttv_init_card2(struct bttv *btv)
2762 case BTTV_KODICOM_4400R: 2767 case BTTV_KODICOM_4400R:
2763 kodicom4400r_init(btv); 2768 kodicom4400r_init(btv);
2764 break; 2769 break;
2765 case BTTV_ADLINK_RTV24:
2766 init_RTV24(btv);
2767 break;
2768 } 2770 }
2769 2771
2770 /* pll configuration */ 2772 /* pll configuration */
@@ -2801,6 +2803,8 @@ void __devinit bttv_init_card2(struct bttv *btv)
2801 } 2803 }
2802 btv->pll.pll_current = -1; 2804 btv->pll.pll_current = -1;
2803 2805
2806 bttv_reset_audio(btv);
2807
2804 /* tuner configuration (from card list / autodetect / insmod option) */ 2808 /* tuner configuration (from card list / autodetect / insmod option) */
2805 if (UNSET != bttv_tvcards[btv->c.type].tuner_type) 2809 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
2806 if(UNSET == btv->tuner_type) 2810 if(UNSET == btv->tuner_type)
@@ -3320,6 +3324,8 @@ static void __devinit init_PXC200(struct bttv *btv)
3320 printk(KERN_INFO "PXC200 Initialised.\n"); 3324 printk(KERN_INFO "PXC200 Initialised.\n");
3321} 3325}
3322 3326
3327
3328
3323/* ----------------------------------------------------------------------- */ 3329/* ----------------------------------------------------------------------- */
3324/* 3330/*
3325 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock 3331 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
@@ -3348,49 +3354,54 @@ static void __devinit init_PXC200(struct bttv *btv)
3348 * error. ERROR_CPLD_Check_Failed. 3354 * error. ERROR_CPLD_Check_Failed.
3349 */ 3355 */
3350/* ----------------------------------------------------------------------- */ 3356/* ----------------------------------------------------------------------- */
3351void init_RTV24(struct bttv *btv) 3357void
3358init_RTV24 (struct bttv *btv)
3352{ 3359{
3353 u32 dataread; 3360 uint32_t dataRead = 0;
3354 const long watchdog_value = 0x0E; 3361 long watchdog_value = 0x0E;
3355 3362
3356 printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation in progress\n", 3363 printk (KERN_INFO
3364 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
3357 btv->c.nr); 3365 btv->c.nr);
3358 3366
3359 btwrite(0x00c3feff, BT848_GPIO_OUT_EN); 3367 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
3360 3368
3361 btwrite(0 + watchdog_value, BT848_GPIO_DATA); 3369 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3362 msleep(1); 3370 msleep (1);
3363 btwrite(0x10 + watchdog_value, BT848_GPIO_DATA); 3371 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
3364 msleep( 10 ); 3372 msleep (10);
3365 btwrite(0 + watchdog_value, BT848_GPIO_DATA); 3373 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3366 3374
3367 dataread = btread(BT848_GPIO_DATA); 3375 dataRead = btread (BT848_GPIO_DATA);
3368 3376
3369 if (((dataread >> 18) & 0x01) != 0 || ((dataread >> 19) & 0x01) != 1) { 3377 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
3370 printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation(1) " 3378 printk (KERN_INFO
3371 "ERROR_CPLD_Check_Failed (read %d)\n", 3379 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
3372 btv->c.nr, dataread); 3380 btv->c.nr, dataRead);
3373 } 3381 }
3374 3382
3375 btwrite(0x4400 + watchdog_value, BT848_GPIO_DATA); 3383 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
3376 msleep(10); 3384 msleep (10);
3377 btwrite(0x4410 + watchdog_value, BT848_GPIO_DATA); 3385 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
3378 msleep(1); 3386 msleep (1);
3379 btwrite(watchdog_value, BT848_GPIO_DATA); 3387 btwrite (watchdog_value, BT848_GPIO_DATA);
3380 msleep(1); 3388 msleep (1);
3381 dataread = btread(BT848_GPIO_DATA); 3389 dataRead = btread (BT848_GPIO_DATA);
3382 3390
3383 if (((dataread >> 18) & 0x01) != 0 || ((dataread >> 19) & 0x01) != 0) { 3391 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
3384 printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation(2) " 3392 printk (KERN_INFO
3385 "ERROR_CPLD_Check_Failed (read %d)\n", 3393 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
3386 btv->c.nr, dataread); 3394 btv->c.nr, dataRead);
3395
3387 return; 3396 return;
3388 } 3397 }
3389 3398
3390 printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation complete.\n", 3399 printk (KERN_INFO
3391 btv->c.nr); 3400 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
3392} 3401}
3393 3402
3403
3404
3394/* ----------------------------------------------------------------------- */ 3405/* ----------------------------------------------------------------------- */
3395/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */ 3406/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
3396/* 3407/*
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
index 033cc5498f23..290289a99757 100644
--- a/drivers/media/video/bttv-driver.c
+++ b/drivers/media/video/bttv-driver.c
@@ -1,5 +1,5 @@
1/* 1/*
2 $Id: bttv-driver.c,v 1.37 2005/02/21 13:57:59 kraxel Exp $ 2 $Id: bttv-driver.c,v 1.38 2005/06/10 17:20:24 mchehab Exp $
3 3
4 bttv - Bt848 frame grabber driver 4 bttv - Bt848 frame grabber driver
5 5
diff --git a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c
index c2368bc832ed..da448a5f9e9c 100644
--- a/drivers/media/video/bttv-i2c.c
+++ b/drivers/media/video/bttv-i2c.c
@@ -1,5 +1,5 @@
1/* 1/*
2 $Id: bttv-i2c.c,v 1.18 2005/02/16 12:14:10 kraxel Exp $ 2 $Id: bttv-i2c.c,v 1.21 2005/06/10 17:20:24 mchehab Exp $
3 3
4 bttv-i2c.c -- all the i2c code is here 4 bttv-i2c.c -- all the i2c code is here
5 5
diff --git a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h
index 9ec1b566af72..191eaf1714ba 100644
--- a/drivers/media/video/bttv.h
+++ b/drivers/media/video/bttv.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: bttv.h,v 1.17 2005/02/22 14:06:32 kraxel Exp $ 2 * $Id: bttv.h,v 1.18 2005/05/24 23:41:42 nsh Exp $
3 * 3 *
4 * bttv - Bt848 frame grabber driver 4 * bttv - Bt848 frame grabber driver
5 * 5 *
@@ -135,7 +135,7 @@
135#define BTTV_DVICO_DVBT_LITE 0x80 135#define BTTV_DVICO_DVBT_LITE 0x80
136#define BTTV_TIBET_CS16 0x83 136#define BTTV_TIBET_CS16 0x83
137#define BTTV_KODICOM_4400R 0x84 137#define BTTV_KODICOM_4400R 0x84
138#define BTTV_ADLINK_RTV24 0x86 138#define BTTV_ADLINK_RTV24 0x85
139 139
140/* i2c address list */ 140/* i2c address list */
141#define I2C_TSA5522 0xc2 141#define I2C_TSA5522 0xc2
diff --git a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h
index 1a9ba7e1cf51..7b6f1e856028 100644
--- a/drivers/media/video/bttvp.h
+++ b/drivers/media/video/bttvp.h
@@ -226,10 +226,6 @@ extern int fini_bttv_i2c(struct bttv *btv);
226#define dprintk if (bttv_debug >= 1) printk 226#define dprintk if (bttv_debug >= 1) printk
227#define d2printk if (bttv_debug >= 2) printk 227#define d2printk if (bttv_debug >= 2) printk
228 228
229/* our devices */
230#define BTTV_MAX 16
231extern unsigned int bttv_num;
232
233#define BTTV_MAX_FBUF 0x208000 229#define BTTV_MAX_FBUF 0x208000
234#define VBIBUF_SIZE (2048*VBI_MAXLINES*2) 230#define VBIBUF_SIZE (2048*VBI_MAXLINES*2)
235#define BTTV_TIMEOUT (HZ/2) /* 0.5 seconds */ 231#define BTTV_TIMEOUT (HZ/2) /* 0.5 seconds */
@@ -375,6 +371,10 @@ struct bttv {
375 unsigned int users; 371 unsigned int users;
376 struct bttv_fh init; 372 struct bttv_fh init;
377}; 373};
374
375/* our devices */
376#define BTTV_MAX 16
377extern unsigned int bttv_num;
378extern struct bttv bttvs[BTTV_MAX]; 378extern struct bttv bttvs[BTTV_MAX];
379 379
380/* private ioctls */ 380/* private ioctls */