From 01501804fdab0c80e31d1aa221d8afb79d436e52 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 4 May 2015 11:30:58 -0600 Subject: dm: i2c: Add a function to find out the chip offset length We can currently set this but there is no API function to get it. Add one. Signed-off-by: Simon Glass Reviewed-by: Joe Hershberger Acked-by: Heiko Schocher --- drivers/i2c/i2c-uclass.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers') diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c index b8eb2d6..eaba965 100644 --- a/drivers/i2c/i2c-uclass.c +++ b/drivers/i2c/i2c-uclass.c @@ -415,6 +415,13 @@ int i2c_set_chip_offset_len(struct udevice *dev, uint offset_len) return 0; } +int i2c_get_chip_offset_len(struct udevice *dev) +{ + struct dm_i2c_chip *chip = dev_get_parent_platdata(dev); + + return chip->offset_len; +} + int i2c_deblock(struct udevice *bus) { struct dm_i2c_ops *ops = i2c_get_ops(bus); -- cgit v1.1