++#ifndef I2C_SLAVE
++/* #include <linux/i2c.h> cannot be used with i2c 2.8.x - it's for internal
++ * kernel use; stuff below is copied from i2c.h and old i2c-dev.h */
++#define I2C_SLAVE 0x0703 /* Change slave address */
++ /* Attn.: Slave address is 7 or 10 bits */
++/*
++ * Data for SMBus Messages
++ */
++#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
++union i2c_smbus_data {
++ __u8 byte;
++ __u16 word;
++ __u8 block[I2C_SMBUS_BLOCK_MAX + 3]; /* block[0] is used for length */
++ /* one more for read length in block process call */
++ /* and one more for PEC */
++};
++#define I2C_SMBUS 0x0720 /* SMBus-level access */
++static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command,
++ int size, union i2c_smbus_data *data)
++{
++ struct i2c_smbus_ioctl_data args;
++
++ args.read_write = read_write;
++ args.command = command;
++ args.size = size;
++ args.data = data;
++ return ioctl(file,I2C_SMBUS,&args);
++}
++/* smbus_access read or write markers */
++#define I2C_SMBUS_WRITE 0
++#define I2C_SMBUS_BYTE_DATA 2
++#define I2C_SMBUS_WORD_DATA 3
++static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command,
++ __u8 value)
++{
++ union i2c_smbus_data data;
++ data.byte = value;
++ return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
++ I2C_SMBUS_BYTE_DATA, &data);
++}
++static inline __s32 i2c_smbus_write_word_data(int file, __u8 command,
++ __u16 value)
++{
++ union i2c_smbus_data data;
++ data.word = value;
++ return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
++ I2C_SMBUS_WORD_DATA, &data);
++}
++#endif