Re: af9005/mt2060 module unload failure

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

 



En/na Luca Olivetti ha escrit:
En/na Olaf Titz ha escrit:


(Btw. once tuned, the actual hardware seems to not care about the tuner
module at all, I can stop tzap, lose lock due to disconnected antenna,
etc. and the demuxer doesn't stop streaming. Is this intentional,
hardware limitation, or what?)

I have no idea. I can only say that I have a af9005_fe_sleep function that supposedly turns off the tuner, though I never turn it on again and it still works. I also see from the reference code that there's a power control function that I didn't implement (don't ask me why, I don't remember). I can try to implement it but not today.

Well, the reference code doesn't work at all: as soon as I write to any of these register the usb communication stops (bulk timeout), and I tried one by one. Here's the code for you to play with, disabled with an #ifdef 0

Bye
--
Luca

diff -r 76b92a337aec linux/drivers/media/dvb/dvb-usb/af9005.c
--- a/linux/drivers/media/dvb/dvb-usb/af9005.c	Wed Jun 13 15:11:15 2007 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/af9005.c	Fri Jun 15 21:17:34 2007 +0200
@@ -921,7 +921,73 @@ static int af9005_rc_query(struct dvb_us
 
 static int af9005_power_ctrl(struct dvb_usb_device *d, int onoff)
 {
-
+#if 0
+	/* as soon as any of these register is written to, either for powering
+	up or down, the sticks stops responding to usb bulk messages */
+	int ret;
+	u8 temp;
+	deb_info("af9005_power_ctrl %d\n", onoff);
+	if (onoff) {
+		/* resume OFSM clock */
+		ret = af9005_write_ofdm_register(d, xd_g_reg_ofsm_clk, 0);
+		if (ret)
+			return ret;
+		/* power on ADC */
+		ret = af9005_write_ofdm_register(d, 0xb200, 0xa1);
+		if (ret)
+			return ret;
+		/* release OFSM reset */
+		ret =
+		    af9005_write_register_bits(d, xd_I2C_reg_ofdm_rst,
+					       reg_ofdm_rst_pos,
+					       reg_ofdm_rst_len, 0);
+		if (ret)
+			return ret;
+		/* disable OFDM reset */
+		ret =
+		    af9005_write_register_bits(d, xd_I2C_reg_ofdm_rst_en,
+					       reg_ofdm_rst_en_pos,
+					       reg_ofdm_rst_en_len, 0);
+		if (ret)
+			return ret;
+
+	} else {
+		/* enable OFDM reset */
+		ret =
+		    af9005_write_register_bits(d, xd_I2C_reg_ofdm_rst_en,
+					       reg_ofdm_rst_en_pos,
+					       reg_ofdm_rst_en_len, 1);
+		if (ret)
+			return ret;
+		/* OFSM reset */
+		ret = af9005_write_ofdm_register(d, 0xaeff, 0);
+		if (ret)
+			return ret;
+			*/
+		/* wait for OFSM reset completed */
+		while (1) {
+			ret =
+			    af9005_read_register_bits(d, xd_I2C_reg_ofdm_rst,
+						      reg_ofdm_rst_pos,
+						      reg_ofdm_rst_len, &temp);
+			if (ret)
+				return ret;
+			if (temp)
+				break;
+			msleep(10);
+		}
+		/* power down ADC */
+		ret = af9005_write_ofdm_register(d, 0xb200, 0xa9);
+		if (ret)
+			return ret;
+		/* slow down OFSM clock */
+		printk("slow down ofsm clock");
+		ret = af9005_write_ofdm_register(d, xd_g_reg_ofsm_clk, 7);
+		if (ret)
+			return ret;
+	}
+	deb_info("af9005_power_ctrl ok\n");
+#endif
 	return 0;
 }
 
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux