3

I am trying to port some I2C device drivers I wrote for an other kernel to work with the newer I2C binding model. The kernel documentation goes through the steps of doing this: http://www.mjmwired.net/kernel/Documentation/i2c/upgrading-clients

The thing that I don't understand is when using this new model, how does one specify the I2C address of the device? It used to be done like this:

static unsigned short normal_i2c[] = { 0x67, I2C_CLIENT_END };

I2C_CLIENT_INSMOD;

I don't think my bus/device supports detection.

1

I ended up registering all my I2C devices as platform devices. The entry in the board file looked something like:

static struct i2c_board_info __initdata my_i2c_device = {
        I2C_BOARD_INFO("my_i2c_device", 0x60)
};

(where I2C address = 0x60)

if (i2c_register_board_info(I2C_MY_BUS_ID, &my_i2c_device, 1) < 0) {
    printk(KERN_ERR "i2c_init: cannot register my I2C device\n");
}

See http://www.mjmwired.net/kernel/Documentation/driver-model/platform.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.