summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-01-25 08:26:55 -0700
committerSimon Glass <sjg@chromium.org>2015-01-29 17:09:53 -0700
commit25ab4b0303f2df5e6b94ed92e37875a7c98f4de3 (patch)
treef8fecc4b22da4c7fe5c4e6d6a6623459e255af47 /include
parent73845350b6281a7afeeb279475e6eb613d7a89f9 (diff)
downloadblackbird-obmc-uboot-25ab4b0303f2df5e6b94ed92e37875a7c98f4de3.tar.gz
blackbird-obmc-uboot-25ab4b0303f2df5e6b94ed92e37875a7c98f4de3.zip
dm: i2c: Provide an offset length parameter where needed
Rather than assuming that the chip offset length is 1, allow it to be provided. This allows chips that don't use the default offset length to be used (at present they are only supported by the command line 'i2c' command which sets the offset length explicitly). Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'include')
-rw-r--r--include/i2c.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/i2c.h b/include/i2c.h
index 47529f4b28..76090b7a93 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -388,10 +388,12 @@ struct dm_i2c_ops {
*
* @bus: Bus to examine
* @chip_addr: Chip address for the new device
+ * @offset_len: Length of a register offset in bytes (normally 1)
* @devp: Returns pointer to new device if found or -ENODEV if not
* found
*/
-int i2c_get_chip(struct udevice *bus, uint chip_addr, struct udevice **devp);
+int i2c_get_chip(struct udevice *bus, uint chip_addr, uint offset_len,
+ struct udevice **devp);
/**
* i2c_get_chip() - get a device to use to access a chip on a bus number
@@ -401,10 +403,12 @@ int i2c_get_chip(struct udevice *bus, uint chip_addr, struct udevice **devp);
*
* @busnum: Bus number to examine
* @chip_addr: Chip address for the new device
+ * @offset_len: Length of a register offset in bytes (normally 1)
* @devp: Returns pointer to new device if found or -ENODEV if not
* found
*/
-int i2c_get_chip_for_busnum(int busnum, int chip_addr, struct udevice **devp);
+int i2c_get_chip_for_busnum(int busnum, int chip_addr, uint offset_len,
+ struct udevice **devp);
/**
* i2c_chip_ofdata_to_platdata() - Decode standard I2C platform data
OpenPOWER on IntegriCloud