aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bttv-cards.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>2005-07-12 16:58:42 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-12 19:01:04 -0400
commitfa9846a8c5965636fbade8655ae0ce1f9a655bd4 (patch)
tree4a011e90cd64eedeeb01bd09e1d3175b3a0edd17 /drivers/media/video/bttv-cards.c
parentde9c634270df3e27675a3c0e95545d2b3f754e3f (diff)
[PATCH] v4l: BTTV update
- use DMA_32BIT_MASK. - Rename tuner structures fields. - Tail spaces removed. - I2C cleanups and converged to a basic reference structure. - Removed unused structures. - Removed BTTV version check. Signed-off-by: <domen@coderock.org> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-Off-By: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> 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.c110
1 files changed, 12 insertions, 98 deletions
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c
index 251092e7f19f..2dbf5ec43abd 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.49 2005/06/10 17:20:24 mchehab Exp $ 2 $Id: bttv-cards.c,v 1.53 2005/07/05 17:37:35 nsh Exp $
3 3
4 bttv-cards.c 4 bttv-cards.c
5 5
@@ -39,9 +39,6 @@
39#include <asm/io.h> 39#include <asm/io.h>
40 40
41#include "bttvp.h" 41#include "bttvp.h"
42#if 0 /* not working yet */
43#include "bt832.h"
44#endif
45 42
46/* fwd decl */ 43/* fwd decl */
47static void boot_msp34xx(struct bttv *btv, int pin); 44static void boot_msp34xx(struct bttv *btv, int pin);
@@ -513,13 +510,8 @@ struct tvcard bttv_tvcards[] = {
513 .svhs = 2, 510 .svhs = 2,
514 .gpiomask = 0x01fe00, 511 .gpiomask = 0x01fe00,
515 .muxsel = { 2, 3, 1, 1}, 512 .muxsel = { 2, 3, 1, 1},
516#if 0
517 // old
518 .audiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 },
519#else
520 // 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> 513 // 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru>
521 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 }, 514 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
522#endif
523 .needs_tvaudio = 1, 515 .needs_tvaudio = 1,
524 .pll = PLL_28, 516 .pll = PLL_28,
525 .tuner_type = -1, 517 .tuner_type = -1,
@@ -766,14 +758,9 @@ struct tvcard bttv_tvcards[] = {
766 .tuner = 0, 758 .tuner = 0,
767 .svhs = 2, 759 .svhs = 2,
768 .muxsel = { 2, 3, 1, 1, 0}, // TV, CVid, SVid, CVid over SVid connector 760 .muxsel = { 2, 3, 1, 1, 0}, // TV, CVid, SVid, CVid over SVid connector
769#if 0
770 .gpiomask = 0xc33000,
771 .audiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 },
772#else
773 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */ 761 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
774 .gpiomask = 0xb33000, 762 .gpiomask = 0xb33000,
775 .audiomux = { 0x122000,0x1000,0x0000,0x620000,0x800000 }, 763 .audiomux = { 0x122000,0x1000,0x0000,0x620000,0x800000 },
776#endif
777 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !) 764 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
778 gpio23 -- hef4052:nEnable (0x800000) 765 gpio23 -- hef4052:nEnable (0x800000)
779 gpio12 -- hef4052:A1 766 gpio12 -- hef4052:A1
@@ -1603,20 +1590,11 @@ struct tvcard bttv_tvcards[] = {
1603 .video_inputs = 4, 1590 .video_inputs = 4,
1604 .audio_inputs = 1, 1591 .audio_inputs = 1,
1605 .tuner = -1, 1592 .tuner = -1,
1606#if 0 /* TODO ... */
1607 .svhs = OSPREY540_SVID_ANALOG,
1608 .muxsel = { [OSPREY540_COMP_ANALOG] = 2,
1609 [OSPREY540_SVID_ANALOG] = 3, },
1610#endif
1611 .pll = PLL_28, 1593 .pll = PLL_28,
1612 .tuner_type = -1, 1594 .tuner_type = -1,
1613 .no_msp34xx = 1, 1595 .no_msp34xx = 1,
1614 .no_tda9875 = 1, 1596 .no_tda9875 = 1,
1615 .no_tda7432 = 1, 1597 .no_tda7432 = 1,
1616#if 0 /* TODO ... */
1617 .muxsel_hook = osprey_540_muxsel,
1618 .picture_hook = osprey_540_set_picture,
1619#endif
1620},{ 1598},{
1621 1599
1622 /* ---- card 0x5C ---------------------------------- */ 1600 /* ---- card 0x5C ---------------------------------- */
@@ -2546,21 +2524,12 @@ static void eagle_muxsel(struct bttv *btv, unsigned int input)
2546 btaor((2)<<5, ~(3<<5), BT848_IFORM); 2524 btaor((2)<<5, ~(3<<5), BT848_IFORM);
2547 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]); 2525 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
2548 2526
2549#if 0
2550 /* svhs */
2551 /* wake chroma ADC */
2552 btand(~BT848_ADC_C_SLEEP, BT848_ADC);
2553 /* set to YC video */
2554 btor(BT848_CONTROL_COMP, BT848_E_CONTROL);
2555 btor(BT848_CONTROL_COMP, BT848_O_CONTROL);
2556#else
2557 /* composite */ 2527 /* composite */
2558 /* set chroma ADC to sleep */ 2528 /* set chroma ADC to sleep */
2559 btor(BT848_ADC_C_SLEEP, BT848_ADC); 2529 btor(BT848_ADC_C_SLEEP, BT848_ADC);
2560 /* set to composite video */ 2530 /* set to composite video */
2561 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL); 2531 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
2562 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL); 2532 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
2563#endif
2564 2533
2565 /* switch sync drive off */ 2534 /* switch sync drive off */
2566 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE); 2535 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
@@ -2813,10 +2782,18 @@ void __devinit bttv_init_card2(struct bttv *btv)
2813 btv->tuner_type = tuner[btv->c.nr]; 2782 btv->tuner_type = tuner[btv->c.nr];
2814 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type); 2783 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
2815 if (btv->pinnacle_id != UNSET) 2784 if (btv->pinnacle_id != UNSET)
2816 bttv_call_i2c_clients(btv,AUDC_CONFIG_PINNACLE, 2785 bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE,
2817 &btv->pinnacle_id); 2786 &btv->pinnacle_id);
2818 if (btv->tuner_type != UNSET) 2787 if (btv->tuner_type != UNSET) {
2819 bttv_call_i2c_clients(btv,TUNER_SET_TYPE,&btv->tuner_type); 2788 struct tuner_setup tun_setup;
2789
2790 tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
2791 tun_setup.type = btv->tuner_type;
2792 tun_setup.addr = ADDR_UNSET;
2793
2794 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
2795 }
2796
2820 btv->svhs = bttv_tvcards[btv->c.type].svhs; 2797 btv->svhs = bttv_tvcards[btv->c.type].svhs;
2821 if (svhs[btv->c.nr] != UNSET) 2798 if (svhs[btv->c.nr] != UNSET)
2822 btv->svhs = svhs[btv->c.nr]; 2799 btv->svhs = svhs[btv->c.nr];
@@ -3125,14 +3102,6 @@ static int tuner_0_table[] = {
3125 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM, 3102 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3126 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL, 3103 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3127 TUNER_PHILIPS_FM1216ME_MK3 }; 3104 TUNER_PHILIPS_FM1216ME_MK3 };
3128#if 0
3129int tuner_0_fm_table[] = {
3130 PHILIPS_FR1236_NTSC, PHILIPS_FR1216_PAL,
3131 PHILIPS_FR1216_PAL, PHILIPS_FR1216_PAL,
3132 PHILIPS_FR1216_PAL, PHILIPS_FR1216_PAL,
3133 PHILIPS_FR1236_SECAM, PHILIPS_FR1236_SECAM,
3134 PHILIPS_FR1236_SECAM, PHILIPS_FR1216_PAL};
3135#endif
3136 3105
3137static int tuner_1_table[] = { 3106static int tuner_1_table[] = {
3138 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL, 3107 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
@@ -3218,36 +3187,6 @@ static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3218 3187
3219static void __devinit boot_bt832(struct bttv *btv) 3188static void __devinit boot_bt832(struct bttv *btv)
3220{ 3189{
3221#if 0 /* not working yet */
3222 int resetbit=0;
3223
3224 switch (btv->c.type) {
3225 case BTTV_PXELVWPLTVPAK:
3226 resetbit = 0x400000;
3227 break;
3228 case BTTV_MODTEC_205:
3229 resetbit = 1<<9;
3230 break;
3231 default:
3232 BUG();
3233 }
3234
3235 request_module("bt832");
3236 bttv_call_i2c_clients(btv, BT832_HEXDUMP, NULL);
3237
3238 printk("bttv%d: Reset Bt832 [line=0x%x]\n",btv->c.nr,resetbit);
3239 gpio_write(0);
3240 gpio_inout(resetbit, resetbit);
3241 udelay(5);
3242 gpio_bits(resetbit, resetbit);
3243 udelay(5);
3244 gpio_bits(resetbit, 0);
3245 udelay(5);
3246
3247 // bt832 on pixelview changes from i2c 0x8a to 0x88 after
3248 // being reset as above. So we must follow by this:
3249 bttv_call_i2c_clients(btv, BT832_REATTACH, NULL);
3250#endif
3251} 3190}
3252 3191
3253/* ----------------------------------------------------------------------- */ 3192/* ----------------------------------------------------------------------- */
@@ -3572,11 +3511,6 @@ void tea5757_set_freq(struct bttv *btv, unsigned short freq)
3572{ 3511{
3573 dprintk("tea5757_set_freq %d\n",freq); 3512 dprintk("tea5757_set_freq %d\n",freq);
3574 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */ 3513 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
3575#if 0
3576 /* breaks Miro PCTV */
3577 value = tea5757_read(btv);
3578 dprintk("bttv%d: tea5757 readback=0x%x\n",btv->c.nr,value);
3579#endif
3580} 3514}
3581 3515
3582 3516
@@ -3656,13 +3590,8 @@ gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
3656{ 3590{
3657 unsigned int val, con; 3591 unsigned int val, con;
3658 3592
3659#if BTTV_VERSION_CODE > KERNEL_VERSION(0,8,0)
3660 if (btv->radio_user) 3593 if (btv->radio_user)
3661 return; 3594 return;
3662#else
3663 if (btv->radio)
3664 return;
3665#endif
3666 3595
3667 val = gpio_read(); 3596 val = gpio_read();
3668 if (set) { 3597 if (set) {
@@ -3851,13 +3780,8 @@ pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
3851{ 3780{
3852 unsigned int val = 0; 3781 unsigned int val = 0;
3853 3782
3854#if BTTV_VERSION_CODE > KERNEL_VERSION(0,8,0)
3855 if (btv->radio_user) 3783 if (btv->radio_user)
3856 return; 3784 return;
3857#else
3858 if (btv->radio)
3859 return;
3860#endif
3861 3785
3862 if (set) { 3786 if (set) {
3863 if (v->mode & VIDEO_SOUND_MONO) { 3787 if (v->mode & VIDEO_SOUND_MONO) {
@@ -3888,13 +3812,8 @@ fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
3888{ 3812{
3889 unsigned int val = 0xffff; 3813 unsigned int val = 0xffff;
3890 3814
3891#if BTTV_VERSION_CODE > KERNEL_VERSION(0,8,0)
3892 if (btv->radio_user) 3815 if (btv->radio_user)
3893 return; 3816 return;
3894#else
3895 if (btv->radio)
3896 return;
3897#endif
3898 if (set) { 3817 if (set) {
3899 if (v->mode & VIDEO_SOUND_MONO) { 3818 if (v->mode & VIDEO_SOUND_MONO) {
3900 val = 0x0000; 3819 val = 0x0000;
@@ -4371,11 +4290,6 @@ void __devinit bttv_check_chipset(void)
4371 latency = 0x0A; 4290 latency = 0x0A;
4372#endif 4291#endif
4373 4292
4374#if 0
4375 /* print which chipset we have */
4376 while ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8,dev)))
4377 printk(KERN_INFO "bttv: Host bridge is %s\n",pci_name(dev));
4378#endif
4379 4293
4380 /* print warnings about any quirks found */ 4294 /* print warnings about any quirks found */
4381 if (triton1) 4295 if (triton1)