Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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