]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/samsung/common/multi_i2c.c
karo: fdt: fix panel-dpi support
[karo-tx-uboot.git] / board / samsung / common / multi_i2c.c
1 /*
2  *  Copyright (C) 2012 Samsung Electronics
3  *  Lukasz Majewski <l.majewski@samsung.com>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <common.h>
9 #include <i2c.h>
10
11 #ifndef CONFIG_SOFT_I2C_I2C10_SCL
12 #define CONFIG_SOFT_I2C_I2C10_SCL 0
13 #endif
14
15 #ifndef CONFIG_SOFT_I2C_I2C10_SDA
16 #define CONFIG_SOFT_I2C_I2C10_SDA 0
17 #endif
18
19 /* Handle multiple I2C buses instances */
20 int get_multi_scl_pin(void)
21 {
22         unsigned int bus = i2c_get_bus_num();
23
24         switch (bus) {
25         case I2C_0:
26                 return CONFIG_SOFT_I2C_I2C5_SCL;
27         case I2C_1:
28                 return CONFIG_SOFT_I2C_I2C9_SCL;
29         case I2C_2:
30                 return CONFIG_SOFT_I2C_I2C10_SCL;
31         default:
32                 printf("I2C_%d not supported!\n", bus);
33         };
34
35         return 0;
36 }
37
38 int get_multi_sda_pin(void)
39 {
40         unsigned int bus = i2c_get_bus_num();
41
42         switch (bus) {
43         case I2C_0:
44                 return CONFIG_SOFT_I2C_I2C5_SDA;
45         case I2C_1:
46                 return CONFIG_SOFT_I2C_I2C9_SDA;
47         case I2C_2:
48                 return CONFIG_SOFT_I2C_I2C10_SDA;
49         default:
50                 printf("I2C_%d not supported!\n", bus);
51         };
52
53         return 0;
54 }
55
56 int multi_i2c_init(void)
57 {
58         return 0;
59 }