X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=include%2Flinux%2Fi2c.h;h=5b4a3cbe5d7dc8a855f71f0db2f2b902bf2f438b;hb=5853b22d96fa786365ff11fe9f008a68a533f043;hp=fffdc270ca18518f4e3c05b5efd2749f52b28f50;hpb=574c7e233344b58c6b14b305c93de361d3e7d35d;p=cascardo%2Flinux.git diff --git a/include/linux/i2c.h b/include/linux/i2c.h index fffdc270ca18..5b4a3cbe5d7d 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -600,6 +600,20 @@ i2c_lock_bus(struct i2c_adapter *adapter, unsigned int flags) adapter->lock_bus(adapter, flags); } +/** + * i2c_trylock_bus - Try to get exclusive access to an I2C bus segment + * @adapter: Target I2C bus segment + * @flags: I2C_LOCK_ROOT_ADAPTER tries to locks the root i2c adapter, + * I2C_LOCK_SEGMENT tries to lock only this branch in the adapter tree + * + * Return: true if the I2C bus segment is locked, false otherwise + */ +static inline int +i2c_trylock_bus(struct i2c_adapter *adapter, unsigned int flags) +{ + return adapter->trylock_bus(adapter, flags); +} + /** * i2c_unlock_bus - Release exclusive access to an I2C bus segment * @adapter: Target I2C bus segment @@ -766,4 +780,13 @@ static inline struct i2c_adapter *of_get_i2c_adapter_by_node(struct device_node } #endif /* CONFIG_OF */ +#if IS_ENABLED(CONFIG_ACPI) +u32 i2c_acpi_find_bus_speed(struct device *dev); +#else +static inline u32 i2c_acpi_find_bus_speed(struct device *dev) +{ + return 0; +} +#endif /* CONFIG_ACPI */ + #endif /* _LINUX_I2C_H */