diff options
author | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-03-25 15:49:03 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2018-05-22 14:42:16 +0300 |
commit | da0086d018223529c686ef46db039533572418d8 (patch) | |
tree | f4c06cbe7be590bbd50ac3c7013ad77b51aa68e5 /include/linux/i2c.h | |
parent | 04782265641839fcead0383e23e3a799f55085e3 (diff) | |
download | linux-da0086d018223529c686ef46db039533572418d8.tar.xz |
i2c: Export of_i2c_get_board_info()
I3C busses have to know about all I2C devices connected on the I3C bus
to properly initialize the I3C master, and I2C frames can't be sent on
the bus until this initialization is done.
We can't let the I2C core parse the DT and instantiate I2C devices as
part of its i2c_add_adapter() procedure because, when done this way,
I2C devices are directly registered to the device-model and might be
attached to drivers which could in turn start sending frames on the bus,
which won't work since, as said above, the bus is not yet initialized.
Export of_i2c_register_device() in order to let the I3C core parse the
I2C device nodes by itself and initialize the bus.
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r-- | include/linux/i2c.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index aeb655772ef8..254cd34eeae2 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -901,6 +901,9 @@ extern const struct of_device_id *i2c_of_match_device(const struct of_device_id *matches, struct i2c_client *client); +int of_i2c_get_board_info(struct device *dev, struct device_node *node, + struct i2c_board_info *info); + #else static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node) @@ -925,6 +928,13 @@ static inline const struct of_device_id return NULL; } +static inline int of_i2c_get_board_info(struct device *dev, + struct device_node *node, + struct i2c_board_info *info) +{ + return -ENOTSUPP; +} + #endif /* CONFIG_OF */ #if IS_ENABLED(CONFIG_ACPI) |