summaryrefslogtreecommitdiff
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2021-08-03 18:00:41 +0200
committerHans de Goede <hdegoede@redhat.com>2021-08-12 17:26:24 +0200
commit20a1b3acfc802ad7b6b327f2bdc0570711538561 (patch)
treea94f8a0ceaee67e54cbb134f01fef1f79ec89d3f /include/linux/i2c.h
parent382b91db8044669d254006df799df9d85d4ad891 (diff)
i2c: acpi: Add an i2c_acpi_client_count() helper function
We have 3 files now which have the need to count the number of I2cSerialBus resources in an ACPI-device's resource-list. Currently all implement their own helper function for this, add a generic helper function to replace the 3 implementations. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210803160044.158802-2-hdegoede@redhat.com Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 3eb60a2e9e61..2ce3efbe9198 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -1010,6 +1010,7 @@ struct acpi_resource_i2c_serialbus;
#if IS_ENABLED(CONFIG_ACPI)
bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
struct acpi_resource_i2c_serialbus **i2c);
+int i2c_acpi_client_count(struct acpi_device *adev);
u32 i2c_acpi_find_bus_speed(struct device *dev);
struct i2c_client *i2c_acpi_new_device(struct device *dev, int index,
struct i2c_board_info *info);
@@ -1020,6 +1021,10 @@ static inline bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
{
return false;
}
+static inline int i2c_acpi_client_count(struct acpi_device *adev)
+{
+ return 0;
+}
static inline u32 i2c_acpi_find_bus_speed(struct device *dev)
{
return 0;