diff options
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r-- | drivers/media/video/bt8xx/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv-cards.c | 1672 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 197 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv-i2c.c | 61 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv-if.c | 18 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv-risc.c | 4 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv-vbi.c | 2 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv.h | 96 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttvp.h | 30 |
9 files changed, 1064 insertions, 1018 deletions
diff --git a/drivers/media/video/bt8xx/Kconfig b/drivers/media/video/bt8xx/Kconfig index ce71e8e7b83..3077c45015f 100644 --- a/drivers/media/video/bt8xx/Kconfig +++ b/drivers/media/video/bt8xx/Kconfig @@ -10,7 +10,7 @@ config VIDEO_BT848 select VIDEO_MSP3400 if VIDEO_HELPER_CHIPS_AUTO select VIDEO_TVAUDIO if VIDEO_HELPER_CHIPS_AUTO select VIDEO_TDA7432 if VIDEO_HELPER_CHIPS_AUTO - select VIDEO_TDA9875 if VIDEO_HELPER_CHIPS_AUTO + select VIDEO_SAA6588 if VIDEO_HELPER_CHIPS_AUTO ---help--- Support for BT848 based frame grabber/overlay boards. This includes the Miro, Hauppauge and STB boards. Please read the material in diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c index d24dcc025e3..b9c3ba51fb8 100644 --- a/drivers/media/video/bt8xx/bttv-cards.c +++ b/drivers/media/video/bt8xx/bttv-cards.c @@ -73,6 +73,11 @@ static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input); static void geovision_muxsel(struct bttv *btv, unsigned int input); +static void phytec_muxsel(struct bttv *btv, unsigned int input); + +static void gv800s_muxsel(struct bttv *btv, unsigned int input); +static void gv800s_init(struct bttv *btv); + static int terratec_active_radio_upgrade(struct bttv *btv); static int tea5757_read(struct bttv *btv); static int tea5757_write(struct bttv *btv, int value); @@ -91,12 +96,10 @@ static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; +static unsigned int audiodev[BTTV_MAX]; +static unsigned int saa6588[BTTV_MAX]; static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL }; -#ifdef MODULE -static unsigned int autoload = 1; -#else -static unsigned int autoload; -#endif +static unsigned int autoload = UNSET; static unsigned int gpiomask = UNSET; static unsigned int audioall = UNSET; static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET }; @@ -115,6 +118,7 @@ module_param_array(pll, int, NULL, 0444); module_param_array(tuner, int, NULL, 0444); module_param_array(svhs, int, NULL, 0444); module_param_array(remote, int, NULL, 0444); +module_param_array(audiodev, int, NULL, 0444); module_param_array(audiomux, int, NULL, 0444); MODULE_PARM_DESC(triton1,"set ETBF pci config bit " @@ -125,7 +129,14 @@ MODULE_PARM_DESC(latency,"pci latency timer"); MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list"); MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)"); MODULE_PARM_DESC(tuner,"specify installed tuner type"); -MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)"); +MODULE_PARM_DESC(autoload, "obsolete option, please do not use anymore"); +MODULE_PARM_DESC(audiodev, "specify audio device:\n" + "\t\t-1 = no audio\n" + "\t\t 0 = autodetect (default)\n" + "\t\t 1 = msp3400\n" + "\t\t 2 = tda7432\n" + "\t\t 3 = tvaudio"); +MODULE_PARM_DESC(saa6588, "if 1, then load the saa6588 RDS module, default (0) is to use the card definition."); MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)" " [some VIA/SIS chipsets are known to have problem with overlay]"); @@ -246,6 +257,10 @@ static struct CARD { { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" }, { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" }, { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" }, + { 0xf0500000, BTTV_BOARD_IVCE8784, "IVCE-8784" }, + { 0xf0500001, BTTV_BOARD_IVCE8784, "IVCE-8784" }, + { 0xf0500002, BTTV_BOARD_IVCE8784, "IVCE-8784" }, + { 0xf0500003, BTTV_BOARD_IVCE8784, "IVCE-8784" }, { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" }, { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" }, @@ -289,6 +304,8 @@ static struct CARD { /* Duplicate PCI ID, reconfigure for this board during the eeprom read. * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */ + { 0x109e036e, BTTV_BOARD_CONCEPTRONIC_CTVFMI2, "Conceptronic CTVFMi v2"}, + /* DVB cards (using pci function .1 for mpeg data xfer) */ { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" }, { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" }, @@ -305,6 +322,20 @@ static struct CARD { { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" }, { 0x763c008a, BTTV_BOARD_GEOVISION_GV600, "GeoVision GV-600" }, { 0x18011000, BTTV_BOARD_ENLTV_FM_2, "Encore ENL TV-FM-2" }, + { 0x763d800a, BTTV_BOARD_GEOVISION_GV800S, "GeoVision GV-800(S) (master)" }, + { 0x763d800b, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" }, + { 0x763d800c, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" }, + { 0x763d800d, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" }, + + { 0x15401830, BTTV_BOARD_PV183, "Provideo PV183-1" }, + { 0x15401831, BTTV_BOARD_PV183, "Provideo PV183-2" }, + { 0x15401832, BTTV_BOARD_PV183, "Provideo PV183-3" }, + { 0x15401833, BTTV_BOARD_PV183, "Provideo PV183-4" }, + { 0x15401834, BTTV_BOARD_PV183, "Provideo PV183-5" }, + { 0x15401835, BTTV_BOARD_PV183, "Provideo PV183-6" }, + { 0x15401836, BTTV_BOARD_PV183, "Provideo PV183-7" }, + { 0x15401837, BTTV_BOARD_PV183, "Provideo PV183-8" }, + { 0, -1, NULL } }; @@ -316,59 +347,50 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_UNKNOWN] = { .name = " *** UNKNOWN/GENERIC *** ", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, .svhs = 2, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_MIRO] = { .name = "MIRO PCTV", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 15, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 2, 0, 0, 0 }, .gpiomute = 10, .needs_tvaudio = 1, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_HAUPPAUGE] = { .name = "Hauppauge (bt848)", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 7, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 1, 2, 3 }, .gpiomute = 4, .needs_tvaudio = 1, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_STB] = { .name = "STB, Gateway P/N 6000699 (bt848)", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 7, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 4, 0, 2, 3 }, .gpiomute = 1, .no_msp34xx = 1, .needs_tvaudio = 1, .tuner_type = TUNER_PHILIPS_NTSC, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, .has_radio = 1, }, @@ -377,202 +399,177 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_INTEL] = { .name = "Intel Create and Share PCI/ Smart Video Recorder III", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 2, .gpiomask = 0, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0 }, .needs_tvaudio = 0, .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_DIAMOND] = { .name = "Diamond DTV2000", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 3, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .gpiomux = { 0, 1, 0, 1 }, .gpiomute = 3, .needs_tvaudio = 1, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_AVERMEDIA] = { .name = "AVerMedia TVPhone", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 3, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomask = 0x0f, .gpiomux = { 0x0c, 0x04, 0x08, 0x04 }, /* 0x04 for some cards ?? */ .needs_tvaudio = 1, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .audio_mode_gpio= avermedia_tvphone_audio, .has_remote = 1, }, [BTTV_BOARD_MATRIX_VISION] = { .name = "MATRIX-Vision MV-Delta", .video_inputs = 5, - .audio_inputs = 1, - .tuner = UNSET, + /* .audio_inputs= 1, */ .svhs = 3, .gpiomask = 0, - .muxsel = { 2, 3, 1, 0, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0, 0), .gpiomux = { 0 }, .needs_tvaudio = 1, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x08 ---------------------------------- */ [BTTV_BOARD_FLYVIDEO] = { .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0xc00, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0xc00, 0x800, 0x400 }, .gpiomute = 0xc00, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_TURBOTV] = { .name = "IMS/IXmicro TurboTV", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 3, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 1, 1, 2, 3 }, .needs_tvaudio = 0, .pll = PLL_28, .tuner_type = TUNER_TEMIC_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_HAUPPAUGE878] = { .name = "Hauppauge (bt878)", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x0f, /* old: 7 */ - .muxsel = { 2, 0, 1, 1 }, + .muxsel = MUXSEL(2, 0, 1, 1), .gpiomux = { 0, 1, 2, 3 }, .gpiomute = 4, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_MIROPRO] = { .name = "MIRO PCTV pro", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x3014f, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x20001,0x10001, 0, 0 }, .gpiomute = 10, .needs_tvaudio = 1, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x0c ---------------------------------- */ [BTTV_BOARD_ADSTECH_TV] = { .name = "ADS Technologies Channel Surfer TV (bt848)", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 15, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 13, 14, 11, 7 }, .needs_tvaudio = 1, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_AVERMEDIA98] = { .name = "AVerMedia TVCapture 98", .video_inputs = 3, - .audio_inputs = 4, - .tuner = 0, + /* .audio_inputs= 4, */ .svhs = 2, .gpiomask = 15, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 13, 14, 11, 7 }, .needs_tvaudio = 1, .msp34xx_alt = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .audio_mode_gpio= avermedia_tv_stereo_audio, .no_gpioirq = 1, }, [BTTV_BOARD_VHX] = { .name = "Aimslab Video Highway Xtreme (VHX)", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 7, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */ .gpiomute = 4, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_ZOLTRIX] = { .name = "Zoltrix TV-Max", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 15, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0, 1, 0 }, .gpiomute = 10, .needs_tvaudio = 1, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x10 ---------------------------------- */ [BTTV_BOARD_PIXVIEWPLAYTV] = { .name = "Prolink Pixelview PlayTV (bt878)", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x01fe00, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */ .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 }, .gpiomute = 0x002000, @@ -580,194 +577,170 @@ struct tvcard bttv_tvcards[] = { .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_WINVIEW_601] = { .name = "Leadtek WinView 601", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x8300f8, - .muxsel = { 2, 3, 1, 1,0 }, + .muxsel = MUXSEL(2, 3, 1, 1, 0), .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 }, .gpiomute = 0xcfa007, .needs_tvaudio = 1, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .volume_gpio = winview_volume, .has_radio = 1, }, [BTTV_BOARD_AVEC_INTERCAP] = { .name = "AVEC Intercapture", .video_inputs = 3, - .audio_inputs = 2, - .tuner = 0, + /* .audio_inputs= 2, */ .svhs = 2, .gpiomask = 0, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 1, 0, 0, 0 }, .needs_tvaudio = 1, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_LIFE_FLYKIT] = { .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)", .video_inputs = 4, - .audio_inputs = 1, - .tuner = UNSET, - .svhs = UNSET, + /* .audio_inputs= 1, */ + .svhs = NO_SVHS, .gpiomask = 0x8dff00, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0 }, .no_msp34xx = 1, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x14 ---------------------------------- */ [BTTV_BOARD_CEI_RAFFLES] = { .name = "CEI Raffles Card", .video_inputs = 3, - .audio_inputs = 3, - .tuner = 0, + /* .audio_inputs= 3, */ .svhs = 2, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_CONFERENCETV] = { .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50", .video_inputs = 4, - .audio_inputs = 2, /* tuner, line in */ - .tuner = 0, + /* .audio_inputs= 2, tuner, line in */ .svhs = 2, .gpiomask = 0x1800, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0x800, 0x1000, 0x1000 }, .gpiomute = 0x1800, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL_I, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_PHOEBE_TVMAS] = { .name = "Askey CPH050/ Phoebe Tv Master + FM", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0xc00, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 1, 0x800, 0x400 }, .gpiomute = 0xc00, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_MODTEC_205] = { .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, - .svhs = UNSET, + /* .audio_inputs= 1, */ + .svhs = NO_SVHS, + .has_dig_in = 1, .gpiomask = 7, - .muxsel = { 2, 3, -1 }, - .digital_mode = DIGITAL_MODE_CAMERA, + .muxsel = MUXSEL(2, 3, 0), /* input 2 is digital */ + /* .digital_mode= DIGITAL_MODE_CAMERA, */ .gpiomux = { 0, 0, 0, 0 }, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = TUNER_ALPS_TSBB5_PAL_I, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x18 ---------------------------------- */ [BTTV_BOARD_MAGICTVIEW061] = { .name = "Askey CPH05X/06X (bt878) [many vendors]", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0xe00, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = {0x400, 0x400, 0x400, 0x400 }, .gpiomute = 0xc00, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_remote = 1, }, [BTTV_BOARD_VOBIS_BOOSTAR] = { .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x1f0fff, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x20000, 0x30000, 0x10000, 0 }, .gpiomute = 0x40000, .needs_tvaudio = 0, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .audio_mode_gpio= terratv_audio, }, [BTTV_BOARD_HAUPPAUG_WCAM] = { .name = "Hauppauge WinCam newer (bt878)", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 3, .gpiomask = 7, - .muxsel = { 2, 0, 1, 1 }, + .muxsel = MUXSEL(2, 0, 1, 1), .gpiomux = { 0, 1, 2, 3 }, .gpiomute = 4, .needs_tvaudio = 1, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_MAXI] = { .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50", .video_inputs = 4, - .audio_inputs = 2, - .tuner = 0, + /* .audio_inputs= 2, */ .svhs = 2, .gpiomask = 0x1800, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0x800, 0x1000, 0x1000 }, .gpiomute = 0x1800, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_SECAM, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x1c ---------------------------------- */ [BTTV_BOARD_TERRATV] = { .name = "Terratec TerraTV+ Version 1.1 (bt878)", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x1f0fff, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 }, .gpiomute = 0x40000, .needs_tvaudio = 0, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .audio_mode_gpio= terratv_audio, /* GPIO wiring: External 20 pin connector (for Active Radio Upgrade board) @@ -805,87 +778,77 @@ struct tvcard bttv_tvcards[] = { /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */ .name = "Imagenation PXC200", .video_inputs = 5, - .audio_inputs = 1, - .tuner = UNSET, + /* .audio_inputs= 1, */ .svhs = 1, /* was: 4 */ .gpiomask = 0, - .muxsel = { 2, 3, 1, 0, 0}, + .muxsel = MUXSEL(2, 3, 1, 0, 0), .gpiomux = { 0 }, .needs_tvaudio = 1, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .muxsel_hook = PXC200_muxsel, }, [BTTV_BOARD_FLYVIDEO_98] = { .name = "Lifeview FlyVideo 98 LR50", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x1800, /* 0x8dfe00 */ - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0x0800, 0x1000, 0x1000 }, .gpiomute = 0x1800, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_IPROTV] = { .name = "Formac iProTV, Formac ProTV I (bt848)", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 3, .gpiomask = 1, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 1, 0, 0, 0 }, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x20 ---------------------------------- */ [BTTV_BOARD_INTEL_C_S_PCI] = { .name = "Intel Create and Share PCI/ Smart Video Recorder III", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 2, .gpiomask = 0, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0 }, .needs_tvaudio = 0, .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_TERRATVALUE] = { .name = "Terratec TerraTValue Version Bt878", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0xffff00, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x500, 0, 0x300, 0x900 }, .gpiomute = 0x900, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_WINFAST2000] = { .name = "Leadtek WinFast 2000/ WinFast 2000 XP", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, - .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */ + /* TV, CVid, SVid, CVid over SVid connector */ + .muxsel = MUXSEL(2, 3, 1, 1, 0), /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */ .gpiomask = 0xb33000, .gpiomux = { 0x122000,0x1000,0x0000,0x620000 }, @@ -906,217 +869,191 @@ struct tvcard bttv_tvcards[] = { .has_radio = 1, .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */ .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .audio_mode_gpio= winfast2000_audio, .has_remote = 1, }, [BTTV_BOARD_CHRONOS_VS2] = { .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II", .video_inputs = 4, - .audio_inputs = 3, - .tuner = 0, + /* .audio_inputs= 3, */ .svhs = 2, .gpiomask = 0x1800, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0x800, 0x1000, 0x1000 }, .gpiomute = 0x1800, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x24 ---------------------------------- */ [BTTV_BOARD_TYPHOON_TVIEW] = { .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner", .video_inputs = 4, - .audio_inputs = 3, - .tuner = 0, + /* .audio_inputs= 3, */ .svhs = 2, .gpiomask = 0x1800, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0x800, 0x1000, 0x1000 }, .gpiomute = 0x1800, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_radio = 1, }, [BTTV_BOARD_PXELVWPLTVPRO] = { .name = "Prolink PixelView PlayTV pro", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0xff, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x21, 0x20, 0x24, 0x2c }, .gpiomute = 0x29, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_MAGICTVIEW063] = { .name = "Askey CPH06X TView99", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x551e00, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .gpiomux = { 0x551400, 0x551200, 0, 0 }, .gpiomute = 0x551c00, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL_I, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_remote = 1, }, [BTTV_BOARD_PINNACLE] = { .name = "Pinnacle PCTV Studio/Rave", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x03000F, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 2, 0xd0001, 0, 0 }, .gpiomute = 1, .needs_tvaudio = 0, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x28 ---------------------------------- */ [BTTV_BOARD_STB2] = { .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 7, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 4, 0, 2, 3 }, .gpiomute = 1, .no_msp34xx = 1, .needs_tvaudio = 1, .tuner_type = TUNER_PHILIPS_NTSC, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, .has_radio = 1, }, [BTTV_BOARD_AVPHONE98] = { .name = "AVerMedia TVPhone 98", .video_inputs = 3, - .audio_inputs = 4, - .tuner = 0, + /* .audio_inputs= 4, */ .svhs = 2, .gpiomask = 15, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 13, 4, 11, 7 }, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_radio = 1, .audio_mode_gpio= avermedia_tvphone_audio, }, [BTTV_BOARD_PV951] = { .name = "ProVideo PV951", /* pic16c54 */ .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0, - .muxsel = { 2, 3, 1, 1}, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0, 0, 0}, .needs_tvaudio = 1, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL_I, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_ONAIR_TV] = { .name = "Little OnAir TV", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0xe00b, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 }, .gpiomute = 0xff3ffc, .no_msp34xx = 1, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x2c ---------------------------------- */ [BTTV_BOARD_SIGMA_TVII_FM] = { .name = "Sigma TVII-FM", .video_inputs = 2, - .audio_inputs = 1, - .tuner = 0, - .svhs = UNSET, + /* .audio_inputs= 1, */ + .svhs = NO_SVHS, .gpiomask = 3, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 1, 1, 0, 2 }, .gpiomute = 3, .no_msp34xx = 1, .pll = PLL_NONE, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_MATRIX_VISION2] = { .name = "MATRIX-Vision MV-Delta 2", .video_inputs = 5, - .audio_inputs = 1, - .tuner = UNSET, + /* .audio_inputs= 1, */ .svhs = 3, .gpiomask = 0, - .muxsel = { 2, 3, 1, 0, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0, 0), .gpiomux = { 0 }, .no_msp34xx = 1, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_ZOLTRIX_GENIE] = { .name = "Zoltrix Genie TV/FM", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0xbcf03f, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 }, .gpiomute = 0xbcb03f, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = TUNER_TEMIC_4039FR5_NTSC, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_TERRATVRADIO] = { .name = "Terratec TV/Radio+", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x70000, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x20000, 0x30000, 0x10000, 0 }, .gpiomute = 0x40000, .needs_tvaudio = 1, @@ -1124,7 +1061,6 @@ struct tvcard bttv_tvcards[] = { .pll = PLL_35, .tuner_type = TUNER_PHILIPS_PAL_I, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_radio = 1, }, @@ -1132,51 +1068,46 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_DYNALINK] = { .name = "Askey CPH03x/ Dynalink Magic TView", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 15, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = {2,0,0,0 }, .gpiomute = 1, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_GVBCTV3PCI] = { .name = "IODATA GV-BCTV3/PCI", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x010f00, - .muxsel = {2, 3, 0, 0 }, + .muxsel = MUXSEL(2, 3, 0, 0), .gpiomux = {0x10000, 0, 0x10000, 0 }, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = TUNER_ALPS_TSHC6_NTSC, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .audio_mode_gpio= gvbctv3pci_audio, }, [BTTV_BOARD_PXELVWPLTVPAK] = { .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP", .video_inputs = 5, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 3, + .has_dig_in = 1, .gpiomask = 0xAA0000, - .muxsel = { 2,3,1,1,-1 }, - .digital_mode = DIGITAL_MODE_CAMERA, + .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */ + /* .digital_mode= DIGITAL_MODE_CAMERA, */ .gpiomux = { 0x20000, 0, 0x80000, 0x80000 }, .gpiomute = 0xa8000, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL_I, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_remote = 1, /* GPIO wiring: (different from Rev.4C !) GPIO17: U4.A0 (first hef4052bt) @@ -1191,17 +1122,15 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_EAGLE] = { .name = "Eagle Wireless Capricorn2 (bt878A)", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 7, - .muxsel = { 2, 0, 1, 1 }, + .muxsel = MUXSEL(2, 0, 1, 1), .gpiomux = { 0, 1, 2, 3 }, .gpiomute = 4, .pll = PLL_28, .tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x34 ---------------------------------- */ @@ -1209,11 +1138,10 @@ struct tvcard bttv_tvcards[] = { /* David Härdeman <david@2gen.com> */ .name = "Pinnacle PCTV Studio Pro", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 3, .gpiomask = 0x03000F, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 1, 0xd0001, 0, 0 }, .gpiomute = 10, /* sound path (5 sources): @@ -1229,25 +1157,22 @@ struct tvcard bttv_tvcards[] = { .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_TVIEW_RDS_FM] = { /* Claas Langbehn <claas@bigfoot.com>, Sven Grothklags <sven@upb.de> */ .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS", .video_inputs = 4, - .audio_inputs = 3, - .tuner = 0, + /* .audio_inputs= 3, */ .svhs = 2, .gpiomask = 0x1c, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0, 0x10, 8 }, .gpiomute = 4, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_radio = 1, }, [BTTV_BOARD_LIFETEC_9415] = { @@ -1258,11 +1183,10 @@ struct tvcard bttv_tvcards[] = { options tuner type=5 */ .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x18e0, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x0000,0x0800,0x1000,0x1000 }, .gpiomute = 0x18e0, /* For cards with tda9820/tda9821: @@ -1272,25 +1196,22 @@ struct tvcard bttv_tvcards[] = { .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_BESTBUY_EASYTV] = { /* Miguel Angel Alvarez <maacruz@navegalia.com> old Easy TV BT848 version (model CPH031) */ .name = "Askey CPH031/ BESTBUY Easy TV", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0xF, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .gpiomux = { 2, 0, 0, 0 }, .gpiomute = 10, .needs_tvaudio = 0, .pll = PLL_28, .tuner_type = TUNER_TEMIC_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x38 ---------------------------------- */ @@ -1298,17 +1219,15 @@ struct tvcard bttv_tvcards[] = { /* Gordon Heydon <gjheydon@bigfoot.com ('98) */ .name = "Lifeview FlyVideo 98FM LR50", .video_inputs = 4, - .audio_inputs = 3, - .tuner = 0, + /* .audio_inputs= 3, */ .svhs = 2, .gpiomask = 0x1800, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0x800, 0x1000, 0x1000 }, .gpiomute = 0x1800, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* This is the ultimate cheapo capture card * just a BT848A on a small PCB! @@ -1316,51 +1235,45 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_GRANDTEC] = { .name = "GrandTec 'Grand Video Capture' (Bt848)", .video_inputs = 2, - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 1, .gpiomask = 0, - .muxsel = { 3, 1 }, + .muxsel = MUXSEL(3, 1), .gpiomux = { 0 }, .needs_tvaudio = 0, .no_msp34xx = 1, .pll = PLL_35, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_ASKEY_CPH060] = { /* Daniel Herrington <daniel.herrington@home.com> */ .name = "Askey CPH060/ Phoebe TV Master Only (No FM)", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0xe00, - .muxsel = { 2, 3, 1, 1}, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x400, 0x400, 0x400, 0x400 }, .gpiomute = 0x800, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = TUNER_TEMIC_4036FY5_NTSC, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_ASKEY_CPH03X] = { /* Matti Mottus <mottus@physic.ut.ee> */ .name = "Askey CPH03x TV Capturer", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x03000F, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .gpiomux = { 2, 0, 0, 0 }, .gpiomute = 1, .pll = PLL_28, .tuner_type = TUNER_TEMIC_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x3c ---------------------------------- */ @@ -1368,34 +1281,30 @@ struct tvcard bttv_tvcards[] = { /* Philip Blundell <philb@gnu.org> */ .name = "Modular Technology MM100PCTV", .video_inputs = 2, - .audio_inputs = 2, - .tuner = 0, - .svhs = UNSET, + /* .audio_inputs= 2, */ + .svhs = NO_SVHS, .gpiomask = 11, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 2, 0, 0, 1 }, .gpiomute = 8, .pll = PLL_35, .tuner_type = TUNER_TEMIC_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_GMV1] = { /* Adrian Cox <adrian@humboldt.co.uk */ .name = "AG Electronics GMV1", .video_inputs = 2, - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 1, .gpiomask = 0xF, - .muxsel = { 2, 2 }, + .muxsel = MUXSEL(2, 2), .gpiomux = { }, .no_msp34xx = 1, .needs_tvaudio = 0, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_BESTBUY_EASYTV2] = { /* Miguel Angel Alvarez <maacruz@navegalia.com> @@ -1403,34 +1312,30 @@ struct tvcard bttv_tvcards[] = { special thanks to Informatica Mieres for providing the card */ .name = "Askey CPH061/ BESTBUY Easy TV (bt878)", .video_inputs = 3, - .audio_inputs = 2, - .tuner = 0, + /* .audio_inputs= 2, */ .svhs = 2, .gpiomask = 0xFF, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .gpiomux = { 1, 0, 4, 4 }, .gpiomute = 9, .needs_tvaudio = 0, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_ATI_TVWONDER] = { /* Lukas Gebauer <geby@volny.cz> */ .name = "ATI TV-Wonder", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0xf03f, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .gpiomux = { 0xbffe, 0, 0xbfff, 0 }, .gpiomute = 0xbffe, .pll = PLL_28, .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x40 ---------------------------------- */ @@ -1438,27 +1343,24 @@ struct tvcard bttv_tvcards[] = { /* Lukas Gebauer <geby@volny.cz> */ .name = "ATI TV-Wonder VE", .video_inputs = 2, - .audio_inputs = 1, - .tuner = 0, - .svhs = UNSET, + /* .audio_inputs= 1, */ + .svhs = NO_SVHS, .gpiomask = 1, - .muxsel = { 2, 3, 0, 1 }, + .muxsel = MUXSEL(2, 3, 0, 1), .gpiomux = { 0, 0, 1, 0 }, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_FLYVIDEO2000] = { /* DeeJay <deejay@westel900.net (2000S) */ .name = "Lifeview FlyVideo 2000S LR90", .video_inputs = 3, - .audio_inputs = 3, - .tuner = 0, + /* .audio_inputs= 3, */ .svhs = 2, .gpiomask = 0x18e0, - .muxsel = { 2, 3, 0, 1 }, + .muxsel = MUXSEL(2, 3, 0, 1), /* Radio changed from 1e80 to 0x800 to make FlyVideo2000S in .hu happy (gm)*/ /* -dk-???: set mute=0x1800 for tda9874h daughterboard */ @@ -1471,40 +1373,35 @@ struct tvcard bttv_tvcards[] = { .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_TERRATVALUER] = { .name = "Terratec TValueRadio", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0xffff00, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x500, 0x500, 0x300, 0x900 }, .gpiomute = 0x900, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_radio = 1, }, [BTTV_BOARD_GVBCTV4PCI] = { /* TANAKA Kei <peg00625@nifty.com> */ .name = "IODATA GV-BCTV4/PCI", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x010f00, - .muxsel = {2, 3, 0, 0 }, + .muxsel = MUXSEL(2, 3, 0, 0), .gpiomux = {0x10000, 0, 0x10000, 0 }, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = TUNER_SHARP_2U5JF5540_NTSC, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .audio_mode_gpio= gvbctv3pci_audio, }, @@ -1514,9 +1411,8 @@ struct tvcard bttv_tvcards[] = { /* try "insmod msp3400 simple=0" if you have * sound problems with this card. */ .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, - .svhs = UNSET, + /* .audio_inputs= 1, */ + .svhs = NO_SVHS, .gpiomask = 0x4f8a00, /* 0x100000: 1=MSP enabled (0=disable again) * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */ @@ -1524,10 +1420,9 @@ struct tvcard bttv_tvcards[] = { .gpiomute = 0x947fff, /* tvtuner, radio, external,internal, mute, stereo * tuner, Composit, SVid, Composit-on-Svid-adapter */ - .muxsel = { 2, 3 ,0 ,1 }, + .muxsel = MUXSEL(2, 3, 0, 1), .tuner_type = TUNER_MT2032, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, .has_radio = 1, }, @@ -1536,9 +1431,8 @@ struct tvcard bttv_tvcards[] = { /* try "insmod msp3400 simple=0" if you have * sound problems with this card. */ .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, - .svhs = UNSET, + /* .audio_inputs= 1, */ + .svhs = NO_SVHS, .gpiomask = 0x4f8a00, /* 0x100000: 1=MSP enabled (0=disable again) * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */ @@ -1546,10 +1440,9 @@ struct tvcard bttv_tvcards[] = { .gpiomute = 0x947fff, /* tvtuner, radio, external,internal, mute, stereo * tuner, Composit, SVid, Composit-on-Svid-adapter */ - .muxsel = { 2, 3 ,0 ,1 }, + .muxsel = MUXSEL(2, 3, 0, 1), .tuner_type = TUNER_MT2032, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, .has_radio = 1, }, @@ -1557,31 +1450,27 @@ struct tvcard bttv_tvcards[] = { /* Philip Blundell <pb@nexus.co.uk> */ .name = "Active Imaging AIMMS", .video_inputs = 1, - .audio_inputs = 0, - .tuner = UNSET, - .tuner_type = UNSET, + /* .audio_inputs= 0, */ + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, - .muxsel = { 2 }, + .muxsel = MUXSEL(2), .gpiomask = 0 }, [BTTV_BOARD_PV_BT878P_PLUS] = { /* Tomasz Pyra <hellfire@sedez.iq.pl> */ .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)", .video_inputs = 3, - .audio_inputs = 4, - .tuner = 0, + /* .audio_inputs= 4, */ .svhs = 2, .gpiomask = 15, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */ .gpiomute = 13, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = TUNER_LG_PAL_I_FM, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_remote = 1, /* GPIO wiring: GPIO0: U4.A0 (hef4052bt) @@ -1594,15 +1483,14 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_FLYVIDEO98EZ] = { .name = "Lifeview FlyVideo 98EZ (capture only) LR51", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 2, - .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */ + /* AV1, AV2, SVHS, CVid adapter on SVHS */ + .muxsel = MUXSEL(2, 3, 1, 1), .pll = PLL_28, .no_msp34xx = 1, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x48 ---------------------------------- */ @@ -1610,11 +1498,10 @@ struct tvcard bttv_tvcards[] = { /* Dariusz Kowalewski <darekk@automex.pl> */ .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x3f, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x01, 0x00, 0x03, 0x03 }, .gpiomute = 0x09, .needs_tvaudio = 1, @@ -1623,7 +1510,6 @@ struct tvcard bttv_tvcards[] = { .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .audio_mode_gpio= pvbt878p9b_audio, /* Note: not all cards have stereo */ .has_radio = 1, /* Note: not all cards have radio */ .has_remote = 1, @@ -1640,49 +1526,42 @@ struct tvcard bttv_tvcards[] = { /* you must jumper JP5 for the card to work */ .name = "Sensoray 311", .video_inputs = 5, - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 4, .gpiomask = 0, - .muxsel = { 2, 3, 1, 0, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0, 0), .gpiomux = { 0 }, .needs_tvaudio = 0, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_RV605] = { /* Miguel Freitas <miguel@cetuc.puc-rio.br> */ .name = "RemoteVision MX (RV605)", .video_inputs = 16, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, .gpiomask = 0x00, .gpiomask2 = 0x07ff, - .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03, - 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 }, + .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3), .no_msp34xx = 1, .no_tda9875 = 1, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .muxsel_hook = rv605_muxsel, }, [BTTV_BOARD_POWERCLR_MTV878] = { .name = "Powercolor MTV878/ MTV878R/ MTV878F", .video_inputs = 3, - .audio_inputs = 2, - .tuner = 0, + /* .audio_inputs= 2, */ .svhs = 2, .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */ - .muxsel = { 2, 1, 1, }, + .muxsel = MUXSEL(2, 1, 1), .gpiomux = { 0, 1, 2, 2 }, .gpiomute = 4, .needs_tvaudio = 0, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, .has_radio = 1, }, @@ -1692,42 +1571,38 @@ struct tvcard bttv_tvcards[] = { /* Masaki Suzuki <masaki@btree.org> */ .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x140007, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 1, 2, 3 }, .gpiomute = 4, .tuner_type = TUNER_PHILIPS_NTSC, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .audio_mode_gpio= windvr_audio, }, [BTTV_BOARD_GRANDTEC_MULTI] = { .name = "GrandTec Multi Capture Card (Bt878)", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, .gpiomask = 0, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .gpiomux = { 0 }, .needs_tvaudio = 0, .no_msp34xx = 1, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_KWORLD] = { .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF", .video_inputs = 4, - .audio_inputs = 3, - .tuner = 0, + /* .audio_inputs= 3, */ .svhs = 2, .gpiomask = 7, - .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */ + /* Tuner, SVid, SVHS, SVid to SVHS connector */ + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio! * This card lacks external Audio In, so we mute it on Ext. & Int. * The PCB can take a sbx1637/sbx1673, wiring unknown. @@ -1741,7 +1616,6 @@ struct tvcard bttv_tvcards[] = { .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and radio signal strength indicators work fine. */ .has_radio = 1, @@ -1759,27 +1633,24 @@ struct tvcard bttv_tvcards[] = { /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */ .name = "DSP Design TCVIDEO", .video_inputs = 4, - .svhs = UNSET, - .muxsel = { 2, 3, 1, 0 }, + .svhs = NO_SVHS, + .muxsel = MUXSEL(2, 3, 1, 0), .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x50 ---------------------------------- */ [BTTV_BOARD_HAUPPAUGEPVR] = { .name = "Hauppauge WinTV PVR", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, - .muxsel = { 2, 0, 1, 1 }, + .muxsel = MUXSEL(2, 0, 1, 1), .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .gpiomask = 7, .gpiomux = {7}, @@ -1787,32 +1658,28 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_GVBCTV5PCI] = { .name = "IODATA GV-BCTV5/PCI", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x0f0f80, - .muxsel = {2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .gpiomux = {0x030000, 0x010000, 0, 0 }, .gpiomute = 0x020000, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_NTSC_M, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .audio_mode_gpio= gvbctv5pci_audio, .has_radio = 1, }, [BTTV_BOARD_OSPREY1x0] = { .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */ .video_inputs = 4, /* id-inputs-clock */ - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 3, - .muxsel = { 3, 2, 0, 1 }, + .muxsel = MUXSEL(3, 2, 0, 1), .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -1820,14 +1687,12 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_OSPREY1x0_848] = { .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */ .video_inputs = 3, - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 2, - .muxsel = { 2, 3, 1 }, + .muxsel = MUXSEL(2, 3, 1), .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -1837,14 +1702,12 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_OSPREY101_848] = { .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */ .video_inputs = 2, - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 1, - .muxsel = { 3, 1 }, + .muxsel = MUXSEL(3, 1), .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -1852,14 +1715,12 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_OSPREY1x1] = { .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */ .video_inputs = 1, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, - .muxsel = { 0 }, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, + .muxsel = MUXSEL(0), .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -1867,14 +1728,12 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_OSPREY1x1_SVID] = { .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */ .video_inputs = 2, - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 1, - .muxsel = { 0, 1 }, + .muxsel = MUXSEL(0, 1), .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -1882,14 +1741,12 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_OSPREY2xx] = { .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */ .video_inputs = 1, - .audio_inputs = 1, - .tuner = UNSET, - .svhs = UNSET, - .muxsel = { 0 }, + /* .audio_inputs= 1, */ + .svhs = NO_SVHS, + .muxsel = MUXSEL(0), .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -1899,14 +1756,12 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_OSPREY2x0_SVID] = { .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */ .video_inputs = 2, - .audio_inputs = 1, - .tuner = UNSET, + /* .audio_inputs= 1, */ .svhs = 1, - .muxsel = { 0, 1 }, + .muxsel = MUXSEL(0, 1), .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -1914,14 +1769,12 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_OSPREY2x0] = { .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */ .video_inputs = 2, - .audio_inputs = 1, - .tuner = UNSET, + /* .audio_inputs= 1, */ .svhs = 1, - .muxsel = { 2, 3 }, + .muxsel = MUXSEL(2, 3), .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -1929,14 +1782,12 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_OSPREY500] = { .name = "Osprey 500", /* 500 */ .video_inputs = 2, - .audio_inputs = 1, - .tuner = UNSET, + /* .audio_inputs= 1, */ .svhs = 1, - .muxsel = { 2, 3 }, + .muxsel = MUXSEL(2, 3), .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -1944,12 +1795,10 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_OSPREY540] = { .name = "Osprey 540", /* 540 */ .video_inputs = 4, - .audio_inputs = 1, - .tuner = UNSET, + /* .audio_inputs= 1, */ .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -1959,14 +1808,12 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_OSPREY2000] = { .name = "Osprey 2000", /* 2000 */ .video_inputs = 2, - .audio_inputs = 1, - .tuner = UNSET, + /* .audio_inputs= 1, */ .svhs = 1, - .muxsel = { 2, 3 }, + .muxsel = MUXSEL(2, 3), .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */ @@ -1975,14 +1822,12 @@ struct tvcard bttv_tvcards[] = { /* M G Berberich <berberic@forwiss.uni-passau.de> */ .name = "IDS Eagle", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, - .tuner_type = UNSET, + /* .audio_inputs= 0, */ + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .svhs = UNSET, + .svhs = NO_SVHS, .gpiomask = 0, - .muxsel = { 0, 1, 2, 3 }, + .muxsel = MUXSEL(2, 2, 2, 2), .muxsel_hook = eagle_muxsel, .no_msp34xx = 1, .no_tda9875 = 1, @@ -1991,16 +1836,14 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_PINNACLESAT] = { .name = "Pinnacle PCTV Sat", .video_inputs = 2, - .audio_inputs = 0, + /* .audio_inputs= 0, */ .svhs = 1, - .tuner = UNSET, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, - .muxsel = { 3, 1 }, + .muxsel = MUXSEL(3, 1), .pll = PLL_28, .no_gpioirq = 1, .has_dvb = 1, @@ -2008,18 +1851,16 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_FORMAC_PROTV] = { .name = "Formac ProTV II (bt878)", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 3, .gpiomask = 2, /* TV, Comp1, Composite over SVID con, SVID */ - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 2, 2, 0, 0 }, .pll = PLL_28, .has_radio = 1, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, /* sound routing: GPIO=0x00,0x01,0x03: mute (?) 0x02: both TV and radio (tuner: FM1216/I) @@ -2033,62 +1874,55 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_MACHTV] = { .name = "MachTV", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, - .svhs = UNSET, + /* .audio_inputs= 1, */ + .svhs = NO_SVHS, .gpiomask = 7, - .muxsel = { 2, 3, 1, 1}, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 1, 2, 3}, .gpiomute = 4, .needs_tvaudio = 1, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, }, [BTTV_BOARD_EURESYS_PICOLO] = { .name = "Euresys Picolo", .video_inputs = 3, - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 2, .gpiomask = 0, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, - .muxsel = { 2, 0, 1}, + .muxsel = MUXSEL(2, 0, 1), .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_PV150] = { /* Luc Van Hoeylandt <luc@e-magic.be> */ .name = "ProVideo PV150", /* 0x4f */ .video_inputs = 2, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, .gpiomask = 0, - .muxsel = { 2, 3 }, + .muxsel = MUXSEL(2, 3), .gpiomux = { 0 }, .needs_tvaudio = 0, .no_msp34xx = 1, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_AD_TVK503] = { /* Hiroshi Takekawa <sian@big.or.jp> */ /* This card lacks subsystem ID */ .name = "AD-TVK503", /* 0x63 */ .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x001e8007, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), /* Tuner, Radio, external, internal, off, on */ .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 }, .gpiomute = 0x0f, @@ -2097,7 +1931,6 @@ struct tvcard bttv_tvcards[] = { .pll = PLL_28, .tuner_type = TUNER_PHILIPS_NTSC, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .audio_mode_gpio= adtvk503_audio, }, @@ -2105,17 +1938,15 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_HERCULES_SM_TV] = { .name = "Hercules Smart TV Stereo", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x00, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .needs_tvaudio = 1, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, /* Notes: - card lacks subsystem ID - stereo variant w/ daughter board with tda9874a @0xb0 @@ -2129,16 +1960,15 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_PACETV] = { .name = "Pace TV & Radio Card", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, - .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */ + /* Tuner, CVid, SVid, CVid over SVid connector */ + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomask = 0, .no_tda9875 = 1, .no_tda7432 = 1, .tuner_type = TUNER_PHILIPS_PAL_I, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_radio = 1, .pll = PLL_28, /* Bt878, Bt832, FI1246 tuner; no pci subsystem id @@ -2152,27 +1982,34 @@ struct tvcard bttv_tvcards[] = { /* Chris Willing <chris@vislab.usyd.edu.au> */ .name = "IVC-200", .video_inputs = 1, - .audio_inputs = 0, - .tuner = UNSET, - .tuner_type = UNSET, + /* .audio_inputs= 0, */ + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .svhs = UNSET, + .svhs = NO_SVHS, + .gpiomask = 0xdf, + .muxsel = MUXSEL(2), + .pll = PLL_28, + }, + [BTTV_BOARD_IVCE8784] = { + .name = "IVCE-8784", + .video_inputs = 1, + /* .audio_inputs= 0, */ + .tuner_type = TUNER_ABSENT, + .tuner_addr = ADDR_UNSET, + .svhs = NO_SVHS, .gpiomask = 0xdf, - .muxsel = { 2 }, + .muxsel = MUXSEL(2), .pll = PLL_28, }, [BTTV_BOARD_XGUARD] = { .name = "Grand X-Guard / Trust 814PCI", .video_inputs = 16, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .gpiomask2 = 0xff, - .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 }, + .muxsel = MUXSEL(2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0), .muxsel_hook = xguard_muxsel, .no_msp34xx = 1, .no_tda9875 = 1, @@ -2184,16 +2021,14 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_NEBULA_DIGITV] = { .name = "Nebula Electronics DigiTV", .video_inputs = 1, - .tuner = UNSET, - .svhs = UNSET, - .muxsel = { 2, 3, 1, 0 }, + .svhs = NO_SVHS, + .muxsel = MUXSEL(2, 3, 1, 0), .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_dvb = 1, .has_remote = 1, .gpiomask = 0x1b, @@ -2203,118 +2038,101 @@ struct tvcard bttv_tvcards[] = { /* Jorge Boncompte - DTI2 <jorge@dti2.net> */ .name = "ProVideo PV143", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, .gpiomask = 0, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .gpiomux = { 0 }, .needs_tvaudio = 0, .no_msp34xx = 1, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_VD009X1_VD011_MINIDIN] = { /* M.Klahr@phytec.de */ .name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, /* card has no tuner */ + /* .audio_inputs= 0, */ .svhs = 3, .gpiomask = 0x00, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ .needs_tvaudio = 0, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_VD009X1_VD011_COMBI] = { .name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, /* card has no tuner */ + /* .audio_inputs= 0, */ .svhs = 3, .gpiomask = 0x00, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ .needs_tvaudio = 0, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x6c ---------------------------------- */ [BTTV_BOARD_VD009_MINIDIN] = { .name = "PHYTEC VD-009 MiniDIN (bt878)", .video_inputs = 10, - .audio_inputs = 0, - .tuner = UNSET, /* card has no tuner */ + /* .audio_inputs= 0, */ .svhs = 9, .gpiomask = 0x00, - .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio - via the upper nibble of muxsel. here: used for - xternal video-mux */ - .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 }, + .gpiomask2 = 0x03, /* used for external vodeo mux */ + .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0), + .muxsel_hook = phytec_muxsel, .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ .needs_tvaudio = 1, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_VD009_COMBI] = { .name = "PHYTEC VD-009 Combi (bt878)", .video_inputs = 10, - .audio_inputs = 0, - .tuner = UNSET, /* card has no tuner */ + /* .audio_inputs= 0, */ .svhs = 9, .gpiomask = 0x00, - .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio - via the upper nibble of muxsel. here: used for - xternal video-mux */ - .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 }, + .gpiomask2 = 0x03, /* used for external vodeo mux */ + .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1), + .muxsel_hook = phytec_muxsel, .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ .needs_tvaudio = 1, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_IVC100] = { .name = "IVC-100", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, - .tuner_type = UNSET, + /* .audio_inputs= 0, */ + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .svhs = UNSET, + .svhs = NO_SVHS, .gpiomask = 0xdf, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .pll = PLL_28, }, [BTTV_BOARD_IVC120] = { /* IVC-120G - Alan Garfield <alan@fromorbit.com> */ .name = "IVC-120G", .video_inputs = 16, - .audio_inputs = 0, /* card has no audio */ - .tuner = UNSET, /* card has no tuner */ - .tuner_type = UNSET, + /* .audio_inputs= 0, */ + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .svhs = UNSET, /* card has no svhs */ + .svhs = NO_SVHS, /* card has no svhs */ .needs_tvaudio = 0, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, .gpiomask = 0x00, - .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 }, + .muxsel = MUXSEL(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .muxsel_hook = ivc120_muxsel, .pll = PLL_28, }, @@ -2323,13 +2141,11 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_PC_HDTV] = { .name = "pcHDTV HD-2000 TV", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .tuner_type = TUNER_PHILIPS_FCV1236D, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_dvb = 1, }, [BTTV_BOARD_TWINHAN_DST] = { @@ -2339,38 +2155,34 @@ struct tvcard bttv_tvcards[] = { .no_tda7432 = 1, .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_video = 1, .has_dvb = 1, }, [BTTV_BOARD_WINFASTVC100] = { .name = "Winfast VC100", .video_inputs = 3, - .audio_inputs = 0, + /* .audio_inputs= 0, */ .svhs = 1, - .tuner = UNSET, - .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */ + /* Vid In, SVid In, Vid over SVid in connector */ + .muxsel = MUXSEL(3, 1, 1, 3), .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, }, [BTTV_BOARD_TEV560] = { .name = "Teppro TEV-560/InterVision IV-560", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 3, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 1, 1, 1, 1 }, .needs_tvaudio = 1, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_35, }, @@ -2378,14 +2190,12 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_SIMUS_GVC1100] = { .name = "SIMUS GVC1100", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, - .tuner_type = UNSET, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, - .muxsel = { 2, 2, 2, 2 }, + .muxsel = MUXSEL(2, 2, 2, 2), .gpiomask = 0x3F, .muxsel_hook = gvc1100_muxsel, }, @@ -2393,47 +2203,41 @@ struct tvcard bttv_tvcards[] = { /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */ .name = "NGS NGSTV+", .video_inputs = 3, - .tuner = 0, .svhs = 2, .gpiomask = 0x008007, - .muxsel = { 2, 3, 0, 0 }, + .muxsel = MUXSEL(2, 3, 0, 0), .gpiomux = { 0, 0, 0, 0 }, .gpiomute = 0x000003, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_remote = 1, }, [BTTV_BOARD_LMLBT4] = { /* http://linuxmedialabs.com */ .name = "LMLBT4", .video_inputs = 4, /* IN1,IN2,IN3,IN4 */ - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, - .muxsel = { 2, 3, 1, 0 }, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, + .muxsel = MUXSEL(2, 3, 1, 0), .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, .needs_tvaudio = 0, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_TEKRAM_M205] = { /* Helmroos Harri <harri.helmroos@pp.inet.fi> */ .name = "Tekram M205 PRO", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .svhs = 2, .needs_tvaudio = 0, .gpiomask = 0x68, - .muxsel = { 2, 3, 1 }, + .muxsel = MUXSEL(2, 3, 1), .gpiomux = { 0x68, 0x68, 0x61, 0x61 }, .pll = PLL_28, }, @@ -2444,18 +2248,16 @@ struct tvcard bttv_tvcards[] = { /* bt878 TV + FM without subsystem ID */ .name = "Conceptronic CONTVFMi", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x008007, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 1, 2, 2 }, .gpiomute = 3, .needs_tvaudio = 0, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_remote = 1, .has_radio = 1, }, @@ -2466,37 +2268,34 @@ struct tvcard bttv_tvcards[] = { /*0x79 in bttv.h*/ .name = "Euresys Picolo Tetra", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, .gpiomask = 0, .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/ .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, - .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/ + /*878A input is always MUX0, see above.*/ + .muxsel = MUXSEL(2, 2, 2, 2), .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ .pll = PLL_28, .needs_tvaudio = 0, .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/ - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_SPIRIT_TV] = { /* Spirit TV Tuner from http://spiritmodems.com.au */ /* Stafford Goodsell <surge@goliath.homeunix.org> */ .name = "Spirit TV Tuner", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x0000000f, - .muxsel = { 2, 1, 1 }, + .muxsel = MUXSEL(2, 1, 1), .gpiomux = { 0x02, 0x00, 0x00, 0x00 }, .tuner_type = TUNER_TEMIC_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, }, @@ -2505,11 +2304,9 @@ struct tvcard bttv_tvcards[] = { .name = "AVerMedia AVerTV DVB-T 771", .video_inputs = 2, .svhs = 1, - .tuner = UNSET, .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .muxsel = { 3 , 3 }, + .muxsel = MUXSEL(3, 3), .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -2524,54 +2321,47 @@ struct tvcard bttv_tvcards[] = { /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */ .name = "AverMedia AverTV DVB-T 761", .video_inputs = 2, - .tuner = UNSET, .svhs = 1, - .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */ + .muxsel = MUXSEL(3, 1, 2, 0), /* Comp0, S-Video, ?, ? */ .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_dvb = 1, .no_gpioirq = 1, .has_remote = 1, }, [BTTV_BOARD_MATRIX_VISIONSQ] = { /* andre.schwarz@matrix-vision.de */ - .name = "MATRIX Vision Sigma-SQ", - .video_inputs = 16, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, - .gpiomask = 0x0, - .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3 }, - .muxsel_hook = sigmaSQ_muxsel, - .gpiomux = { 0 }, - .no_msp34xx = 1, - .pll = PLL_28, - .tuner_type = UNSET, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, + .name = "MATRIX Vision Sigma-SQ", + .video_inputs = 16, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, + .gpiomask = 0x0, + .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3), + .muxsel_hook = sigmaSQ_muxsel, + .gpiomux = { 0 }, + .no_msp34xx = 1, + .pll = PLL_28, + .tuner_type = TUNER_ABSENT, + .tuner_addr = ADDR_UNSET, }, [BTTV_BOARD_MATRIX_VISIONSLC] = { /* andre.schwarz@matrix-vision.de */ - .name = "MATRIX Vision Sigma-SLC", - .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, - .gpiomask = 0x0, - .muxsel = { 2, 2, 2, 2 }, - .muxsel_hook = sigmaSLC_muxsel, - .gpiomux = { 0 }, - .no_msp34xx = 1, - .pll = PLL_28, - .tuner_type = UNSET, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, + .name = "MATRIX Vision Sigma-SLC", + .video_inputs = 4, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, + .gpiomask = 0x0, + .muxsel = MUXSEL(2, 2, 2, 2), + .muxsel_hook = sigmaSLC_muxsel, + .gpiomux = { 0 }, + .no_msp34xx = 1, + .pll = PLL_28, + .tuner_type = TUNER_ABSENT, + .tuner_addr = ADDR_UNSET, }, /* BTTV_BOARD_APAC_VIEWCOMP */ [BTTV_BOARD_APAC_VIEWCOMP] = { @@ -2579,18 +2369,16 @@ struct tvcard bttv_tvcards[] = { /* bt878 TV + FM 0x00000000 subsystem ID */ .name = "APAC Viewcomp 878(AMAX)", .video_inputs = 2, - .audio_inputs = 1, - .tuner = 0, - .svhs = UNSET, + /* .audio_inputs= 1, */ + .svhs = NO_SVHS, .gpiomask = 0xFF, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 2, 0, 0, 0 }, .gpiomute = 10, .needs_tvaudio = 0, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */ .has_radio = 1, /* not every card has radio */ }, @@ -2599,46 +2387,40 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_DVICO_DVBT_LITE] = { /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */ .name = "DViCO FusionHDTV DVB-T Lite", - .tuner = UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, .pll = PLL_28, .no_video = 1, .has_dvb = 1, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_VGEAR_MYVCD] = { /* Steven <photon38@pchome.com.tw> */ .name = "V-Gear MyVCD", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x3f, - .muxsel = {2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .gpiomux = {0x31, 0x31, 0x31, 0x31 }, .gpiomute = 0x31, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_NTSC_M, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_radio = 0, }, [BTTV_BOARD_SUPER_TV] = { /* Rick C <cryptdragoon@gmail.com> */ .name = "Super TV Tuner", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .tuner_type = TUNER_PHILIPS_NTSC, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .gpiomask = 0x008007, .gpiomux = { 0, 0x000001,0,0 }, .needs_tvaudio = 1, @@ -2648,17 +2430,15 @@ struct tvcard bttv_tvcards[] = { /* Chris Fanning <video4linux@haydon.net> */ .name = "Tibet Systems 'Progress DVR' CS16", .video_inputs = 16, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, - .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, + .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2), .pll = PLL_28, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .muxsel_hook = tibetCS16_muxsel, }, [BTTV_BOARD_KODICOM_4400R] = { @@ -2675,12 +2455,10 @@ struct tvcard bttv_tvcards[] = { */ .name = "Kodicom 4400R (master)", .video_inputs = 16, - .audio_inputs = 0, - .tuner = UNSET, - .tuner_type = UNSET, + /* .audio_inputs= 0, */ + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .svhs = UNSET, + .svhs = NO_SVHS, /* GPIO bits 0-9 used for analog switch: * 00 - 03: camera selector * 04 - 06: channel (controller) selector @@ -2691,7 +2469,7 @@ struct tvcard bttv_tvcards[] = { */ .gpiomask = 0x0003ff, .no_gpioirq = 1, - .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3), .pll = PLL_28, .no_msp34xx = 1, .no_tda7432 = 1, @@ -2707,15 +2485,13 @@ struct tvcard bttv_tvcards[] = { */ .name = "Kodicom 4400R (slave)", .video_inputs = 16, - .audio_inputs = 0, - .tuner = UNSET, - .tuner_type = UNSET, + /* .audio_inputs= 0, */ + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .svhs = UNSET, + .svhs = NO_SVHS, .gpiomask = 0x010000, .no_gpioirq = 1, - .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3), .pll = PLL_28, .no_msp34xx = 1, .no_tda7432 = 1, @@ -2728,27 +2504,23 @@ struct tvcard bttv_tvcards[] = { /* Adlink RTV24 with special unlock codes */ .name = "Adlink RTV24", .video_inputs = 4, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, - .muxsel = { 2, 3, 1, 0 }, + .muxsel = MUXSEL(2, 3, 1, 0), .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, }, /* ---- card 0x87---------------------------------- */ [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = { /* Michael Krufky <mkrufky@m1k.net> */ .name = "DViCO FusionHDTV 5 Lite", - .tuner = 0, .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */ .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .video_inputs = 3, - .audio_inputs = 1, + /* .audio_inputs= 1, */ .svhs = 2, - .muxsel = { 2, 3, 1 }, + .muxsel = MUXSEL(2, 3, 1), .gpiomask = 0x00e00007, .gpiomux = { 0x00400005, 0, 0x00000001, 0 }, .gpiomute = 0x00c00007, @@ -2762,75 +2534,68 @@ struct tvcard bttv_tvcards[] = { /* Mauro Carvalho Chehab <mchehab@infradead.org> */ .name = "Acorp Y878F", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x01fe00, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 }, .gpiomute = 0x002000, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = TUNER_YMEC_TVF66T5_B_DFF, .tuner_addr = 0xc1 >>1, - .radio_addr = 0xc1 >>1, .has_radio = 1, }, /* ---- card 0x89 ---------------------------------- */ [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = { .name = "Conceptronic CTVFMi v2", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x001c0007, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 1, 2, 2 }, .gpiomute = 3, .needs_tvaudio = 0, .pll = PLL_28, .tuner_type = TUNER_TENA_9533_DI, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_remote = 1, .has_radio = 1, }, /* ---- card 0x8a ---------------------------------- */ [BTTV_BOARD_PV_BT878P_2E] = { - .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)", - .video_inputs = 5, - .audio_inputs = 1, - .tuner = 0, - .svhs = 3, - .gpiomask = 0x01fe00, - .muxsel = { 2,3,1,1,-1 }, - .digital_mode = DIGITAL_MODE_CAMERA, - .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 }, - .gpiomute = 0x12400, - .no_msp34xx = 1, - .pll = PLL_28, - .tuner_type = TUNER_LG_PAL_FM, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .has_remote = 1, + .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)", + .video_inputs = 5, + /* .audio_inputs= 1, */ + .svhs = 3, + .has_dig_in = 1, + .gpiomask = 0x01fe00, + .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */ + /* .digital_mode= DIGITAL_MODE_CAMERA, */ + .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 }, + .gpiomute = 0x12400, + .no_msp34xx = 1, + .pll = PLL_28, + .tuner_type = TUNER_LG_PAL_FM, + .tuner_addr = ADDR_UNSET, + .has_remote = 1, }, /* ---- card 0x8b ---------------------------------- */ [BTTV_BOARD_PV_M4900] = { /* Sérgio Fortier <sergiofortier@yahoo.com.br> */ .name = "Prolink PixelView PlayTV MPEG2 PV-M4900", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x3f, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x21, 0x20, 0x24, 0x2c }, .gpiomute = 0x29, .no_msp34xx = 1, .pll = PLL_28, .tuner_type = TUNER_YMEC_TVF_5533MF, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .has_radio = 1, .has_remote = 1, }, @@ -2850,17 +2615,15 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_OSPREY440] = { .name = "Osprey 440", .video_inputs = 4, - .audio_inputs = 2, /* this is meaningless */ - .tuner = UNSET, - .svhs = UNSET, - .muxsel = { 2, 3, 0, 1 }, /* 3,0,1 are guesses */ + /* .audio_inputs= 2, */ + .svhs = NO_SVHS, + .muxsel = MUXSEL(2, 3, 0, 1), /* 3,0,1 are guesses */ .gpiomask = 0x303, .gpiomute = 0x000, /* int + 32kHz */ .gpiomux = { 0, 0, 0x000, 0x100}, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, @@ -2869,28 +2632,25 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_ASOUND_SKYEYE] = { .name = "Asound Skyeye PCTV", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 15, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 2, 0, 0, 0 }, .gpiomute = 1, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_NTSC, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x8e ---------------------------------- */ [BTTV_BOARD_SABRENT_TVFM] = { .name = "Sabrent TV-FM (bttv version)", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x108007, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 100000, 100002, 100002, 100000 }, .no_msp34xx = 1, .no_tda9875 = 1, @@ -2904,17 +2664,15 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = { .name = "Hauppauge ImpactVCB (bt878)", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, .gpiomask = 0x0f, /* old: 7 */ - .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */ + .muxsel = MUXSEL(0, 1, 3, 2), /* Composite 0-3 */ .no_msp34xx = 1, .no_tda9875 = 1, .no_tda7432 = 1, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_MACHTV_MAGICTV] = { /* Julian Calaby <julian.calaby@gmail.com> @@ -2926,16 +2684,14 @@ struct tvcard bttv_tvcards[] = { .name = "MagicTV", /* rebranded MachTV */ .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 7, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 1, 2, 3 }, .gpiomute = 4, .tuner_type = TUNER_TEMIC_4009FR5_PAL, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, .has_radio = 1, .has_remote = 1, @@ -2943,36 +2699,30 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_SSAI_SECURITY] = { .name = "SSAI Security Video Interface", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, - .muxsel = { 0, 1, 2, 3 }, - .tuner_type = UNSET, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, + .muxsel = MUXSEL(0, 1, 2, 3), + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_SSAI_ULTRASOUND] = { .name = "SSAI Ultrasound Video Interface", .video_inputs = 2, - .audio_inputs = 0, - .tuner = UNSET, + /* .audio_inputs= 0, */ .svhs = 1, - .muxsel = { 2, 0, 1, 3 }, - .tuner_type = UNSET, + .muxsel = MUXSEL(2, 0, 1, 3), + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, /* ---- card 0x94---------------------------------- */ [BTTV_BOARD_DVICO_FUSIONHDTV_2] = { .name = "DViCO FusionHDTV 2", - .tuner = 0, .tuner_type = TUNER_PHILIPS_FCV1236D, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .video_inputs = 3, - .audio_inputs = 1, + /* .audio_inputs= 1, */ .svhs = 2, - .muxsel = { 2, 3, 1 }, + .muxsel = MUXSEL(2, 3, 1), .gpiomask = 0x00e00007, .gpiomux = { 0x00400005, 0, 0x00000001, 0 }, .gpiomute = 0x00c00007, @@ -2984,36 +2734,31 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_TYPHOON_TVTUNERPCI] = { .name = "Typhoon TV-Tuner PCI (50684)", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x3014f, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0x20001,0x10001, 0, 0 }, .gpiomute = 10, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL_I, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_GEOVISION_GV600] = { /* emhn@usb.ve */ - .name = "Geovision GV-600", - .video_inputs = 16, - .audio_inputs = 0, - .tuner = UNSET, - .svhs = UNSET, - .gpiomask = 0x0, - .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2 }, - .muxsel_hook = geovision_muxsel, - .gpiomux = { 0 }, - .no_msp34xx = 1, - .pll = PLL_28, - .tuner_type = UNSET, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, + .name = "Geovision GV-600", + .video_inputs = 16, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, + .gpiomask = 0x0, + .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2), + .muxsel_hook = geovision_muxsel, + .gpiomux = { 0 }, + .no_msp34xx = 1, + .pll = PLL_28, + .tuner_type = TUNER_ABSENT, + .tuner_addr = ADDR_UNSET, }, [BTTV_BOARD_KOZUMI_KTV_01C] = { /* Mauro Lacy <mauro@lacy.com.ar> @@ -3021,17 +2766,15 @@ struct tvcard bttv_tvcards[] = { .name = "Kozumi KTV-01C", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, .gpiomask = 0x008007, - .muxsel = { 2, 3, 1, 1 }, + .muxsel = MUXSEL(2, 3, 1, 1), .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */ .gpiomute = 3, /* CONTVFMi */ .needs_tvaudio = 0, .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */ .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, .has_radio = 1, .has_remote = 1, @@ -3041,8 +2784,7 @@ struct tvcard bttv_tvcards[] = { Mauro Carvalho Chehab <mchehab@infradead.org */ .name = "Encore ENL TV-FM-2", .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, + /* .audio_inputs= 1, */ .svhs = 2, /* bit 6 -> IR disabled bit 18/17 = 00 -> mute @@ -3051,12 +2793,11 @@ struct tvcard bttv_tvcards[] = { 11 -> internal audio input */ .gpiomask = 0x060040, - .muxsel = { 2, 3, 3 }, + .muxsel = MUXSEL(2, 3, 3), .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 }, .gpiomute = 0, .tuner_type = TUNER_TCL_MF02GIP_5N, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, .pll = PLL_28, .has_radio = 1, .has_remote = 1, @@ -3065,50 +2806,111 @@ struct tvcard bttv_tvcards[] = { /* D.Heer@Phytec.de */ .name = "PHYTEC VD-012 (bt878)", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, /* card has no tuner */ - .svhs = UNSET, /* card has no s-video */ + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, .gpiomask = 0x00, - .muxsel = { 0, 2, 3, 1 }, + .muxsel = MUXSEL(0, 2, 3, 1), .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ .needs_tvaudio = 0, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_VD012_X1] = { /* D.Heer@Phytec.de */ .name = "PHYTEC VD-012-X1 (bt878)", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, /* card has no tuner */ + /* .audio_inputs= 0, */ .svhs = 3, .gpiomask = 0x00, - .muxsel = { 2, 3, 1 }, + .muxsel = MUXSEL(2, 3, 1), .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ .needs_tvaudio = 0, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, }, [BTTV_BOARD_VD012_X2] = { /* D.Heer@Phytec.de */ .name = "PHYTEC VD-012-X2 (bt878)", .video_inputs = 4, - .audio_inputs = 0, - .tuner = UNSET, /* card has no tuner */ + /* .audio_inputs= 0, */ .svhs = 3, .gpiomask = 0x00, - .muxsel = { 3, 2, 1 }, + .muxsel = MUXSEL(3, 2, 1), .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ .needs_tvaudio = 0, .pll = PLL_28, - .tuner_type = UNSET, + .tuner_type = TUNER_ABSENT, .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - } + }, + [BTTV_BOARD_GEOVISION_GV800S] = { + /* Bruno Christo <bchristo@inf.ufsm.br> + * + * GeoVision GV-800(S) has 4 Conexant Fusion 878A: + * 1 audio input per BT878A = 4 audio inputs + * 4 video inputs per BT878A = 16 video inputs + * This is the first BT878A chip of the GV-800(S). It's the + * "master" chip and it controls the video inputs through an + * analog multiplexer (a CD22M3494) via some GPIO pins. The + * slaves should use card type 0x9e (following this one). + * There is a EEPROM on the card which is currently not handled. + * The audio input is not working yet. + */ + .name = "Geovision GV-800(S) (master)", + .video_inputs = 4, + /* .audio_inputs= 1, */ + .tuner_type = TUNER_ABSENT, + .tuner_addr = ADDR_UNSET, + .svhs = NO_SVHS, + .gpiomask = 0xf107f, + .no_gpioirq = 1, + .muxsel = MUXSEL(2, 2, 2, 2), + .pll = PLL_28, + .no_msp34xx = 1, + .no_tda7432 = 1, + .no_tda9875 = 1, + .muxsel_hook = gv800s_muxsel, + }, + [BTTV_BOARD_GEOVISION_GV800S_SL] = { + /* Bruno Christo <bchristo@inf.ufsm.br> + * + * GeoVision GV-800(S) has 4 Conexant Fusion 878A: + * 1 audio input per BT878A = 4 audio inputs + * 4 video inputs per BT878A = 16 video inputs + * The 3 other BT878A chips are "slave" chips of the GV-800(S) + * and should use this card type. + * The audio input is not working yet. + */ + .name = "Geovision GV-800(S) (slave)", + .video_inputs = 4, + /* .audio_inputs= 1, */ + .tuner_type = TUNER_ABSENT, + .tuner_addr = ADDR_UNSET, + .svhs = NO_SVHS, + .gpiomask = 0x00, + .no_gpioirq = 1, + .muxsel = MUXSEL(2, 2, 2, 2), + .pll = PLL_28, + .no_msp34xx = 1, + .no_tda7432 = 1, + .no_tda9875 = 1, + .muxsel_hook = gv800s_muxsel, + }, + [BTTV_BOARD_PV183] = { + .name = "ProVideo PV183", /* 0x9f */ + .video_inputs = 2, + /* .audio_inputs= 0, */ + .svhs = NO_SVHS, + .gpiomask = 0, + .muxsel = MUXSEL(2, 3), + .gpiomux = { 0 }, + .needs_tvaudio = 0, + .no_msp34xx = 1, + .pll = PLL_28, + .tuner_type = TUNER_ABSENT, + .tuner_addr = ADDR_UNSET, + }, }; static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards); @@ -3152,7 +2954,7 @@ void __devinit bttv_idcard(struct bttv *btv) btv->c.nr, btv->cardid & 0xffff, (btv->cardid >> 16) & 0xffff); printk(KERN_DEBUG "please mail id, board name and " - "the correct card= insmod option to video4linux-list@redhat.com\n"); + "the correct card= insmod option to linux-media@vger.kernel.org\n"); } } @@ -3403,8 +3205,7 @@ static void init_ids_eagle(struct bttv *btv) * has its own multiplexer */ static void eagle_muxsel(struct bttv *btv, unsigned int input) { - btaor((2)<<5, ~(3<<5), BT848_IFORM); - gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]); + gpio_bits(3, input & 3); /* composite */ /* set chroma ADC to sleep */ @@ -3523,6 +3324,17 @@ void __devinit bttv_init_card1(struct bttv *btv) /* initialization part two -- after registering i2c bus */ void __devinit bttv_init_card2(struct bttv *btv) { + static const unsigned short tvaudio_addrs[] = { + I2C_ADDR_TDA8425 >> 1, + I2C_ADDR_TEA6300 >> 1, + I2C_ADDR_TEA6420 >> 1, + I2C_ADDR_TDA9840 >> 1, + I2C_ADDR_TDA985x_L >> 1, + I2C_ADDR_TDA985x_H >> 1, + I2C_ADDR_TDA9874 >> 1, + I2C_ADDR_PIC16C54 >> 1, + I2C_CLIENT_END + }; int addr=ADDR_UNSET; btv->tuner_type = UNSET; @@ -3629,6 +3441,9 @@ void __devinit bttv_init_card2(struct bttv *btv) case BTTV_BOARD_KODICOM_4400R: kodicom4400r_init(btv); break; + case BTTV_BOARD_GEOVISION_GV800S: + gv800s_init(btv); + break; } /* pll configuration */ @@ -3670,13 +3485,12 @@ void __devinit bttv_init_card2(struct bttv *btv) addr = bttv_tvcards[btv->c.type].tuner_addr; if (UNSET != bttv_tvcards[btv->c.type].tuner_type) - if(UNSET == btv->tuner_type) + if (UNSET == btv->tuner_type) btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type; if (UNSET != tuner[btv->c.nr]) btv->tuner_type = tuner[btv->c.nr]; - if (btv->tuner_type == TUNER_ABSENT || - bttv_tvcards[btv->c.type].tuner == UNSET) + if (btv->tuner_type == TUNER_ABSENT) printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr); else if(btv->tuner_type == UNSET) printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr); @@ -3684,14 +3498,35 @@ void __devinit bttv_init_card2(struct bttv *btv) printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr, btv->tuner_type); - if (btv->tuner_type != UNSET) { + if (autoload != UNSET) { + printk(KERN_WARNING "bttv%d: the autoload option is obsolete.\n", btv->c.nr); + printk(KERN_WARNING "bttv%d: use option msp3400, tda7432 or tvaudio to\n", btv->c.nr); + printk(KERN_WARNING "bttv%d: override which audio module should be used.\n", btv->c.nr); + } + + if (UNSET == btv->tuner_type) + btv->tuner_type = TUNER_ABSENT; + + if (btv->tuner_type != TUNER_ABSENT) { struct tuner_setup tun_setup; + /* Load tuner module before issuing tuner config call! */ + if (bttv_tvcards[btv->c.type].has_radio) + v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, + "tuner", "tuner", v4l2_i2c_tuner_addrs(ADDRS_RADIO)); + v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, "tuner", + "tuner", v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); + v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, "tuner", + "tuner", v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD)); + tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; tun_setup.type = btv->tuner_type; tun_setup.addr = addr; - bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup); + if (bttv_tvcards[btv->c.type].has_radio) + tun_setup.mode_mask |= T_RADIO; + + bttv_call_all(btv, tuner, s_type_addr, &tun_setup); } if (btv->tda9887_conf) { @@ -3700,10 +3535,13 @@ void __devinit bttv_init_card2(struct bttv *btv) tda9887_cfg.tuner = TUNER_TDA9887; tda9887_cfg.priv = &btv->tda9887_conf; - bttv_call_i2c_clients(btv, TUNER_SET_CONFIG, &tda9887_cfg); + bttv_call_all(btv, tuner, s_config, &tda9887_cfg); } - btv->svhs = bttv_tvcards[btv->c.type].svhs; + btv->dig = bttv_tvcards[btv->c.type].has_dig_in ? + bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET; + btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ? + UNSET : bttv_tvcards[btv->c.type].svhs; if (svhs[btv->c.nr] != UNSET) btv->svhs = svhs[btv->c.nr]; if (remote[btv->c.nr] != UNSET) @@ -3720,34 +3558,127 @@ void __devinit bttv_init_card2(struct bttv *btv) if (bttv_tvcards[btv->c.type].audio_mode_gpio) btv->audio_mode_gpio=bttv_tvcards[btv->c.type].audio_mode_gpio; - if (!autoload) - return; - - if (bttv_tvcards[btv->c.type].tuner == UNSET) + if (btv->tuner_type == TUNER_ABSENT) return; /* no tuner or related drivers to load */ + if (btv->has_saa6588 || saa6588[btv->c.nr]) { + /* Probe for RDS receiver chip */ + static const unsigned short addrs[] = { + 0x20 >> 1, + 0x22 >> 1, + I2C_CLIENT_END + }; + struct v4l2_subdev *sd; + + sd = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, + "saa6588", "saa6588", addrs); + btv->has_saa6588 = (sd != NULL); + } + /* try to detect audio/fader chips */ - if (!bttv_tvcards[btv->c.type].no_msp34xx && - bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0) - request_module("msp3400"); - if (bttv_tvcards[btv->c.type].msp34xx_alt && - bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0) - request_module("msp3400"); + /* First check if the user specified the audio chip via a module + option. */ + + switch (audiodev[btv->c.nr]) { + case -1: + return; /* do not load any audio module */ + + case 0: /* autodetect */ + break; + + case 1: { + /* The user specified that we should probe for msp3400 */ + static const unsigned short addrs[] = { + I2C_ADDR_MSP3400 >> 1, + I2C_ADDR_MSP3400_ALT >> 1, + I2C_CLIENT_END + }; + + btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, + "msp3400", "msp3400", addrs); + if (btv->sd_msp34xx) + return; + goto no_audio; + } + + case 2: { + /* The user specified that we should probe for tda7432 */ + static const unsigned short addrs[] = { + I2C_ADDR_TDA7432 >> 1, + I2C_CLIENT_END + }; + + if (v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, + "tda7432", "tda7432", addrs)) + return; + goto no_audio; + } + + case 3: { + /* The user specified that we should probe for tvaudio */ + btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, + "tvaudio", "tvaudio", tvaudio_addrs); + if (btv->sd_tvaudio) + return; + goto no_audio; + } + + default: + printk(KERN_WARNING "bttv%d: unknown audiodev value!\n", + btv->c.nr); + return; + } - if (!bttv_tvcards[btv->c.type].no_tda9875 && - bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0) - request_module("tda9875"); + /* There were no overrides, so now we try to discover this through the + card definition */ + + /* probe for msp3400 first: this driver can detect whether or not + it really is a msp3400, so it will return NULL when the device + found is really something else (e.g. a tea6300). */ + if (!bttv_tvcards[btv->c.type].no_msp34xx) { + static const unsigned short addrs[] = { + I2C_ADDR_MSP3400 >> 1, + I2C_CLIENT_END + }; + + btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, + "msp3400", "msp3400", addrs); + } else if (bttv_tvcards[btv->c.type].msp34xx_alt) { + static const unsigned short addrs[] = { + I2C_ADDR_MSP3400_ALT >> 1, + I2C_CLIENT_END + }; + + btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, + "msp3400", "msp3400", addrs); + } - if (!bttv_tvcards[btv->c.type].no_tda7432 && - bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0) - request_module("tda7432"); + /* If we found a msp34xx, then we're done. */ + if (btv->sd_msp34xx) + return; - if (bttv_tvcards[btv->c.type].needs_tvaudio) - request_module("tvaudio"); + /* it might also be a tda7432. */ + if (!bttv_tvcards[btv->c.type].no_tda7432) { + static const unsigned short addrs[] = { + I2C_ADDR_TDA7432 >> 1, + I2C_CLIENT_END + }; - if (btv->tuner_type != UNSET && btv->tuner_type != TUNER_ABSENT) - request_module("tuner"); + if (v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, + "tda7432", "tda7432", addrs)) + return; + } + + /* Now see if we can find one of the tvaudio devices. */ + btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, + "tvaudio", "tvaudio", tvaudio_addrs); + if (btv->sd_tvaudio) + return; + +no_audio: + printk(KERN_WARNING "bttv%d: audio absent, no audio device found!\n", + btv->c.nr); } @@ -3819,6 +3750,7 @@ static int terratec_active_radio_upgrade(struct bttv *btv) printk("bttv%d: Terratec Active Radio Upgrade found.\n", btv->c.nr); btv->has_radio = 1; + btv->has_saa6588 = 1; btv->has_matchbox = 1; } else { btv->has_radio = 0; @@ -4067,27 +3999,26 @@ static void __devinit avermedia_eeprom(struct bttv *btv) btv->has_remote ? "yes" : "no"); } -/* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */ -void bttv_tda9880_setnorm(struct bttv *btv, int norm) +/* + * For Voodoo TV/FM and Voodoo 200. These cards' tuners use a TDA9880 + * analog demod, which is not I2C controlled like the newer and more common + * TDA9887 series. Instead is has two tri-state input pins, S0 and S1, + * that control the IF for the video and audio. Apparently, bttv GPIO + * 0x10000 is connected to S0. S0 low selects a 38.9 MHz VIF for B/G/D/K/I + * (i.e., PAL) while high selects 45.75 MHz for M/N (i.e., NTSC). + */ +u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits) { - /* fix up our card entry */ - if(norm==V4L2_STD_NTSC) { - bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff; - bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x957fff; - bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff; - bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomute=0x957fff; - dprintk("bttv_tda9880_setnorm to NTSC\n"); - } - else { - bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff; - bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x947fff; - bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff; - bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomute=0x947fff; - dprintk("bttv_tda9880_setnorm to PAL\n"); + + if (btv->audio == TVAUDIO_INPUT_TUNER) { + if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN) + gpiobits |= 0x10000; + else + gpiobits &= ~0x10000; } - /* set GPIO according */ - gpio_bits(bttv_tvcards[btv->c.type].gpiomask, - bttv_tvcards[btv->c.type].gpiomux[btv->audio]); + + gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits); + return gpiobits; } @@ -4463,6 +4394,11 @@ void tea5757_set_freq(struct bttv *btv, unsigned short freq) */ static void rv605_muxsel(struct bttv *btv, unsigned int input) { + static const u8 muxgpio[] = { 0x3, 0x1, 0x2, 0x4, 0xf, 0x7, 0xe, 0x0, + 0xd, 0xb, 0xc, 0x6, 0x9, 0x5, 0x8, 0xa }; + + gpio_bits(0x07f, muxgpio[input]); + /* reset all conections */ gpio_bits(0x200,0x200); mdelay(1); @@ -4470,7 +4406,6 @@ static void rv605_muxsel(struct bttv *btv, unsigned int input) mdelay(1); /* create a new connection */ - gpio_bits(0x480,0x080); gpio_bits(0x480,0x480); mdelay(1); gpio_bits(0x480,0x080); @@ -4729,8 +4664,7 @@ static void ivc120_muxsel(struct bttv *btv, unsigned int input) bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02, ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */ - /* Selects MUX0 for input on the 878 */ - btaor((0)<<5, ~(3<<5), BT848_IFORM); + /* 878's MUX0 is already selected for input via muxsel values */ } @@ -4814,6 +4748,132 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input) printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux); } +static void phytec_muxsel(struct bttv *btv, unsigned int input) +{ + unsigned int mux = input % 4; + + if (input == btv->svhs) + mux = 0; + + gpio_bits(0x3, mux); +} + +/* + * GeoVision GV-800(S) functions + * Bruno Christo <bchristo@inf.ufsm.br> +*/ + +/* This is a function to control the analog switch, which determines which + * camera is routed to which controller. The switch comprises an X-address + * (gpio bits 0-3, representing the camera, ranging from 0-15), and a + * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3). + * A data value (gpio bit 18) of '1' enables the switch, and '0' disables + * the switch. A STROBE bit (gpio bit 17) latches the data value into the + * specified address. There is also a chip select (gpio bit 16). + * The idea is to set the address and chip select together, bring + * STROBE high, write the data, and finally bring STROBE back to low. + */ +static void gv800s_write(struct bttv *btv, + unsigned char xaddr, + unsigned char yaddr, + unsigned char data) { + /* On the "master" 878A: + * GPIO bits 0-9 are used for the analog switch: + * 00 - 03: camera selector + * 04 - 06: 878A (controller) selector + * 16: cselect + * 17: strobe + * 18: data (1->on, 0->off) + * 19: reset + */ + const u32 ADDRESS = ((xaddr&0xf) | (yaddr&3)<<4); + const u32 CSELECT = 1<<16; + const u32 STROBE = 1<<17; + const u32 DATA = data<<18; + + gpio_bits(0x1007f, ADDRESS | CSELECT); /* write ADDRESS and CSELECT */ + gpio_bits(0x20000, STROBE); /* STROBE high */ + gpio_bits(0x40000, DATA); /* write DATA */ + gpio_bits(0x20000, ~STROBE); /* STROBE low */ +} + +/* + * GeoVision GV-800(S) muxsel + * + * Each of the 4 cards (controllers) use this function. + * The controller using this function selects the input through the GPIO pins + * of the "master" card. A pointer to this card is stored in master[btv->c.nr]. + * + * The parameter 'input' is the requested camera number (0-4) on the controller. + * The map array has the address of each input. Note that the addresses in the + * array are in the sequence the original GeoVision driver uses, that is, set + * every controller to input 0, then to input 1, 2, 3, repeat. This means that + * the physical "camera 1" connector corresponds to controller 0 input 0, + * "camera 2" corresponds to controller 1 input 0, and so on. + * + * After getting the input address, the function then writes the appropriate + * data to the analog switch, and housekeeps the local copy of the switch + * information. + */ +static void gv800s_muxsel(struct bttv *btv, unsigned int input) +{ + struct bttv *mctlr; + char *sw_status; + int xaddr, yaddr; + static unsigned int map[4][4] = { { 0x0, 0x4, 0xa, 0x6 }, + { 0x1, 0x5, 0xb, 0x7 }, + { 0x2, 0x8, 0xc, 0xe }, + { 0x3, 0x9, 0xd, 0xf } }; + input = input%4; + mctlr = master[btv->c.nr]; + if (mctlr == NULL) { + /* do nothing until the "master" is detected */ + return; + } + yaddr = (btv->c.nr - mctlr->c.nr) & 3; + sw_status = (char *)(&mctlr->mbox_we); + xaddr = map[yaddr][input] & 0xf; + + /* Check if the controller/camera pair has changed, ignore otherwise */ + if (sw_status[yaddr] != xaddr) { + /* disable the old switch, enable the new one and save status */ + gv800s_write(mctlr, sw_status[yaddr], yaddr, 0); + sw_status[yaddr] = xaddr; + gv800s_write(mctlr, xaddr, yaddr, 1); + } +} + +/* GeoVision GV-800(S) "master" chip init */ +static void gv800s_init(struct bttv *btv) +{ + char *sw_status = (char *)(&btv->mbox_we); + int ix; + + gpio_inout(0xf107f, 0xf107f); + gpio_write(1<<19); /* reset the analog MUX */ + gpio_write(0); + + /* Preset camera 0 to the 4 controllers */ + for (ix = 0; ix < 4; ix++) { + sw_status[ix] = ix; + gv800s_write(btv, ix, ix, 1); + } + + /* Inputs on the "master" controller need this brightness fix */ + bttv_I2CWrite(btv, 0x18, 0x5, 0x90, 1); + + if (btv->c.nr > BTTV_MAX-4) + return; + /* + * Store the "master" controller pointer in the master + * array for later use in the muxsel function. + */ + master[btv->c.nr] = btv; + master[btv->c.nr+1] = btv; + master[btv->c.nr+2] = btv; + master[btv->c.nr+3] = btv; +} + /* ----------------------------------------------------------------------- */ /* motherboard chipset specific stuff */ diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index c71f394fc0e..7a8ca0d8356 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -58,7 +58,7 @@ unsigned int bttv_num; /* number of Bt848s in use */ -struct bttv bttvs[BTTV_MAX]; +struct bttv *bttvs[BTTV_MAX]; unsigned int bttv_debug; unsigned int bttv_verbose = 1; @@ -167,7 +167,7 @@ static ssize_t show_card(struct device *cd, struct device_attribute *attr, char *buf) { struct video_device *vfd = container_of(cd, struct video_device, dev); - struct bttv *btv = dev_get_drvdata(vfd->parent); + struct bttv *btv = video_get_drvdata(vfd); return sprintf(buf, "%d\n", btv ? btv->c.type : UNSET); } static DEVICE_ATTR(card, S_IRUGO, show_card, NULL); @@ -1040,7 +1040,7 @@ static void bt848A_set_timing(struct bttv *btv) int table_idx = bttv_tvnorms[btv->tvnorm].sram; int fsc = bttv_tvnorms[btv->tvnorm].Fsc; - if (UNSET == bttv_tvcards[btv->c.type].muxsel[btv->input]) { + if (btv->input == btv->dig) { dprintk("bttv%d: load digital timing table (table_idx=%d)\n", btv->c.nr,table_idx); @@ -1142,7 +1142,7 @@ video_mux(struct bttv *btv, unsigned int input) btand(~BT848_CONTROL_COMP, BT848_E_CONTROL); btand(~BT848_CONTROL_COMP, BT848_O_CONTROL); } - mux = bttv_tvcards[btv->c.type].muxsel[input] & 3; + mux = bttv_muxsel(btv, input); btaor(mux<<5, ~(3<<5), BT848_IFORM); dprintk(KERN_DEBUG "bttv%d: video mux: input=%d mux=%d\n", btv->c.nr,input,mux); @@ -1163,7 +1163,6 @@ audio_mux(struct bttv *btv, int input, int mute) { int gpio_val, signal; struct v4l2_control ctrl; - struct i2c_client *c; gpio_inout(bttv_tvcards[btv->c.type].gpiomask, bttv_tvcards[btv->c.type].gpiomask); @@ -1180,7 +1179,16 @@ audio_mux(struct bttv *btv, int input, int mute) else gpio_val = bttv_tvcards[btv->c.type].gpiomux[input]; - gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpio_val); + switch (btv->c.type) { + case BTTV_BOARD_VOODOOTV_FM: + case BTTV_BOARD_VOODOOTV_200: + gpio_val = bttv_tda9880_setnorm(btv, gpio_val); + break; + + default: + gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpio_val); + } + if (bttv_gpio) bttv_gpio_tracking(btv, audio_modes[mute ? 4 : input]); if (in_interrupt()) @@ -1188,9 +1196,8 @@ audio_mux(struct bttv *btv, int input, int mute) ctrl.id = V4L2_CID_AUDIO_MUTE; ctrl.value = btv->mute; - bttv_call_i2c_clients(btv, VIDIOC_S_CTRL, &ctrl); - c = btv->i2c_msp34xx_client; - if (c) { + bttv_call_all(btv, core, s_ctrl, &ctrl); + if (btv->sd_msp34xx) { struct v4l2_routing route; /* Note: the inputs tuner/radio/extern/intern are translated @@ -1229,15 +1236,14 @@ audio_mux(struct bttv *btv, int input, int mute) break; } route.output = MSP_OUTPUT_DEFAULT; - c->driver->command(c, VIDIOC_INT_S_AUDIO_ROUTING, &route); + v4l2_subdev_call(btv->sd_msp34xx, audio, s_routing, &route); } - c = btv->i2c_tvaudio_client; - if (c) { + if (btv->sd_tvaudio) { struct v4l2_routing route; route.input = input; route.output = 0; - c->driver->command(c, VIDIOC_INT_S_AUDIO_ROUTING, &route); + v4l2_subdev_call(btv->sd_tvaudio, audio, s_routing, &route); } return 0; } @@ -1277,7 +1283,7 @@ bttv_crop_calc_limits(struct bttv_crop *c) } static void -bttv_crop_reset(struct bttv_crop *c, int norm) +bttv_crop_reset(struct bttv_crop *c, unsigned int norm) { c->rect = bttv_tvnorms[norm].cropcap.defrect; bttv_crop_calc_limits(c); @@ -1290,16 +1296,13 @@ set_tvnorm(struct bttv *btv, unsigned int norm) const struct bttv_tvnorm *tvnorm; v4l2_std_id id; - if (norm < 0 || norm >= BTTV_TVNORMS) - return -EINVAL; + BUG_ON(norm >= BTTV_TVNORMS); + BUG_ON(btv->tvnorm >= BTTV_TVNORMS); tvnorm = &bttv_tvnorms[norm]; - if (btv->tvnorm < 0 || - btv->tvnorm >= BTTV_TVNORMS || - 0 != memcmp(&bttv_tvnorms[btv->tvnorm].cropcap, - &tvnorm->cropcap, - sizeof (tvnorm->cropcap))) { + if (!memcmp(&bttv_tvnorms[btv->tvnorm].cropcap, &tvnorm->cropcap, + sizeof (tvnorm->cropcap))) { bttv_crop_reset(&btv->crop[0], norm); btv->crop[1] = btv->crop[0]; /* current = default */ @@ -1322,11 +1325,11 @@ set_tvnorm(struct bttv *btv, unsigned int norm) switch (btv->c.type) { case BTTV_BOARD_VOODOOTV_FM: case BTTV_BOARD_VOODOOTV_200: - bttv_tda9880_setnorm(btv,norm); + bttv_tda9880_setnorm(btv, gpio_read()); break; } id = tvnorm->v4l2_id; - bttv_call_i2c_clients(btv, VIDIOC_S_STD, &id); + bttv_call_all(btv, tuner, s_std, id); return 0; } @@ -1350,8 +1353,8 @@ set_input(struct bttv *btv, unsigned int input, unsigned int norm) } else { video_mux(btv,input); } - audio_input(btv,(input == bttv_tvcards[btv->c.type].tuner ? - TVAUDIO_INPUT_TUNER : TVAUDIO_INPUT_EXTERN)); + audio_input(btv, (btv->tuner_type != TUNER_ABSENT && input == 0) ? + TVAUDIO_INPUT_TUNER : TVAUDIO_INPUT_EXTERN); set_tvnorm(btv, norm); } @@ -1470,7 +1473,7 @@ static int bttv_g_ctrl(struct file *file, void *priv, case V4L2_CID_AUDIO_BALANCE: case V4L2_CID_AUDIO_BASS: case V4L2_CID_AUDIO_TREBLE: - bttv_call_i2c_clients(btv, VIDIOC_G_CTRL, c); + bttv_call_all(btv, core, g_ctrl, c); break; case V4L2_CID_PRIVATE_CHROMA_AGC: @@ -1544,12 +1547,12 @@ static int bttv_s_ctrl(struct file *file, void *f, if (btv->volume_gpio) btv->volume_gpio(btv, c->value); - bttv_call_i2c_clients(btv, VIDIOC_S_CTRL, c); + bttv_call_all(btv, core, s_ctrl, c); break; case V4L2_CID_AUDIO_BALANCE: case V4L2_CID_AUDIO_BASS: case V4L2_CID_AUDIO_TREBLE: - bttv_call_i2c_clients(btv, VIDIOC_S_CTRL, c); + bttv_call_all(btv, core, s_ctrl, c); break; case V4L2_CID_PRIVATE_CHROMA_AGC: @@ -1888,20 +1891,15 @@ static int bttv_enum_input(struct file *file, void *priv, { struct bttv_fh *fh = priv; struct bttv *btv = fh->btv; - unsigned int n; - - n = i->index; + int n; - if (n >= bttv_tvcards[btv->c.type].video_inputs) + if (i->index >= bttv_tvcards[btv->c.type].video_inputs) return -EINVAL; - memset(i, 0, sizeof(*i)); - - i->index = n; i->type = V4L2_INPUT_TYPE_CAMERA; i->audioset = 1; - if (i->index == bttv_tvcards[btv->c.type].tuner) { + if (btv->tuner_type != TUNER_ABSENT && i->index == 0) { sprintf(i->name, "Television"); i->type = V4L2_INPUT_TYPE_TUNER; i->tuner = 0; @@ -1965,14 +1963,14 @@ static int bttv_s_tuner(struct file *file, void *priv, if (0 != err) return err; - if (UNSET == bttv_tvcards[btv->c.type].tuner) + if (btv->tuner_type == TUNER_ABSENT) return -EINVAL; if (0 != t->index) return -EINVAL; mutex_lock(&btv->lock); - bttv_call_i2c_clients(btv, VIDIOC_S_TUNER, t); + bttv_call_all(btv, tuner, s_tuner, t); if (btv->audio_mode_gpio) btv->audio_mode_gpio(btv, t, 1); @@ -2017,7 +2015,7 @@ static int bttv_s_frequency(struct file *file, void *priv, return -EINVAL; mutex_lock(&btv->lock); btv->freq = f->frequency; - bttv_call_i2c_clients(btv, VIDIOC_S_FREQUENCY, f); + bttv_call_all(btv, tuner, s_frequency, f); if (btv->has_matchbox && btv->radio_user) tea5757_set_freq(btv, btv->freq); mutex_unlock(&btv->lock); @@ -2031,7 +2029,7 @@ static int bttv_log_status(struct file *file, void *f) printk(KERN_INFO "bttv%d: ======== START STATUS CARD #%d ========\n", btv->c.nr, btv->c.nr); - bttv_call_i2c_clients(btv, VIDIOC_LOG_STATUS, NULL); + bttv_call_all(btv, core, log_status); printk(KERN_INFO "bttv%d: ======== END STATUS CARD #%d ========\n", btv->c.nr, btv->c.nr); return 0; @@ -2659,8 +2657,7 @@ static int bttv_querycap(struct file *file, void *priv, if (no_overlay <= 0) cap->capabilities |= V4L2_CAP_VIDEO_OVERLAY; - if (bttv_tvcards[btv->c.type].tuner != UNSET && - bttv_tvcards[btv->c.type].tuner != TUNER_ABSENT) + if (btv->tuner_type != TUNER_ABSENT) cap->capabilities |= V4L2_CAP_TUNER; return 0; } @@ -2927,13 +2924,9 @@ static int bttv_g_parm(struct file *file, void *f, { struct bttv_fh *fh = f; struct bttv *btv = fh->btv; - struct v4l2_standard s; - if (parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) - return -EINVAL; - v4l2_video_std_construct(&s, bttv_tvnorms[btv->tvnorm].v4l2_id, - bttv_tvnorms[btv->tvnorm].name); - parm->parm.capture.timeperframe = s.frameperiod; + v4l2_video_std_frame_period(bttv_tvnorms[btv->tvnorm].v4l2_id, + &parm->parm.capture.timeperframe); return 0; } @@ -2943,15 +2936,14 @@ static int bttv_g_tuner(struct file *file, void *priv, struct bttv_fh *fh = priv; struct bttv *btv = fh->btv; - if (UNSET == bttv_tvcards[btv->c.type].tuner) + if (btv->tuner_type == TUNER_ABSENT) return -EINVAL; if (0 != t->index) return -EINVAL; mutex_lock(&btv->lock); - memset(t, 0, sizeof(*t)); t->rxsubchans = V4L2_TUNER_SUB_MONO; - bttv_call_i2c_clients(btv, VIDIOC_G_TUNER, t); + bttv_call_all(btv, tuner, g_tuner, t); strcpy(t->name, "Television"); t->capability = V4L2_TUNER_CAP_NORM; t->type = V4L2_TUNER_ANALOG_TV; @@ -3212,29 +3204,19 @@ err: static int bttv_open(struct file *file) { int minor = video_devdata(file)->minor; - struct bttv *btv = NULL; + struct bttv *btv = video_drvdata(file); struct bttv_fh *fh; enum v4l2_buf_type type = 0; - unsigned int i; dprintk(KERN_DEBUG "bttv: open minor=%d\n",minor); lock_kernel(); - for (i = 0; i < bttv_num; i++) { - if (bttvs[i].video_dev && - bttvs[i].video_dev->minor == minor) { - btv = &bttvs[i]; - type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - break; - } - if (bttvs[i].vbi_dev && - bttvs[i].vbi_dev->minor == minor) { - btv = &bttvs[i]; - type = V4L2_BUF_TYPE_VBI_CAPTURE; - break; - } - } - if (NULL == btv) { + if (btv->video_dev->minor == minor) { + type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + } else if (btv->vbi_dev->minor == minor) { + type = V4L2_BUF_TYPE_VBI_CAPTURE; + } else { + WARN_ON(1); unlock_kernel(); return -ENODEV; } @@ -3424,20 +3406,14 @@ static struct video_device bttv_video_template = { static int radio_open(struct file *file) { int minor = video_devdata(file)->minor; - struct bttv *btv = NULL; + struct bttv *btv = video_drvdata(file); struct bttv_fh *fh; - unsigned int i; dprintk("bttv: open minor=%d\n",minor); lock_kernel(); - for (i = 0; i < bttv_num; i++) { - if (bttvs[i].radio_dev && bttvs[i].radio_dev->minor == minor) { - btv = &bttvs[i]; - break; - } - } - if (NULL == btv) { + WARN_ON(btv->radio_dev && btv->radio_dev->minor != minor); + if (!btv->radio_dev || btv->radio_dev->minor != minor) { unlock_kernel(); return -ENODEV; } @@ -3458,7 +3434,7 @@ static int radio_open(struct file *file) btv->radio_user++; - bttv_call_i2c_clients(btv,AUDC_SET_RADIO,NULL); + bttv_call_all(btv, tuner, s_radio); audio_input(btv,TVAUDIO_INPUT_RADIO); mutex_unlock(&btv->lock); @@ -3478,7 +3454,7 @@ static int radio_release(struct file *file) btv->radio_user--; - bttv_call_i2c_clients(btv, RDS_CMD_CLOSE, &cmd); + bttv_call_all(btv, core, ioctl, RDS_CMD_CLOSE, &cmd); return 0; } @@ -3503,16 +3479,15 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t) struct bttv_fh *fh = priv; struct bttv *btv = fh->btv; - if (UNSET == bttv_tvcards[btv->c.type].tuner) + if (btv->tuner_type == TUNER_ABSENT) return -EINVAL; if (0 != t->index) return -EINVAL; mutex_lock(&btv->lock); - memset(t, 0, sizeof(*t)); strcpy(t->name, "Radio"); t->type = V4L2_TUNER_RADIO; - bttv_call_i2c_clients(btv, VIDIOC_G_TUNER, t); + bttv_call_all(btv, tuner, g_tuner, t); if (btv->audio_mode_gpio) btv->audio_mode_gpio(btv, t, 0); @@ -3554,7 +3529,7 @@ static int radio_s_tuner(struct file *file, void *priv, if (0 != t->index) return -EINVAL; - bttv_call_i2c_clients(btv, VIDIOC_G_TUNER, t); + bttv_call_all(btv, tuner, g_tuner, t); return 0; } @@ -3615,7 +3590,7 @@ static ssize_t radio_read(struct file *file, char __user *data, cmd.instance = file; cmd.result = -ENODEV; - bttv_call_i2c_clients(btv, RDS_CMD_READ, &cmd); + bttv_call_all(btv, core, ioctl, RDS_CMD_READ, &cmd); return cmd.result; } @@ -3628,7 +3603,7 @@ static unsigned int radio_poll(struct file *file, poll_table *wait) cmd.instance = file; cmd.event_list = wait; cmd.result = -ENODEV; - bttv_call_i2c_clients(btv, RDS_CMD_POLL, &cmd); + bttv_call_all(btv, core, ioctl, RDS_CMD_POLL, &cmd); return cmd.result; } @@ -3712,14 +3687,14 @@ static void bttv_risc_disasm(struct bttv *btv, unsigned int i,j,n; printk("%s: risc disasm: %p [dma=0x%08lx]\n", - btv->c.name, risc->cpu, (unsigned long)risc->dma); + btv->c.v4l2_dev.name, risc->cpu, (unsigned long)risc->dma); for (i = 0; i < (risc->size >> 2); i += n) { - printk("%s: 0x%lx: ", btv->c.name, + printk("%s: 0x%lx: ", btv->c.v4l2_dev.name, (unsigned long)(risc->dma + (i<<2))); n = bttv_risc_decode(le32_to_cpu(risc->cpu[i])); for (j = 1; j < n; j++) printk("%s: 0x%lx: 0x%08x [ arg #%d ]\n", - btv->c.name, (unsigned long)(risc->dma + ((i+j)<<2)), + btv->c.v4l2_dev.name, (unsigned long)(risc->dma + ((i+j)<<2)), risc->cpu[i+j], j); if (0 == risc->cpu[i]) break; @@ -4195,9 +4170,10 @@ static struct video_device *vdev_init(struct bttv *btv, return NULL; *vfd = *template; vfd->minor = -1; - vfd->parent = &btv->c.pci->dev; + vfd->v4l2_dev = &btv->c.v4l2_dev; vfd->release = video_device_release; vfd->debug = bttv_debug; + video_set_drvdata(vfd, btv); snprintf(vfd->name, sizeof(vfd->name), "BT%d%s %s (%s)", btv->id, (btv->id==848 && btv->revision==0x12) ? "A" : "", type_name, bttv_tvcards[btv->c.type].name); @@ -4307,10 +4283,14 @@ static int __devinit bttv_probe(struct pci_dev *dev, if (bttv_num == BTTV_MAX) return -ENOMEM; printk(KERN_INFO "bttv: Bt8xx card found (%d).\n", bttv_num); - btv=&bttvs[bttv_num]; - memset(btv,0,sizeof(*btv)); + bttvs[bttv_num] = btv = kzalloc(sizeof(*btv), GFP_KERNEL); + if (btv == NULL) { + printk(KERN_ERR "bttv: out of memory.\n"); + return -ENOMEM; + } btv->c.nr = bttv_num; - sprintf(btv->c.name,"bttv%d",btv->c.nr); + snprintf(btv->c.v4l2_dev.name, sizeof(btv->c.v4l2_dev.name), + "bttv%d", btv->c.nr); /* initialize structs / fill in defaults */ mutex_init(&btv->lock); @@ -4347,7 +4327,7 @@ static int __devinit bttv_probe(struct pci_dev *dev, } if (!request_mem_region(pci_resource_start(dev,0), pci_resource_len(dev,0), - btv->c.name)) { + btv->c.v4l2_dev.name)) { printk(KERN_WARNING "bttv%d: can't request iomem (0x%llx).\n", btv->c.nr, (unsigned long long)pci_resource_start(dev,0)); @@ -4355,7 +4335,12 @@ static int __devinit bttv_probe(struct pci_dev *dev, } pci_set_master(dev); pci_set_command(dev); - pci_set_drvdata(dev,btv); + + result = v4l2_device_register(&dev->dev, &btv->c.v4l2_dev); + if (result < 0) { + printk(KERN_WARNING "bttv%d: v4l2_device_register() failed\n", btv->c.nr); + goto fail0; + } pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); @@ -4379,7 +4364,7 @@ static int __devinit bttv_probe(struct pci_dev *dev, /* disable irqs, register irq handler */ btwrite(0, BT848_INT_MASK); result = request_irq(btv->c.pci->irq, bttv_irq, - IRQF_SHARED | IRQF_DISABLED,btv->c.name,(void *)btv); + IRQF_SHARED | IRQF_DISABLED, btv->c.v4l2_dev.name, (void *)btv); if (result < 0) { printk(KERN_ERR "bttv%d: can't get IRQ %d\n", bttv_num,btv->c.pci->irq); @@ -4463,21 +4448,24 @@ static int __devinit bttv_probe(struct pci_dev *dev, bttv_num++; return 0; - fail2: +fail2: free_irq(btv->c.pci->irq,btv); - fail1: +fail1: + v4l2_device_unregister(&btv->c.v4l2_dev); + +fail0: if (btv->bt848_mmio) iounmap(btv->bt848_mmio); release_mem_region(pci_resource_start(btv->c.pci,0), pci_resource_len(btv->c.pci,0)); - pci_set_drvdata(dev,NULL); return result; } static void __devexit bttv_remove(struct pci_dev *pci_dev) { - struct bttv *btv = pci_get_drvdata(pci_dev); + struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); + struct bttv *btv = to_bttv(v4l2_dev); if (bttv_verbose) printk("bttv%d: unloading\n",btv->c.nr); @@ -4511,14 +4499,18 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev) release_mem_region(pci_resource_start(btv->c.pci,0), pci_resource_len(btv->c.pci,0)); - pci_set_drvdata(pci_dev, NULL); + v4l2_device_unregister(&btv->c.v4l2_dev); + bttvs[btv->c.nr] = NULL; + kfree(btv); + return; } #ifdef CONFIG_PM static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state) { - struct bttv *btv = pci_get_drvdata(pci_dev); + struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); + struct bttv *btv = to_bttv(v4l2_dev); struct bttv_buffer_set idle; unsigned long flags; @@ -4553,7 +4545,8 @@ static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state) static int bttv_resume(struct pci_dev *pci_dev) { - struct bttv *btv = pci_get_drvdata(pci_dev); + struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); + struct bttv *btv = to_bttv(v4l2_dev); unsigned long flags; int err; diff --git a/drivers/media/video/bt8xx/bttv-i2c.c b/drivers/media/video/bt8xx/bttv-i2c.c index bcd2cd240a1..a99d92fac3d 100644 --- a/drivers/media/video/bt8xx/bttv-i2c.c +++ b/drivers/media/video/bt8xx/bttv-i2c.c @@ -36,8 +36,6 @@ #include <linux/jiffies.h> #include <asm/io.h> -static int attach_inform(struct i2c_client *client); - static int i2c_debug; static int i2c_hw; static int i2c_scan; @@ -231,7 +229,8 @@ bttv_i2c_readbytes(struct bttv *btv, const struct i2c_msg *msg, int last) static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { - struct bttv *btv = i2c_get_adapdata(i2c_adap); + struct v4l2_device *v4l2_dev = i2c_get_adapdata(i2c_adap); + struct bttv *btv = to_bttv(v4l2_dev); int retval = 0; int i; @@ -265,52 +264,6 @@ static const struct i2c_algorithm bttv_algo = { /* ----------------------------------------------------------------------- */ /* I2C functions - common stuff */ -static int attach_inform(struct i2c_client *client) -{ - struct bttv *btv = i2c_get_adapdata(client->adapter); - int addr=ADDR_UNSET; - - - if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr) - addr = bttv_tvcards[btv->c.type].tuner_addr; - - - if (bttv_debug) - printk(KERN_DEBUG "bttv%d: %s i2c attach [addr=0x%x,client=%s]\n", - btv->c.nr, client->driver->driver.name, client->addr, - client->name); - if (!client->driver->command) - return 0; - - if (client->driver->id == I2C_DRIVERID_MSP3400) - btv->i2c_msp34xx_client = client; - if (client->driver->id == I2C_DRIVERID_TVAUDIO) - btv->i2c_tvaudio_client = client; - if (btv->tuner_type != UNSET) { - struct tuner_setup tun_setup; - - if ((addr==ADDR_UNSET) || - (addr==client->addr)) { - - tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV | T_RADIO; - tun_setup.type = btv->tuner_type; - tun_setup.addr = addr; - bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup); - } - - } - - return 0; -} - -void bttv_call_i2c_clients(struct bttv *btv, unsigned int cmd, void *arg) -{ - if (0 != btv->i2c_rc) - return; - i2c_clients_command(&btv->c.i2c_adap, cmd, arg); -} - - /* read I2C */ int bttv_I2CRead(struct bttv *btv, unsigned char addr, char *probe_for) { @@ -417,21 +370,15 @@ int __devinit init_bttv_i2c(struct bttv *btv) btv->c.i2c_adap.algo_data = &btv->i2c_algo; } btv->c.i2c_adap.owner = THIS_MODULE; - btv->c.i2c_adap.class = I2C_CLASS_TV_ANALOG; - btv->c.i2c_adap.client_register = attach_inform; btv->c.i2c_adap.dev.parent = &btv->c.pci->dev; snprintf(btv->c.i2c_adap.name, sizeof(btv->c.i2c_adap.name), "bt%d #%d [%s]", btv->id, btv->c.nr, btv->use_i2c_hw ? "hw" : "sw"); - i2c_set_adapdata(&btv->c.i2c_adap, btv); + i2c_set_adapdata(&btv->c.i2c_adap, &btv->c.v4l2_dev); btv->i2c_client.adapter = &btv->c.i2c_adap; - if (bttv_tvcards[btv->c.type].no_video) - btv->c.i2c_adap.class &= ~I2C_CLASS_TV_ANALOG; - if (bttv_tvcards[btv->c.type].has_dvb) - btv->c.i2c_adap.class |= I2C_CLASS_TV_DIGITAL; if (btv->use_i2c_hw) { btv->i2c_rc = i2c_add_adapter(&btv->c.i2c_adap); @@ -441,7 +388,7 @@ int __devinit init_bttv_i2c(struct bttv *btv) btv->i2c_rc = i2c_bit_add_bus(&btv->c.i2c_adap); } if (0 == btv->i2c_rc && i2c_scan) - do_i2c_scan(btv->c.name,&btv->i2c_client); + do_i2c_scan(btv->c.v4l2_dev.name, &btv->i2c_client); return btv->i2c_rc; } diff --git a/drivers/media/video/bt8xx/bttv-if.c b/drivers/media/video/bt8xx/bttv-if.c index ecf07988cd3..a6a540dc9e4 100644 --- a/drivers/media/video/bt8xx/bttv-if.c +++ b/drivers/media/video/bt8xx/bttv-if.c @@ -47,7 +47,10 @@ struct pci_dev* bttv_get_pcidev(unsigned int card) { if (card >= bttv_num) return NULL; - return bttvs[card].c.pci; + if (!bttvs[card]) + return NULL; + + return bttvs[card]->c.pci; } @@ -59,7 +62,10 @@ int bttv_gpio_enable(unsigned int card, unsigned long mask, unsigned long data) return -EINVAL; } - btv = &bttvs[card]; + btv = bttvs[card]; + if (!btv) + return -ENODEV; + gpio_inout(mask,data); if (bttv_gpio) bttv_gpio_tracking(btv,"extern enable"); @@ -74,7 +80,9 @@ int bttv_read_gpio(unsigned int card, unsigned long *data) return -EINVAL; } - btv = &bttvs[card]; + btv = bttvs[card]; + if (!btv) + return -ENODEV; if(btv->shutdown) { return -ENODEV; @@ -94,7 +102,9 @@ int bttv_write_gpio(unsigned int card, unsigned long mask, unsigned long data) return -EINVAL; } - btv = &bttvs[card]; + btv = bttvs[card]; + if (!btv) + return -ENODEV; /* prior setting BT848_GPIO_REG_INP is (probably) not needed because direct input is set on init */ diff --git a/drivers/media/video/bt8xx/bttv-risc.c b/drivers/media/video/bt8xx/bttv-risc.c index 5b1b8e4c78b..d16af283637 100644 --- a/drivers/media/video/bt8xx/bttv-risc.c +++ b/drivers/media/video/bt8xx/bttv-risc.c @@ -341,7 +341,7 @@ bttv_calc_geo_old(struct bttv *btv, struct bttv_geometry *geo, int totalwidth = tvnorm->totalwidth; int scaledtwidth = tvnorm->scaledtwidth; - if (bttv_tvcards[btv->c.type].muxsel[btv->input] < 0) { + if (btv->input == btv->dig) { swidth = 720; totalwidth = 858; scaledtwidth = 858; @@ -391,7 +391,7 @@ bttv_calc_geo (struct bttv * btv, && crop->width == tvnorm->cropcap.defrect.width && crop->height == tvnorm->cropcap.defrect.height && width <= tvnorm->swidth /* see PAL-Nc et al */) - || bttv_tvcards[btv->c.type].muxsel[btv->input] < 0) { + || btv->input == btv->dig) { bttv_calc_geo_old(btv, geo, width, height, both_fields, tvnorm); return; diff --git a/drivers/media/video/bt8xx/bttv-vbi.c b/drivers/media/video/bt8xx/bttv-vbi.c index 6819e21a377..e79a402fa6c 100644 --- a/drivers/media/video/bt8xx/bttv-vbi.c +++ b/drivers/media/video/bt8xx/bttv-vbi.c @@ -411,7 +411,7 @@ int bttv_g_fmt_vbi_cap(struct file *file, void *f, struct v4l2_format *frt) return 0; } -void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, int norm) +void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, unsigned int norm) { const struct bttv_tvnorm *tvnorm; unsigned int real_samples_per_line; diff --git a/drivers/media/video/bt8xx/bttv.h b/drivers/media/video/bt8xx/bttv.h index 529bf6cf634..3d36daf206f 100644 --- a/drivers/media/video/bt8xx/bttv.h +++ b/drivers/media/video/bt8xx/bttv.h @@ -14,8 +14,9 @@ #ifndef _BTTV_H_ #define _BTTV_H_ -#include <linux/videodev.h> +#include <linux/videodev2.h> #include <linux/i2c.h> +#include <media/v4l2-device.h> #include <media/ir-common.h> #include <media/ir-kbd-i2c.h> #include <media/i2c-addr.h> @@ -180,6 +181,10 @@ #define BTTV_BOARD_VD012 0x99 #define BTTV_BOARD_VD012_X1 0x9a #define BTTV_BOARD_VD012_X2 0x9b +#define BTTV_BOARD_IVCE8784 0x9c +#define BTTV_BOARD_GEOVISION_GV800S 0x9d +#define BTTV_BOARD_GEOVISION_GV800S_SL 0x9e +#define BTTV_BOARD_PV183 0x9f /* more card-specific defines */ @@ -191,12 +196,9 @@ #define WINVIEW_PT2254_DATA 0x20 #define WINVIEW_PT2254_STROBE 0x80 -/* digital_mode */ -#define DIGITAL_MODE_VIDEO 1 -#define DIGITAL_MODE_CAMERA 2 - struct bttv_core { /* device structs */ + struct v4l2_device v4l2_dev; struct pci_dev *pci; struct i2c_adapter i2c_adap; struct list_head subs; /* struct bttv_sub_device */ @@ -204,59 +206,79 @@ struct bttv_core { /* device config */ unsigned int nr; /* dev nr (for printk("bttv%d: ..."); */ unsigned int type; /* card type (pointer into tvcards[]) */ - char name[8]; /* dev name */ }; struct bttv; - -struct tvcard -{ +struct tvcard { char *name; - unsigned int video_inputs; - unsigned int audio_inputs; - unsigned int tuner; - unsigned int svhs; - unsigned int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO + void (*volume_gpio)(struct bttv *btv, __u16 volume); + void (*audio_mode_gpio)(struct bttv *btv, struct v4l2_tuner *tuner, int set); + void (*muxsel_hook)(struct bttv *btv, unsigned int input); + + /* MUX bits for each input, two bits per input starting with the LSB */ + u32 muxsel; /* Use MUXSEL() to set */ + u32 gpiomask; - u32 muxsel[16]; u32 gpiomux[4]; /* Tuner, Radio, external, internal */ u32 gpiomute; /* GPIO mute setting */ u32 gpiomask2; /* GPIO MUX mask */ + unsigned int tuner_type; + u8 tuner_addr; + u8 video_inputs; /* Number of inputs */ + unsigned int svhs:4; /* Which input is s-video */ +#define NO_SVHS 15 + unsigned int pll:2; +#define PLL_NONE 0 +#define PLL_28 1 +#define PLL_35 2 + /* i2c audio flags */ unsigned int no_msp34xx:1; unsigned int no_tda9875:1; unsigned int no_tda7432:1; unsigned int needs_tvaudio:1; unsigned int msp34xx_alt:1; + /* Note: currently no card definition needs to mark the presence + of a RDS saa6588 chip. If this is ever needed, then add a new + 'has_saa6588' bit here. */ - /* flag: video pci function is unused */ - unsigned int no_video:1; + unsigned int no_video:1; /* video pci function is unused */ unsigned int has_dvb:1; unsigned int has_remote:1; + unsigned int has_radio:1; + unsigned int has_dig_in:1; /* Has digital input (always last input) */ unsigned int no_gpioirq:1; - - /* other settings */ - unsigned int pll; -#define PLL_NONE 0 -#define PLL_28 1 -#define PLL_35 2 - - unsigned int tuner_type; - unsigned int tuner_addr; - unsigned int radio_addr; - - unsigned int has_radio; - - void (*volume_gpio)(struct bttv *btv, __u16 volume); - void (*audio_mode_gpio)(struct bttv *btv, struct v4l2_tuner *tuner, int set); - - void (*muxsel_hook)(struct bttv *btv, unsigned int input); }; extern struct tvcard bttv_tvcards[]; +/* + * This bit of cpp voodoo is used to create a macro with a variable number of + * arguments (1 to 16). It will pack each argument into a word two bits at a + * time. It can't be a function because it needs to be compile time constant to + * initialize structures. Since each argument must fit in two bits, it's ok + * that they are changed to octal. One should not use hex number, macros, or + * anything else with this macro. Just use plain integers from 0 to 3. + */ +#define _MUXSELf(a) 0##a << 30 +#define _MUXSELe(a, b...) 0##a << 28 | _MUXSELf(b) +#define _MUXSELd(a, b...) 0##a << 26 | _MUXSELe(b) +#define _MUXSELc(a, b...) 0##a << 24 | _MUXSELd(b) +#define _MUXSELb(a, b...) 0##a << 22 | _MUXSELc(b) +#define _MUXSELa(a, b...) 0##a << 20 | _MUXSELb(b) +#define _MUXSEL9(a, b...) 0##a << 18 | _MUXSELa(b) +#define _MUXSEL8(a, b...) 0##a << 16 | _MUXSEL9(b) +#define _MUXSEL7(a, b...) 0##a << 14 | _MUXSEL8(b) +#define _MUXSEL6(a, b...) 0##a << 12 | _MUXSEL7(b) +#define _MUXSEL5(a, b...) 0##a << 10 | _MUXSEL6(b) +#define _MUXSEL4(a, b...) 0##a << 8 | _MUXSEL5(b) +#define _MUXSEL3(a, b...) 0##a << 6 | _MUXSEL4(b) +#define _MUXSEL2(a, b...) 0##a << 4 | _MUXSEL3(b) +#define _MUXSEL1(a, b...) 0##a << 2 | _MUXSEL2(b) +#define MUXSEL(a, b...) (a | _MUXSEL1(b)) + /* identification / initialization of the card */ extern void bttv_idcard(struct bttv *btv); extern void bttv_init_card1(struct bttv *btv); @@ -264,7 +286,7 @@ extern void bttv_init_card2(struct bttv *btv); /* card-specific funtions */ extern void tea5757_set_freq(struct bttv *btv, unsigned short freq); -extern void bttv_tda9880_setnorm(struct bttv *btv, int norm); +extern u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits); /* extra tweaks for some chipsets */ extern void bttv_check_chipset(void); @@ -336,7 +358,9 @@ void bttv_gpio_bits(struct bttv_core *core, u32 mask, u32 bits); /* ---------------------------------------------------------- */ /* i2c */ -extern void bttv_call_i2c_clients(struct bttv *btv, unsigned int cmd, void *arg); +#define bttv_call_all(btv, o, f, args...) \ + v4l2_device_call_all(&btv->c.v4l2_dev, 0, o, f, ##args) + extern int bttv_I2CRead(struct bttv *btv, unsigned char addr, char *probe_for); extern int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1, unsigned char b2, int both); diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h index 199a4d225ca..96498489199 100644 --- a/drivers/media/video/bt8xx/bttvp.h +++ b/drivers/media/video/bt8xx/bttvp.h @@ -32,7 +32,6 @@ #include <linux/wait.h> #include <linux/i2c.h> #include <linux/i2c-algo-bit.h> -#include <linux/videodev.h> #include <linux/pci.h> #include <linux/input.h> #include <linux/mutex.h> @@ -135,7 +134,7 @@ struct bttv_buffer { /* bttv specific */ const struct bttv_format *fmt; - int tvnorm; + unsigned int tvnorm; int btformat; int btswap; struct bttv_geometry geo; @@ -154,7 +153,7 @@ struct bttv_buffer_set { }; struct bttv_overlay { - int tvnorm; + unsigned int tvnorm; struct v4l2_rect w; enum v4l2_field field; struct v4l2_clip *clips; @@ -174,7 +173,7 @@ struct bttv_vbi_fmt { }; /* bttv-vbi.c */ -void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, int norm); +void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, unsigned int norm); struct bttv_crop { /* A cropping rectangle in struct bttv_tvnorm.cropcap units. */ @@ -329,7 +328,8 @@ struct bttv { unsigned int cardid; /* pci subsystem id (bt878 based ones) */ unsigned int tuner_type; /* tuner chip type */ unsigned int tda9887_conf; - unsigned int svhs; + unsigned int svhs, dig; + unsigned int has_saa6588:1; struct bttv_pll_info pll; int triton1; int gpioirq; @@ -353,8 +353,8 @@ struct bttv { int i2c_state, i2c_rc; int i2c_done; wait_queue_head_t i2c_queue; - struct i2c_client *i2c_msp34xx_client; - struct i2c_client *i2c_tvaudio_client; + struct v4l2_subdev *sd_msp34xx; + struct v4l2_subdev *sd_tvaudio; /* video4linux (1) */ struct video_device *video_dev; @@ -378,7 +378,8 @@ struct bttv { unsigned int audio; unsigned int mute; unsigned long freq; - int tvnorm,hue,contrast,bright,saturation; + unsigned int tvnorm; + int hue, contrast, bright, saturation; struct v4l2_framebuffer fbuf; unsigned int field_count; @@ -458,10 +459,21 @@ struct bttv { __s32 crop_start; }; +static inline struct bttv *to_bttv(struct v4l2_device *v4l2_dev) +{ + return container_of(v4l2_dev, struct bttv, c.v4l2_dev); +} + /* our devices */ #define BTTV_MAX 32 extern unsigned int bttv_num; -extern struct bttv bttvs[BTTV_MAX]; +extern struct bttv *bttvs[BTTV_MAX]; + +static inline unsigned int bttv_muxsel(const struct bttv *btv, + unsigned int input) +{ + return (bttv_tvcards[btv->c.type].muxsel >> (input * 2)) & 3; +} #endif |