Mailing List archive

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

[mpeg2] Re: Can't compile saa7134-20030826



On Thursday 28 August 2003 00:31, Thomas Sparr wrote:
> Hi,
>
> SAA6752HS_VIDEO_TARGET_BITRATE_MAX and SAA6752HS_VIDEO_MAX_BITRATE_MAX
> undeclared.
> What value should they have?
>
> Best Regards
>
> Thomas

Hi, attached is my latest patch against 20030826 (Gerd, you already have it)
--- saa7134.orig/saa6752hs.c	2003-08-26 13:04:31.000000000 +0100
+++ saa7134/saa6752hs.c	2003-08-28 02:04:43.000000000 +0100
@@ -147,6 +147,7 @@
 	unsigned char buf[3];
 	enum saa6752hs_mode _oldmode;
 	unsigned long timeout;
+	int status = 0;
 
 	// determine the old mode
 	saa6752hs_get_mode(client, &_oldmode);
@@ -192,8 +193,8 @@
 	}
 	
   	// set it and wait for it to be so
-	timeout = jiffies + HZ / 10;
 	i2c_master_send(client, buf, 1);
+	timeout = jiffies + (2*HZ);
 	do {
 		// get the current status
 		buf[0] = 0x10;
@@ -203,11 +204,16 @@
 		// wait a bit
 		current->state = TASK_INTERRUPTIBLE;
 		schedule_timeout(1);
-	} while ((buf[0] & 0x20) && time_after(jiffies,timeout));
+	} while ((buf[0] & 0x20) && (!time_after(jiffies,timeout)));
+	if (time_after(jiffies, timeout)) status = -ETIMEDOUT;
+
+	// delay a bit to let encoder settle
+	current->state = TASK_INTERRUPTIBLE;
+	schedule_timeout(5);
 
 	// done
 	if (oldmode) *oldmode = _oldmode;
-  	return 0;
+  	return status;
 }
 
 
--- saa7134.orig/saa6752hs.h	2003-08-26 13:05:36.000000000 +0100
+++ saa7134/saa6752hs.h	2003-08-27 21:03:58.000000000 +0100
@@ -47,13 +47,14 @@
 	SAA6752HS_AUDIO_BITRATE_MAX
 };
 
-#define SAA6752HS_VIDEO_BITRATE_MAX 27000
+#define SAA6752HS_VIDEO_TARGET_BITRATE_MAX 27000
+#define SAA6752HS_VIDEO_MAX_BITRATE_MAX 27000
 #define SAA6752HS_TOTAL_BITRATE_MAX 27000
 
 struct saa6752hs_bitrate {
 	enum saa6752hs_bitrate_mode bitrate_mode;
 	unsigned int video_target_bitrate;
-	unsigned int video_max_bitrate;
+  	unsigned int video_max_bitrate; // only used for VBR
 	enum saa6752hs_audio_bitrate audio_bitrate;
 	unsigned int total_bitrate;
 };
@@ -68,9 +69,3 @@
 #define SAA6752HSIOC_GETSTREAMTYPE    _IOR('6',103,enum saa6752hs_streamtype)	/* get stream type */
 
 #endif // _SAA6752HS_H
-
-/*
- * Local variables:
- * c-basic-offset: 8
- * End:
- */
--- saa7134.orig/saa7134-ts.c	2003-08-26 12:42:52.000000000 +0100
+++ saa7134/saa7134-ts.c	2003-08-27 21:22:48.000000000 +0100
@@ -215,7 +215,6 @@
 	/* stop the encoder */
 	dev->ts.started = 0;
 	saa7134_i2c_call_clients(dev, MPEG_ENC_STOP, 0);
-	saa_writeb(SAA7134_I2S_OUTPUT_FORMAT,  0x00); //ADQHACK
   
 	up(&dev->ts.ts.lock);
 	return 0;
@@ -228,7 +227,6 @@
 
 	/* start the encoder */
 	if (!dev->ts.started) {
-		saa_writeb(SAA7134_I2S_OUTPUT_FORMAT,  0x01); //ADQHACK
 		saa7134_i2c_call_clients(dev, MPEG_ENC_START, 0);
 		dev->ts.started = 1;
 	}
--- saa7134.orig/saa7134-core.c	2003-08-20 11:25:26.000000000 +0100
+++ saa7134/saa7134-core.c	2003-08-28 01:29:53.000000000 +0100
@@ -27,6 +27,7 @@
 #include <linux/kmod.h>
 #include <linux/sound.h>
 #include <linux/interrupt.h>
+#include <linux/delay.h>
 
 #include "saa7134-reg.h"
 #include "saa7134.h"
@@ -863,12 +864,13 @@
 		goto fail3;
 	}
 
-	/* register i2c bus */
-	saa7134_i2c_register(dev);
-
 	/* initialize hardware */
 	saa7134_board_init(dev);
 	saa7134_hwinit(dev);
+	mdelay(30);
+  
+	/* register i2c bus */
+	saa7134_i2c_register(dev);
 
 	/* load i2c helpers */
 	if (TUNER_ABSENT != dev->tuner_type)

Home | Main Index | Thread Index