coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
i2c.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <
device/device.h
>
4
#include <
intelblocks/cfg.h
>
5
#include <
drivers/i2c/designware/dw_i2c.h
>
6
#include <soc/pci_devs.h>
7
8
int
dw_i2c_soc_devfn_to_bus
(
unsigned
int
devfn)
9
{
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;
23
}
24
return
-1;
25
}
26
27
int
dw_i2c_soc_bus_to_devfn
(
unsigned
int
bus
)
28
{
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
;
42
}
43
return
-1;
44
}
dw_i2c.h
device.h
dw_i2c_soc_bus_to_devfn
int dw_i2c_soc_bus_to_devfn(unsigned int bus)
Definition:
i2c.c:36
dw_i2c_soc_devfn_to_bus
int dw_i2c_soc_devfn_to_bus(unsigned int devfn)
Definition:
i2c.c:13
PCH_DEVFN_I2C5
#define PCH_DEVFN_I2C5
Definition:
pci_devs.h:163
PCH_DEVFN_I2C0
#define PCH_DEVFN_I2C0
Definition:
pci_devs.h:134
PCH_DEVFN_I2C3
#define PCH_DEVFN_I2C3
Definition:
pci_devs.h:137
PCH_DEVFN_I2C4
#define PCH_DEVFN_I2C4
Definition:
pci_devs.h:162
PCH_DEVFN_I2C2
#define PCH_DEVFN_I2C2
Definition:
pci_devs.h:136
PCH_DEVFN_I2C1
#define PCH_DEVFN_I2C1
Definition:
pci_devs.h:135
cfg.h
bus
Definition:
device.h:76
src
soc
intel
skylake
i2c.c
Generated by
1.9.1