Merge branch 'i2c/fwnode-api' into i2c/for-mergewindow

This commit is contained in:
Wolfram Sang
2023-01-17 09:50:02 +01:00
4 changed files with 121 additions and 82 deletions

View File

@@ -965,15 +965,33 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr);
#endif /* I2C */
#if IS_ENABLED(CONFIG_OF)
/* must call put_device() when done with returned i2c_client device */
struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
struct i2c_client *i2c_find_device_by_fwnode(struct fwnode_handle *fwnode);
/* must call put_device() when done with returned i2c_adapter device */
struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
struct i2c_adapter *i2c_find_adapter_by_fwnode(struct fwnode_handle *fwnode);
/* must call i2c_put_adapter() when done with returned i2c_adapter device */
struct i2c_adapter *of_get_i2c_adapter_by_node(struct device_node *node);
struct i2c_adapter *i2c_get_adapter_by_fwnode(struct fwnode_handle *fwnode);
#if IS_ENABLED(CONFIG_OF)
/* must call put_device() when done with returned i2c_client device */
static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
{
return i2c_find_device_by_fwnode(of_fwnode_handle(node));
}
/* must call put_device() when done with returned i2c_adapter device */
static inline struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node)
{
return i2c_find_adapter_by_fwnode(of_fwnode_handle(node));
}
/* must call i2c_put_adapter() when done with returned i2c_adapter device */
static inline struct i2c_adapter *of_get_i2c_adapter_by_node(struct device_node *node)
{
return i2c_get_adapter_by_fwnode(of_fwnode_handle(node));
}
const struct of_device_id
*i2c_of_match_device(const struct of_device_id *matches,