Lines Matching refs:btv

36 static void boot_msp34xx(struct bttv *btv, int pin);
37 static void hauppauge_eeprom(struct bttv *btv);
38 static void avermedia_eeprom(struct bttv *btv);
39 static void osprey_eeprom(struct bttv *btv, const u8 ee[256]);
40 static void modtec_eeprom(struct bttv *btv);
41 static void init_PXC200(struct bttv *btv);
42 static void init_RTV24(struct bttv *btv);
43 static void init_PCI8604PW(struct bttv *btv);
45 static void rv605_muxsel(struct bttv *btv, unsigned int input);
46 static void eagle_muxsel(struct bttv *btv, unsigned int input);
47 static void xguard_muxsel(struct bttv *btv, unsigned int input);
48 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
49 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
51 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
53 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
54 static void picolo_tetra_init(struct bttv *btv);
56 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
57 static void tibetCS16_init(struct bttv *btv);
59 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
60 static void kodicom4400r_init(struct bttv *btv);
62 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
63 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
65 static void geovision_muxsel(struct bttv *btv, unsigned int input);
67 static void phytec_muxsel(struct bttv *btv, unsigned int input);
69 static void gv800s_muxsel(struct bttv *btv, unsigned int input);
70 static void gv800s_init(struct bttv *btv);
72 static void td3116_muxsel(struct bttv *btv, unsigned int input);
74 static int terratec_active_radio_upgrade(struct bttv *btv);
75 static int tea575x_init(struct bttv *btv);
76 static void identify_by_eeprom(struct bttv *btv,
78 static int pvr_boot(struct bttv *btv);
2893 void bttv_idcard(struct bttv *btv) in bttv_idcard() argument
2899 btv->cardid = btv->c.pci->subsystem_device << 16; in bttv_idcard()
2900 btv->cardid |= btv->c.pci->subsystem_vendor; in bttv_idcard()
2902 if (0 != btv->cardid && 0xffffffff != btv->cardid) { in bttv_idcard()
2905 if (cards[i].id == btv->cardid) in bttv_idcard()
2911 btv->c.nr, cards[type].name, cards[type].cardnr, in bttv_idcard()
2912 btv->cardid & 0xffff, in bttv_idcard()
2913 (btv->cardid >> 16) & 0xffff); in bttv_idcard()
2914 btv->c.type = cards[type].cardnr; in bttv_idcard()
2918 btv->c.nr, btv->cardid & 0xffff, in bttv_idcard()
2919 (btv->cardid >> 16) & 0xffff); in bttv_idcard()
2925 if (card[btv->c.nr] < bttv_num_tvcards) in bttv_idcard()
2926 btv->c.type=card[btv->c.nr]; in bttv_idcard()
2930 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type, in bttv_idcard()
2931 card[btv->c.nr] < bttv_num_tvcards in bttv_idcard()
2941 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i]; in bttv_idcard()
2947 bttv_tvcards[btv->c.type].gpiomux[i] = audioall; in bttv_idcard()
2950 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits; in bttv_idcard()
2952 btv->c.nr, bttv_tvcards[btv->c.type].gpiomask); in bttv_idcard()
2955 i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]); in bttv_idcard()
2965 static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]) in identify_by_eeprom() argument
2977 btv->c.type = type; in identify_by_eeprom()
2979 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type); in identify_by_eeprom()
2983 static void flyvideo_gpio(struct bttv *btv) in flyvideo_gpio() argument
3023 pr_info("%d: FlyVideo_gpio: unknown tuner type\n", btv->c.nr); in flyvideo_gpio()
3041 btv->c.nr, has_radio ? "yes" : "no", in flyvideo_gpio()
3044 btv->c.nr, is_lr90 ? "yes" : "no", in flyvideo_gpio()
3049 btv->tuner_type = tuner_type; in flyvideo_gpio()
3050 btv->has_radio = has_radio; in flyvideo_gpio()
3056 btv->audio_mode_gpio = lt9415_audio; in flyvideo_gpio()
3065 static void miro_pinnacle_gpio(struct bttv *btv) in miro_pinnacle_gpio() argument
3073 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx"); in miro_pinnacle_gpio()
3075 btv->tuner_type = miro_tunermap[id]; in miro_pinnacle_gpio()
3077 btv->has_radio = 1; in miro_pinnacle_gpio()
3079 btv->has_tea575x = 1; in miro_pinnacle_gpio()
3080 btv->tea_gpio.wren = 6; in miro_pinnacle_gpio()
3081 btv->tea_gpio.most = 7; in miro_pinnacle_gpio()
3082 btv->tea_gpio.clk = 8; in miro_pinnacle_gpio()
3083 btv->tea_gpio.data = 9; in miro_pinnacle_gpio()
3084 tea575x_init(btv); in miro_pinnacle_gpio()
3087 btv->has_radio = 0; in miro_pinnacle_gpio()
3090 if (btv->c.type == BTTV_BOARD_MIRO) in miro_pinnacle_gpio()
3091 btv->c.type = BTTV_BOARD_MIROPRO; in miro_pinnacle_gpio()
3092 if (btv->c.type == BTTV_BOARD_PINNACLE) in miro_pinnacle_gpio()
3093 btv->c.type = BTTV_BOARD_PINNACLEPRO; in miro_pinnacle_gpio()
3096 btv->c.nr, id+1, btv->tuner_type, in miro_pinnacle_gpio()
3097 !btv->has_radio ? "no" : in miro_pinnacle_gpio()
3098 (btv->has_tea575x ? "tea575x" : "fmtuner"), in miro_pinnacle_gpio()
3103 btv->has_radio = 0; in miro_pinnacle_gpio()
3107 btv->tda9887_conf = TDA9887_INTERCARRIER; in miro_pinnacle_gpio()
3111 btv->has_radio = 1; in miro_pinnacle_gpio()
3112 btv->tda9887_conf = TDA9887_QSS; in miro_pinnacle_gpio()
3116 btv->has_radio = 1; in miro_pinnacle_gpio()
3117 btv->tda9887_conf = TDA9887_QSS; in miro_pinnacle_gpio()
3121 btv->tda9887_conf = TDA9887_QSS; in miro_pinnacle_gpio()
3125 btv->tda9887_conf = TDA9887_INTERCARRIER; in miro_pinnacle_gpio()
3129 btv->tda9887_conf = TDA9887_INTERCARRIER; in miro_pinnacle_gpio()
3133 btv->tda9887_conf = TDA9887_INTERCARRIER; in miro_pinnacle_gpio()
3140 btv->c.type = BTTV_BOARD_PINNACLEPRO; in miro_pinnacle_gpio()
3142 btv->c.nr, id, info, btv->has_radio ? "yes" : "no"); in miro_pinnacle_gpio()
3143 btv->tuner_type = TUNER_MT2032; in miro_pinnacle_gpio()
3150 static void init_ids_eagle(struct bttv *btv) in init_ids_eagle() argument
3168 static void eagle_muxsel(struct bttv *btv, unsigned int input) in eagle_muxsel() argument
3183 static void gvc1100_muxsel(struct bttv *btv, unsigned int input) in gvc1100_muxsel() argument
3202 static void init_lmlbt4x(struct bttv *btv) in init_lmlbt4x() argument
3210 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input) in sigmaSQ_muxsel() argument
3217 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input) in sigmaSLC_muxsel() argument
3224 static void geovision_muxsel(struct bttv *btv, unsigned int input) in geovision_muxsel() argument
3241 static void td3116_latch_value(struct bttv *btv, u32 value) in td3116_latch_value() argument
3249 static void td3116_muxsel(struct bttv *btv, unsigned int input) in td3116_muxsel() argument
3259 td3116_latch_value(btv, value); in td3116_muxsel()
3264 td3116_latch_value(btv, value); in td3116_muxsel()
3269 static void bttv_reset_audio(struct bttv *btv) in bttv_reset_audio() argument
3280 if (btv->id != 878) in bttv_reset_audio()
3284 pr_debug("%d: BT878A ARESET\n", btv->c.nr); in bttv_reset_audio()
3291 void bttv_init_card1(struct bttv *btv) in bttv_init_card1() argument
3293 switch (btv->c.type) { in bttv_init_card1()
3296 boot_msp34xx(btv,5); in bttv_init_card1()
3300 boot_msp34xx(btv,20); in bttv_init_card1()
3303 boot_msp34xx(btv,11); in bttv_init_card1()
3306 pvr_boot(btv); in bttv_init_card1()
3311 btv->use_i2c_hw = 1; in bttv_init_card1()
3314 init_RTV24( btv ); in bttv_init_card1()
3317 init_PCI8604PW(btv); in bttv_init_card1()
3321 if (!bttv_tvcards[btv->c.type].has_dvb) in bttv_init_card1()
3322 bttv_reset_audio(btv); in bttv_init_card1()
3326 void bttv_init_card2(struct bttv *btv) in bttv_init_card2() argument
3328 btv->tuner_type = UNSET; in bttv_init_card2()
3330 if (BTTV_BOARD_UNKNOWN == btv->c.type) { in bttv_init_card2()
3331 bttv_readee(btv,eeprom_data,0xa0); in bttv_init_card2()
3332 identify_by_eeprom(btv,eeprom_data); in bttv_init_card2()
3335 switch (btv->c.type) { in bttv_init_card2()
3341 miro_pinnacle_gpio(btv); in bttv_init_card2()
3354 flyvideo_gpio(btv); in bttv_init_card2()
3360 bttv_readee(btv,eeprom_data,0xa0); in bttv_init_card2()
3361 hauppauge_eeprom(btv); in bttv_init_card2()
3365 bttv_readee(btv,eeprom_data,0xa0); in bttv_init_card2()
3366 avermedia_eeprom(btv); in bttv_init_card2()
3369 init_PXC200(btv); in bttv_init_card2()
3372 picolo_tetra_init(btv); in bttv_init_card2()
3375 btv->has_radio = 1; in bttv_init_card2()
3376 btv->has_tea575x = 1; in bttv_init_card2()
3377 btv->tea_gpio.wren = 5; in bttv_init_card2()
3378 btv->tea_gpio.most = 6; in bttv_init_card2()
3379 btv->tea_gpio.clk = 3; in bttv_init_card2()
3380 btv->tea_gpio.data = 4; in bttv_init_card2()
3381 tea575x_init(btv); in bttv_init_card2()
3385 terratec_active_radio_upgrade(btv); in bttv_init_card2()
3388 if (btv->cardid == 0x3002144f) { in bttv_init_card2()
3389 btv->has_radio=1; in bttv_init_card2()
3391 btv->c.nr); in bttv_init_card2()
3395 if (btv->cardid == 0x3060121a) { in bttv_init_card2()
3398 btv->has_radio=0; in bttv_init_card2()
3399 btv->tuner_type=TUNER_TEMIC_NTSC; in bttv_init_card2()
3414 bttv_readee(btv,eeprom_data,0xa0); in bttv_init_card2()
3415 osprey_eeprom(btv, eeprom_data); in bttv_init_card2()
3418 init_ids_eagle(btv); in bttv_init_card2()
3421 bttv_readee(btv,eeprom_data,0xa0); in bttv_init_card2()
3422 modtec_eeprom(btv); in bttv_init_card2()
3425 init_lmlbt4x(btv); in bttv_init_card2()
3428 tibetCS16_init(btv); in bttv_init_card2()
3431 kodicom4400r_init(btv); in bttv_init_card2()
3434 gv800s_init(btv); in bttv_init_card2()
3439 if (!(btv->id==848 && btv->revision==0x11)) { in bttv_init_card2()
3441 if (PLL_28 == bttv_tvcards[btv->c.type].pll) { in bttv_init_card2()
3442 btv->pll.pll_ifreq=28636363; in bttv_init_card2()
3443 btv->pll.pll_crystal=BT848_IFORM_XT0; in bttv_init_card2()
3445 if (PLL_35 == bttv_tvcards[btv->c.type].pll) { in bttv_init_card2()
3446 btv->pll.pll_ifreq=35468950; in bttv_init_card2()
3447 btv->pll.pll_crystal=BT848_IFORM_XT1; in bttv_init_card2()
3449 if (PLL_14 == bttv_tvcards[btv->c.type].pll) { in bttv_init_card2()
3450 btv->pll.pll_ifreq = 14318181; in bttv_init_card2()
3451 btv->pll.pll_crystal = BT848_IFORM_XT0; in bttv_init_card2()
3454 switch (pll[btv->c.nr]) { in bttv_init_card2()
3456 btv->pll.pll_crystal = 0; in bttv_init_card2()
3457 btv->pll.pll_ifreq = 0; in bttv_init_card2()
3458 btv->pll.pll_ofreq = 0; in bttv_init_card2()
3462 btv->pll.pll_ifreq = 28636363; in bttv_init_card2()
3463 btv->pll.pll_ofreq = 0; in bttv_init_card2()
3464 btv->pll.pll_crystal = BT848_IFORM_XT0; in bttv_init_card2()
3468 btv->pll.pll_ifreq = 35468950; in bttv_init_card2()
3469 btv->pll.pll_ofreq = 0; in bttv_init_card2()
3470 btv->pll.pll_crystal = BT848_IFORM_XT1; in bttv_init_card2()
3474 btv->pll.pll_ifreq = 14318181; in bttv_init_card2()
3475 btv->pll.pll_ofreq = 0; in bttv_init_card2()
3476 btv->pll.pll_crystal = BT848_IFORM_XT0; in bttv_init_card2()
3480 btv->pll.pll_current = -1; in bttv_init_card2()
3483 if (UNSET != bttv_tvcards[btv->c.type].tuner_type) in bttv_init_card2()
3484 if (UNSET == btv->tuner_type) in bttv_init_card2()
3485 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type; in bttv_init_card2()
3486 if (UNSET != tuner[btv->c.nr]) in bttv_init_card2()
3487 btv->tuner_type = tuner[btv->c.nr]; in bttv_init_card2()
3489 if (btv->tuner_type == TUNER_ABSENT) in bttv_init_card2()
3490 pr_info("%d: tuner absent\n", btv->c.nr); in bttv_init_card2()
3491 else if (btv->tuner_type == UNSET) in bttv_init_card2()
3492 pr_warn("%d: tuner type unset\n", btv->c.nr); in bttv_init_card2()
3494 pr_info("%d: tuner type=%d\n", btv->c.nr, btv->tuner_type); in bttv_init_card2()
3497 pr_warn("%d: the autoload option is obsolete\n", btv->c.nr); in bttv_init_card2()
3499 btv->c.nr); in bttv_init_card2()
3502 if (UNSET == btv->tuner_type) in bttv_init_card2()
3503 btv->tuner_type = TUNER_ABSENT; in bttv_init_card2()
3505 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ? in bttv_init_card2()
3506 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET; in bttv_init_card2()
3507 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ? in bttv_init_card2()
3508 UNSET : bttv_tvcards[btv->c.type].svhs; in bttv_init_card2()
3509 if (svhs[btv->c.nr] != UNSET) in bttv_init_card2()
3510 btv->svhs = svhs[btv->c.nr]; in bttv_init_card2()
3511 if (remote[btv->c.nr] != UNSET) in bttv_init_card2()
3512 btv->has_remote = remote[btv->c.nr]; in bttv_init_card2()
3514 if (bttv_tvcards[btv->c.type].has_radio) in bttv_init_card2()
3515 btv->has_radio = 1; in bttv_init_card2()
3516 if (bttv_tvcards[btv->c.type].has_remote) in bttv_init_card2()
3517 btv->has_remote = 1; in bttv_init_card2()
3518 if (!bttv_tvcards[btv->c.type].no_gpioirq) in bttv_init_card2()
3519 btv->gpioirq = 1; in bttv_init_card2()
3520 if (bttv_tvcards[btv->c.type].volume_gpio) in bttv_init_card2()
3521 btv->volume_gpio = bttv_tvcards[btv->c.type].volume_gpio; in bttv_init_card2()
3522 if (bttv_tvcards[btv->c.type].audio_mode_gpio) in bttv_init_card2()
3523 btv->audio_mode_gpio = bttv_tvcards[btv->c.type].audio_mode_gpio; in bttv_init_card2()
3525 if (btv->tuner_type == TUNER_ABSENT) in bttv_init_card2()
3528 if (btv->has_saa6588 || saa6588[btv->c.nr]) { in bttv_init_card2()
3537 sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3538 &btv->c.i2c_adap, "saa6588", 0, addrs); in bttv_init_card2()
3539 btv->has_saa6588 = (sd != NULL); in bttv_init_card2()
3547 switch (audiodev[btv->c.nr]) { in bttv_init_card2()
3562 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3563 &btv->c.i2c_adap, "msp3400", 0, addrs); in bttv_init_card2()
3564 if (btv->sd_msp34xx) in bttv_init_card2()
3576 if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3577 &btv->c.i2c_adap, "tda7432", 0, addrs)) in bttv_init_card2()
3584 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3585 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs()); in bttv_init_card2()
3586 if (btv->sd_tvaudio) in bttv_init_card2()
3592 pr_warn("%d: unknown audiodev value!\n", btv->c.nr); in bttv_init_card2()
3602 if (!bttv_tvcards[btv->c.type].no_msp34xx) { in bttv_init_card2()
3603 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3604 &btv->c.i2c_adap, "msp3400", in bttv_init_card2()
3606 } else if (bttv_tvcards[btv->c.type].msp34xx_alt) { in bttv_init_card2()
3607 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3608 &btv->c.i2c_adap, "msp3400", in bttv_init_card2()
3613 if (btv->sd_msp34xx) in bttv_init_card2()
3617 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3618 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs()); in bttv_init_card2()
3619 if (btv->sd_tvaudio) { in bttv_init_card2()
3622 v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3623 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs()); in bttv_init_card2()
3627 if (!bttv_tvcards[btv->c.type].no_tda7432) { in bttv_init_card2()
3633 btv->sd_tda7432 = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_card2()
3634 &btv->c.i2c_adap, "tda7432", 0, addrs); in bttv_init_card2()
3635 if (btv->sd_tda7432) in bttv_init_card2()
3638 if (btv->sd_tvaudio) in bttv_init_card2()
3642 pr_warn("%d: audio absent, no audio device found!\n", btv->c.nr); in bttv_init_card2()
3647 void bttv_init_tuner(struct bttv *btv) in bttv_init_tuner() argument
3651 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr) in bttv_init_tuner()
3652 addr = bttv_tvcards[btv->c.type].tuner_addr; in bttv_init_tuner()
3654 if (btv->tuner_type != TUNER_ABSENT) { in bttv_init_tuner()
3658 if (btv->has_radio) in bttv_init_tuner()
3659 v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_tuner()
3660 &btv->c.i2c_adap, "tuner", in bttv_init_tuner()
3662 v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_tuner()
3663 &btv->c.i2c_adap, "tuner", in bttv_init_tuner()
3665 v4l2_i2c_new_subdev(&btv->c.v4l2_dev, in bttv_init_tuner()
3666 &btv->c.i2c_adap, "tuner", in bttv_init_tuner()
3670 tun_setup.type = btv->tuner_type; in bttv_init_tuner()
3673 if (btv->has_radio) in bttv_init_tuner()
3676 bttv_call_all(btv, tuner, s_type_addr, &tun_setup); in bttv_init_tuner()
3679 if (btv->tda9887_conf) { in bttv_init_tuner()
3683 tda9887_cfg.priv = &btv->tda9887_conf; in bttv_init_tuner()
3685 bttv_call_all(btv, tuner, s_config, &tda9887_cfg); in bttv_init_tuner()
3691 static void modtec_eeprom(struct bttv *btv) in modtec_eeprom() argument
3694 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I; in modtec_eeprom()
3696 btv->c.nr, &eeprom_data[0x1e]); in modtec_eeprom()
3698 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I; in modtec_eeprom()
3700 btv->c.nr, &eeprom_data[0x1e]); in modtec_eeprom()
3702 btv->tuner_type=TUNER_PHILIPS_NTSC; in modtec_eeprom()
3704 btv->c.nr, &eeprom_data[0x1e]); in modtec_eeprom()
3707 btv->c.nr, &eeprom_data[0x1e]); in modtec_eeprom()
3711 static void hauppauge_eeprom(struct bttv *btv) in hauppauge_eeprom() argument
3716 btv->tuner_type = tv.tuner_type; in hauppauge_eeprom()
3717 btv->has_radio = tv.has_radio; in hauppauge_eeprom()
3720 btv->c.nr, tv.model); in hauppauge_eeprom()
3728 btv->c.nr, in hauppauge_eeprom()
3729 bttv_tvcards[btv->c.type].name, in hauppauge_eeprom()
3731 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB; in hauppauge_eeprom()
3736 btv->radio_uses_msp_demodulator = 1; in hauppauge_eeprom()
3743 struct bttv *btv = tea->private_data; in bttv_tea575x_set_pins() local
3744 struct bttv_tea575x_gpio gpio = btv->tea_gpio; in bttv_tea575x_set_pins()
3752 if (btv->mbox_ior) { in bttv_tea575x_set_pins()
3754 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0); in bttv_tea575x_set_pins()
3757 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel, in bttv_tea575x_set_pins()
3758 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel); in bttv_tea575x_set_pins()
3764 struct bttv *btv = tea->private_data; in bttv_tea575x_get_pins() local
3765 struct bttv_tea575x_gpio gpio = btv->tea_gpio; in bttv_tea575x_get_pins()
3769 if (btv->mbox_ior) { in bttv_tea575x_get_pins()
3771 gpio_bits(btv->mbox_ior | btv->mbox_csel, 0); in bttv_tea575x_get_pins()
3775 if (btv->mbox_ior) { in bttv_tea575x_get_pins()
3777 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel, in bttv_tea575x_get_pins()
3778 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel); in bttv_tea575x_get_pins()
3791 struct bttv *btv = tea->private_data; in bttv_tea575x_set_direction() local
3792 struct bttv_tea575x_gpio gpio = btv->tea_gpio; in bttv_tea575x_set_direction()
3809 static int tea575x_init(struct bttv *btv) in tea575x_init() argument
3811 btv->tea.private_data = btv; in tea575x_init()
3812 btv->tea.ops = &bttv_tea_ops; in tea575x_init()
3813 if (!snd_tea575x_hw_init(&btv->tea)) { in tea575x_init()
3814 pr_info("%d: detected TEA575x radio\n", btv->c.nr); in tea575x_init()
3815 btv->tea.mute = false; in tea575x_init()
3819 btv->has_tea575x = 0; in tea575x_init()
3820 btv->has_radio = 0; in tea575x_init()
3827 static int terratec_active_radio_upgrade(struct bttv *btv) in terratec_active_radio_upgrade() argument
3829 btv->has_radio = 1; in terratec_active_radio_upgrade()
3830 btv->has_tea575x = 1; in terratec_active_radio_upgrade()
3831 btv->tea_gpio.wren = 4; in terratec_active_radio_upgrade()
3832 btv->tea_gpio.most = 5; in terratec_active_radio_upgrade()
3833 btv->tea_gpio.clk = 3; in terratec_active_radio_upgrade()
3834 btv->tea_gpio.data = 2; in terratec_active_radio_upgrade()
3836 btv->mbox_iow = 1 << 8; in terratec_active_radio_upgrade()
3837 btv->mbox_ior = 1 << 9; in terratec_active_radio_upgrade()
3838 btv->mbox_csel = 1 << 10; in terratec_active_radio_upgrade()
3840 if (!tea575x_init(btv)) { in terratec_active_radio_upgrade()
3841 pr_info("%d: Terratec Active Radio Upgrade found\n", btv->c.nr); in terratec_active_radio_upgrade()
3842 btv->has_saa6588 = 1; in terratec_active_radio_upgrade()
3864 static int pvr_altera_load(struct bttv *btv, const u8 *micro, u32 microlen) in pvr_altera_load() argument
3901 static int pvr_boot(struct bttv *btv) in pvr_boot() argument
3906 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev); in pvr_boot()
3908 pr_warn("%d: no altera firmware [via hotplug]\n", btv->c.nr); in pvr_boot()
3911 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size); in pvr_boot()
3913 btv->c.nr, (rc < 0) ? "failed" : "ok"); in pvr_boot()
3921 static void osprey_eeprom(struct bttv *btv, const u8 ee[256]) in osprey_eeprom() argument
3928 if (btv->c.type == BTTV_BOARD_UNKNOWN) { in osprey_eeprom()
4012 btv->c.nr, type); in osprey_eeprom()
4019 btv->c.nr, cardid, in osprey_eeprom()
4022 if (cardid<0 || btv->c.type == cardid) in osprey_eeprom()
4026 if (card[btv->c.nr] < bttv_num_tvcards) { in osprey_eeprom()
4028 btv->c.nr); in osprey_eeprom()
4031 btv->c.nr, btv->c.type, cardid); in osprey_eeprom()
4032 btv->c.type = cardid; in osprey_eeprom()
4054 static void avermedia_eeprom(struct bttv *btv) in avermedia_eeprom() argument
4061 btv->has_remote = (eeprom_data[0x42] & 0x01); in avermedia_eeprom()
4075 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]); in avermedia_eeprom()
4077 btv->tuner_type = tuner_type; in avermedia_eeprom()
4083 btv->has_remote ? "yes" : "no"); in avermedia_eeprom()
4094 u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits) in bttv_tda9880_setnorm() argument
4097 if (btv->audio_input == TVAUDIO_INPUT_TUNER) { in bttv_tda9880_setnorm()
4098 if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN) in bttv_tda9880_setnorm()
4104 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits); in bttv_tda9880_setnorm()
4116 static void boot_msp34xx(struct bttv *btv, int pin) in boot_msp34xx() argument
4127 bttv_gpio_tracking(btv,"msp34xx"); in boot_msp34xx()
4130 btv->c.nr, pin); in boot_msp34xx()
4139 static void init_PXC200(struct bttv *btv) in init_PXC200() argument
4156 bttv_gpio_tracking(btv,"pxc200"); in init_PXC200()
4170 bttv_I2CWrite(btv,0x5E,0,0x80,1); in init_PXC200()
4195 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1); in init_PXC200()
4198 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL)); in init_PXC200()
4236 init_RTV24 (struct bttv *btv) in init_RTV24() argument
4242 btv->c.nr); in init_RTV24()
4256 btv->c.nr, dataRead); in init_RTV24()
4269 btv->c.nr, dataRead); in init_RTV24()
4274 pr_info("%d: Adlink RTV-24 initialisation complete\n", btv->c.nr); in init_RTV24()
4301 init_PCI8604PW(struct bttv *btv) in init_PCI8604PW() argument
4305 if ((PCI_SLOT(btv->c.pci->devfn) & ~3) != 0xC) { in init_PCI8604PW()
4310 if (PCI_SLOT(btv->c.pci->devfn) != 0xD) in init_PCI8604PW()
4391 static void rv605_muxsel(struct bttv *btv, unsigned int input) in rv605_muxsel() argument
4439 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input) in tibetCS16_muxsel() argument
4445 static void tibetCS16_init(struct bttv *btv) in tibetCS16_init() argument
4479 static void kodicom4400r_write(struct bttv *btv, in kodicom4400r_write() argument
4499 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input) in kodicom4400r_muxsel() argument
4505 mctlr = master[btv->c.nr]; in kodicom4400r_muxsel()
4509 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */ in kodicom4400r_muxsel()
4528 static void kodicom4400r_init(struct bttv *btv) in kodicom4400r_init() argument
4537 btv->sw_status[ix] = ix; in kodicom4400r_init()
4538 kodicom4400r_write(btv, ix, ix, 1); in kodicom4400r_init()
4545 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3)) in kodicom4400r_init()
4547 master[btv->c.nr-1] = btv; in kodicom4400r_init()
4548 master[btv->c.nr] = btv; in kodicom4400r_init()
4549 master[btv->c.nr+1] = btv; in kodicom4400r_init()
4550 master[btv->c.nr+2] = btv; in kodicom4400r_init()
4571 static void xguard_muxsel(struct bttv *btv, unsigned int input) in xguard_muxsel() argument
4581 static void picolo_tetra_init(struct bttv *btv) in picolo_tetra_init() argument
4587 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input) in picolo_tetra_muxsel() argument
4590 dprintk("%d : picolo_tetra_muxsel => input = %d\n", btv->c.nr, input); in picolo_tetra_muxsel()
4629 static void ivc120_muxsel(struct bttv *btv, unsigned int input) in ivc120_muxsel() argument
4636 btv->c.nr, input, matrix, key); in ivc120_muxsel()
4639 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00, in ivc120_muxsel()
4641 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00, in ivc120_muxsel()
4643 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00, in ivc120_muxsel()
4645 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00, in ivc120_muxsel()
4649 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02, in ivc120_muxsel()
4651 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02, in ivc120_muxsel()
4653 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02, in ivc120_muxsel()
4655 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02, in ivc120_muxsel()
4679 static void PXC200_muxsel(struct bttv *btv, unsigned int input) in PXC200_muxsel() argument
4690 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1); in PXC200_muxsel()
4693 btv->c.nr, rc); in PXC200_muxsel()
4698 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL); in PXC200_muxsel()
4701 btv->c.nr, rc); in PXC200_muxsel()
4716 if (btv->cardid == PX_PXC200A_CARDID) { in PXC200_muxsel()
4723 if (btv->cardid == PX_PXC200A_CARDID) in PXC200_muxsel()
4736 if (btv->cardid == PX_PXC200A_CARDID) in PXC200_muxsel()
4741 pr_debug("%d: setting input channel to:%d\n", btv->c.nr, (int)mux); in PXC200_muxsel()
4744 static void phytec_muxsel(struct bttv *btv, unsigned int input) in phytec_muxsel() argument
4748 if (input == btv->svhs) in phytec_muxsel()
4769 static void gv800s_write(struct bttv *btv, in gv800s_write() argument
4811 static void gv800s_muxsel(struct bttv *btv, unsigned int input) in gv800s_muxsel() argument
4820 mctlr = master[btv->c.nr]; in gv800s_muxsel()
4825 yaddr = (btv->c.nr - mctlr->c.nr) & 3; in gv800s_muxsel()
4838 static void gv800s_init(struct bttv *btv) in gv800s_init() argument
4848 btv->sw_status[ix] = ix; in gv800s_init()
4849 gv800s_write(btv, ix, ix, 1); in gv800s_init()
4853 bttv_I2CWrite(btv, 0x18, 0x5, 0x90, 1); in gv800s_init()
4855 if (btv->c.nr > BTTV_MAX-4) in gv800s_init()
4861 master[btv->c.nr] = btv; in gv800s_init()
4862 master[btv->c.nr+1] = btv; in gv800s_init()
4863 master[btv->c.nr+2] = btv; in gv800s_init()
4864 master[btv->c.nr+3] = btv; in gv800s_init()
4913 int bttv_handle_chipset(struct bttv *btv) in bttv_handle_chipset() argument
4923 btv->c.nr); in bttv_handle_chipset()
4924 if (vsfx && btv->id >= 878) in bttv_handle_chipset()
4925 pr_info("%d: enabling VSFX\n", btv->c.nr); in bttv_handle_chipset()
4928 btv->c.nr, latency); in bttv_handle_chipset()
4931 if (btv->id < 878) { in bttv_handle_chipset()
4934 btv->triton1 = BT848_INT_ETBF; in bttv_handle_chipset()
4937 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command); in bttv_handle_chipset()
4942 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command); in bttv_handle_chipset()
4945 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency); in bttv_handle_chipset()