summaryrefslogtreecommitdiffstats
path: root/include/i2c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-09-09 22:08:39 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-09-14 11:47:41 +0200
commit75265ae5272213afeebcc06aea66a37a63d10686 (patch)
tree6fa03aab03f52bcc5702a3ee76ba1b249c5cfe6d /include/i2c
parent617bfbcbeb3a278c76ab53e76b4fb7a086255a1e (diff)
downloadbarebox-75265ae5272213afeebcc06aea66a37a63d10686.tar.gz
barebox-75265ae5272213afeebcc06aea66a37a63d10686.tar.xz
I2C: Put I2C devices on their own bus
This patch adds a I2C bus on which the I2C devices and drivers register. This makes it cleaner as I2C devices won't accidently end up probed by a platform_device driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/i2c')
-rw-r--r--include/i2c/i2c.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h
index c3e176354d..de2a7ea27d 100644
--- a/include/i2c/i2c.h
+++ b/include/i2c/i2c.h
@@ -139,4 +139,12 @@ extern int i2c_write_reg(struct i2c_client *client, u32 addr, const u8 *buf, u16
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+extern struct bus_type i2c_bus;
+
+static inline int i2c_register_driver(struct driver_d *drv)
+{
+ drv->bus = &i2c_bus;
+ return register_driver(drv);
+}
+
#endif /* I2C_I2C_H */