This allows drivers to lookup i2c adapters on ACPI based systems similar to of_get_i2c_adapter_by_node() with DT based systems.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -14,6 +14,7 @@ · 13 unmodified lines | |||
| 14 | #ifndef _LINUX_I2C_H | 14 | #ifndef _LINUX_I2C_H |
| 15 | #define _LINUX_I2C_H | 15 | #define _LINUX_I2C_H |
| 16 | 16 | ||
| 17 | #include <linux/acpi.h> /* for acpi_handle */ | ||
| 17 | #include <linux/mod_devicetable.h> | 18 | #include <linux/mod_devicetable.h> |
| 18 | #include <linux/device.h> /* for struct device */ | 19 | #include <linux/device.h> /* for struct device */ |
| 19 | #include <linux/sched.h> /* for completion */ | 20 | #include <linux/sched.h> /* for completion */ |
| @@ -981,6 +982,7 @@ bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares, · 961 unmodified lines | |||
| 981 | u32 i2c_acpi_find_bus_speed(struct device *dev); | 982 | u32 i2c_acpi_find_bus_speed(struct device *dev); |
| 982 | struct i2c_client *i2c_acpi_new_device(struct device *dev, int index, | 983 | struct i2c_client *i2c_acpi_new_device(struct device *dev, int index, |
| 983 | struct i2c_board_info *info); | 984 | struct i2c_board_info *info); |
| 985 | struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle); | ||
| 984 | #else | 986 | #else |
| 985 | static inline bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares, | 987 | static inline bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares, |
| 986 | struct acpi_resource_i2c_serialbus **i2c) | 988 | struct acpi_resource_i2c_serialbus **i2c) |
| @@ -996,6 +998,10 @@ static inline struct i2c_client *i2c_acpi_new_device(struct device *dev, · 9 unmodified lines | |||
| 996 | { | 998 | { |
| 997 | return NULL; | 999 | return NULL; |
| 998 | } | 1000 | } |
| 1001 | static inline struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle) | ||
| 1002 | { | ||
| 1003 | return NULL; | ||
| 1004 | } | ||
| 999 | #endif /* CONFIG_ACPI */ | 1005 | #endif /* CONFIG_ACPI */ |
| 1000 | 1006 | ||
| 1001 | #endif /* _LINUX_I2C_H */ | 1007 | #endif /* _LINUX_I2C_H */ |