diff options
author | Troy Kisky <troy.kisky@boundarydevices.com> | 2012-07-19 08:18:20 +0000 |
---|---|---|
committer | Heiko Schocher <hs@denx.de> | 2012-07-31 07:59:41 +0200 |
commit | 9815326d043b08f7ad355e53b8b7027634507879 (patch) | |
tree | c6749349ddd605fb157b945a4238f4155e9cd190 /drivers/i2c/mxc_i2c.c | |
parent | 96c19bd3ef45394acd846d561657bba4c1dc613f (diff) | |
download | u-boot-imx-9815326d043b08f7ad355e53b8b7027634507879.zip u-boot-imx-9815326d043b08f7ad355e53b8b7027634507879.tar.gz u-boot-imx-9815326d043b08f7ad355e53b8b7027634507879.tar.bz2 |
mxc_i2c: finish adding CONFIG_I2C_MULTI_BUS support
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Diffstat (limited to 'drivers/i2c/mxc_i2c.c')
-rw-r--r-- | drivers/i2c/mxc_i2c.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index c00ead1..73d8958 100644 --- a/drivers/i2c/mxc_i2c.c +++ b/drivers/i2c/mxc_i2c.c @@ -416,6 +416,23 @@ static int i2c_idle_bus(void *base) return 0; } +#ifdef CONFIG_I2C_MULTI_BUS +unsigned int i2c_get_bus_num(void) +{ + return srdata.curr_i2c_bus; +} + +int i2c_set_bus_num(unsigned bus_idx) +{ + if (bus_idx >= ARRAY_SIZE(srdata.i2c_data)) + return -1; + if (!srdata.i2c_data[bus_idx].base) + return -1; + srdata.curr_i2c_bus = bus_idx; + return 0; +} +#endif + int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len) { return bus_i2c_read(get_base(), chip, addr, alen, buf, len); |