I need to use the I2C bus interface in slave mode, but I can't find any hint on how to proceed.
Is there a Linux module or some demonstration software to use the I2C Bus in slave mode for OMAP35xx processor
family?
Thanks for any suggestions.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I need to use the I2C bus interface in slave mode, but I can't find any hint on how to proceed.
Is there a Linux module or some demonstration software to use the I2C Bus in slave mode for OMAP35xx processor
family?
Thanks for any suggestions.
Hello,
I don't know if you're still waiting for an answer... I currently try to implement an I2C-slave-driver in linux (the easy way) - that means I take the standard I2c-master code for the OMAP3530 and expand it so that it can also operate in slave mode.
Oh Yes! I'm still looking for a i2c bus slave driver under Linux. I'd like to find something that could solve my problem. Can you tell me something when this driver is ready?
I'm currently running a test version of it and I already received many bytes ;-). One issue is that my driver has to extract the first databyte out of a stream to evaluate it. (this is due to a specific protocol that I have to implement). I should remove this feature for general purposes.
Another thing to be aware of is, that my driver isn't completely independent of the kernel version because it extends the available driver. I use kernel 2.6.32 (git://www.sakoman.com/git/linux-omap-2.6.git;branch=omap3-2.6.32) but an adaption to another kernel is possible of course.
If you don't have a more official solution to the i2c slave problem I could prepare a kernel patch that extends the standard i2c master driver for a specific kernel. My current version supports the open(), close(), read() and write()-systemcalls. I tested it at a single master bus and it seems to work so far.
Eventually one could include some more features, but this depends on the application.
I am waiting for your driver: as soon as possible I'll try it when it will be available. The version of my the kernel is "2.6.29-rc3-omap1. Thanks!!
Hi Youssef,
spontaneously I haven't found the 2.6.29-rc3-omap1 kernel source code - so a driver patch might break because of little differences between your actual kernel and my version. I have adapted my current driver version to the interfaces provided by the 2.6.29-omap1 driver (which are probably / hopefully compatible to your rc3-version). You can download the driver file, a little application example and a readme from http://www-user.tu-chemnitz.de/~sebag/i2c_omap_slave.tar.gz . Just try whether it compiles without errors... If you notice a bug please post again
I am very happy today, finally some good news about this eagerly awaited driver! Thank you very much for your help and the attached explanations (all seems very clear). The eve of Easter does not allow me to test this driver immediately, Tuesday morning it will be my first priority!
Happy Easter !!!
Thanks ;-) - I'm curious whether it will work for you. Two things that I forgot to write: the OMAPs I2C address is currently hardcoded in the driver (as a define, I think it's set to address 0x01). And before you connect the I2c-bus make sure that the voltage levels fit because the OMAP expects a 1,8V bus - voltage shifters might be necessary. Have some nice holidays...
Is Working!!!!!!! Really thanks for your help, everything works fine. Now I can proceed as I had decided from the beginning of the project. Still compliments for how you've changed the i2c bus Linux's driver.
Gianni.
Hey, that sounds great. Meanwhile I've just made a minor change in the driver so that it supports to send more than 200 bytes at once (write systemcall implementation). So don't wonder if the driver rejects sending more than 200 bytes at once in the older version. Everything else should work. Good luck with your project!
You can download the driver having the new write-systemcall integrated now. Either using the old link or from my TI profile, where uploads obviously should be located.
Cheers
Hello Geissler-san,
I'm using Kernel version 2.6.37, I need also slave mode driver of that version.
I compared your i2c-omap.c of 2.6.32 and 2.6.37 one, but there are many differences between your i2c-omap.c of 2.6.32 and 2.6.37.
Do you have i2c-omap.c of 2.6.37 with slave mode supported?
Thank you.
Sorry, but I don't adapt the driver any further for newer kernels because my field of work changed. You could try to extend the newer kernel on your own or -- if the interfaces to the I2C core didn't change -- use my old C-file together with the newer kernel. This way you would just have to check if the interfaces to the core still work and the hardware-specific part would stay old (and hopefully working as it did in 2.6.32)
Hi Sebastian,
I use Omap 3530 and my kernel version 2.6.32. And I need i2c slave mode driver. But I couldn't find your patch anywhere. Do you mind sending me your i2c slave mode patch for omap?
Thanks.
Hi Serkan,
you can find the code by navigating to my TI-profile and entering the "Files" section. Up to now I had an archive there, that seemed to be based on Kernel 2.6.29. I've added a second archive now with a version I just found on my harddrive ... it's for linux-2.6.32 ;-) . Check the readme for further details
Hi Sebastian,
Nice to meet you!
I need to use the I2C bus interface in slave mode and base on linux3.2.0&AM335x.I know you provided module is base on linux2.6.32,and I tried to port them from linux2.6.32 to linux 3.2.0 but I realize it is not easy, so I want to ask for your help, could you provide the i2c driver can surport slave mode base on linux3.2.0&AM335x ?
I very much look forword to hear about this information.
Thanks a lot!
Hello Kim,
I didn't port the driver to newer kernels because I left the research project that requested these developments. You can find my driver/patches in my profile in the files section. If you see and understand the changes I made you can apply them accordingly to your kernel. Can you do this (or have you already done this)?