aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv-cards.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-cards.c')
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c53
1 files changed, 38 insertions, 15 deletions
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index 6addc42df045..6b31e50fb951 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -291,6 +291,9 @@ static struct CARD {
291 291
292 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" }, 292 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
293 293
294 { 0x53534149, BTTV_BOARD_SSAI_SECURITY, "SSAI Security Video Interface" },
295 { 0x5353414a, BTTV_BOARD_SSAI_ULTRASOUND, "SSAI Ultrasound Video Interface" },
296
294 /* likely broken, vendor id doesn't match the other magic views ... 297 /* likely broken, vendor id doesn't match the other magic views ...
295 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */ 298 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
296 299
@@ -2907,6 +2910,28 @@ struct tvcard bttv_tvcards[] = {
2907 .has_radio = 1, 2910 .has_radio = 1,
2908 .has_remote = 1, 2911 .has_remote = 1,
2909 }, 2912 },
2913 [BTTV_BOARD_SSAI_SECURITY] = {
2914 .name = "SSAI Security Video Interface",
2915 .video_inputs = 4,
2916 .audio_inputs = 0,
2917 .tuner = -1,
2918 .svhs = -1,
2919 .muxsel = { 0, 1, 2, 3 },
2920 .tuner_type = -1,
2921 .tuner_addr = ADDR_UNSET,
2922 .radio_addr = ADDR_UNSET,
2923 },
2924 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2925 .name = "SSAI Ultrasound Video Interface",
2926 .video_inputs = 2,
2927 .audio_inputs = 0,
2928 .tuner = -1,
2929 .svhs = 1,
2930 .muxsel = { 2, 0, 1, 3 },
2931 .tuner_type = -1,
2932 .tuner_addr = ADDR_UNSET,
2933 .radio_addr = ADDR_UNSET,
2934 },
2910}; 2935};
2911 2936
2912static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards); 2937static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
@@ -2970,20 +2995,20 @@ void __devinit bttv_idcard(struct bttv *btv)
2970 2995
2971 if (UNSET != audiomux[0]) { 2996 if (UNSET != audiomux[0]) {
2972 gpiobits = 0; 2997 gpiobits = 0;
2973 for (i = 0; i < 4; i++) { 2998 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2974 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i]; 2999 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
2975 gpiobits |= audiomux[i]; 3000 gpiobits |= audiomux[i];
2976 } 3001 }
2977 } else { 3002 } else {
2978 gpiobits = audioall; 3003 gpiobits = audioall;
2979 for (i = 0; i < 4; i++) { 3004 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2980 bttv_tvcards[btv->c.type].gpiomux[i] = audioall; 3005 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
2981 } 3006 }
2982 } 3007 }
2983 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits; 3008 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2984 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=", 3009 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2985 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask); 3010 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2986 for (i = 0; i < 5; i++) { 3011 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2987 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]); 3012 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
2988 } 3013 }
2989 printk("\n"); 3014 printk("\n");
@@ -3638,7 +3663,7 @@ static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3638 3663
3639 for (n = 0; n < microlen; n++) { 3664 for (n = 0; n < microlen; n++) {
3640 bits = micro[n]; 3665 bits = micro[n];
3641 for ( i = 0 ; i < 8 ; i++ ) { 3666 for (i = 0 ; i < 8 ; i++) {
3642 gpio_bits(BTTV_ALT_DCLK,0); 3667 gpio_bits(BTTV_ALT_DCLK,0);
3643 if (bits & 0x01) 3668 if (bits & 0x01)
3644 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA); 3669 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
@@ -3691,7 +3716,7 @@ static void __devinit osprey_eeprom(struct bttv *btv)
3691 /* this might be an antique... check for MMAC label in eeprom */ 3716 /* this might be an antique... check for MMAC label in eeprom */
3692 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) { 3717 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3693 unsigned char checksum = 0; 3718 unsigned char checksum = 0;
3694 for (i =0; i<21; i++) 3719 for (i = 0; i < 21; i++)
3695 checksum += ee[i]; 3720 checksum += ee[i];
3696 if (checksum != ee[21]) 3721 if (checksum != ee[21])
3697 return; 3722 return;
@@ -3703,12 +3728,13 @@ static void __devinit osprey_eeprom(struct bttv *btv)
3703 unsigned short type; 3728 unsigned short type;
3704 int offset = 4*16; 3729 int offset = 4*16;
3705 3730
3706 for(; offset < 8*16; offset += 16) { 3731 for (; offset < 8*16; offset += 16) {
3707 unsigned short checksum = 0; 3732 unsigned short checksum = 0;
3708 /* verify the checksum */ 3733 /* verify the checksum */
3709 for(i = 0; i<14; i++) checksum += ee[i+offset]; 3734 for (i = 0; i < 14; i++)
3710 checksum = ~checksum; /* no idea why */ 3735 checksum += ee[i+offset];
3711 if ((((checksum>>8)&0x0FF) == ee[offset+14]) && 3736 checksum = ~checksum; /* no idea why */
3737 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
3712 ((checksum & 0x0FF) == ee[offset+15])) { 3738 ((checksum & 0x0FF) == ee[offset+15])) {
3713 break; 3739 break;
3714 } 3740 }
@@ -3721,7 +3747,6 @@ static void __devinit osprey_eeprom(struct bttv *btv)
3721 type = (ee[offset+4]<<8) | (ee[offset+5]); 3747 type = (ee[offset+4]<<8) | (ee[offset+5]);
3722 3748
3723 switch(type) { 3749 switch(type) {
3724
3725 /* 848 based */ 3750 /* 848 based */
3726 case 0x0004: 3751 case 0x0004:
3727 btv->c.type = BTTV_BOARD_OSPREY1x0_848; 3752 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
@@ -4149,8 +4174,7 @@ static int tea5757_read(struct bttv *btv)
4149 } 4174 }
4150 4175
4151 dprintk("bttv%d: tea5757:",btv->c.nr); 4176 dprintk("bttv%d: tea5757:",btv->c.nr);
4152 for(i = 0; i < 24; i++) 4177 for (i = 0; i < 24; i++) {
4153 {
4154 udelay(5); 4178 udelay(5);
4155 bus_high(btv,btv->mbox_clk); 4179 bus_high(btv,btv->mbox_clk);
4156 udelay(5); 4180 udelay(5);
@@ -4182,8 +4206,7 @@ static int tea5757_write(struct bttv *btv, int value)
4182 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value); 4206 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4183 bus_low(btv,btv->mbox_clk); 4207 bus_low(btv,btv->mbox_clk);
4184 bus_high(btv,btv->mbox_we); 4208 bus_high(btv,btv->mbox_we);
4185 for(i = 0; i < 25; i++) 4209 for (i = 0; i < 25; i++) {
4186 {
4187 if (reg & 0x1000000) 4210 if (reg & 0x1000000)
4188 bus_high(btv,btv->mbox_data); 4211 bus_high(btv,btv->mbox_data);
4189 else 4212 else
@@ -4755,7 +4778,7 @@ static void kodicom4400r_init(struct bttv *btv)
4755 gpio_write(1 << 9); /* reset MUX */ 4778 gpio_write(1 << 9); /* reset MUX */
4756 gpio_write(0); 4779 gpio_write(0);
4757 /* Preset camera 0 to the 4 controllers */ 4780 /* Preset camera 0 to the 4 controllers */
4758 for (ix=0; ix<4; ix++) { 4781 for (ix = 0; ix < 4; ix++) {
4759 sw_status[ix] = ix; 4782 sw_status[ix] = ix;
4760 kodicom4400r_write(btv, ix, ix, 1); 4783 kodicom4400r_write(btv, ix, ix, 1);
4761 } 4784 }