Mailing List archive

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

[linux-dvb] Re: alps_tdlb7 broken in current dvb-kernel



Hi,

On 24.09.2004 17:42, Michael Hunold wrote:
Perhaps you can go through the old and new version, compare them and find the error by yourself? I'll have a look at the code and come back to you if I find anything suspicous.
Can you please try out the attached patch (directly inside the frontend directory)? The changes are not that crucial, but the open/close on the i2c gate may not be correct.

Thanks,
Juri
CU
Michael.
--- alps_tdlb7.c	2004-09-24 17:52:00.000000000 +0200
+++ a.c	2004-09-24 17:51:17.000000000 +0200
@@ -108,20 +108,14 @@
 static int sp5659_write (struct i2c_adapter *i2c, u8 data [4])
 {
         int ret;
+        struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = data, .len = 4 };
 
-        u8 buf_open [] = { 0x206 >> 8, 0x206 & 0xff, 0x001 >> 8, 0x001 & 0xff };
-        u8 buf_close [] = { 0x206 >> 8, 0x206 & 0xff, 0x000 >> 8, 0x000 & 0xff };
+        ret = i2c_transfer (i2c, &msg, 1);
 
-        struct i2c_msg msg[3] = { {.addr = 0x71, .flags = 0, .buf = buf_open, .len = 4 },
-				  {.addr = 0x60, .flags = 0, .buf = data, .len = 4 },
-				  {.addr = 0x71, .flags = 0, .buf = buf_close, .len = 4 } };
-
-        ret = i2c_transfer (i2c, &msg[0], 3);
-
-        if (ret != 3)
+        if (ret != 1)
                 printk("%s: i/o error (ret == %i)\n", __FUNCTION__, ret);
 
-        return (ret != 3) ? -EREMOTEIO : 0;
+        return (ret != 1) ? -1 : 0;
 }
 
 static void sp5659_set_tv_freq (struct i2c_adapter *i2c, u32 freq)
@@ -141,7 +135,9 @@
 	buf[3] = pwr << 6;
 
 	/* open i2c gate for PLL message transmission... */
+	sp8870_writereg(i2c, 0x206, 0x001);
 	sp5659_write (i2c, buf);
+	sp8870_writereg(i2c, 0x206, 0x000);
 }
 
 static int sp8870_firmware_upload (struct i2c_adapter *i2c, const struct firmware *fw)

Home | Main Index | Thread Index