Re: looking for cirrus logic docs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Sun, Oct 20, 2002 at 01:05:11PM +0600, Cherry George Mathew wrote:
> Hello,
> 
> I was wondering where to get info on the CLGD5446, like tech refs. A url
> would be great. 

Tons of cirrus logic docs:

ftp://ftp.leo.org/pub/comp/general/devices/cirruslogic/pubs

They've got tech refs, etc.. (gd5446trm.pdf.gz, ...)

> I've a pixelview combo plus card with an ITTvpx3225d tuner
> attached to the GD5446 via i2c. Want the info in connection with writing a
> v4l driver.

There's a user space driver (no v4l) at:

http://users.actcom.co.il/~nahshon/linux-tv.html

It supports gd5446, gd5465, gd5480 and the CL-PX4072 pixel decoder.

I have an lgv-5480tvr card which uses gd5480, vpx3225d, and Samsung
TCPN9082DA27C NTSC tuner.  A small patch to his driver got the card working 
(assumes vpx3225d will only be used in NTSC mode).

The driver/program only supports overlay, no capture.

> 
> Any general comments would also be welcome.
> 
> Thanks in advance.
> 
> George.
> 
> 
> -- 
> 
> " And do not fear those who kill the body but cannot kill the soul. 
>   But rather fear Him who is able to destroy both soul and body in hell." 
> 
> Jesus of Nazareth.
> 
> Cherry George Mathew,
> II/157, Thyparampil Veedu,
> Eraviperoor P.O
> Kerala,
> India 689542,
> Tel:+91-473-663982
> http://resumes.yahoo.com/berryplumis/myprofile/
> 
> 
> 
> _______________________________________________
> Video4linux-list mailing list
> Video4linux-list@xxxxxxxxxx
> https://listman.redhat.com/mailman/listinfo/video4linux-list
> 
diff -Naur xtv/README.lgv-5480tvr xtv-patched2/README.lgv-5480tvr
--- xtv/README.lgv-5480tvr	Wed Dec 31 19:00:00 1969
+++ xtv-patched2/README.lgv-5480tvr	Sun Sep 22 08:41:01 2002
@@ -0,0 +1 @@
+xtvtap -i i5-lgv-5480tvr -geometry 640x480
diff -Naur xtv/i2c.c xtv-patched2/i2c.c
--- xtv/i2c.c	Sat Nov 13 20:38:04 1999
+++ xtv-patched2/i2c.c	Sun Sep 22 09:29:51 2002
@@ -308,6 +308,10 @@
 			fscanf(in, "%d %lf", &data, &freq);
 			SetPresetChannel(data, freq);
 		}
+		else if(!strcmp(cmd, "px0002")) {
+			fscanf(in, "%x", &data);
+			i2c_0002 = data;
+		}
 		else {
 			printf("Parser: syntax error at %s\n", cmd);
 		}
