require '_h2ph_pre.ph';

unless(defined(&I2C_H)) {
    eval 'sub I2C_H () {1;}' unless defined(&I2C_H);
    require 'linux/i2c-id.ph';
    require 'linux/types.ph';
    eval 'sub I2C_M_TEN () {0x10;}' unless defined(&I2C_M_TEN);
    eval 'sub I2C_M_RD () {0x1;}' unless defined(&I2C_M_RD);
    eval 'sub I2C_M_NOSTART () {0x4000;}' unless defined(&I2C_M_NOSTART);
    eval 'sub I2C_M_REV_DIR_ADDR () {0x2000;}' unless defined(&I2C_M_REV_DIR_ADDR);
    eval 'sub I2C_FUNC_I2C () {0x1;}' unless defined(&I2C_FUNC_I2C);
    eval 'sub I2C_FUNC_10BIT_ADDR () {0x2;}' unless defined(&I2C_FUNC_10BIT_ADDR);
    eval 'sub I2C_FUNC_PROTOCOL_MANGLING () {0x4;}' unless defined(&I2C_FUNC_PROTOCOL_MANGLING);
    eval 'sub I2C_FUNC_SMBUS_QUICK () {0x10000;}' unless defined(&I2C_FUNC_SMBUS_QUICK);
    eval 'sub I2C_FUNC_SMBUS_READ_BYTE () {0x20000;}' unless defined(&I2C_FUNC_SMBUS_READ_BYTE);
    eval 'sub I2C_FUNC_SMBUS_WRITE_BYTE () {0x40000;}' unless defined(&I2C_FUNC_SMBUS_WRITE_BYTE);
    eval 'sub I2C_FUNC_SMBUS_READ_BYTE_DATA () {0x80000;}' unless defined(&I2C_FUNC_SMBUS_READ_BYTE_DATA);
    eval 'sub I2C_FUNC_SMBUS_WRITE_BYTE_DATA () {0x100000;}' unless defined(&I2C_FUNC_SMBUS_WRITE_BYTE_DATA);
    eval 'sub I2C_FUNC_SMBUS_READ_WORD_DATA () {0x200000;}' unless defined(&I2C_FUNC_SMBUS_READ_WORD_DATA);
    eval 'sub I2C_FUNC_SMBUS_WRITE_WORD_DATA () {0x400000;}' unless defined(&I2C_FUNC_SMBUS_WRITE_WORD_DATA);
    eval 'sub I2C_FUNC_SMBUS_PROC_CALL () {0x800000;}' unless defined(&I2C_FUNC_SMBUS_PROC_CALL);
    eval 'sub I2C_FUNC_SMBUS_READ_BLOCK_DATA () {0x1000000;}' unless defined(&I2C_FUNC_SMBUS_READ_BLOCK_DATA);
    eval 'sub I2C_FUNC_SMBUS_WRITE_BLOCK_DATA () {0x2000000;}' unless defined(&I2C_FUNC_SMBUS_WRITE_BLOCK_DATA);
    eval 'sub I2C_FUNC_SMBUS_READ_I2C_BLOCK () {0x4000000;}' unless defined(&I2C_FUNC_SMBUS_READ_I2C_BLOCK);
    eval 'sub I2C_FUNC_SMBUS_WRITE_I2C_BLOCK () {0x8000000;}' unless defined(&I2C_FUNC_SMBUS_WRITE_I2C_BLOCK);
    eval 'sub I2C_FUNC_SMBUS_BYTE () { &I2C_FUNC_SMBUS_READ_BYTE |  &I2C_FUNC_SMBUS_WRITE_BYTE;}' unless defined(&I2C_FUNC_SMBUS_BYTE);
    eval 'sub I2C_FUNC_SMBUS_BYTE_DATA () { &I2C_FUNC_SMBUS_READ_BYTE_DATA |  &I2C_FUNC_SMBUS_WRITE_BYTE_DATA;}' unless defined(&I2C_FUNC_SMBUS_BYTE_DATA);
    eval 'sub I2C_FUNC_SMBUS_WORD_DATA () { &I2C_FUNC_SMBUS_READ_WORD_DATA |  &I2C_FUNC_SMBUS_WRITE_WORD_DATA;}' unless defined(&I2C_FUNC_SMBUS_WORD_DATA);
    eval 'sub I2C_FUNC_SMBUS_BLOCK_DATA () { &I2C_FUNC_SMBUS_READ_BLOCK_DATA |  &I2C_FUNC_SMBUS_WRITE_BLOCK_DATA;}' unless defined(&I2C_FUNC_SMBUS_BLOCK_DATA);
    eval 'sub I2C_FUNC_SMBUS_I2C_BLOCK () { &I2C_FUNC_SMBUS_READ_I2C_BLOCK |  &I2C_FUNC_SMBUS_WRITE_I2C_BLOCK;}' unless defined(&I2C_FUNC_SMBUS_I2C_BLOCK);
    eval 'sub I2C_FUNC_SMBUS_EMUL () { &I2C_FUNC_SMBUS_QUICK |  &I2C_FUNC_SMBUS_BYTE |  &I2C_FUNC_SMBUS_BYTE_DATA |  &I2C_FUNC_SMBUS_WORD_DATA |  &I2C_FUNC_SMBUS_PROC_CALL |  &I2C_FUNC_SMBUS_WRITE_BLOCK_DATA;}' unless defined(&I2C_FUNC_SMBUS_EMUL);
    eval 'sub I2C_SMBUS_READ () {1;}' unless defined(&I2C_SMBUS_READ);
    eval 'sub I2C_SMBUS_WRITE () {0;}' unless defined(&I2C_SMBUS_WRITE);
    eval 'sub I2C_SMBUS_QUICK () {0;}' unless defined(&I2C_SMBUS_QUICK);
    eval 'sub I2C_SMBUS_BYTE () {1;}' unless defined(&I2C_SMBUS_BYTE);
    eval 'sub I2C_SMBUS_BYTE_DATA () {2;}' unless defined(&I2C_SMBUS_BYTE_DATA);
    eval 'sub I2C_SMBUS_WORD_DATA () {3;}' unless defined(&I2C_SMBUS_WORD_DATA);
    eval 'sub I2C_SMBUS_PROC_CALL () {4;}' unless defined(&I2C_SMBUS_PROC_CALL);
    eval 'sub I2C_SMBUS_BLOCK_DATA () {5;}' unless defined(&I2C_SMBUS_BLOCK_DATA);
    eval 'sub I2C_SMBUS_I2C_BLOCK_DATA () {6;}' unless defined(&I2C_SMBUS_I2C_BLOCK_DATA);
    eval 'sub I2C_RETRIES () {0x701;}' unless defined(&I2C_RETRIES);
    eval 'sub I2C_TIMEOUT () {0x702;}' unless defined(&I2C_TIMEOUT);
    eval 'sub I2C_SLAVE () {0x703;}' unless defined(&I2C_SLAVE);
    eval 'sub I2C_SLAVE_FORCE () {0x706;}' unless defined(&I2C_SLAVE_FORCE);
    eval 'sub I2C_TENBIT () {0x704;}' unless defined(&I2C_TENBIT);
    eval 'sub I2C_FUNCS () {0x705;}' unless defined(&I2C_FUNCS);
    eval 'sub I2C_RDWR () {0x707;}' unless defined(&I2C_RDWR);
    if(0) {
	eval 'sub I2C_ACK_TEST () {0x710;}' unless defined(&I2C_ACK_TEST);
    }
    eval 'sub I2C_SMBUS () {0x720;}' unless defined(&I2C_SMBUS);
    eval 'sub I2C_UDELAY () {0x705;}' unless defined(&I2C_UDELAY);
    eval 'sub I2C_MDELAY () {0x706;}' unless defined(&I2C_MDELAY);
    eval 'sub I2C_MAJOR () {89;}' unless defined(&I2C_MAJOR);
}
1;
