summaryrefslogtreecommitdiff
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2018-07-11 01:24:22 +0300
committerWolfram Sang <wsa@the-dreams.de>2018-07-17 11:46:51 +0300
commit7ca5f6be7900ca753ed01c0202dc5f998a41f4ee (patch)
tree3648c63c59b230dfcd24f7fef705e77cf90ef39f /include/linux/i2c.h
parent0b71026c69caa10261218528326721828d29a481 (diff)
downloadlinux-7ca5f6be7900ca753ed01c0202dc5f998a41f4ee.tar.xz
i2c: recovery: add get_bus_free callback
Some IP cores have an internal 'bus free' logic which may be more advanced than just checking if SDA is high. Add a separate callback to get this status. Filling it is optional. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 4c4360f94786..bc8d42f8544f 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -587,6 +587,8 @@ struct i2c_timings {
* @set_sda: This sets/clears the SDA line. This or get_sda() is mandatory for
* generic SCL recovery. Populated internally, if sda_gpio is a valid GPIO,
* for generic GPIO recovery.
+ * @get_bus_free: Returns the bus free state as seen from the IP core in case it
+ * has a more complex internal logic than just reading SDA. Optional.
* @prepare_recovery: This will be called before starting recovery. Platform may
* configure padmux here for SDA/SCL line or something else they want.
* @unprepare_recovery: This will be called after completing recovery. Platform
@@ -601,6 +603,7 @@ struct i2c_bus_recovery_info {
void (*set_scl)(struct i2c_adapter *adap, int val);
int (*get_sda)(struct i2c_adapter *adap);
void (*set_sda)(struct i2c_adapter *adap, int val);
+ int (*get_bus_free)(struct i2c_adapter *adap);
void (*prepare_recovery)(struct i2c_adapter *adap);
void (*unprepare_recovery)(struct i2c_adapter *adap);