diff -Naur xtv/i5-lgv-5480tvr xtv-patched2/i5-lgv-5480tvr
--- xtv/i5-lgv-5480tvr	Wed Dec 31 19:00:00 1969
+++ xtv-patched2/i5-lgv-5480tvr	Sun Sep 22 09:31:49 2002
@@ -0,0 +1,172 @@
+# tuner 4 (samsung TCPN9082DA27C NTSC only tuner). Probe for I2C address.
+tuner 4 0
+
+# alternate address for px0002 (actually, I'm not even sure if it's a
+# px0002)
+px0002 0x4e
+
+# preset channels 
+# These match the local cable channels on the local
+# You probably need to edit and fix this. A good start
+# is the file \WINDOWS\CHANNEL.INI which the Windows95
+# tv program is using.
+#
+# These are for NTSC USA CATV STD.
+# Taken from c:\WINDOWS\CHANNEL.INI that came with lgv-5480tvr
+ch      1     000.00
+ch      2     055.25
+ch      3     061.25
+ch      4     067.25
+ch      5     077.25
+ch      6     083.25
+ch      7     175.25
+ch      8     181.25
+ch      9     187.25
+ch      10    193.25
+ch      11    199.25
+ch      12    205.25
+ch      13    211.25
+ch      14    121.25
+ch      15    127.25
+ch      16    133.25
+ch      17    139.25
+ch      18    145.25
+ch      19    151.25
+ch      20    157.25
+ch      21    163.25
+ch      22    169.25
+ch      23    217.25
+ch      24    223.25
+ch      25    229.25
+ch      26    235.25
+ch      27    241.25
+ch      28    247.25
+ch      29    253.25
+ch      30    259.25
+ch      31    265.25
+ch      32    271.25
+ch      33    277.25
+ch      34    283.25
+ch      35    289.25
+ch      36    295.25
+ch      37    301.25
+ch      38    307.25
+ch      39    313.25
+ch      40    319.25
+ch      41    325.25
+ch      42    331.25
+ch      43    337.25
+ch      44    343.25
+ch      45    349.25
+ch      46    355.25
+ch      47    361.25
+ch      48    367.25
+ch      49    373.25
+ch      50    379.25
+ch      51    385.25
+ch      52    391.25
+ch      53    397.25
+ch      54    403.25
+ch      55    409.25
+ch      56    415.25
+ch      57    421.25
+ch      58    427.25
+ch      59    433.25
+ch      60    439.25
+ch      61    445.25
+ch      62    451.25
+ch      63    457.25
+ch      64    463.25
+ch      65    469.25
+ch      66    475.25
+ch      67    481.25
+ch      68    487.25
+ch      69    493.25
+ch      70    499.25
+ch      71    505.25
+ch      72    511.25
+ch      73    517.25
+ch      74    523.25
+ch      75    529.25
+ch      76    535.25
+ch      77    541.25
+ch      78    547.25
+ch      79    553.25
+ch      80    559.25
+ch      81    565.25
+ch      82    571.25
+ch      83    577.25
+ch      84    583.25
+ch      85    589.25
+ch      86    595.25
+ch      87    601.25 
+ch      88    607.25 
+ch      89    613.25 
+ch      90    619.25 
+ch      91    625.25 
+ch      92    631.25 
+ch      93    637.25 
+ch      94    643.25 
+ch      95    91.25 
+ch      96    97.25 
+ch      97    103.25 
+ch      98    109.25 
+ch      99    115.25 
+ch      100   649.25 
+ch      101   655.25 
+ch      102   661.25 
+ch      103   667.25 
+ch      104   673.25 
+ch      105   679.25 
+ch      106   685.25 
+ch      107   691.25 
+ch      108   697.25 
+ch      109   703.25 
+ch      110   709.25 
+ch      111   715.25 
+ch      112   721.25 
+ch      113   727.25 
+ch      114   733.25 
+ch      115   739.25 
+ch      116   745.25 
+ch      117   751.25 
+ch      118   757.25 
+ch      119   763.25 
+ch      120   769.25 
+ch      121   775.25 
+ch      122   781.25 
+ch      123   787.25 
+ch      124   793.25 
+ch      125   799.25 
+
+# w2 - write to px0002 register
+# t - set tuner's initial channel
+w2 4 32
+w2 3 3a
+w2 3 38
+w2 3 38
+w2 4 36
+w2 3 38
+w2 3 38
+w2 3 38
+w2 4 32
+w2 2 0d
+w2 1 a0
+w2 2 0d
+w2 3 0
+w2 2 3d
+w2 3 8
+w2 4 3b
+
+w2 3 38
+w2 3 3a
+w2 3 3a
+
+w2 04 3b
+
+w2 4 33
+
+t 4
+
+w2 3 32
+w2 4 37
diff -Naur xtv/lgtvr xtv-patched2/lgtvr
--- xtv/lgtvr	Wed Dec 31 19:00:00 1969
+++ xtv-patched2/lgtvr	Sun Sep 29 06:38:22 2002
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+./xtvtap -i i5-lgv-5480tvr -geometry 640x480
+
diff -Naur xtv/px0002.c xtv-patched2/px0002.c
--- xtv/px0002.c	Wed Nov 11 17:35:28 1998
+++ xtv-patched2/px0002.c	Sun Sep 22 05:17:10 2002
@@ -39,8 +39,27 @@
 void
 set_mute(int mute) {
 	int val;
+
+	/*FIXME with lgv-5480tvr set_mute(0) doesn't work.  Since this function
+	 * is called after a channel switch in xwin.c, sound is lost.
+	 */
+	if (i2c_0002 == 0x4e)
+		return;
+
 	val = i2c_read8(i2c_0002, 0x04);
 	val &= ~0x04;
 	if(!mute) val |= 0x04;
 	i2c_write8(i2c_0002, 0x04, val);
+}
+
+/*FIXME since I'm not using the above set_mute() function this is makes sure
+ * sound is turned off when the program exits.
+ */ 
+void
+audio_off(void) {
+	int val;
+
+	val = i2c_read8(i2c_0002, 0x04);
+    val &= ~0x04;
+    i2c_write8(i2c_0002, 0x04, val);
 }
