mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
i2c: core: helper function to detect slave mode
This function has the purpose of mode detection by checking the device nodes for a reg matching with the I2C_OWN_SLAVE_ADDREESS flag. Currently only checks using OF functions (ACPI slave not supported yet). Signed-off-by: Luis Oliveira <lolivei@synopsys.com> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
50b918c5a6
commit
cefae80249
2 changed files with 34 additions and 0 deletions
|
@ -282,6 +282,7 @@ enum i2c_slave_event {
|
|||
|
||||
extern int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb);
|
||||
extern int i2c_slave_unregister(struct i2c_client *client);
|
||||
extern bool i2c_detect_slave_mode(struct device *dev);
|
||||
|
||||
static inline int i2c_slave_event(struct i2c_client *client,
|
||||
enum i2c_slave_event event, u8 *val)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue