]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/samsung/trats2/trats2.c
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / board / samsung / trats2 / trats2.c
index 9552522001cc84a77235fba532b6685ecfebf58c..147de179cc60accfc785aeb9e4f60c1f6b77f2bc 100644 (file)
@@ -118,12 +118,17 @@ static void board_external_gpio_init(void)
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 static void board_init_i2c(void)
 {
+       int err;
+
        gpio1 = (struct exynos4x12_gpio_part1 *)samsung_get_base_gpio_part1();
        gpio2 = (struct exynos4x12_gpio_part2 *)samsung_get_base_gpio_part2();
 
        /* I2C_7 */
-       s5p_gpio_direction_output(&gpio1->d0, 2, 1);
-       s5p_gpio_direction_output(&gpio1->d0, 3, 1);
+       err = exynos_pinmux_config(PERIPH_ID_I2C7, PINMUX_FLAG_NONE);
+       if (err) {
+               debug("I2C%d not configured\n", (I2C_7));
+               return;
+       }
 
        /* I2C_8 */
        s5p_gpio_direction_output(&gpio1->f1, 4, 1);
@@ -135,6 +140,24 @@ static void board_init_i2c(void)
 }
 #endif
 
+#ifdef CONFIG_SYS_I2C_SOFT
+int get_soft_i2c_scl_pin(void)
+{
+       if (I2C_ADAP_HWNR)
+               return exynos4x12_gpio_part2_get_nr(m2, 1); /* I2C9 */
+       else
+               return exynos4x12_gpio_part1_get_nr(f1, 4); /* I2C8 */
+}
+
+int get_soft_i2c_sda_pin(void)
+{
+       if (I2C_ADAP_HWNR)
+               return exynos4x12_gpio_part2_get_nr(m2, 0); /* I2C9 */
+       else
+               return exynos4x12_gpio_part1_get_nr(f1, 5); /* I2C8 */
+}
+#endif
+
 int board_early_init_f(void)
 {
        check_hw_revision();
@@ -170,11 +193,11 @@ int power_init_board(void)
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
        board_init_i2c();
 #endif
-       pmic_init(I2C_0);               /* I2C adapter 0 - bus name I2C_5 */
+       pmic_init(I2C_7);               /* I2C adapter 7 - bus name s3c24x0_7 */
        pmic_init_max77686();
-       pmic_init_max77693(I2C_2);      /* I2C adapter 2 - bus name I2C_10 */
-       power_muic_init(I2C_2);         /* I2C adapter 2 - bus name I2C_10 */
-       power_fg_init(I2C_1);           /* I2C adapter 1 - bus name I2C_9 */
+       pmic_init_max77693(I2C_9);      /* I2C adapter 9 - bus name soft1 */
+       power_muic_init(I2C_9);         /* I2C adapter 9 - bus name soft1 */
+       power_fg_init(I2C_8);           /* I2C adapter 8 - bus name soft0 */
        power_bat_init(0);
 
        p_chrg = pmic_get("MAX77693_PMIC");