diff -Naur xtv/px4072.c xtv-patched2/px4072.c
--- xtv/px4072.c	Mon Apr 12 06:31:27 1999
+++ xtv-patched2/px4072.c	Tue Oct  8 03:40:13 2002
@@ -15,12 +15,21 @@
 
 #include "xtv.h"
 
+#define VPX3225D 0x7230
+
 int i2c_4072  = 0x86; 
 
 /* Hard limits for the 4072, PAL and the clocks used */
 unsigned long max_width  = 704;	/* must be a multiple of 4 ! */
 unsigned long max_height = 576;
 
+static unsigned decoderId = 0x0;
+
+static unsigned fpReadReg   = 0x26;
+static unsigned fpWriteReg  = 0x27;
+static unsigned fpDataReg   = 0x28;
+static unsigned fpStatusReg = 0x29;
+
 void
 px4072_write_direct(unsigned reg, unsigned data) {
 	i2c_write8(i2c_4072, reg, data);
@@ -34,12 +43,12 @@
 void
 px4072_write_indirect(unsigned reg, unsigned data) {
 	unsigned status;
-	status = i2c_read8(i2c_4072, 0x29);
+	status = i2c_read8(i2c_4072, fpStatusReg);
 	/* printf("stat = %x\n", status); */
-	i2c_write16(i2c_4072, 0x27, reg);
-	status = i2c_read8(i2c_4072, 0x29);
+	i2c_write16(i2c_4072, fpWriteReg, reg);
+	status = i2c_read8(i2c_4072, fpStatusReg);
 	/* printf("stat = %x\n", status); */
-	i2c_write16(i2c_4072, 0x28, data);
+	i2c_write16(i2c_4072, fpDataReg, data);
 }
 
 
@@ -47,12 +56,12 @@
 px4072_read_indirect(unsigned reg) {
 	unsigned data, status;
 	
-	status = i2c_read8(i2c_4072, 0x29);
+	status = i2c_read8(i2c_4072, fpStatusReg);
 	/* printf("stat = %x\n", status); */
-	i2c_write16(i2c_4072, 0x26, reg);
-	status = i2c_read8(i2c_4072, 0x29);
+	i2c_write16(i2c_4072, fpReadReg, reg);
+	status = i2c_read8(i2c_4072, fpStatusReg);
 	/* printf("stat = %x\n", status); */
-	data = i2c_read16(i2c_4072, 0x28);
+	data = i2c_read16(i2c_4072, fpDataReg);
 
 	return data;
 }
@@ -77,17 +86,54 @@
 		h = lines-2*begin;
 	if(w > max_width)
 		w = max_width;
-	px4072_write_indirect(0x8e, begin);
-	px4072_write_indirect(0x8f, lines/2);
-	px4072_write_indirect(0x90, h/2);
-	px4072_write_indirect(0x91, 0);
-	px4072_write_indirect(0x92, w);
-	px4072_write_indirect(0x93, w);
-	px4072_write_indirect(0xf0, 0x041);
+
+	switch (decoderId) {
+	case VPX3225D:  //FIXME double check this
+		px4072_write_indirect (0x120, begin);  /* window1 ver begin */
+		px4072_write_indirect (0x121, lines/2);  /* w1 ver lines in */
+		px4072_write_indirect (0x122, h/2);  /* w1 ver lines out */
+		px4072_write_indirect (0x123, 0);  /* w1 horiz begin */
+		px4072_write_indirect (0x124, w); /* w1 horiz length */
+		px4072_write_indirect (0x125, w);  /* w1 num of pixels */
+		//px4072_write_indirect (0x140, 0x060);
+		px4072_write_indirect (0x140, 0x020);  /* latch window 1 */
+		break;
+	default:
+		px4072_write_indirect(0x8e, begin);
+		px4072_write_indirect(0x8f, lines/2);
+		px4072_write_indirect(0x90, h/2);
+		px4072_write_indirect(0x91, 0);
+		px4072_write_indirect(0x92, w);
+		px4072_write_indirect(0x93, w);
+		px4072_write_indirect(0xf0, 0x041);
+		break;
+	}
+}
+
+static void 
+vpx3225d_Setsource (void) {
+	unsigned data;
+
+	data = px4072_read_indirect (0x20);
+
+	switch (videosource) {
+	case TUNER:
+		px4072_write_indirect (0x21, 0x001);
+		px4072_write_indirect (0x20, data & 0xfbf);
+		break;
+	case VCR:  // svhs
+		px4072_write_indirect (0x21, 0x406);
+		px4072_write_indirect (0x20, data | 0x40);
+		break;
+	}
 }
 
 void
 px4072_Setsource(void) {
+	if (decoderId == VPX3225D) {
+		vpx3225d_Setsource ();
+		return;
+	}
 	switch(videosource) {
 	case TUNER:
 		px4072_write_direct(0x33, 1);
@@ -101,6 +147,12 @@
 void
 px4072_Setcolorspace() {
 	int valE8;
+
+	if (decoderId == VPX3225D) {
+		/*FIXME */
+		return;
+	}
+
 	switch(colorspace) {
 	case RGB_565:
 		valE8 = 0x06;
@@ -124,8 +176,28 @@
 	px4072_write_direct(0xe8, valE8);
 }
 
+static void
+vpx3225d_Setsystem (void) {
+	unsigned val;
+
+	/*FIXME */
+	switch (system) {
+	case NTSC:
+	default:
+		val = 0x001;
+		break;
+	}
+
+	px4072_write_indirect (0x150, val);
+}
+		
 void
 px4072_Setsystem() {
+	if (decoderId == VPX3225D) {
+		vpx3225d_Setsystem ();
+		return;
+	}
+
 	switch(system) {
 	case NTSC:
 		px4072_write_indirect(0xf2, 0x13);
@@ -142,6 +214,36 @@
 	}
 }
 
+void video_decoder_off (void)
+{
+	if (decoderId == VPX3225D) {
+		px4072_write_direct (0xF2, 0x00);  // disable output
+		px4072_write_direct (0xAA, 0x03);  // switch to low power mode
+		return;
+	}
+}
+
+static void
+vpx3225d_init (void) {
+	px4072_write_direct (0xAA, 0x00);  // full power mode
+	//px4072_write_direct (0xF8, 0x24);  // 
+	//px4072_write_direct (0xF9, 0x20);
+	//AC	px4072_write_direct (0xC8, 0);  // 64  sync slicer disable
+
+	px4072_Setwindow(capW, capH);
+	vpx3225d_Setsystem ();
+	px4072_Setsource();
+
+	//px4072_write_indirect (0x22, 0);  // start position of video active
+	//px4072_write_indirect (0x138, 0);  // disable vbi window
+	px4072_write_indirect (0x12B, 0xc00);  // disable window 2
+	px4072_write_indirect (0x126, 0x100);  // peaking and coring
+
+	px4072_write_indirect (0x154, 0x200);  // output multiplexer, set double
+	                                       // clock
+	px4072_write_direct (0xF2, 0x0f);  // enable output
+}
+
 void
 InitPX4072() {
 	int t1, t2;
@@ -156,15 +258,26 @@
 	      px4072_read_direct(0x01);
 
 	printf("InitPX4072: videodecoder %02x %04x\n", t1, t2);
+	decoderId = t2;
 
 	switch(t2) {
 	case 0x4680:
 	case 0x4260:
 	case 0x4280:
+	case VPX3225D:  /* 0x7230 */
+		fpReadReg = 0x36;
+		fpWriteReg = 0x37;
+		fpDataReg = 0x38;
+		fpStatusReg = 0x35;
 		break;
 	default:
 		fprintf(stderr, "Unsupported video decoder\n");
 		exit(1);
+	}
+
+	if (decoderId == VPX3225D) {
+		vpx3225d_init ();
+		return;
 	}
 
 	px4072_write_indirect(0x89, 0xc01);
diff -Naur xtv/tuner.c xtv-patched2/tuner.c
--- xtv/tuner.c	Sat Jun 19 18:45:21 1999
+++ xtv-patched2/tuner.c	Sun Sep 22 06:56:31 2002
@@ -44,6 +44,7 @@
 	{ 38.90,  48.25, 170.00, 450.00, 855.25 }, /* 1216 CCIR B/G */
 	{ 42.75,  55.25, 160.00, 454.00, 801.25 }, /* 1236 RTMA M/N */
 	{ 38.90,  45.75, 170.00, 450.00, 855.25 }, /* 1246 CCIR I   */
+	{ 45.75,  55.25, 169.25, 457.25, 855.25 }, /* samsung TCPN9082DA27C NTSC only */
 };
 
 static int is_radio = 0;
diff -Naur xtv/xwin.c xtv-patched2/xwin.c
--- xtv/xwin.c	Sat Nov 13 23:01:25 1999
+++ xtv-patched2/xwin.c	Sun Sep 22 08:46:53 2002
@@ -326,6 +326,8 @@
 	case XK_q:
 		gd5480_off();
 		set_mute(1);
+		audio_off ();  /*FIXME */
+		video_decoder_off ();
 		gd5480_restore();
 		exit(0);
 		break;

[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux