I2C Header File Causing Compile Issue
This is an update to a previous post from 6/21/07 to which I received no reply. Can anyone Please help!!???
I'm having a serious compile problem I'm hoping somebody can help me with. Documentation and especially examples seem to be non-existent for this issue.
I have a shared object library which implements certain "board support" functions (i.e. accessing devices on our target systems), including I2C. In our currently deployed environment (Based upon Linux 2.4.21 kernel), all is well.
Now, we are looking to transition to the world of Linux 2.6 and we are running into the following problem. It seems that one needs to remove references to most "standard" header files (like stdio.h, etc). However, when I get to the file that implements the I2C driver, I run into problems. IF I don't include <linux/i2c.h>, I get the following:
platformHdw.c:2127: error: storage size of 'msg' isn't known
platformHdw.c:2152: error: `I2C_M_RD' undeclared (first use in this function)
platformHdw.c:2152: error: (Each undeclared identifier is reported only once
platformHdw.c:2152: error: for each function it appears in.)
platformHdw.c:2156: error: `I2C_RDWR' undeclared (first use in this function)
platformHdw.c:2127: warning: unused variable `msg'
As would be expected, since most of this is in the i2c.h file. Now, if I now INCLUDE this in header file, I get the following:
In file included from /usr/include/linux/timex.h:58,
/usr/include/linux/time.h:12: error: redefinition of `struct timespec'
/usr/include/linux/time.h:20: error: parse error before "suseconds_t"
/usr/include/linux/time.h:140: error: redefinition of `struct itimerspec'
/usr/include/linux/time.h:146: error: field `it_interval' has incomplete type
/usr/include/linux/time.h:147: error: field `it_value' has incomplete type
In file included from /usr/include/linux/sched.h:11,
/usr/include/linux/timex.h:147: error: field `time' has incomplete type
In file included from /usr/include/asm/div64.h:3,
/usr/include/asm-generic/div64.h:54:3: #error do_div() does not yet support the C64
And a whole lot more of these type of errors of a similar nature. I understand that a great many things have been moved around, etc, but I am at a loss to find either documentation or examples the would help me overcome this issue.
Can anyone provide any assistance here? I'm really at my wits end here. The cross-compiler or the "native" compiler on the target (for PPC architecture, specifically a PPC440) produce the same results.
Thank you in Advance for your assistance.