Subashini Balaraman wrote:
  We are trying to use I2C bus to access any chip on
the DVEVM. We are using the sample code that came with
the DVEVM 1.10.01 download from the TI website.

 Our code compiles well on our Linux PC. But when
cross-compiling for ARM, there are a lot of
compilation errors in the include file i2c.h.
We use these:
#include <linux/i2c.h> and #include <linux/i2c-dev.h>
as specified in the dev-interface doc that came with
the documentation.

I create a header file including only the definitions I need as part of the build process.
(makefile snippet below)  This may not be applicable to your situation.

Roberto Waltman




Makefile:
.....
.....

#----------------------------------------------------------------------
# extract necessary definitions from i2c.h
# (including the whole file fails compilation)
# ARMINC is defined in the environment as the
# path to the cross-compiler base include
# directory

i2c_defs.h :
   @echo "creating i2c_defs.h"
@echo "#ifndef I2C_DEFS_H" >i2c_defs.h @echo "#define I2C_DEFS_H" >>i2c_defs.h @echo >>i2c_defs.h @echo "/* extracted from <linux/i2c.h> - do not edit */" >>i2c_defs.h @echo >>i2c_defs.h @grep "#[\t ]*define[\t ][\t ]*I2C_SLAVE[^A-Z0-9_]" $(ARMINC)/linux/i2c.h >>i2c_defs.h @grep "#[\t ]*define[\t ][\t ]*I2C_FUNCS[^A-Z0-9_]" $(ARMINC)/linux/i2c.h >>i2c_defs.h @grep "#[\t ]*define[\t ][\t ]*I2C_RDWR[^A-Z0-9_]" $(ARMINC)/linux/i2c.h >>i2c_defs.h @echo >>i2c_defs.h @echo "#endif /* I2C_DEFS_H */" >>i2c_defs.h



_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to