Mailing List archive

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

[linux-dvb] Re: [PATCHES] Frontend kernel i2c conversion.



On Tuesday 20 July 2004 00:11, Andreas Witte wrote:
> Hello All!
>
> I realized that mt352 frontend and tda1004x frontend is damaged!?
>
> Since some time, i get crazy sound out of my technotrend dvb-t card
> after channel switching, but only on some stations... The audio module
> seems not to be the problem, since i hear any music or watch videos with
> mplayer without problems. (Current cvs of linuxtv).
>
> The mt352 frontend still crash if i load them for an aver dvb-t 771
> card.
>
> Are they still under work?

Sorry that this got so delayed, but would you be interrested in testing the 
attached patch for the mt352 frontend, and see if that's what's needed to get 
in back in workable state?

Kenneth
Index: mt352.c
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/frontends/mt352.c,v
retrieving revision 1.11
diff -u -r1.11 mt352.c
--- mt352.c	17 Jul 2004 14:51:41 -0000	1.11
+++ mt352.c	28 Jul 2004 11:16:50 -0000
@@ -60,7 +60,6 @@
 
 struct mt352_state {
 	struct i2c_adapter *i2c;
-	struct dvb_adapter *dvb;
 };
 
 #define mt352_write(ibuf, ilen)						\
@@ -546,8 +545,7 @@
 	ret = i2c_transfer(i2c, msg, 2);
 
 	if (ret != 2)
-		printk(KERN_WARNING
-		       "%s: readreg error (ret == %i)\n", __FUNCTION__, ret);
+		dprintk("readreg error (ret == %i)\n", ret);
 
 	return b1[0];
 }
@@ -821,16 +819,6 @@
 		return ret;
 	}
 
-	BUG_ON(!state->dvb);
-
-	if ((ret = dvb_register_frontend_new(mt352_ioctl, state->dvb, state,
-					     &mt352_info, THIS_MODULE))) {
-		i2c_detach_client(client);
-		kfree(client);
-		kfree(state);
-		return ret;
-	}
-
 	return 0;
 }
 
@@ -838,9 +826,7 @@
 {
 	struct mt352_state *state = i2c_get_clientdata(client);
 
-	dvb_unregister_frontend_new (mt352_ioctl, state->dvb);
 	i2c_detach_client(client);
-	BUG_ON(state->dvb);
 	kfree(client);
 	kfree(state);
 	return 0;
@@ -848,14 +834,18 @@
 
 static int mt352_command (struct i2c_client *client, unsigned int cmd, void *arg)
 {
-	struct mt352_state *state = i2c_get_clientdata(client);
-
 	switch (cmd) {
 	case FE_REGISTER:
-		state->dvb = arg;
+		BUG_ON(!arg);
+		dprintk("registering frontend.\n");
+		dvb_register_frontend_new(mt352_ioctl, arg, NULL,
+					  &mt352_info, THIS_MODULE);
+
 		break;
 	case FE_UNREGISTER:
-		state->dvb = NULL;
+		BUG_ON(!arg);
+		dprintk("unregistering frontend.\n");
+		dvb_unregister_frontend_new (mt352_ioctl, arg);
 		break;
 	default:
 		return -EOPNOTSUPP;

Home | Main Index | Thread Index