bktr_core.c (39040) | bktr_core.c (39041) |
---|---|
1/* BT848 1.52 Driver for Brooktree's Bt848 based cards. | 1/* BT848 1.53 Driver for Brooktree's Bt848 based cards. |
2 The Brooktree BT848 Driver driver is based upon Mark Tinguely and 3 Jim Lowe's driver for the Matrox Meteor PCI card . The 4 Philips SAA 7116 and SAA 7196 are very different chipsets than 5 the BT848. For starters, the BT848 is a one chipset solution and 6 it incorporates a RISC engine to control the DMA transfers -- 7 that is it the actual dma process is control by a program which 8 resides in the hosts memory also the register definitions between 9 the Philips chipsets and the Bt848 are very different. --- 287 unchanged lines hidden (view full) --- 297 Removed Hauppauge EEPROM 0x10 detection as I think 298 0x10 should be a PAL tuner, not NTSC. 299 Reinstated some Tuner Guesswork code from 1.27 300 3011.52 3 Sep 1998 Roger Hardiman <roger@cs.strath.ac.uk> 302 Submitted patch by Vsevolod Lobko <seva@alex-ua.com> 303 to correct SECAM B-Delay and add XUSSR channel set. 304 | 2 The Brooktree BT848 Driver driver is based upon Mark Tinguely and 3 Jim Lowe's driver for the Matrox Meteor PCI card . The 4 Philips SAA 7116 and SAA 7196 are very different chipsets than 5 the BT848. For starters, the BT848 is a one chipset solution and 6 it incorporates a RISC engine to control the DMA transfers -- 7 that is it the actual dma process is control by a program which 8 resides in the hosts memory also the register definitions between 9 the Philips chipsets and the Bt848 are very different. --- 287 unchanged lines hidden (view full) --- 297 Removed Hauppauge EEPROM 0x10 detection as I think 298 0x10 should be a PAL tuner, not NTSC. 299 Reinstated some Tuner Guesswork code from 1.27 300 3011.52 3 Sep 1998 Roger Hardiman <roger@cs.strath.ac.uk> 302 Submitted patch by Vsevolod Lobko <seva@alex-ua.com> 303 to correct SECAM B-Delay and add XUSSR channel set. 304 |
3051.53 9 Sep 1998 Roger Hardiman <roger@cs.strath.ac.uk> 306 Changed METEORSINPUT for Hauppauge cards with bt878. 307 Submitted by Fred Templin <templin@erg.sri.com> 308 Also fixed video_open defines and 878 support. |
|
305 | 309 |
306 | |
307*/ 308 309#define DDB(x) x 310#define DEB(x) 311 312#ifdef __FreeBSD__ 313#include "bktr.h" 314#include "opt_bktr.h" --- 639 unchanged lines hidden (view full) --- 954/* 955 * the data for each type of card 956 * 957 * Note: 958 * these entried MUST be kept in the order defined by the CARD_XXX defines! 959 */ 960static const struct CARDTYPE cards[] = { 961 | 310*/ 311 312#define DDB(x) x 313#define DEB(x) 314 315#ifdef __FreeBSD__ 316#include "bktr.h" 317#include "opt_bktr.h" --- 639 unchanged lines hidden (view full) --- 957/* 958 * the data for each type of card 959 * 960 * Note: 961 * these entried MUST be kept in the order defined by the CARD_XXX defines! 962 */ 963static const struct CARDTYPE cards[] = { 964 |
962 /* CARD_UNKNOWN */ 963 { "Unknown", /* the 'name' */ | 965 { CARD_UNKNOWN, /* the card id */ 966 "Unknown", /* the 'name' */ |
964 NULL, /* the tuner */ 965 0, /* dbx unknown */ 966 0, 967 0, /* EEProm unknown */ 968 0, /* EEProm unknown */ 969 { 0, 0, 0, 0, 0 } }, 970 | 967 NULL, /* the tuner */ 968 0, /* dbx unknown */ 969 0, 970 0, /* EEProm unknown */ 971 0, /* EEProm unknown */ 972 { 0, 0, 0, 0, 0 } }, 973 |
971 /* CARD_MIRO */ 972 { "Miro TV", /* the 'name' */ | 974 { CARD_MIRO, /* the card id */ 975 "Miro TV", /* the 'name' */ |
973 NULL, /* the tuner */ 974 0, /* dbx unknown */ 975 0, 976 0, /* EEProm unknown */ 977 0, /* size unknown */ 978 { 0x02, 0x01, 0x00, 0x0a, 1 } }, /* XXX ??? */ 979 | 976 NULL, /* the tuner */ 977 0, /* dbx unknown */ 978 0, 979 0, /* EEProm unknown */ 980 0, /* size unknown */ 981 { 0x02, 0x01, 0x00, 0x0a, 1 } }, /* XXX ??? */ 982 |
980 /* CARD_HAUPPAUGE */ 981 { "Hauppauge WinCast/TV", /* the 'name' */ | 983 { CARD_HAUPPAUGE, /* the card id */ 984 "Hauppauge WinCast/TV", /* the 'name' */ |
982 NULL, /* the tuner */ 983 0, /* dbx is optional */ 984 0, 985 PFC8582_WADDR, /* EEProm type */ 986 (u_char)(256 / EEPROMBLOCKSIZE), /* 256 bytes */ 987 { 0x00, 0x02, 0x01, 0x01, 1 } }, /* audio MUX values */ 988 | 985 NULL, /* the tuner */ 986 0, /* dbx is optional */ 987 0, 988 PFC8582_WADDR, /* EEProm type */ 989 (u_char)(256 / EEPROMBLOCKSIZE), /* 256 bytes */ 990 { 0x00, 0x02, 0x01, 0x01, 1 } }, /* audio MUX values */ 991 |
989 /* CARD_STB */ 990 { "STB TV/PCI", /* the 'name' */ | 992 { CARD_STB, /* the card id */ 993 "STB TV/PCI", /* the 'name' */ |
991 NULL, /* the tuner */ 992 0, /* dbx is optional */ 993 0, 994 X24C01_WADDR, /* EEProm type */ 995 (u_char)(128 / EEPROMBLOCKSIZE), /* 128 bytes */ 996 { 0x00, 0x01, 0x02, 0x02, 1 } }, /* audio MUX values */ 997 | 994 NULL, /* the tuner */ 995 0, /* dbx is optional */ 996 0, 997 X24C01_WADDR, /* EEProm type */ 998 (u_char)(128 / EEPROMBLOCKSIZE), /* 128 bytes */ 999 { 0x00, 0x01, 0x02, 0x02, 1 } }, /* audio MUX values */ 1000 |
998 /* CARD_INTEL */ 999 { "Intel Smart Video III/VideoLogic Captivator PCI", /* the 'name' */ | 1001 { CARD_INTEL, /* the card id */ 1002 "Intel Smart Video III/VideoLogic Captivator PCI", /* the 'name' */ |
1000 NULL, /* the tuner */ 1001 0, 1002 0, 1003 0, 1004 0, 1005 { 0, 0, 0, 0, 0 } }, 1006 | 1003 NULL, /* the tuner */ 1004 0, 1005 0, 1006 0, 1007 0, 1008 { 0, 0, 0, 0, 0 } }, 1009 |
1007 /* CARD_IMS_TURBO */ 1008 { "IMS TV Turbo", /* the 'name' */ | 1010 { CARD_IMS_TURBO, /* the card id */ 1011 "IMS TV Turbo", /* the 'name' */ |
1009 NULL, /* the tuner */ 1010 0, /* dbx is optional */ 1011 0, 1012 PFC8582_WADDR, /* EEProm type */ 1013 (u_char)(256 / EEPROMBLOCKSIZE), /* 256 bytes */ 1014 { 0x01, 0x02, 0x01, 0x00, 1 } }, /* audio MUX values */ 1015 | 1012 NULL, /* the tuner */ 1013 0, /* dbx is optional */ 1014 0, 1015 PFC8582_WADDR, /* EEProm type */ 1016 (u_char)(256 / EEPROMBLOCKSIZE), /* 256 bytes */ 1017 { 0x01, 0x02, 0x01, 0x00, 1 } }, /* audio MUX values */ 1018 |
1016 /* CARD_AVER_MEDIA */ 1017 { "AVer Media TV/FM", /* the 'name' */ | 1019 { CARD_AVER_MEDIA, /* the card id */ 1020 "AVer Media TV/FM", /* the 'name' */ |
1018 NULL, /* the tuner */ 1019 0, /* dbx is optional */ 1020 0, 1021 0, /* EEProm type */ 1022 0, /* EEProm size */ 1023 { 0x0c, 0x00, 0x0b, 0x0b, 1 } }, /* audio MUX values */ 1024}; 1025 --- 639 unchanged lines hidden (view full) --- 1665 1666 if (bt848_format == 0 ) 1667 video_format = 0; 1668 1669 if (bt848_format == 1 ) 1670 video_format = 1; 1671 1672 if (video_format == 1 ) { | 1021 NULL, /* the tuner */ 1022 0, /* dbx is optional */ 1023 0, 1024 0, /* EEProm type */ 1025 0, /* EEProm size */ 1026 { 0x0c, 0x00, 0x0b, 0x0b, 1 } }, /* audio MUX values */ 1027}; 1028 --- 639 unchanged lines hidden (view full) --- 1668 1669 if (bt848_format == 0 ) 1670 video_format = 0; 1671 1672 if (bt848_format == 1 ) 1673 video_format = 1; 1674 1675 if (video_format == 1 ) { |
1673 bt848->iform = BT848_IFORM_M_MUX1 | 1674 BT848_IFORM_X_XT0 | 1675 BT848_IFORM_F_NTSCM; | 1676 bt848->iform = BT848_IFORM_F_NTSCM; |
1676 bktr->format_params = BT848_IFORM_F_NTSCM; 1677 1678 } else { | 1677 bktr->format_params = BT848_IFORM_F_NTSCM; 1678 1679 } else { |
1679 bt848->iform = BT848_IFORM_M_MUX1 | 1680 BT848_IFORM_X_XT1 | 1681 BT848_IFORM_F_PALBDGHI; | 1680 bt848->iform = BT848_IFORM_F_PALBDGHI; |
1682 bktr->format_params = BT848_IFORM_F_PALBDGHI; 1683 1684 } 1685 | 1681 bktr->format_params = BT848_IFORM_F_PALBDGHI; 1682 1683 } 1684 |
1685 bt848->iform |= format_params[bktr->format_params].iform_xtsel; 1686 1687 /* work around for new Hauppauge 878 cards */ 1688 if ((bktr->card.card_id == CARD_HAUPPAUGE) && 1689 (bktr->id==BROOKTREE_878_ID || bktr->id==BROOKTREE_879_ID) ) 1690 bt848->iform |= BT848_IFORM_M_MUX3; 1691 else 1692 bt848->iform |= BT848_IFORM_M_MUX1; 1693 |
|
1686 bt848->adelay = format_params[bktr->format_params].adelay; 1687 bt848->bdelay = format_params[bktr->format_params].bdelay; 1688 frame_rate = format_params[bktr->format_params].frame_rate; 1689 1690#ifdef BKTR_USE_PLL 1691 bt848->tgctrl=0; 1692 bt848->pll_f_lo=0xf9; 1693 bt848->pll_f_hi=0xdc; --- 1184 unchanged lines hidden (view full) --- 2878{ 2879 int pixfmt; 2880 unsigned int temp; 2881 struct meteor_pixfmt *pf_pub; 2882 2883 switch (cmd) { 2884 2885 case METEORSINPUT: /* set input device */ | 1694 bt848->adelay = format_params[bktr->format_params].adelay; 1695 bt848->bdelay = format_params[bktr->format_params].bdelay; 1696 frame_rate = format_params[bktr->format_params].frame_rate; 1697 1698#ifdef BKTR_USE_PLL 1699 bt848->tgctrl=0; 1700 bt848->pll_f_lo=0xf9; 1701 bt848->pll_f_hi=0xdc; --- 1184 unchanged lines hidden (view full) --- 2886{ 2887 int pixfmt; 2888 unsigned int temp; 2889 struct meteor_pixfmt *pf_pub; 2890 2891 switch (cmd) { 2892 2893 case METEORSINPUT: /* set input device */ |
2894 /* Bt848 has 3 MUX Inputs. Bt848a/849/878/879 has 4 MUX Inputs*/ 2895 /* On the original bt848 boards, */ 2896 /* Tuner is MUX0, RCA is MUX1, S-Video is MUX2 */ 2897 /* On the Hauppauge bt878 boards, */ 2898 /* Tuner is MUX0, RCA is MUX4 */ 2899 /* Unfortunatly Meteor driver codes DEV_RCA as DEV_0, so we */ 2900 /* stick with this system in our Meteor Emulation */ 2901 |
|
2886 switch(*(unsigned long *)arg & METEOR_DEV_MASK) { 2887 2888 /* this is the RCA video input */ 2889 case 0: /* default */ 2890 case METEOR_INPUT_DEV0: | 2902 switch(*(unsigned long *)arg & METEOR_DEV_MASK) { 2903 2904 /* this is the RCA video input */ 2905 case 0: /* default */ 2906 case METEOR_INPUT_DEV0: |
2907 /* METEOR_INPUT_DEV_RCA: */ |
|
2891 bktr->flags = (bktr->flags & ~METEOR_DEV_MASK) 2892 | METEOR_DEV0; 2893 bt848->iform &= ~BT848_IFORM_MUXSEL; | 2908 bktr->flags = (bktr->flags & ~METEOR_DEV_MASK) 2909 | METEOR_DEV0; 2910 bt848->iform &= ~BT848_IFORM_MUXSEL; |
2894 bt848->iform |= BT848_IFORM_M_MUX1; | 2911 2912 /* work around for new Hauppauge 878 cards */ 2913 if ((bktr->card.card_id == CARD_HAUPPAUGE) && 2914 (bktr->id==BROOKTREE_878_ID || 2915 bktr->id==BROOKTREE_879_ID) ) 2916 bt848->iform |= BT848_IFORM_M_MUX3; 2917 else 2918 bt848->iform |= BT848_IFORM_M_MUX1; 2919 |
2895 bt848->e_control &= ~BT848_E_CONTROL_COMP; 2896 bt848->o_control &= ~BT848_O_CONTROL_COMP; 2897 set_audio( bktr, AUDIO_EXTERN ); 2898 break; 2899 2900 /* this is the tuner input */ 2901 case METEOR_INPUT_DEV1: 2902 bktr->flags = (bktr->flags & ~METEOR_DEV_MASK) --- 13 unchanged lines hidden (view full) --- 2916 bt848->iform &= ~BT848_IFORM_MUXSEL; 2917 bt848->iform |= BT848_IFORM_M_MUX2; 2918 bt848->e_control |= BT848_E_CONTROL_COMP; 2919 bt848->o_control |= BT848_O_CONTROL_COMP; 2920 set_audio( bktr, AUDIO_EXTERN ); 2921 break; 2922 2923 case METEOR_INPUT_DEV3: | 2920 bt848->e_control &= ~BT848_E_CONTROL_COMP; 2921 bt848->o_control &= ~BT848_O_CONTROL_COMP; 2922 set_audio( bktr, AUDIO_EXTERN ); 2923 break; 2924 2925 /* this is the tuner input */ 2926 case METEOR_INPUT_DEV1: 2927 bktr->flags = (bktr->flags & ~METEOR_DEV_MASK) --- 13 unchanged lines hidden (view full) --- 2941 bt848->iform &= ~BT848_IFORM_MUXSEL; 2942 bt848->iform |= BT848_IFORM_M_MUX2; 2943 bt848->e_control |= BT848_E_CONTROL_COMP; 2944 bt848->o_control |= BT848_O_CONTROL_COMP; 2945 set_audio( bktr, AUDIO_EXTERN ); 2946 break; 2947 2948 case METEOR_INPUT_DEV3: |
2924 if (bktr->id == BROOKTREE_878_ID || 2925 bktr->id == BROOKTREE_879_ID ) { | 2949 /* how do I detect a bt848a ? */ 2950 if ((bktr->id == BROOKTREE_849_ID) || 2951 (bktr->id == BROOKTREE_878_ID) || 2952 (bktr->id == BROOKTREE_879_ID) ) { |
2926 bktr->flags = (bktr->flags & ~METEOR_DEV_MASK) 2927 | METEOR_DEV3; 2928 bt848->iform &= ~BT848_IFORM_MUXSEL; 2929 bt848->iform |= BT848_IFORM_M_MUX3; 2930 bt848->e_control &= ~BT848_E_CONTROL_COMP; 2931 bt848->o_control &= ~BT848_O_CONTROL_COMP; 2932 set_audio( bktr, AUDIO_EXTERN ); 2933 --- 2466 unchanged lines hidden --- | 2953 bktr->flags = (bktr->flags & ~METEOR_DEV_MASK) 2954 | METEOR_DEV3; 2955 bt848->iform &= ~BT848_IFORM_MUXSEL; 2956 bt848->iform |= BT848_IFORM_M_MUX3; 2957 bt848->e_control &= ~BT848_E_CONTROL_COMP; 2958 bt848->o_control &= ~BT848_O_CONTROL_COMP; 2959 set_audio( bktr, AUDIO_EXTERN ); 2960 --- 2466 unchanged lines hidden --- |