[i2c] [patch 4/5] i2c board_info and i2c_new_device()
Jean Delvare
khali at linux-fr.org
Thu Mar 8 07:13:45 CET 2007
Hi David,
Something I overlooked...
On Thu, 15 Feb 2007 00:46:10 -0800, David Brownell wrote:
> +/**
> + * struct i2c_board_info - template for device creation
> + * @driver: identifies the driver to be bound to the device
> + * @dev_addr: stored in i2c_client.addr
> + * @bus_num: usually matches i2c_client.adapter->nr
> + * @platform_data: stored in i2c_client.dev.platform_data
> + * @irq: stored in i2c_client.irq
> +
> + * I2C doesn't actually support hardware probing, although controllers and
> + * devices may be able to use I2C_SMBUS_QUICK to tell whether or not there's
> + * a device at a given address. Drivers commonly need more information than
> + * that, such as chip type, configuration, associated IRQ, and so on.
> + *
> + * i2c_board_info is used to build tables of information listing I2C devices
> + * that are present. This information is used to grow the driver model tree
> + * for "new style" I2C drivers. For mainboards this is done statically using
> + * i2c_register_board_info(), where @bus_num represents an adapter that isn't
> + * yet available. For add-on boards, i2c_new_device() does this dynamically
> + * with the adapter already known.
> + */
> +struct i2c_board_info {
> + char driver[KOBJ_NAME_LEN];
> + short bus_num;
> + unsigned short dev_addr;
> + void *platform_data;
> + int irq;
> +};
You need to include room for the client flags here. Otherwise we won't
be able to instantiate 10-bit or PEC-enabled clients.
Thanks,
--
Jean Delvare
More information about the i2c
mailing list