• Home
  • Raw
  • Download

Lines Matching refs:btv

48 static void boot_msp34xx(struct bttv *btv, int pin);
49 static void hauppauge_eeprom(struct bttv *btv);
50 static void avermedia_eeprom(struct bttv *btv);
51 static void osprey_eeprom(struct bttv *btv, const u8 ee[256]);
52 static void modtec_eeprom(struct bttv *btv);
53 static void init_PXC200(struct bttv *btv);
54 static void init_RTV24(struct bttv *btv);
56 static void rv605_muxsel(struct bttv *btv, unsigned int input);
57 static void eagle_muxsel(struct bttv *btv, unsigned int input);
58 static void xguard_muxsel(struct bttv *btv, unsigned int input);
59 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
60 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
62 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
64 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
65 static void picolo_tetra_init(struct bttv *btv);
67 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
68 static void tibetCS16_init(struct bttv *btv);
70 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
71 static void kodicom4400r_init(struct bttv *btv);
73 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
74 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
76 static void geovision_muxsel(struct bttv *btv, unsigned int input);
78 static void phytec_muxsel(struct bttv *btv, unsigned int input);
80 static void gv800s_muxsel(struct bttv *btv, unsigned int input);
81 static void gv800s_init(struct bttv *btv);
83 static void td3116_muxsel(struct bttv *btv, unsigned int input);
85 static int terratec_active_radio_upgrade(struct bttv *btv);
86 static int tea5757_read(struct bttv *btv);
87 static int tea5757_write(struct bttv *btv, int value);
88 static void identify_by_eeprom(struct bttv *btv,
90 static int pvr_boot(struct bttv *btv);
2840 void bttv_idcard(struct bttv *btv) in bttv_idcard() argument
2846 btv->cardid = btv->c.pci->subsystem_device << 16; in bttv_idcard()
2847 btv->cardid |= btv->c.pci->subsystem_vendor; in bttv_idcard()
2849 if (0 != btv->cardid && 0xffffffff != btv->cardid) { in bttv_idcard()
2852 if (cards[i].id == btv->cardid) in bttv_idcard()
2858 btv->c.nr, cards[type].name, cards[type].cardnr, in bttv_idcard()
2859 btv->cardid & 0xffff, in bttv_idcard()
2860 (btv->cardid >> 16) & 0xffff); in bttv_idcard()
2861 btv->c.type = cards[type].cardnr; in bttv_idcard()
2865 btv->c.nr, btv->cardid & 0xffff, in bttv_idcard()
2866 (btv->cardid >> 16) & 0xffff); in bttv_idcard()
2872 if (card[btv->c.nr] < bttv_num_tvcards) in bttv_idcard()
2873 btv->c.type=card[btv->c.nr]; in bttv_idcard()
2877 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type, in bttv_idcard()
2878 card[btv->c.nr] < bttv_num_tvcards in bttv_idcard()
2888 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i]; in bttv_idcard()
2894 bttv_tvcards[btv->c.type].gpiomux[i] = audioall; in bttv_idcard()
2897 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits; in bttv_idcard()
2899 btv->c.nr, bttv_tvcards[btv->c.type].gpiomask); in bttv_idcard()
2902 i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]); in bttv_idcard()
2912 static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]) in identify_by_eeprom() argument
2924 btv->c.type = type; in identify_by_eeprom()
2926 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type); in identify_by_eeprom()
2930 static void flyvideo_gpio(struct bttv *btv) in flyvideo_gpio() argument
2970 pr_info("%d: FlyVideo_gpio: unknown tuner type\n", btv->c.nr); in flyvideo_gpio()
2988 btv->c.nr, has_radio ? "yes" : "no", in flyvideo_gpio()
2991 btv->c.nr, is_lr90 ? "yes" : "no", in flyvideo_gpio()
2996 btv->tuner_type = tuner_type; in flyvideo_gpio()
2997 btv->has_radio = has_radio; in flyvideo_gpio()
3003 btv->audio_mode_gpio = lt9415_audio; in flyvideo_gpio()
3012 static void miro_pinnacle_gpio(struct bttv *btv) in miro_pinnacle_gpio() argument
3020 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx"); in miro_pinnacle_gpio()
3022 btv->tuner_type = miro_tunermap[id]; in miro_pinnacle_gpio()
3024 btv->has_radio = 1; in miro_pinnacle_gpio()
3026 btv->has_matchbox = 1; in miro_pinnacle_gpio()
3027 btv->mbox_we = (1<<6); in miro_pinnacle_gpio()
3028 btv->mbox_most = (1<<7); in miro_pinnacle_gpio()
3029 btv->mbox_clk = (1<<8); in miro_pinnacle_gpio()
3030 btv->mbox_data = (1<<9); in miro_pinnacle_gpio()
3031 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9); in miro_pinnacle_gpio()
3034 btv->has_radio = 0; in miro_pinnacle_gpio()
3037 if (btv->c.type == BTTV_BOARD_MIRO) in miro_pinnacle_gpio()
3038 btv->c.type = BTTV_BOARD_MIROPRO; in miro_pinnacle_gpio()
3039 if (btv->c.type == BTTV_BOARD_PINNACLE) in miro_pinnacle_gpio()
3040 btv->c.type = BTTV_BOARD_PINNACLEPRO; in miro_pinnacle_gpio()
3043 btv->c.nr, id+1, btv->tuner_type, in miro_pinnacle_gpio()
3044 !btv->has_radio ? "no" : in miro_pinnacle_gpio()
3045 (btv->has_matchbox ? "matchbox" : "fmtuner"), in miro_pinnacle_gpio()
3050 btv->has_radio = 0; in miro_pinnacle_gpio()
3054 btv->tda9887_conf = TDA9887_INTERCARRIER; in miro_pinnacle_gpio()
3058 btv->has_radio = 1; in miro_pinnacle_gpio()
3059 btv->tda9887_conf = TDA9887_QSS; in miro_pinnacle_gpio()
3063 btv->has_radio = 1; in miro_pinnacle_gpio()
3064 btv->tda9887_conf = TDA9887_QSS; in miro_pinnacle_gpio()
3068 btv->tda9887_conf = TDA9887_QSS; in miro_pinnacle_gpio()
3072 btv->tda9887_conf = TDA9887_INTERCARRIER; in miro_pinnacle_gpio()
3076 btv->tda9887_conf = TDA9887_INTERCARRIER; in miro_pinnacle_gpio()
3080 btv->tda9887_conf = TDA9887_INTERCARRIER; in miro_pinnacle_gpio()
3087 btv->c.type = BTTV_BOARD_PINNACLEPRO; in miro_pinnacle_gpio()
3089 btv->c.nr, id, info, btv->has_radio ? "yes" : "no"); in miro_pinnacle_gpio()
3090 btv->tuner_type = TUNER_MT2032; in miro_pinnacle_gpio()
3097 static void init_ids_eagle(struct bttv *btv) in init_ids_eagle() argument
3115 static void eagle_muxsel(struct bttv *btv, unsigned int input) in eagle_muxsel() argument
3130 static void gvc1100_muxsel(struct bttv *btv, unsigned int input) in gvc1100_muxsel() argument
3149 static void init_lmlbt4x(struct bttv *btv) in init_lmlbt4x() argument
3157 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input) in sigmaSQ_muxsel() argument
3164 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input) in sigmaSLC_muxsel() argument
3171 static void geovision_muxsel(struct bttv *btv, unsigned int input) in geovision_muxsel() argument
3188 static void td3116_latch_value(struct bttv *btv, u32 value) in td3116_latch_value() argument
3196 static void td3116_muxsel(struct bttv *btv, unsigned int input) in td3116_muxsel() argument
3206 td3116_latch_value(btv, value); in td3116_muxsel()
3211 td3116_latch_value(btv, value); in td3116_muxsel()
3216 static void bttv_reset_audio(struct bttv *btv) in bttv_reset_audio() argument
3227 if (btv->id != 878) in bttv_reset_audio()
3231 pr_debug("%d: BT878A ARESET\n", btv->c.nr); in bttv_reset_audio()
3238 void bttv_init_card1(struct bttv *btv) in bttv_init_card1() argument
3240 switch (btv->c.type) { in bttv_init_card1()
3243 boot_msp34xx(btv,5); in bttv_init_card1()
3247 boot_msp34xx(btv,20); in bttv_init_card1()
3250 boot_msp34xx(btv,11); in bttv_init_card1()
3253 pvr_boot(btv); in bttv_init_card1()
3258 btv->use_i2c_hw = 1; in bttv_init_card1()
3261 init_RTV24( btv ); in bttv_init_card1()
3265 if (!bttv_tvcards[btv->c.type].has_dvb) in bttv_init_card1()
3266 bttv_reset_audio(btv); in bttv_init_card1()
3270 void bttv_init_card2(struct bttv *btv) in bttv_init_card2() argument
3272 btv->tuner_type = UNSET; in bttv_init_card2()
3274 if (BTTV_BOARD_UNKNOWN == btv->c.type) { in bttv_init_card2()
3275 bttv_readee(btv,eeprom_data,0xa0); in bttv_init_card2()
3276 identify_by_eeprom(btv,eeprom_data); in bttv_init_card2()
3279 switch (btv->c.type) { in bttv_init_card2()
3285 miro_pinnacle_gpio(btv); in bttv_init_card2()
3298 flyvideo_gpio(btv); in bttv_init_card2()
3304 bttv_readee(btv,eeprom_data,0xa0); in bttv_init_card2()
3305 hauppauge_eeprom(btv); in bttv_init_card2()
3309 bttv_readee(btv,eeprom_data,0xa0); in bttv_init_card2()
3310 avermedia_eeprom(btv); in bttv_init_card2()
3313 init_PXC200(btv); in bttv_init_card2()
3316 picolo_tetra_init(btv); in bttv_init_card2()
3319 btv->has_radio = 1; in bttv_init_card2()
3320 btv->has_matchbox = 1; in bttv_init_card2()
3321 btv->mbox_we = 0x20; in bttv_init_card2()
3322 btv->mbox_most = 0; in bttv_init_card2()
3323 btv->mbox_clk = 0x08; in bttv_init_card2()
3324 btv->mbox_data = 0x10; in bttv_init_card2()
3325 btv->mbox_mask = 0x38; in bttv_init_card2()
3329 terratec_active_radio_upgrade(btv); in bttv_init_card2()
3332 if (btv->cardid == 0x3002144f) { in bttv_init_card2()
3333 btv->has_radio=1; in bttv_init_card2()
3335 btv->c.nr); in bttv_init_card2()
3339 if (btv->cardid == 0x3060121a) { in bttv_init_card2()
3342 btv->has_radio=0; in bttv_init_card2()
3343 btv->tuner_type=TUNER_TEMIC_NTSC; in bttv_init_card2()
3358 bttv_readee(btv,eeprom_data,0xa0); in bttv_init_card2()
3359 osprey_eeprom(btv, eeprom_data); in bttv_init_card2()
3362 init_ids_eagle(btv); in bttv_init_card2()
3365 bttv_readee(btv,eeprom_data,0xa0); in bttv_init_card2()
3366 modtec_eeprom(btv); in bttv_init_card2()
3369 init_lmlbt4x(btv); in bttv_init_card2()
3372 tibetCS16_init(btv); in bttv_init_card2()
3375 kodicom4400r_init(btv); in bttv_init_card2()
3378 gv800s_init(btv); in bttv_init_card2()
3383 if (!(btv->id==848 && btv->revision==0x11)) { in bttv_init_card2()
3385 if (PLL_28 == bttv_tvcards[btv->c.type].pll) { in bttv_init_card2()
3386 btv->pll.pll_ifreq=28636363; in bttv_init_card2()
3387 btv->pll.pll_crystal=BT848_IFORM_XT0; in bttv_init_card2()
3389 if (PLL_35 == bttv_tvcards[btv->c.type].pll) { in bttv_init_card2()
3390 btv->pll.pll_ifreq=35468950; in bttv_init_card2()
3391 btv->pll.pll_crystal=BT848_IFORM_XT1; in bttv_init_card2()
3394 switch (pll[btv->c.nr]) { in bttv_init_card2()
3396 btv->pll.pll_crystal = 0; in bttv_init_card2()
3397 btv->pll.pll_ifreq = 0; in bttv_init_card2()
3398 btv->pll.pll_ofreq = 0; in bttv_init_card2()
3402 btv->pll.pll_ifreq = 28636363; in bttv_init_card2()
3403 btv->pll.pll_ofreq = 0; in bttv_init_card2()
3404 btv->pll.pll_crystal = BT848_IFORM_XT0; in bttv_init_card2()
3408 btv->pll.pll_ifreq = 35468950; in bttv_init_card2()
3409 btv->pll.pll_ofreq = 0; in bttv_init_card2()
3410 btv->pll.pll_crystal = BT848_IFORM_XT1; in bttv_init_card2()
3414 btv->pll.pll_current = -1; in bttv_init_card2()
3417 if (UNSET != bttv_tvcards[btv->c.type].tuner_type) in bttv_init_card2()
3418 if (UNSET == btv->tuner_type) in bttv_init_card2()
3419 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type; in bttv_init_card2()
3420 if (UNSET != tuner[btv->c.nr]) in bttv_init_card2()
3421 btv->tuner_type = tuner[btv->c.nr]; in bttv_init_card2()
3423 if (btv->tuner_type == TUNER_ABSENT) in bttv_init_card2()
3424 pr_info("%d: tuner absent\n", btv->c.nr); in bttv_init_card2()
3425 else if (btv->tuner_type == UNSET) in bttv_init_card2()
3426 pr_warn("%d: tuner type unset\n", btv->c.nr); in bttv_init_card2()
3428 pr_info("%d: tuner type=%d\n", btv->c.nr, btv->tuner_type); in bttv_init_card2()
3431 pr_warn("%d: the autoload option is obsolete\n", btv->c.nr); in bttv_init_card2()
3433 btv->c.nr); in bttv_init_card2()
3436 if (UNSET == btv->tuner_type) in bttv_init_card2()
3437 btv->tuner_type = TUNER_ABSENT; in bttv_init_card2()
3439 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ? in bttv_init_card2()
3440 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET; in bttv_init_card2()
3441 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ? in bttv_init_card2()
3442 UNSET : bttv_tvcards[btv->c.type].svhs; in bttv_init_card2()
3443 if (svhs[btv->c.nr] != UNSET) in bttv_init_card2()
3444 btv->svhs = svhs[btv->c.nr]; in bttv_init_card2()
3445 if (remote[btv->c.nr] != UNSET) in bttv_init_card2()
3446 btv->has_remote = remote[btv->c.nr]; in bttv_init_card2()
3448 if (bttv_tvcards[btv->c.type].has_radio) in bttv_init_card2()
3449 btv->has_radio = 1; in bttv_init_card2()
3450 if (bttv_tvcards[btv->c.type].has_remote) in bttv_init_card2()
3451 btv->has_remote = 1; in bttv_init_card2()
3452 if (!bttv_tvcards[btv->c.type].no_gpioirq) in bttv_init_card2()
3453 btv->gpioirq = 1; in bttv_init_card2()
3454 if (bttv_tvcards[btv->c.type].volume_gpio) in bttv_init_card2()
3455 btv->volume_gpio = bttv_tvcards[btv->c.type].volume_gpio; in bttv_init_card2()
3456 if (bttv_tvcards[btv->c.type].audio_mode_gpio) in bttv_init_card2()
3457 btv->audio_mode_gpio = bttv_tvcards[btv->c.type].audio_mode_gpio; in bttv_init_card2()
3459 if (btv->tuner_type == TUNER_ABSENT) in bttv_init_card2()
3462 if (btv->has_saa6588 || saa6588[btv->c.nr]) { in bttv_init_card2()
3471 sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3472 &btv->c.i2c_adap, "saa6588", 0, addrs); in bttv_init_card2()
3473 btv->has_saa6588 = (sd != NULL); in bttv_init_card2()
3481 switch (audiodev[btv->c.nr]) { in bttv_init_card2()
3496 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3497 &btv->c.i2c_adap, "msp3400", 0, addrs); in bttv_init_card2()
3498 if (btv->sd_msp34xx) in bttv_init_card2()
3510 if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3511 &btv->c.i2c_adap, "tda7432", 0, addrs)) in bttv_init_card2()
3518 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3519 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs()); in bttv_init_card2()
3520 if (btv->sd_tvaudio) in bttv_init_card2()
3526 pr_warn("%d: unknown audiodev value!\n", btv->c.nr); in bttv_init_card2()
3536 if (!bttv_tvcards[btv->c.type].no_msp34xx) { in bttv_init_card2()
3537 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3538 &btv->c.i2c_adap, "msp3400", in bttv_init_card2()
3540 } else if (bttv_tvcards[btv->c.type].msp34xx_alt) { in bttv_init_card2()
3541 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3542 &btv->c.i2c_adap, "msp3400", in bttv_init_card2()
3547 if (btv->sd_msp34xx) in bttv_init_card2()
3551 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3552 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs()); in bttv_init_card2()
3553 if (btv->sd_tvaudio) { in bttv_init_card2()
3556 v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3557 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs()); in bttv_init_card2()
3561 if (!bttv_tvcards[btv->c.type].no_tda7432) { in bttv_init_card2()
3567 btv->sd_tda7432 = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3568 &btv->c.i2c_adap, "tda7432", 0, addrs); in bttv_init_card2()
3569 if (btv->sd_tda7432) in bttv_init_card2()
3572 if (btv->sd_tvaudio) in bttv_init_card2()
3576 pr_warn("%d: audio absent, no audio device found!\n", btv->c.nr); in bttv_init_card2()
3581 void bttv_init_tuner(struct bttv *btv) in bttv_init_tuner() argument
3585 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr) in bttv_init_tuner()
3586 addr = bttv_tvcards[btv->c.type].tuner_addr; in bttv_init_tuner()
3588 if (btv->tuner_type != TUNER_ABSENT) { in bttv_init_tuner()
3592 if (btv->has_radio) in bttv_init_tuner()
3593 v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_tuner()
3594 &btv->c.i2c_adap, "tuner", in bttv_init_tuner()
3596 v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_tuner()
3597 &btv->c.i2c_adap, "tuner", in bttv_init_tuner()
3599 v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_tuner()
3600 &btv->c.i2c_adap, "tuner", in bttv_init_tuner()
3604 tun_setup.type = btv->tuner_type; in bttv_init_tuner()
3607 if (btv->has_radio) in bttv_init_tuner()
3610 bttv_call_all(btv, tuner, s_type_addr, &tun_setup); in bttv_init_tuner()
3613 if (btv->tda9887_conf) { in bttv_init_tuner()
3617 tda9887_cfg.priv = &btv->tda9887_conf; in bttv_init_tuner()
3619 bttv_call_all(btv, tuner, s_config, &tda9887_cfg); in bttv_init_tuner()
3625 static void modtec_eeprom(struct bttv *btv) in modtec_eeprom() argument
3628 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I; in modtec_eeprom()
3630 btv->c.nr, &eeprom_data[0x1e]); in modtec_eeprom()
3632 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I; in modtec_eeprom()
3634 btv->c.nr, &eeprom_data[0x1e]); in modtec_eeprom()
3636 btv->tuner_type=TUNER_PHILIPS_NTSC; in modtec_eeprom()
3638 btv->c.nr, &eeprom_data[0x1e]); in modtec_eeprom()
3641 btv->c.nr, &eeprom_data[0x1e]); in modtec_eeprom()
3645 static void hauppauge_eeprom(struct bttv *btv) in hauppauge_eeprom() argument
3649 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data); in hauppauge_eeprom()
3650 btv->tuner_type = tv.tuner_type; in hauppauge_eeprom()
3651 btv->has_radio = tv.has_radio; in hauppauge_eeprom()
3654 btv->c.nr, tv.model); in hauppauge_eeprom()
3662 btv->c.nr, in hauppauge_eeprom()
3663 bttv_tvcards[btv->c.type].name, in hauppauge_eeprom()
3665 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB; in hauppauge_eeprom()
3670 btv->radio_uses_msp_demodulator = 1; in hauppauge_eeprom()
3673 static int terratec_active_radio_upgrade(struct bttv *btv) in terratec_active_radio_upgrade() argument
3677 btv->has_radio = 1; in terratec_active_radio_upgrade()
3678 btv->has_matchbox = 1; in terratec_active_radio_upgrade()
3679 btv->mbox_we = 0x10; in terratec_active_radio_upgrade()
3680 btv->mbox_most = 0x20; in terratec_active_radio_upgrade()
3681 btv->mbox_clk = 0x08; in terratec_active_radio_upgrade()
3682 btv->mbox_data = 0x04; in terratec_active_radio_upgrade()
3683 btv->mbox_mask = 0x3c; in terratec_active_radio_upgrade()
3685 btv->mbox_iow = 1 << 8; in terratec_active_radio_upgrade()
3686 btv->mbox_ior = 1 << 9; in terratec_active_radio_upgrade()
3687 btv->mbox_csel = 1 << 10; in terratec_active_radio_upgrade()
3690 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */ in terratec_active_radio_upgrade()
3691 if (0x1ed8 == tea5757_read(btv)) { in terratec_active_radio_upgrade()
3692 pr_info("%d: Terratec Active Radio Upgrade found\n", btv->c.nr); in terratec_active_radio_upgrade()
3693 btv->has_radio = 1; in terratec_active_radio_upgrade()
3694 btv->has_saa6588 = 1; in terratec_active_radio_upgrade()
3695 btv->has_matchbox = 1; in terratec_active_radio_upgrade()
3697 btv->has_radio = 0; in terratec_active_radio_upgrade()
3698 btv->has_matchbox = 0; in terratec_active_radio_upgrade()
3719 static int pvr_altera_load(struct bttv *btv, const u8 *micro, u32 microlen) in pvr_altera_load() argument
3756 static int pvr_boot(struct bttv *btv) in pvr_boot() argument
3761 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev); in pvr_boot()
3763 pr_warn("%d: no altera firmware [via hotplug]\n", btv->c.nr); in pvr_boot()
3766 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size); in pvr_boot()
3768 btv->c.nr, (rc < 0) ? "failed" : "ok"); in pvr_boot()
3776 static void osprey_eeprom(struct bttv *btv, const u8 ee[256]) in osprey_eeprom() argument
3783 if (btv->c.type == BTTV_BOARD_UNKNOWN) { in osprey_eeprom()
3865 btv->c.nr, type); in osprey_eeprom()
3872 btv->c.nr, cardid, in osprey_eeprom()
3875 if (cardid<0 || btv->c.type == cardid) in osprey_eeprom()
3879 if (card[btv->c.nr] < bttv_num_tvcards) { in osprey_eeprom()
3881 btv->c.nr); in osprey_eeprom()
3884 btv->c.nr, btv->c.type, cardid); in osprey_eeprom()
3885 btv->c.type = cardid; in osprey_eeprom()
3907 static void avermedia_eeprom(struct bttv *btv) in avermedia_eeprom() argument
3914 btv->has_remote = (eeprom_data[0x42] & 0x01); in avermedia_eeprom()
3928 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]); in avermedia_eeprom()
3930 btv->tuner_type = tuner_type; in avermedia_eeprom()
3936 btv->has_remote ? "yes" : "no"); in avermedia_eeprom()
3947 u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits) in bttv_tda9880_setnorm() argument
3950 if (btv->audio_input == TVAUDIO_INPUT_TUNER) { in bttv_tda9880_setnorm()
3951 if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN) in bttv_tda9880_setnorm()
3957 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits); in bttv_tda9880_setnorm()
3969 static void boot_msp34xx(struct bttv *btv, int pin) in boot_msp34xx() argument
3980 bttv_gpio_tracking(btv,"msp34xx"); in boot_msp34xx()
3983 btv->c.nr, pin); in boot_msp34xx()
3992 static void init_PXC200(struct bttv *btv) in init_PXC200() argument
4009 bttv_gpio_tracking(btv,"pxc200"); in init_PXC200()
4023 bttv_I2CWrite(btv,0x5E,0,0x80,1); in init_PXC200()
4048 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1); in init_PXC200()
4051 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL)); in init_PXC200()
4089 init_RTV24 (struct bttv *btv) in init_RTV24() argument
4095 btv->c.nr); in init_RTV24()
4109 btv->c.nr, dataRead); in init_RTV24()
4122 btv->c.nr, dataRead); in init_RTV24()
4127 pr_info("%d: Adlink RTV-24 initialisation complete\n", btv->c.nr); in init_RTV24()
4141 static void bus_low(struct bttv *btv, int bit) in bus_low() argument
4143 if (btv->mbox_ior) { in bus_low()
4144 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel, in bus_low()
4145 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel); in bus_low()
4152 if (btv->mbox_ior) { in bus_low()
4153 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0); in bus_low()
4158 static void bus_high(struct bttv *btv, int bit) in bus_high() argument
4160 if (btv->mbox_ior) { in bus_high()
4161 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel, in bus_high()
4162 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel); in bus_high()
4169 if (btv->mbox_ior) { in bus_high()
4170 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0); in bus_high()
4175 static int bus_in(struct bttv *btv, int bit) in bus_in() argument
4177 if (btv->mbox_ior) { in bus_in()
4178 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel, in bus_in()
4179 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel); in bus_in()
4182 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0); in bus_in()
4216 static int tea5757_read(struct bttv *btv) in tea5757_read() argument
4223 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we); in tea5757_read()
4225 if (btv->mbox_ior) { in tea5757_read()
4226 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel, in tea5757_read()
4227 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel); in tea5757_read()
4232 bttv_gpio_tracking(btv,"tea5757 read"); in tea5757_read()
4234 bus_low(btv,btv->mbox_we); in tea5757_read()
4235 bus_low(btv,btv->mbox_clk); in tea5757_read()
4241 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout)) in tea5757_read()
4243 if (bus_in(btv,btv->mbox_data)) { in tea5757_read()
4244 pr_warn("%d: tea5757: read timeout\n", btv->c.nr); in tea5757_read()
4248 dprintk("%d: tea5757:", btv->c.nr); in tea5757_read()
4251 bus_high(btv,btv->mbox_clk); in tea5757_read()
4254 bus_in(btv, btv->mbox_most) == 0 ? 'T' : '-'); in tea5757_read()
4255 bus_low(btv,btv->mbox_clk); in tea5757_read()
4257 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */ in tea5757_read()
4259 bus_in(btv, btv->mbox_most) == 0 ? 'S' : 'M'); in tea5757_read()
4262 dprintk("%d: tea5757: read 0x%X\n", btv->c.nr, value); in tea5757_read()
4266 static int tea5757_write(struct bttv *btv, int value) in tea5757_write() argument
4271 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data); in tea5757_write()
4273 if (btv->mbox_ior) { in tea5757_write()
4274 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel, in tea5757_write()
4275 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel); in tea5757_write()
4279 bttv_gpio_tracking(btv,"tea5757 write"); in tea5757_write()
4281 dprintk("%d: tea5757: write 0x%X\n", btv->c.nr, value); in tea5757_write()
4282 bus_low(btv,btv->mbox_clk); in tea5757_write()
4283 bus_high(btv,btv->mbox_we); in tea5757_write()
4286 bus_high(btv,btv->mbox_data); in tea5757_write()
4288 bus_low(btv,btv->mbox_data); in tea5757_write()
4290 bus_high(btv,btv->mbox_clk); in tea5757_write()
4292 bus_low(btv,btv->mbox_clk); in tea5757_write()
4295 bus_low(btv,btv->mbox_we); /* unmute !!! */ in tea5757_write()
4299 void tea5757_set_freq(struct bttv *btv, unsigned short freq) in tea5757_set_freq() argument
4302 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */ in tea5757_set_freq()
4329 static void rv605_muxsel(struct bttv *btv, unsigned int input) in rv605_muxsel() argument
4377 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input) in tibetCS16_muxsel() argument
4383 static void tibetCS16_init(struct bttv *btv) in tibetCS16_init() argument
4419 static void kodicom4400r_write(struct bttv *btv, in kodicom4400r_write() argument
4439 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input) in kodicom4400r_muxsel() argument
4446 mctlr = master[btv->c.nr]; in kodicom4400r_muxsel()
4450 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */ in kodicom4400r_muxsel()
4470 static void kodicom4400r_init(struct bttv *btv) in kodicom4400r_init() argument
4472 char *sw_status = (char *)(&btv->mbox_we); in kodicom4400r_init()
4481 kodicom4400r_write(btv, ix, ix, 1); in kodicom4400r_init()
4488 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3)) in kodicom4400r_init()
4490 master[btv->c.nr-1] = btv; in kodicom4400r_init()
4491 master[btv->c.nr] = btv; in kodicom4400r_init()
4492 master[btv->c.nr+1] = btv; in kodicom4400r_init()
4493 master[btv->c.nr+2] = btv; in kodicom4400r_init()
4514 static void xguard_muxsel(struct bttv *btv, unsigned int input) in xguard_muxsel() argument
4524 static void picolo_tetra_init(struct bttv *btv) in picolo_tetra_init() argument
4530 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input) in picolo_tetra_muxsel() argument
4533 dprintk("%d : picolo_tetra_muxsel => input = %d\n", btv->c.nr, input); in picolo_tetra_muxsel()
4572 static void ivc120_muxsel(struct bttv *btv, unsigned int input) in ivc120_muxsel() argument
4579 btv->c.nr, input, matrix, key); in ivc120_muxsel()
4582 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00, in ivc120_muxsel()
4584 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00, in ivc120_muxsel()
4586 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00, in ivc120_muxsel()
4588 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00, in ivc120_muxsel()
4592 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02, in ivc120_muxsel()
4594 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02, in ivc120_muxsel()
4596 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02, in ivc120_muxsel()
4598 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02, in ivc120_muxsel()
4622 static void PXC200_muxsel(struct bttv *btv, unsigned int input) in PXC200_muxsel() argument
4633 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1); in PXC200_muxsel()
4636 btv->c.nr, rc); in PXC200_muxsel()
4641 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL); in PXC200_muxsel()
4644 btv->c.nr, rc); in PXC200_muxsel()
4659 if (btv->cardid == PX_PXC200A_CARDID) { in PXC200_muxsel()
4666 if (btv->cardid == PX_PXC200A_CARDID) in PXC200_muxsel()
4679 if (btv->cardid == PX_PXC200A_CARDID) in PXC200_muxsel()
4684 pr_debug("%d: setting input channel to:%d\n", btv->c.nr, (int)mux); in PXC200_muxsel()
4687 static void phytec_muxsel(struct bttv *btv, unsigned int input) in phytec_muxsel() argument
4691 if (input == btv->svhs) in phytec_muxsel()
4712 static void gv800s_write(struct bttv *btv, in gv800s_write() argument
4754 static void gv800s_muxsel(struct bttv *btv, unsigned int input) in gv800s_muxsel() argument
4764 mctlr = master[btv->c.nr]; in gv800s_muxsel()
4769 yaddr = (btv->c.nr - mctlr->c.nr) & 3; in gv800s_muxsel()
4783 static void gv800s_init(struct bttv *btv) in gv800s_init() argument
4785 char *sw_status = (char *)(&btv->mbox_we); in gv800s_init()
4795 gv800s_write(btv, ix, ix, 1); in gv800s_init()
4799 bttv_I2CWrite(btv, 0x18, 0x5, 0x90, 1); in gv800s_init()
4801 if (btv->c.nr > BTTV_MAX-4) in gv800s_init()
4807 master[btv->c.nr] = btv; in gv800s_init()
4808 master[btv->c.nr+1] = btv; in gv800s_init()
4809 master[btv->c.nr+2] = btv; in gv800s_init()
4810 master[btv->c.nr+3] = btv; in gv800s_init()
4859 int bttv_handle_chipset(struct bttv *btv) in bttv_handle_chipset() argument
4869 btv->c.nr); in bttv_handle_chipset()
4870 if (vsfx && btv->id >= 878) in bttv_handle_chipset()
4871 pr_info("%d: enabling VSFX\n", btv->c.nr); in bttv_handle_chipset()
4874 btv->c.nr, latency); in bttv_handle_chipset()
4877 if (btv->id < 878) { in bttv_handle_chipset()
4880 btv->triton1 = BT848_INT_ETBF; in bttv_handle_chipset()
4883 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command); in bttv_handle_chipset()
4888 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command); in bttv_handle_chipset()
4891 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency); in bttv_handle_chipset()