[Sun Aug 13 2006] [18:32:52] hi [Sun Aug 13 2006] [18:34:32] <{ma}> this is what i implemented for the Hw I2C .. http://pastebin.ca/129383 [Sun Aug 13 2006] [18:34:53] <{ma}> how would you suggest to go on integrating it into the current cx88 scenario ? [Sun Aug 13 2006] [18:36:42] looking... [Sun Aug 13 2006] [18:39:20] hmm.. I should test your code. [Sun Aug 13 2006] [18:39:36] Maybe it will just work fine with other cx88 boards. [Sun Aug 13 2006] [18:40:21] I'm in doubt about this: [Sun Aug 13 2006] [18:40:23] + core->int_status = status; + if (status & MO_INT_I2CDONE) + wake_up(&core->i2c_wq); [Sun Aug 13 2006] [18:40:56] and this: [Sun Aug 13 2006] [18:40:57] + init_waitqueue_head(&core->i2c_wq); [Sun Aug 13 2006] [18:41:14] <{ma}> that is interrupt driven I2C [Sun Aug 13 2006] [18:42:06] <{ma}> but i was wondering how to integrate that into the current cx88 implementation [Sun Aug 13 2006] [18:42:23] that's the point... [Sun Aug 13 2006] [18:42:39] currently, the functions are synchronous [Sun Aug 13 2006] [18:43:01] <{ma}> currently, the i2c routines are just bitbanging [Sun Aug 13 2006] [18:43:03] e.g., when you call I2C, it will return only after doing [Sun Aug 13 2006] [18:43:09] <{ma}> that is not how it is in Hw [Sun Aug 13 2006] [18:43:21] <{ma}> It is called upon in the case of an interrupt [Sun Aug 13 2006] [18:43:25] cx88 and saa7134 are very close [Sun Aug 13 2006] [18:43:33] in terms of source code [Sun Aug 13 2006] [18:43:35] <{ma}> i wrote it from the cx88 specs [Sun Aug 13 2006] [18:43:54] <{ma}> Ralph also agrees to it [Sun Aug 13 2006] [18:44:38] <{ma}> but how it is to be integrated into the current scenario, i was thinking .. but the code as it is will work [Sun Aug 13 2006] [18:44:42] hmm... on saa7134, there is this code: [Sun Aug 13 2006] [18:44:43] i2c_is_busy [Sun Aug 13 2006] [18:45:05] <{ma}> let 's not compare code from an another driver [Sun Aug 13 2006] [18:45:17] <{ma}> there is pagemode operations as well for the cx88 [Sun Aug 13 2006] [18:45:32] <{ma}> ie the address sequencer is present [Sun Aug 13 2006] [18:45:40] we need to compare. As I said, both codes are similar [Sun Aug 13 2006] [18:45:41] <{ma}> which many devices do not have [Sun Aug 13 2006] [18:46:06] so, we need to check how saa7134 does bind i2c support on it [Sun Aug 13 2006] [18:46:09] <{ma}> currently on what i worked, the mantis also has a hw address sequencer [Sun Aug 13 2006] [18:46:19] <{ma}> othre than the cx88 [Sun Aug 13 2006] [18:46:22] (of course, the i2c programming stuff will be different) [Sun Aug 13 2006] [18:46:52] <{ma}> it does work as i tested it also, but that testing code did not have any V4L code at all [Sun Aug 13 2006] [18:47:01] <{ma}> completely written from scratch [Sun Aug 13 2006] [18:47:03] but, as saa7134 works fine with hardware i2c, the way i2c events are handled should be similar [Sun Aug 13 2006] [18:47:21] <{ma}> saa7134 also doesn't implement HW I2C properly [Sun Aug 13 2006] [18:47:43] <{ma}> it is a mixture of bitbanging and some convenience functions [Sun Aug 13 2006] [18:47:48] hmm.. on saa7134, it have a loop to check for status. using irq for sure is better. [Sun Aug 13 2006] [18:48:30] <{ma}> BTW, Ralph said he did not write the code for the CX88 [Sun Aug 13 2006] [18:48:44] weird to have his name on it then... [Sun Aug 13 2006] [18:48:52] <{ma}> and he was not so happy to see the code in such a bad state and his copyright being in there [Sun Aug 13 2006] [18:48:56] I dunno who included it [Sun Aug 13 2006] [18:49:07] <{ma}> well, anyway .. [Sun Aug 13 2006] [18:49:20] if he send a msg to V4L ML about it, I can remove its name from the driver [Sun Aug 13 2006] [18:49:31] hmm... [Sun Aug 13 2006] [18:49:33] better... [Sun Aug 13 2006] [18:49:41] <{ma}> maybe somebody copied some of hios code into that for the bitbanging [Sun Aug 13 2006] [18:49:43] he should send me a signed patch removing his name [Sun Aug 13 2006] [18:49:59] c/c to mailing list [Sun Aug 13 2006] [18:50:03] <{ma}> because he wrote bitbanging in the first place [Sun Aug 13 2006] [18:50:11] ah [Sun Aug 13 2006] [18:50:21] <{ma}> so many people copied his code [Sun Aug 13 2006] [18:50:32] <{ma}> he said probably that could be a possible thing [Sun Aug 13 2006] [18:50:49] on saa7134: [Sun Aug 13 2006] [18:50:51] i2c_send_byte [Sun Aug 13 2006] [18:51:00] ... [Sun Aug 13 2006] [18:51:01] if (!i2c_is_busy_wait(dev)) [Sun Aug 13 2006] [18:51:01] return -EIO; [Sun Aug 13 2006] [18:51:20] <{ma}> as i looked at saa7134 too, myself and ralph .. the implementation on saa7134 is also not correct [Sun Aug 13 2006] [18:51:29] so, what saa7134 i2c implementation does is wait for i2c completion [Sun Aug 13 2006] [18:51:33] <{ma}> -EIO is not correct in fact [Sun Aug 13 2006] [18:51:39] <{ma}> it is -EREMOTEIO [Sun Aug 13 2006] [18:51:52] ah, we need then to fix there. [Sun Aug 13 2006] [18:51:54] <{ma}> i2c devices are called Remote devices [Sun Aug 13 2006] [18:52:20] do you need asynchronous i2c ? [Sun Aug 13 2006] [18:52:40] <{ma}> you mean interrupt driven .. ? [Sun Aug 13 2006] [18:53:02] <{ma}> i have the logs on the other machine .. let me switch to it [Sun Aug 13 2006] [18:53:05] <{ma}> one sec [Sun Aug 13 2006] [18:53:29] no. [Sun Aug 13 2006] [18:53:33] what I mean is: [Sun Aug 13 2006] [18:53:56] the easiest way to make it work is to make i2c send/receive routines to wait for completion [Sun Aug 13 2006] [18:54:10] this can be done using IRQ. No trouble with that. [Sun Aug 13 2006] [18:54:35] we can make the routine to sleep until i2c completion or a timeout. *** Logfile started *** on Sun Aug 13 22:38:04 2006 [Sun Aug 13 2006] [22:38:04] manu? [Sun Aug 13 2006] [22:43:22] <{ma}> yep [Sun Aug 13 2006] [22:43:22] Away mchehab is away: No momento, estou ocupado. Currently I'm busy [Sun Aug 13 2006] [22:43:46] <{ma}> i need to go now , will be back a while later [Sun Aug 13 2006] [22:51:47] ok. [Sun Aug 13 2006] [22:51:52] I think I found the trouble. [Sun Aug 13 2006] [22:51:58] I'll do some tests [Sun Aug 13 2006] [23:10:03] Quit mchehab has left this server (Read error: 60 (Operation timed out)). [Mon Aug 14 2006] [01:03:29] Quit mchehab has left this server (Read error: 60 (Operation timed out)).