From 3ded9c10e32eb780070ca8412fb57818b73d3b50 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 3 Oct 2011 13:10:33 -0700 Subject: tegra3: i2c: Add low level functions for T30 We need these functions to set up the power chip during low-level init. BUG=chromium-os:21033 TEST=build and boot on Seaboard Change-Id: I69b9d3c12581e0a71db39b031b9ea2ef4ec184bf Reviewed-on: http://gerrit.chromium.org/gerrit/8696 Reviewed-by: Che-Liang Chiou Tested-by: Simon Glass --- drivers/i2c/tegra_i2c.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'drivers') diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c index c51dd90692..3a94116831 100644 --- a/drivers/i2c/tegra_i2c.c +++ b/drivers/i2c/tegra_i2c.c @@ -32,6 +32,9 @@ #include #include +/* TODO(sjg): This driver has not been tested with Tegra3 yet */ +#ifdef CONFIG_TEGRA2 + DECLARE_GLOBAL_DATA_PTR; static unsigned int i2c_bus_num; @@ -623,3 +626,30 @@ int i2c_set_bus_num(unsigned int bus) return 0; } #endif + +#else /* not CONFIG_TEGRA2 */ + +/* Not implemented for now */ +int i2c_init_board(void) +{ + printf("i2c support is not available on T30\n"); + return -1; +} + +#endif /* CONFIG_TEGRA2 */ + +void tegra_i2c_ll_write_addr(uint addr, uint config) +{ + struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE; + + writel(addr, ®->cmd_addr0); + writel(config, ®->cnfg); +} + +void tegra_i2c_ll_write_data(uint data, uint config) +{ + struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE; + + writel(data, ®->cmd_data1); + writel(config, ®->cnfg); +} -- cgit v1.2.3