blob: 8fd3126deea6fc611674d08e59a9e47c71bd35ee [file] [log] [blame]
Patrick Georgiac959032020-05-05 22:49:26 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Aamir Bohradd7acaa2020-03-25 11:36:22 +05302
Aamir Bohradd7acaa2020-03-25 11:36:22 +05303#include <intelblocks/spi.h>
4#include <soc/pci_devs.h>
5
6int spi_soc_devfn_to_bus(unsigned int devfn)
7{
8 switch (devfn) {
9 case PCH_DEVFN_SPI:
10 return 0;
11 case PCH_DEVFN_GSPI0:
12 return 1;
13 case PCH_DEVFN_GSPI1:
14 return 2;
15 case PCH_DEVFN_GSPI2:
16 return 3;
17 }
18 return -1;
19}