[linux-dvb] [PATCH] Clean up some cruft in or51132 frontend

Trent Piepho xyzzy at speakeasy.org
Sat Apr 1 01:38:35 CEST 2006


There is some old code that does nothing in the or51132 firmware loading
blackbox.  This cleans that up.
-------------- next part --------------
# HG changeset patch
# User Trent Piepho <xyzzy at speakeasy.org>
# Node ID 103dceb47d97714ce3dcf271a62b67efcd3eaba0
# Parent  df444a0d0a03709496c2af7ed4d8a99529b7e774
Clean up some cruft in or51132 firmware load

From: Trent Piepho <xyzzy at speakeasy.org>

There is some old code in the or51133 firmware loading function that
has no effect.  Left a comment to in case it helps someone trying
to reverse engineer the chip.

Signed-off-by: Trent Piepho <xyzzy at speakeasy.org>

diff -r df444a0d0a03 -r 103dceb47d97 linux/drivers/media/dvb/frontends/or51132.c
--- a/linux/drivers/media/dvb/frontends/or51132.c	Fri Mar 31 13:46:54 2006 -0800
+++ b/linux/drivers/media/dvb/frontends/or51132.c	Fri Mar 31 14:44:33 2006 -0800
@@ -106,9 +106,8 @@ static int or51132_load_firmware (struct
 {
 	struct or51132_state* state = fe->demodulator_priv;
 	static u8 run_buf[] = {0x7F,0x01};
-	static u8 get_ver_buf[] = {0x04,0x00,0x30,0x00,0x00};
-	u8 rec_buf[14];
-	u8 cmd_buf[14];
+	u8 rec_buf[8];
+	u8 cmd_buf[3];
 	u32 firmwareAsize, firmwareBsize;
 	int i,ret;
 
@@ -157,7 +156,6 @@ static int or51132_load_firmware (struct
 	cmd_buf[0] = 0x10;
 	cmd_buf[1] = 0x10;
 	cmd_buf[2] = 0x00;
-	cmd_buf[3] = 0x00;
 	msleep(20); /* 20ms */
 	if ((ret = i2c_writebytes(state,state->config->demod_address,
 				 cmd_buf,3))) {
@@ -167,8 +165,6 @@ static int or51132_load_firmware (struct
 
 	cmd_buf[0] = 0x04;
 	cmd_buf[1] = 0x17;
-	cmd_buf[2] = 0x00;
-	cmd_buf[3] = 0x00;
 	msleep(20); /* 20ms */
 	if ((ret = i2c_writebytes(state,state->config->demod_address,
 				 cmd_buf,2))) {
@@ -178,8 +174,6 @@ static int or51132_load_firmware (struct
 
 	cmd_buf[0] = 0x00;
 	cmd_buf[1] = 0x00;
-	cmd_buf[2] = 0x00;
-	cmd_buf[3] = 0x00;
 	msleep(20); /* 20ms */
 	if ((ret = i2c_writebytes(state,state->config->demod_address,
 				 cmd_buf,2))) {
@@ -189,7 +183,11 @@ static int or51132_load_firmware (struct
 
 	for(i=0;i<4;i++) {
 		msleep(20); /* 20ms */
-		get_ver_buf[4] = i+1;
+		/* One apon a time, this command might have had something
+		   to do with getting the firmware version, but it's
+		   not used anymore:
+		   {0x04,0x00,0x30,0x00,i+1} */
+		/* Read 8 bytes, two bytes at a time */
 		if ((ret = i2c_readbytes(state,state->config->demod_address,
 					&rec_buf[i*2],2))) {
 			printk(KERN_WARNING
@@ -208,7 +206,6 @@ static int or51132_load_firmware (struct
 	cmd_buf[0] = 0x10;
 	cmd_buf[1] = 0x00;
 	cmd_buf[2] = 0x00;
-	cmd_buf[3] = 0x00;
 	msleep(20); /* 20ms */
 	if ((ret = i2c_writebytes(state,state->config->demod_address,
 				 cmd_buf,3))) {


More information about the linux-dvb mailing list