diff options
Diffstat (limited to 'include/linux/i2c.h')
| -rw-r--r-- | include/linux/i2c.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index e988fa935b3c..2ab11dc38077 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -447,11 +447,13 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) | |||
| 447 | static inline struct i2c_adapter * | 447 | static inline struct i2c_adapter * |
| 448 | i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) | 448 | i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) |
| 449 | { | 449 | { |
| 450 | #if IS_ENABLED(I2C_MUX) | ||
| 450 | struct device *parent = adapter->dev.parent; | 451 | struct device *parent = adapter->dev.parent; |
| 451 | 452 | ||
| 452 | if (parent != NULL && parent->type == &i2c_adapter_type) | 453 | if (parent != NULL && parent->type == &i2c_adapter_type) |
| 453 | return to_i2c_adapter(parent); | 454 | return to_i2c_adapter(parent); |
| 454 | else | 455 | else |
| 456 | #endif | ||
| 455 | return NULL; | 457 | return NULL; |
| 456 | } | 458 | } |
| 457 | 459 | ||
| @@ -542,10 +544,24 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) | |||
| 542 | 544 | ||
| 543 | #endif /* I2C */ | 545 | #endif /* I2C */ |
| 544 | 546 | ||
| 545 | #if IS_ENABLED(CONFIG_ACPI_I2C) | 547 | #if IS_ENABLED(CONFIG_OF) |
| 546 | extern void acpi_i2c_register_devices(struct i2c_adapter *adap); | 548 | /* must call put_device() when done with returned i2c_client device */ |
| 549 | extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node); | ||
| 550 | |||
| 551 | /* must call put_device() when done with returned i2c_adapter device */ | ||
| 552 | extern struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node); | ||
| 553 | |||
| 547 | #else | 554 | #else |
| 548 | static inline void acpi_i2c_register_devices(struct i2c_adapter *adap) {} | 555 | |
| 549 | #endif | 556 | static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node) |
| 557 | { | ||
| 558 | return NULL; | ||
| 559 | } | ||
| 560 | |||
| 561 | static inline struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node) | ||
| 562 | { | ||
| 563 | return NULL; | ||
| 564 | } | ||
| 565 | #endif /* CONFIG_OF */ | ||
| 550 | 566 | ||
| 551 | #endif /* _LINUX_I2C_H */ | 567 | #endif /* _LINUX_I2C_H */ |
