diff options
author | Simon Glass <sjg@chromium.org> | 2012-04-02 13:19:01 +0000 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2012-05-15 08:31:39 +0200 |
commit | e31c1e50ac8d85ede3f62c438034397ba54734d7 (patch) | |
tree | a79cb7e9ffb14902c2b8a017949598384da807bc /drivers/i2c | |
parent | 1f47efa87a00dd98d61937c7040c8d2590d8b16f (diff) |
tegra: i2c: Add function to find DVC bus
Add tegra_i2c_get_dvc_bus_num() to obtain the I2C bus number of DVC bus.
This allows us to talk to the PMU.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/tegra_i2c.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c index 21f6897269..5b6ea0e759 100644 --- a/drivers/i2c/tegra_i2c.c +++ b/drivers/i2c/tegra_i2c.c @@ -567,3 +567,17 @@ int i2c_set_bus_num(unsigned int bus) return 0; } #endif + +int tegra_i2c_get_dvc_bus_num(void) +{ + int i; + + for (i = 0; i < CONFIG_SYS_MAX_I2C_BUS; i++) { + struct i2c_bus *bus = &i2c_controllers[i]; + + if (bus->inited && bus->is_dvc) + return i; + } + + return -1; +} |