Hi Geert, I am still struckling with the I2C driver and I have problems to install your code correctly. First a list what I did:
1. I checked the configuration of the kernel: kernelconfig -->Drivers for built-in interfaces ---> x x [*] I2C support x x [*] I2C uses PB not PB-I2C x x (0) I2C SDA bit number x x (1) I2C SCL bit number x x [ ] I2C EEPROM (non-volatile RAM) support 2. I copied your files: cp -v /Volumes/DEVBOARD/bigblue/drive_led/i2c.h /Volumes/DEVBOARD/os/ linux-2.6/arch/cris/arch-v10/drivers/ cp -v /Volumes/DEVBOARD/bigblue/drive_led/i2c.c /Volumes/DEVBOARD/os/ linux-2.6/arch/cris/arch-v10/drivers/ cp -v /Volumes/DEVBOARD/bigblue/drive_led/etraxi2c.h /Volumes/ DEVBOARD/os/linux-2.6/include/asm-cris/ cp -v /Volumes/DEVBOARD/bigblue/drive_led/i2c_errno.h /Volumes/ DEVBOARD/os/linux-2.6/include/asm-cris/ (Please note that /Volumes/DEVBOARD/ is just a mount point of a samba share.) 3. I changed the code in i2c.c to use static major number: //#define DYNAMIC_MAJOR_I2CDEV_NUMBER_ALLOC #undef DYNAMIC_MAJOR_I2CDEV_NUMBER_ALLOC 4. I added a debug function to read out the actual level of the SDA and SCL pins. With this setup your code is compiled when I run make of a new fimage, but the code is not in effect. Whatever changes I do in the source code of i2c.c, there is no effect to the execution of code. I do not know what i2c.c file is installed in the fimage, but it is not the one in DEVBOARD/os/linux-2.6/arch/cris/arch-v10/drivers/. There are more than 20 locations in the file tree, where a file i2c.c is located. In the following there is a list I created with "locate i2c.c": /home/fox/devboard-R2_01/apps/i2c/i2c.c /home/fox/devboard-R2_01/apps/i2c/.svn/prop-base/i2c.c.svn-base /home/fox/devboard-R2_01/apps/i2c/.svn/props/i2c.c.svn-work /home/fox/devboard-R2_01/apps/i2c/.svn/text-base/i2c.c.svn-base /home/fox/devboard-R2_01/bigblue/drive_led/i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/arch/cris/ arch-v10/drivers/i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/arch/cris/ arch-v10/drivers/i2c.c.orig /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/arch/cris/ arch-v10/drivers/.svn/prop-base/i2c.c.svn-base /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/arch/cris/ arch-v10/drivers/.svn/props/i2c.c.svn-work /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/arch/cris/ arch-v10/drivers/.svn/text-base/i2c.c.svn-base /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/arch/cris/ arch-v32/drivers/i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/arch/ powerpc/platforms/powermac/low_i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/arch/ppc/ platforms/pmac_low_i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ acorn/char/i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ i2c/busses/scx200_i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ media/common/saa7146_i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ media/dvb/b2c2/flexcop-i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ media/dvb/dvb-usb/dvb-usb-i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ media/video/bttv-i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ media/video/cx88/cx88-i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ media/video/em28xx/em28xx-i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ media/video/ir-kbd-i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ media/video/saa7134/saa7134-i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ media/video/zr36120_i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ net/sk98lin/ski2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ sbus/char/bbc_i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ sbus/char/vfc_i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ video/aty/radeon_i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ video/i810/i810-i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ video/nvidia/nv_i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ video/riva/rivafb-i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/drivers/ video/savage/savagefb-i2c.c /home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1/sound/i2c/ i2c.c /home/fox/devboard-R2_01/os/linux-tag--devboard-R2_01/arch/cris/ drivers/i2c.c /home/fox/devboard-R2_01/os/linux-tag--devboard-R2_01/arch/cris/ drivers/.svn/prop-base/i2c.c.svn-base /home/fox/devboard-R2_01/os/linux-tag--devboard-R2_01/arch/cris/ drivers/.svn/props/i2c.c.svn-work /home/fox/devboard-R2_01/os/linux-tag--devboard-R2_01/arch/cris/ drivers/.svn/text-base/i2c.c.svn-base /home/fox/devboard-R2_01/os/linux-tag--devboard-R2_01/drivers/acorn/ char/i2c.c /home/fox/devboard-R2_01/os/linux-tag--devboard-R2_01/drivers/i2c/ scx200_i2c.c /home/fox/devboard-R2_01/os/linux-tag--devboard-R2_01/drivers/media/ video/zr36120_i2c.c /home/fox/devboard-R2_01/os/linux-tag--devboard-R2_01/drivers/net/ sk98lin/ski2c.c /home/fox/devboard-R2_01/os/linux-tag--devboard-R2_01/drivers/sbus/ char/bbc_i2c.c /home/fox/devboard-R2_01/os/linux-tag--devboard-R2_01/drivers/sbus/ char/vfc_i2c.c /home/fox/devboard-R2_01/os/linux-tag--devboard-R2_01/drivers/scsi/ cpqfcTSi2c.c Therefore I assume, that I simply replaced the wrong i2c.c file (and i2c.h, of course) with the code you had posted. Can you give me a hint how to install your i2c driver correctly? Thank you very much in advance. .................... Thomas Treyer Am 07.01.2007 um 19:45 schrieb Geert Vancompernolle: > Hi, > > As I mentioned a while ago (see thread > http://tech.groups.yahoo.com/group/foxboard/message/3020), I was busy > studying and possibly trying to improve the current version of the I2C > driver. > > Well, I've just finished reworking the I2C driver. The changes are > quite drastical. The changes result in a faster driver and now it can > cope with all possible cases (at least, the ones that I know of...). > > The driver has been tested on several I2C components (see further) and > there are more to come... > > I've created a zip file that contains the following items: > > - a PDF file describing the changes, showing DSO plots and giving in > detail the timings of the current I2C implementation. > > - a new I2C error header file i2c_errno.h (see PDF file for some > explanation) > > - the changed i2c.h header file > > - the changed etraxi2c.h header file > > - the new I2C source file > > - an example file which has been used to test the I2C driver on the > following devices: > * NVM 24C32 > * PCF8574 > * PCF8591 > > - Makefile to use for the example code. > > - switches header file to activate one or more of the tested > components. > > Those interested can have a look over here: > > http://tech.groups.yahoo.com/group/foxboard/files/GeertVc > > All suggestions/improvements/remarks are welcome. > > I would especially ask John Crispin to have a look at the driver (John > knows what I'm talking about...) > > Best rgds, > > --Geert > > > [Non-text portions of this message have been removed]
