aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorPeter Skipworth <pete@peterskipworth.com>2005-06-24 01:04:45 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:06:37 -0400
commit93b43f13b5bfeac09ef5743edf39eeeee3f4eeae (patch)
tree9993975474f4f033ab866586c8b0e6dba0fe67ac /drivers/media/video
parent097b750e6c0209b4b951996826ca0bd6707e357a (diff)
[PATCH] BTTV support for Adlink RTV24 capture card
The bttv module currently lacks support for the Adlink RTV24 capture card. The following patch adds support for the Adlink RTV24 video capture card to the bttv module. Cc: Gerd Knorr <kraxel@bytesex.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/bttv-cards.c87
-rw-r--r--drivers/media/video/bttv.h1
2 files changed, 88 insertions, 0 deletions
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c
index 6334122704ae..ca7c993fecb7 100644
--- a/drivers/media/video/bttv-cards.c
+++ b/drivers/media/video/bttv-cards.c
@@ -51,6 +51,7 @@ static void avermedia_eeprom(struct bttv *btv);
51static void osprey_eeprom(struct bttv *btv); 51static void osprey_eeprom(struct bttv *btv);
52static void modtec_eeprom(struct bttv *btv); 52static void modtec_eeprom(struct bttv *btv);
53static void init_PXC200(struct bttv *btv); 53static void init_PXC200(struct bttv *btv);
54static void init_RTV24(struct bttv *btv);
54 55
55static void winview_audio(struct bttv *btv, struct video_audio *v, int set); 56static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
56static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set); 57static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
@@ -2251,6 +2252,19 @@ struct tvcard bttv_tvcards[] = {
2251 .no_tda7432 = 1, 2252 .no_tda7432 = 1,
2252 .no_tda9875 = 1, 2253 .no_tda9875 = 1,
2253 .muxsel_hook = kodicom4400r_muxsel, 2254 .muxsel_hook = kodicom4400r_muxsel,
2255},
2256{
2257 /* ---- card 0x86---------------------------------- */
2258 /* Michael Henson <mhenson@clarityvi.com> */
2259 /* Adlink RTV24 with special unlock codes */
2260 .name = "Adlink RTV24",
2261 .video_inputs = 4,
2262 .audio_inputs = 1,
2263 .tuner = 0,
2264 .svhs = 2,
2265 .muxsel = { 2, 3, 1, 0},
2266 .tuner_type = -1,
2267 .pll = PLL_28,
2254}}; 2268}};
2255 2269
2256static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards); 2270static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
@@ -2748,6 +2762,9 @@ void __devinit bttv_init_card2(struct bttv *btv)
2748 case BTTV_KODICOM_4400R: 2762 case BTTV_KODICOM_4400R:
2749 kodicom4400r_init(btv); 2763 kodicom4400r_init(btv);
2750 break; 2764 break;
2765 case BTTV_ADLINK_RTV24:
2766 init_RTV24(btv);
2767 break;
2751 } 2768 }
2752 2769
2753 /* pll configuration */ 2770 /* pll configuration */
@@ -3303,6 +3320,76 @@ static void __devinit init_PXC200(struct bttv *btv)
3303 printk(KERN_INFO "PXC200 Initialised.\n"); 3320 printk(KERN_INFO "PXC200 Initialised.\n");
3304} 3321}
3305 3322
3323/* ----------------------------------------------------------------------- */
3324/*
3325 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3326 * it. This apparently involves the following procedure for each 878 chip:
3327 *
3328 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3329 *
3330 * 2) write to GPIO_DATA
3331 * - 0x0E
3332 * - sleep 1ms
3333 * - 0x10 + 0x0E
3334 * - sleep 10ms
3335 * - 0x0E
3336 * read from GPIO_DATA into buf (uint_32)
3337 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3338 * error. ERROR_CPLD_Check_Failed stop.
3339 *
3340 * 3) write to GPIO_DATA
3341 * - write 0x4400 + 0x0E
3342 * - sleep 10ms
3343 * - write 0x4410 + 0x0E
3344 * - sleep 1ms
3345 * - write 0x0E
3346 * read from GPIO_DATA into buf (uint_32)
3347 * - if ( buf>>18 & 0x01 ) || ( buf>>19 && 0x01 != 0 )
3348 * error. ERROR_CPLD_Check_Failed.
3349 */
3350/* ----------------------------------------------------------------------- */
3351void init_RTV24(struct bttv *btv)
3352{
3353 u32 dataread;
3354 const long watchdog_value = 0x0E;
3355
3356 printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation in progress\n",
3357 btv->c.nr);
3358
3359 btwrite(0x00c3feff, BT848_GPIO_OUT_EN);
3360
3361 btwrite(0 + watchdog_value, BT848_GPIO_DATA);
3362 msleep(1);
3363 btwrite(0x10 + watchdog_value, BT848_GPIO_DATA);
3364 msleep( 10 );
3365 btwrite(0 + watchdog_value, BT848_GPIO_DATA);
3366
3367 dataread = btread(BT848_GPIO_DATA);
3368
3369 if (((dataread >> 18) & 0x01) != 0 || ((dataread >> 19) & 0x01) != 1) {
3370 printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation(1) "
3371 "ERROR_CPLD_Check_Failed (read %d)\n",
3372 btv->c.nr, dataread);
3373 }
3374
3375 btwrite(0x4400 + watchdog_value, BT848_GPIO_DATA);
3376 msleep(10);
3377 btwrite(0x4410 + watchdog_value, BT848_GPIO_DATA);
3378 msleep(1);
3379 btwrite(watchdog_value, BT848_GPIO_DATA);
3380 msleep(1);
3381 dataread = btread(BT848_GPIO_DATA);
3382
3383 if (((dataread >> 18) & 0x01) != 0 || ((dataread >> 19) & 0x01) != 0) {
3384 printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation(2) "
3385 "ERROR_CPLD_Check_Failed (read %d)\n",
3386 btv->c.nr, dataread);
3387 return;
3388 }
3389
3390 printk(KERN_INFO "bttv%d: Adlink RTV-24 initialisation complete.\n",
3391 btv->c.nr);
3392}
3306 3393
3307/* ----------------------------------------------------------------------- */ 3394/* ----------------------------------------------------------------------- */
3308/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */ 3395/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
diff --git a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h
index 8322b66e0905..9ec1b566af72 100644
--- a/drivers/media/video/bttv.h
+++ b/drivers/media/video/bttv.h
@@ -135,6 +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 139
139/* i2c address list */ 140/* i2c address list */
140#define I2C_TSA5522 0xc2 141#define I2C_TSA5522 0xc2