mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 06:41:39 +00:00
i2c: Add support for device alias names
Based on earlier work by Jon Smirl and Jochen Friedrich. This patch allows new-style i2c chip drivers to have alias names using the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this point, the old i2c driver binding scheme (driver_name/type) is still supported. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Jochen Friedrich <jochen@scram.de> Cc: Jon Smirl <jonsmirl@gmail.com> Cc: Kay Sievers <kay.sievers@vrfy.org>
This commit is contained in:
parent
ee56d97742
commit
d2653e9273
43 changed files with 146 additions and 54 deletions
|
@ -126,7 +126,7 @@ struct i2c_driver {
|
|||
* With the driver model, device enumeration is NEVER done by drivers;
|
||||
* it's done by infrastructure. (NEW STYLE DRIVERS ONLY)
|
||||
*/
|
||||
int (*probe)(struct i2c_client *);
|
||||
int (*probe)(struct i2c_client *, const struct i2c_device_id *);
|
||||
int (*remove)(struct i2c_client *);
|
||||
|
||||
/* driver model interfaces that don't relate to enumeration */
|
||||
|
@ -140,11 +140,10 @@ struct i2c_driver {
|
|||
int (*command)(struct i2c_client *client,unsigned int cmd, void *arg);
|
||||
|
||||
struct device_driver driver;
|
||||
const struct i2c_device_id *id_table;
|
||||
};
|
||||
#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver)
|
||||
|
||||
#define I2C_NAME_SIZE 20
|
||||
|
||||
/**
|
||||
* struct i2c_client - represent an I2C slave device
|
||||
* @flags: I2C_CLIENT_TEN indicates the device uses a ten bit chip address;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue