aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bttv-cards.c
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/media/video/bttv-cards.c
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/media/video/bttv-cards.c')
-rw-r--r--drivers/media/video/bttv-cards.c99
1 files changed, 55 insertions, 44 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/*