soc/intel/pantherlake: Remove soc_info.[hc] interface
[coreboot2.git] / src / soc / intel / skylake / i2c.c
blob521fcb0dd7efad50be5508483141b177bcf52149
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/device.h>
4 #include <intelblocks/cfg.h>
5 #include <drivers/i2c/designware/dw_i2c.h>
6 #include <soc/pci_devs.h>
8 int dw_i2c_soc_devfn_to_bus(unsigned int devfn)
10 switch (devfn) {
11 case PCH_DEVFN_I2C0:
12 return 0;
13 case PCH_DEVFN_I2C1:
14 return 1;
15 case PCH_DEVFN_I2C2:
16 return 2;
17 case PCH_DEVFN_I2C3:
18 return 3;
19 case PCH_DEVFN_I2C4:
20 return 4;
21 case PCH_DEVFN_I2C5:
22 return 5;
24 return -1;
27 int dw_i2c_soc_bus_to_devfn(unsigned int bus)
29 switch (bus) {
30 case 0:
31 return PCH_DEVFN_I2C0;
32 case 1:
33 return PCH_DEVFN_I2C1;
34 case 2:
35 return PCH_DEVFN_I2C2;
36 case 3:
37 return PCH_DEVFN_I2C3;
38 case 4:
39 return PCH_DEVFN_I2C4;
40 case 5:
41 return PCH_DEVFN_I2C5;
43 return -1;