diff options
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-cards.c')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-cards.c | 73 |
1 files changed, 42 insertions, 31 deletions
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c index 1c56ae92ce74..6081edc362df 100644 --- a/drivers/media/video/bt8xx/bttv-cards.c +++ b/drivers/media/video/bt8xx/bttv-cards.c | |||
@@ -3144,8 +3144,9 @@ static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]) | |||
3144 | 3144 | ||
3145 | static void flyvideo_gpio(struct bttv *btv) | 3145 | static void flyvideo_gpio(struct bttv *btv) |
3146 | { | 3146 | { |
3147 | int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821; | 3147 | int gpio, has_remote, has_radio, is_capture_only; |
3148 | int tuner=UNSET,ttype; | 3148 | int is_lr90, has_tda9820_tda9821; |
3149 | int tuner_type = UNSET, ttype; | ||
3149 | 3150 | ||
3150 | gpio_inout(0xffffff, 0); | 3151 | gpio_inout(0xffffff, 0); |
3151 | udelay(8); /* without this we would see the 0x1800 mask */ | 3152 | udelay(8); /* without this we would see the 0x1800 mask */ |
@@ -3163,20 +3164,26 @@ static void flyvideo_gpio(struct bttv *btv) | |||
3163 | * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered | 3164 | * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered |
3164 | * Note: Some bits are Audio_Mask ! | 3165 | * Note: Some bits are Audio_Mask ! |
3165 | */ | 3166 | */ |
3166 | ttype=(gpio&0x0f0000)>>16; | 3167 | ttype = (gpio & 0x0f0000) >> 16; |
3167 | switch(ttype) { | 3168 | switch (ttype) { |
3168 | case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */ | 3169 | case 0x0: |
3170 | tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */ | ||
3169 | break; | 3171 | break; |
3170 | case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */ | 3172 | case 0x2: |
3173 | tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */ | ||
3171 | break; | 3174 | break; |
3172 | case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */ | 3175 | case 0x4: |
3176 | tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */ | ||
3173 | break; | 3177 | break; |
3174 | case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */ | 3178 | case 0x6: |
3179 | tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */ | ||
3175 | break; | 3180 | break; |
3176 | case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */ | 3181 | case 0xC: |
3182 | tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */ | ||
3177 | break; | 3183 | break; |
3178 | default: | 3184 | default: |
3179 | printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr); | 3185 | printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr); |
3186 | break; | ||
3180 | } | 3187 | } |
3181 | 3188 | ||
3182 | has_remote = gpio & 0x800000; | 3189 | has_remote = gpio & 0x800000; |
@@ -3189,23 +3196,26 @@ static void flyvideo_gpio(struct bttv *btv) | |||
3189 | /* | 3196 | /* |
3190 | * gpio & 0x001000 output bit for audio routing */ | 3197 | * gpio & 0x001000 output bit for audio routing */ |
3191 | 3198 | ||
3192 | if(is_capture_only) | 3199 | if (is_capture_only) |
3193 | tuner = TUNER_ABSENT; /* No tuner present */ | 3200 | tuner_type = TUNER_ABSENT; /* No tuner present */ |
3194 | 3201 | ||
3195 | printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", | 3202 | printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", |
3196 | btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio); | 3203 | btv->c.nr, has_radio ? "yes" : "no ", |
3204 | has_remote ? "yes" : "no ", tuner_type, gpio); | ||
3197 | printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n", | 3205 | printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n", |
3198 | btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ", | 3206 | btv->c.nr, is_lr90 ? "yes" : "no ", |
3199 | is_capture_only?"yes":"no "); | 3207 | has_tda9820_tda9821 ? "yes" : "no ", |
3208 | is_capture_only ? "yes" : "no "); | ||
3200 | 3209 | ||
3201 | if (tuner != UNSET) /* only set if known tuner autodetected, else let insmod option through */ | 3210 | if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */ |
3202 | btv->tuner_type = tuner; | 3211 | btv->tuner_type = tuner_type; |
3203 | btv->has_radio = has_radio; | 3212 | btv->has_radio = has_radio; |
3204 | 3213 | ||
3205 | /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80 | 3214 | /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80 |
3206 | * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00 | 3215 | * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00 |
3207 | * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */ | 3216 | * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */ |
3208 | if(has_tda9820_tda9821) btv->audio_mode_gpio = lt9415_audio; | 3217 | if (has_tda9820_tda9821) |
3218 | btv->audio_mode_gpio = lt9415_audio; | ||
3209 | /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */ | 3219 | /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */ |
3210 | } | 3220 | } |
3211 | 3221 | ||
@@ -3962,7 +3972,7 @@ static int tuner_1_table[] = { | |||
3962 | 3972 | ||
3963 | static void __devinit avermedia_eeprom(struct bttv *btv) | 3973 | static void __devinit avermedia_eeprom(struct bttv *btv) |
3964 | { | 3974 | { |
3965 | int tuner_make,tuner_tv_fm,tuner_format,tuner=0; | 3975 | int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0; |
3966 | 3976 | ||
3967 | tuner_make = (eeprom_data[0x41] & 0x7); | 3977 | tuner_make = (eeprom_data[0x41] & 0x7); |
3968 | tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3; | 3978 | tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3; |
@@ -3970,24 +3980,24 @@ static void __devinit avermedia_eeprom(struct bttv *btv) | |||
3970 | btv->has_remote = (eeprom_data[0x42] & 0x01); | 3980 | btv->has_remote = (eeprom_data[0x42] & 0x01); |
3971 | 3981 | ||
3972 | if (tuner_make == 0 || tuner_make == 2) | 3982 | if (tuner_make == 0 || tuner_make == 2) |
3973 | if(tuner_format <=0x0a) | 3983 | if (tuner_format <= 0x0a) |
3974 | tuner = tuner_0_table[tuner_format]; | 3984 | tuner_type = tuner_0_table[tuner_format]; |
3975 | if (tuner_make == 1) | 3985 | if (tuner_make == 1) |
3976 | if(tuner_format <=9) | 3986 | if (tuner_format <= 9) |
3977 | tuner = tuner_1_table[tuner_format]; | 3987 | tuner_type = tuner_1_table[tuner_format]; |
3978 | 3988 | ||
3979 | if (tuner_make == 4) | 3989 | if (tuner_make == 4) |
3980 | if(tuner_format == 0x09) | 3990 | if (tuner_format == 0x09) |
3981 | tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */ | 3991 | tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */ |
3982 | 3992 | ||
3983 | printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=", | 3993 | printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=", |
3984 | btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]); | 3994 | btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]); |
3985 | if(tuner) { | 3995 | if (tuner_type) { |
3986 | btv->tuner_type=tuner; | 3996 | btv->tuner_type = tuner_type; |
3987 | printk("%d",tuner); | 3997 | printk(KERN_CONT "%d", tuner_type); |
3988 | } else | 3998 | } else |
3989 | printk("Unknown type"); | 3999 | printk(KERN_CONT "Unknown type"); |
3990 | printk(" radio:%s remote control:%s\n", | 4000 | printk(KERN_CONT " radio:%s remote control:%s\n", |
3991 | tuner_tv_fm ? "yes" : "no", | 4001 | tuner_tv_fm ? "yes" : "no", |
3992 | btv->has_remote ? "yes" : "no"); | 4002 | btv->has_remote ? "yes" : "no"); |
3993 | } | 4003 | } |
@@ -4029,7 +4039,8 @@ static void __devinit boot_msp34xx(struct bttv *btv, int pin) | |||
4029 | 4039 | ||
4030 | gpio_inout(mask,mask); | 4040 | gpio_inout(mask,mask); |
4031 | gpio_bits(mask,0); | 4041 | gpio_bits(mask,0); |
4032 | udelay(2500); | 4042 | mdelay(2); |
4043 | udelay(500); | ||
4033 | gpio_bits(mask,mask); | 4044 | gpio_bits(mask,mask); |
4034 | 4045 | ||
4035 | if (bttv_gpio) | 4046 | if (bttv_gpio) |