blob: 4fce987540d150f0fa9b56f181deb6a6c89a5194 [file] [log] [blame]
Łukasz Majewskib2d76522012-09-04 23:15:20 +00001/*
2 * Copyright (C) 2012 Samsung Electronics
3 * Lukasz Majewski <l.majewski@samsung.com>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Łukasz Majewskib2d76522012-09-04 23:15:20 +00006 */
7
8#include <common.h>
9#include <i2c.h>
10
11/* Handle multiple I2C buses instances */
12int get_multi_scl_pin(void)
13{
14 unsigned int bus = I2C_GET_BUS();
15
16 switch (bus) {
17 case I2C_0: /* I2C_0 definition - compatibility layer */
18 case I2C_5:
19 return CONFIG_SOFT_I2C_I2C5_SCL;
20 case I2C_9:
21 return CONFIG_SOFT_I2C_I2C9_SCL;
22 default:
23 printf("I2C_%d not supported!\n", bus);
24 };
25
26 return 0;
27}
28
29int get_multi_sda_pin(void)
30{
31 unsigned int bus = I2C_GET_BUS();
32
33 switch (bus) {
34 case I2C_0: /* I2C_0 definition - compatibility layer */
35 case I2C_5:
36 return CONFIG_SOFT_I2C_I2C5_SDA;
37 case I2C_9:
38 return CONFIG_SOFT_I2C_I2C9_SDA;
39 default:
40 printf("I2C_%d not supported!\n", bus);
41 };
42
43 return 0;
44}
45
46int multi_i2c_init(void)
47{
48 return 0;
49}