diff options
| author | James Simmons <jsimmons@kozmo.(none)> | 2003-04-11 07:51:00 -0700 |
|---|---|---|
| committer | James Simmons <jsimmons@kozmo.(none)> | 2003-04-11 07:51:00 -0700 |
| commit | 39074c8cbbb5a17ff7c1e523f1496c63d5ed9848 (patch) | |
| tree | 78c0bdcf27a24252f030d7beec88ac96278346b8 /include/linux | |
| parent | 808c8a580dc03b5431d888e84dd597eeca3f097c (diff) | |
| parent | 21347414286dfc62520a100b1affa2040c16c198 (diff) | |
Merge kozmo.(none):/usr/src/linus-2.5
into kozmo.(none):/usr/src/fbdev-2.5
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/i2c-dev.h | 6 | ||||
| -rw-r--r-- | include/linux/i2c.h | 13 | ||||
| -rw-r--r-- | include/linux/kobject.h | 22 |
3 files changed, 34 insertions, 7 deletions
diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h index 3803c36293a8..dd2e43c66905 100644 --- a/include/linux/i2c-dev.h +++ b/include/linux/i2c-dev.h @@ -31,16 +31,16 @@ /* This is the structure as used in the I2C_SMBUS ioctl call */ struct i2c_smbus_ioctl_data { - char read_write; + __u8 read_write; __u8 command; - int size; + __u32 size; union i2c_smbus_data *data; }; /* This is the structure as used in the I2C_RDWR ioctl call */ struct i2c_rdwr_ioctl_data { struct i2c_msg *msgs; /* pointers to i2c_msgs */ - int nmsgs; /* number of i2c_msgs */ + __u32 nmsgs; /* number of i2c_msgs */ }; #endif /* _LINUX_I2C_DEV_H */ diff --git a/include/linux/i2c.h b/include/linux/i2c.h index bc10de846363..12befd6bd7e0 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -182,6 +182,13 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data) return dev_set_drvdata (&dev->dev, data); } +#define I2C_DEVNAME(str) .dev = { .name = str } + +static inline char *i2c_clientname(struct i2c_client *c) +{ + return c->dev.name; +} + /* * The following structs are for those who like to implement new bus drivers: * i2c_algorithm is the interface to a class of hardware solutions which can @@ -360,15 +367,15 @@ extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func); */ struct i2c_msg { __u16 addr; /* slave address */ - unsigned short flags; + __u16 flags; #define I2C_M_TEN 0x10 /* we have a ten bit chip address */ #define I2C_M_RD 0x01 #define I2C_M_NOSTART 0x4000 #define I2C_M_REV_DIR_ADDR 0x2000 #define I2C_M_IGNORE_NAK 0x1000 #define I2C_M_NO_RD_ACK 0x0800 - short len; /* msg length */ - char *buf; /* pointer to msg data */ + __u16 len; /* msg length */ + __u8 *buf; /* pointer to msg data */ }; /* To determine what functionality is present */ diff --git a/include/linux/kobject.h b/include/linux/kobject.h index e9cfa0dc3d24..8c84e7bce42e 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -57,12 +57,24 @@ struct kobj_type { * of object; multiple ksets can belong to one subsystem. All * ksets of a subsystem share the subsystem's lock. * + * Each kset can support hotplugging; if it does, it will be given + * the opportunity to filter out specific kobjects from being + * reported, as well as to add its own "data" elements to the + * environment being passed to the hotplug helper. */ +struct kset_hotplug_ops { + int (*filter)(struct kset *kset, struct kobject *kobj); + char *(*name)(struct kset *kset, struct kobject *kobj); + int (*hotplug)(struct kset *kset, struct kobject *kobj, char **envp, + int num_envp, char *buffer, int buffer_size); +}; + struct kset { struct subsystem * subsys; struct kobj_type * ktype; struct list_head list; struct kobject kobj; + struct kset_hotplug_ops * hotplug_ops; }; @@ -86,6 +98,13 @@ static inline void kset_put(struct kset * k) kobject_put(&k->kobj); } +static inline struct kobj_type * get_ktype(struct kobject * k) +{ + if (k->kset && k->kset->ktype) + return k->kset->ktype; + else + return k->ktype; +} extern struct kobject * kset_find_obj(struct kset *, const char *); @@ -95,11 +114,12 @@ struct subsystem { struct rw_semaphore rwsem; }; -#define decl_subsys(_name,_type) \ +#define decl_subsys(_name,_type,_hotplug_ops) \ struct subsystem _name##_subsys = { \ .kset = { \ .kobj = { .name = __stringify(_name) }, \ .ktype = _type, \ + .hotplug_ops =_hotplug_ops, \ } \ } |
