summaryrefslogtreecommitdiff
path: root/board/samsung/trats
diff options
context:
space:
mode:
authorƁukasz Majewski <l.majewski@samsung.com>2013-08-16 15:33:33 +0200
committerHeiko Schocher <hs@denx.de>2013-08-20 11:15:32 +0200
commit2936df1f1183f0bb884489e993a0381c3f179ea6 (patch)
treea9d1f8926d7fa5f38d1718825c79f9faf8c5d3a3 /board/samsung/trats
parentea0f73abb1afbf5bb4bf34f5a5eeb7896111df97 (diff)
i2c:samsung: Adjust Trats, GONI and Universal_c210 boards to work with new I2C framework
New I2C framework, introduced after v2013.07 final release, imposed I2C code adjustment for some Samsung boards - namely Trats, GONI and Universal_c210. Those boards were using schematic based I2C enumeration (I2C_5, I2C_9). However, new I2C framework imposes usage of logical I2C adapters numbering (e.g. I2C_0, I2C_1, etc). Additionally, I2C_GET_* macros were replaced with i2c_*_bus_num() functions. Trats board gained definition of second soft I2C adapter. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'board/samsung/trats')
-rw-r--r--board/samsung/trats/trats.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index c8698f30df8..7f61d17abb2 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -61,10 +61,10 @@ void i2c_init_board(void)
struct exynos4_gpio_part2 *gpio2 =
(struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2();
- /* I2C_5 -> PMIC */
+ /* I2C_5 -> PMIC -> Adapter 0 */
s5p_gpio_direction_output(&gpio1->b, 7, 1);
s5p_gpio_direction_output(&gpio1->b, 6, 1);
- /* I2C_9 -> FG */
+ /* I2C_9 -> FG -> Adapter 1 */
s5p_gpio_direction_output(&gpio2->y4, 0, 1);
s5p_gpio_direction_output(&gpio2->y4, 1, 1);
}
@@ -282,10 +282,17 @@ int power_init_board(void)
struct power_battery *pb;
struct pmic *p_fg, *p_chrg, *p_muic, *p_bat;
- ret = pmic_init(I2C_5);
+ /*
+ * For PMIC/MUIC the I2C bus is named as I2C5, but it is connected
+ * to logical I2C adapter 0
+ *
+ * The FUEL_GAUGE is marked as I2C9 on the schematic, but connected
+ * to logical I2C adapter 1
+ */
+ ret = pmic_init(I2C_0);
ret |= pmic_init_max8997();
- ret |= power_fg_init(I2C_9);
- ret |= power_muic_init(I2C_5);
+ ret |= power_fg_init(I2C_1);
+ ret |= power_muic_init(I2C_0);
ret |= power_bat_init(0);
if (ret)
return ret;