summaryrefslogtreecommitdiff
path: root/board/nvidia/cardhu/cardhu.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-12-10 08:55:57 -0700
committerSimon Glass <sjg@chromium.org>2014-12-11 13:18:44 -0700
commitb0e6ef46405353270595ffa35c21f4334c541189 (patch)
tree919f435acfe6b7276e465deecdc777631155f158 /board/nvidia/cardhu/cardhu.c
parenta6c7b461814028870697182d19383ef5b370c257 (diff)
downloadu-boot-imx-b0e6ef46405353270595ffa35c21f4334c541189.zip
u-boot-imx-b0e6ef46405353270595ffa35c21f4334c541189.tar.gz
u-boot-imx-b0e6ef46405353270595ffa35c21f4334c541189.tar.bz2
dm: i2c: tegra: Convert to driver model
This converts all Tegra boards over to use driver model for I2C. The driver is adjusted to use driver model and the following obsolete CONFIGs are removed: - CONFIG_SYS_I2C_INIT_BOARD - CONFIG_I2C_MULTI_BUS - CONFIG_SYS_MAX_I2C_BUS - CONFIG_SYS_I2C_SPEED - CONFIG_SYS_I2C This has been tested on: - trimslice (no I2C) - beaver - Jetson-TK1 It has not been tested on Tegra 114 as I don't have that board. Acked-by: Heiko Schocher <hs@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/nvidia/cardhu/cardhu.c')
-rw-r--r--board/nvidia/cardhu/cardhu.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/board/nvidia/cardhu/cardhu.c b/board/nvidia/cardhu/cardhu.c
index cc0e5e1..026f45c 100644
--- a/board/nvidia/cardhu/cardhu.c
+++ b/board/nvidia/cardhu/cardhu.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <dm.h>
#include <asm/arch/pinmux.h>
#include <asm/arch/gp_padctrl.h>
#include "pinmux-config-cardhu.h"
@@ -37,17 +38,23 @@ void pinmux_init(void)
*/
void board_sdmmc_voltage_init(void)
{
+ struct udevice *dev;
uchar reg, data_buffer[1];
+ int ret;
int i;
- i2c_set_bus_num(0); /* PMU is on bus 0 */
+ ret = i2c_get_chip_for_busnum(0, PMU_I2C_ADDRESS, &dev);
+ if (ret) {
+ debug("%s: Cannot find PMIC I2C chip\n", __func__);
+ return;
+ }
/* TPS659110: LDO5_REG = 3.3v, ACTIVE to SDMMC1 */
data_buffer[0] = 0x65;
reg = 0x32;
for (i = 0; i < MAX_I2C_RETRY; ++i) {
- if (i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1))
+ if (i2c_write(dev, reg, data_buffer, 1))
udelay(100);
}
@@ -56,7 +63,7 @@ void board_sdmmc_voltage_init(void)
reg = 0x67;
for (i = 0; i < MAX_I2C_RETRY; ++i) {
- if (i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1))
+ if (i2c_write(dev, reg, data_buffer, 1))
udelay(100);
}
}