patch-2.3.4 linux/drivers/char/bttv.c

Next file: linux/drivers/char/bttv.h
Previous file: linux/drivers/char/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.3/linux/drivers/char/bttv.c linux/drivers/char/bttv.c
@@ -543,6 +543,8 @@
         { 3, 1, 0, 2,15, { 2, 3, 1, 1}, { 0, 0, 0, 0, 0}},
         /* Pixelview PlayTV (bt878) */
         { 3, 4, 0, 2, 0x01e000, { 2, 0, 1, 1}, {0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 }},
+        /* "Leadtek WinView 601", */
+        { 3, 1, 0, 2, 0x8300f8, { 2, 3, 1, 1,0}, {0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007}},
 };
 #define TVCARDS (sizeof(tvcards)/sizeof(tvcard))
 
@@ -2036,6 +2038,41 @@
 				I2CWrite(&(btv->i2c), I2C_TDA9850,
 					TDA9850_CON3, con3, 1);
 			}
+		   
+		       /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
+		        if (btv->type == BTTV_WINVIEW_601) { 
+			   int bits_out, loops, vol, data;
+
+			   /* 32 levels logarithmic */
+			   vol = 32 - ((v.volume>>11));
+			   /* units */
+                           bits_out = (PT2254_DBS_IN_2>>(vol%5));
+			   /* tens */
+                           bits_out |= (PT2254_DBS_IN_10>>(vol/5));
+			   bits_out |= PT2254_L_CHANEL | PT2254_R_CHANEL;
+			   data = btread(BT848_GPIO_DATA);
+			   data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
+				      WINVIEW_PT2254_STROBE);
+			   for (loops = 17; loops >= 0 ; loops--) {
+				if (bits_out & (1<<loops))
+				   data |=  WINVIEW_PT2254_DATA;
+				else
+				   data &= ~WINVIEW_PT2254_DATA;
+			       btwrite(data, BT848_GPIO_DATA);
+			       udelay(5);
+			       data |= WINVIEW_PT2254_CLK;
+			       btwrite(data, BT848_GPIO_DATA);
+			       udelay(5);
+			       data &= ~WINVIEW_PT2254_CLK;
+			       btwrite(data, BT848_GPIO_DATA);
+			   }
+			   data |=  WINVIEW_PT2254_STROBE;
+			   data &= ~WINVIEW_PT2254_DATA;
+			   btwrite(data, BT848_GPIO_DATA);
+			   udelay(10);			   
+			   data &= ~WINVIEW_PT2254_STROBE;
+			   btwrite(data, BT848_GPIO_DATA);
+			}
 			if (btv->have_msp3400) 
 			{
                                 i2c_control_device(&(btv->i2c),
@@ -3033,6 +3070,9 @@
 		case BTTV_VHX:
 			strcpy(btv->video_dev.name,"BT848(Aimslab-VHX)");
  			break;
+	        case BTTV_WINVIEW_601:
+			strcpy(btv->video_dev.name,"BT848(Leadtek WinView 601)");
+ 			break;	   
 	}
 	printk("%s\n",btv->video_dev.name);
 	audio(btv, AUDIO_MUTE);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)