diff options
author | Mark Brown <broonie@kernel.org> | 2015-02-21 18:06:59 +0900 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-02-21 18:06:59 +0900 |
commit | 5c4f9098b76b4d3aa797513db19bb11696942953 (patch) | |
tree | 7e42df26ffd218120dad54b204f0a07f84a54f70 /include/linux/i2c.h | |
parent | def31719e14fb7866fa243c453393ca7b90cca73 (diff) | |
parent | 80124ed1ec12ae83dfdcae3ca15e491a813c1729 (diff) |
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-androidlsk-v3.10-android-15.02lsk-v3.10-android-14.02
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r-- | include/linux/i2c.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index e988fa935b3c..21891898ced0 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -542,6 +542,26 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) #endif /* I2C */ +#if IS_ENABLED(CONFIG_OF) +/* must call put_device() when done with returned i2c_client device */ +extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node); + +/* must call put_device() when done with returned i2c_adapter device */ +extern struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node); + +#else + +static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node) +{ + return NULL; +} + +static inline struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node) +{ + return NULL; +} +#endif /* CONFIG_OF */ + #if IS_ENABLED(CONFIG_ACPI_I2C) extern void acpi_i2c_register_devices(struct i2c_adapter *adap); #else |