diff options
Diffstat (limited to 'include/linux/i2c.h')
| -rw-r--r-- | include/linux/i2c.h | 22 | 
1 files changed, 13 insertions, 9 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 500404d85141..13a1ce38cb0c 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -236,8 +236,8 @@ enum i2c_driver_flags {  /**   * struct i2c_driver - represent an I2C device driver   * @class: What kind of i2c device we instantiate (for detect) - * @probe: Callback for device binding - soon to be deprecated - * @probe_new: New callback for device binding + * @probe: Callback for device binding + * @probe_new: Transitional callback for device binding - do not use   * @remove: Callback for device unbinding   * @shutdown: Callback for device shutdown   * @alert: Alert callback, for example for the SMBus alert protocol @@ -272,14 +272,18 @@ enum i2c_driver_flags {  struct i2c_driver {  	unsigned int class; +	union {  	/* Standard driver model interfaces */ -	int (*probe)(struct i2c_client *client, const struct i2c_device_id *id); +		int (*probe)(struct i2c_client *client); +		/* +		 * Legacy callback that was part of a conversion of .probe(). +		 * Today it has the same semantic as .probe(). Don't use for new +		 * code. +		 */ +		int (*probe_new)(struct i2c_client *client); +	};  	void (*remove)(struct i2c_client *client); -	/* New driver model interface to aid the seamless removal of the -	 * current probe()'s, more commonly unused than used second parameter. -	 */ -	int (*probe_new)(struct i2c_client *client);  	/* driver model interfaces that don't relate to enumeration  */  	void (*shutdown)(struct i2c_client *client); @@ -381,7 +385,6 @@ static inline void i2c_set_clientdata(struct i2c_client *client, void *data)  /* I2C slave support */ -#if IS_ENABLED(CONFIG_I2C_SLAVE)  enum i2c_slave_event {  	I2C_SLAVE_READ_REQUESTED,  	I2C_SLAVE_WRITE_REQUESTED, @@ -392,9 +395,10 @@ enum i2c_slave_event {  int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb);  int i2c_slave_unregister(struct i2c_client *client); -bool i2c_detect_slave_mode(struct device *dev);  int i2c_slave_event(struct i2c_client *client,  		    enum i2c_slave_event event, u8 *val); +#if IS_ENABLED(CONFIG_I2C_SLAVE) +bool i2c_detect_slave_mode(struct device *dev);  #else  static inline bool i2c_detect_slave_mode(struct device *dev) { return false; }  #endif  |