blob: 084858defa39e1da3cbdc853397fa77688edfae7 [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{
Łukasz Majewskide55e752013-08-16 15:33:33 +020014 unsigned int bus = i2c_get_bus_num();
Łukasz Majewskib2d76522012-09-04 23:15:20 +000015
16 switch (bus) {
Łukasz Majewskide55e752013-08-16 15:33:33 +020017 case I2C_0:
Łukasz Majewskib2d76522012-09-04 23:15:20 +000018 return CONFIG_SOFT_I2C_I2C5_SCL;
Łukasz Majewskide55e752013-08-16 15:33:33 +020019 case I2C_1:
Łukasz Majewskib2d76522012-09-04 23:15:20 +000020 return CONFIG_SOFT_I2C_I2C9_SCL;
21 default:
22 printf("I2C_%d not supported!\n", bus);
23 };
24
25 return 0;
26}
27
28int get_multi_sda_pin(void)
29{
Łukasz Majewskide55e752013-08-16 15:33:33 +020030 unsigned int bus = i2c_get_bus_num();
Łukasz Majewskib2d76522012-09-04 23:15:20 +000031
32 switch (bus) {
Łukasz Majewskide55e752013-08-16 15:33:33 +020033 case I2C_0:
Łukasz Majewskib2d76522012-09-04 23:15:20 +000034 return CONFIG_SOFT_I2C_I2C5_SDA;
Łukasz Majewskide55e752013-08-16 15:33:33 +020035 case I2C_1:
Łukasz Majewskib2d76522012-09-04 23:15:20 +000036 return CONFIG_SOFT_I2C_I2C9_SDA;
37 default:
38 printf("I2C_%d not supported!\n", bus);
39 };
40
41 return 0;
42}
43
44int multi_i2c_init(void)
45{
46 return 0;
47}