mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [DVB] tda1004x frontend regression
@ 2004-07-11 23:26 Ian Molton
  0 siblings, 0 replies; only message in thread
From: Ian Molton @ 2004-07-11 23:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-dvb

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

Hi.

Attached is a diff I've made.

I tried the 2.6.7-bk20 driver for the tda1004x frontend on my DVB-T card, only to find out that it failed to work, unlike the 2.6.5 driver which appeared to work well.

I assumed this was due to my firmware being out of date but this was not the case.

I discovered the problem was related to some additions made to the driver, and commenting them out allowed things to work again. Ther is also a dodgy looking alteration to some pointer (fe->data).

In the course of my fiddling, I added support to the firmware list for the latest (2.17d) firmware.

all this is in the attached diff, and the driver works in this modified state for me.

[-- Attachment #2: diff_dvb --]
[-- Type: application/octet-stream, Size: 2823 bytes --]

--- drivers/media/dvb/frontends/tda1004x.c.new	2004-07-12 00:16:41.000000000 +0100
+++ drivers/media/dvb/frontends/tda1004x.c	2004-07-12 00:11:37.000000000 +0100
@@ -184,7 +184,8 @@
 	int fw_offset;
 	int fw_size;
 };
-static struct fwinfo tda10045h_fwinfo[] = { {.file_size = 286720,.fw_offset = 0x34cc5,.fw_size = 30555} };
+static struct fwinfo tda10045h_fwinfo[] = { {.file_size = 286720,.fw_offset = 0x34cc5,.fw_size = 30555},
+					    {.file_size = 303104,.fw_offset = 0x37ef9,.fw_size = 30554} };
 static int tda10045h_fwinfo_count = sizeof(tda10045h_fwinfo) / sizeof(struct fwinfo);
 
 static struct fwinfo tda10046h_fwinfo[] = { {.file_size = 286720,.fw_offset = 0x3c4f9,.fw_size = 24479} };
@@ -1306,7 +1307,7 @@
 {
 	int status = 0;
 	struct dvb_i2c_bus *i2c = fe->i2c;
-	struct tda1004x_state *tda_state = (struct tda1004x_state *) fe->data;
+	struct tda1004x_state *tda_state = (struct tda1004x_state *) &(fe->data);
 
 	dprintk("%s: cmd=0x%x\n", __FUNCTION__, cmd);
 
@@ -1368,6 +1369,7 @@
 			tda_state->initialised = 1;
 		return status;
 
+#if 0
 	case FE_GET_TUNE_SETTINGS:
 	{
 		struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg;
@@ -1376,6 +1378,7 @@
 		fesettings->max_drift = 166667*2;
 		return 0;
 	}
+#endif
 	    
 	default:
 		return -EOPNOTSUPP;
@@ -1392,7 +1395,7 @@
         int fe_type = -1;
         int tuner_type = -1;
 	struct tda1004x_state tda_state;
-	struct tda1004x_state* ptda_state;
+//	struct tda1004x_state* ptda_state;
 	struct i2c_msg tuner_msg = {.addr=0, .flags=0, .buf=0, .len=0 };
         static u8 td1344_init[] = { 0x0b, 0xf5, 0x88, 0xab };
         static u8 td1316_init[] = { 0x0b, 0xf5, 0x85, 0xab };
@@ -1485,20 +1488,24 @@
         // upload firmware
         if ((status = tda1004x_fwupload(i2c, &tda_state)) != 0) return status;
 
+#if 0
 	// create the real state we'll be passing about
 	if ((ptda_state = (struct tda1004x_state*) kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL)) == NULL) {
 		return -ENOMEM;
 	}
 	memcpy(ptda_state, &tda_state, sizeof(struct tda1004x_state));
 	*data = ptda_state;
+#endif
 
 	// register
         switch(tda_state.fe_type) {
         case FE_TYPE_TDA10045H:
-		return dvb_register_frontend(tda1004x_ioctl, i2c, ptda_state, &tda10045h_info);
+		return dvb_register_frontend(tda1004x_ioctl, i2c, (void *)(*((u32*) &tda_state)), &tda10045h_info);
+//		return dvb_register_frontend(tda1004x_ioctl, i2c, ptda_state, &tda10045h_info);
 
         case FE_TYPE_TDA10046H:
-		return dvb_register_frontend(tda1004x_ioctl, i2c, ptda_state, &tda10046h_info);
+		return dvb_register_frontend(tda1004x_ioctl, i2c, (void *)(*((u32*) &tda_state)), &tda10046h_info);
+//		return dvb_register_frontend(tda1004x_ioctl, i2c, ptda_state, &tda10046h_info);
         }
 
         // should not get here

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-07-11 23:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-11 23:26 [DVB] tda1004x frontend regression Ian Molton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®