mb/google/brya/var/orisa: Update Type C DisplayPort HPD Configuration
[coreboot2.git] / src / soc / intel / pantherlake / i2c.c
blob50ab4a73eb456549324b094dbdb2807fe24f2f32
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/device.h>
4 #include <drivers/i2c/designware/dw_i2c.h>
5 #include <soc/pci_devs.h>
7 int dw_i2c_soc_devfn_to_bus(unsigned int devfn)
9 switch (devfn) {
10 case PCI_DEVFN_I2C0:
11 return 0;
12 case PCI_DEVFN_I2C1:
13 return 1;
14 case PCI_DEVFN_I2C2:
15 return 2;
16 case PCI_DEVFN_I2C3:
17 return 3;
18 case PCI_DEVFN_I2C4:
19 return 4;
20 case PCI_DEVFN_I2C5:
21 return 5;
23 return -1;
26 int dw_i2c_soc_bus_to_devfn(unsigned int bus)
28 switch (bus) {
29 case 0:
30 return PCI_DEVFN_I2C0;
31 case 1:
32 return PCI_DEVFN_I2C1;
33 case 2:
34 return PCI_DEVFN_I2C2;
35 case 3:
36 return PCI_DEVFN_I2C3;
37 case 4:
38 return PCI_DEVFN_I2C4;
39 case 5:
40 return PCI_DEVFN_I2C5;
42 return -1;