blob: 498dd96a2a2d63a7484ef636949cd19e998390b1 [file] [log] [blame]
Angel Pons230e4f9d2020-04-05 15:47:14 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Lee Leahyac690b12016-05-15 15:12:56 -07003
4#include <console/console.h>
Lee Leahyac690b12016-05-15 15:12:56 -07005#include <device/device.h>
Nico Huber0f2dd1e2017-08-01 14:02:40 +02006#include <device/i2c_simple.h>
Lee Leahyac690b12016-05-15 15:12:56 -07007#include <device/pci.h>
8#include <device/pci_ids.h>
9#include <soc/i2c.h>
10#include <soc/ramstage.h>
11#include <soc/reg_access.h>
12
Elyes HAOUAS696545d2018-05-25 13:11:37 +020013__weak void mainboard_gpio_i2c_init(struct device *dev)
Lee Leahyac690b12016-05-15 15:12:56 -070014{
15 /* Initialize any of the GPIOs or I2C devices */
16 printk(BIOS_SPEW, "WEAK; mainboard_gpio_i2c_init\n");
17}
18
19static struct device_operations device_ops = {
20 .read_resources = pci_dev_read_resources,
21 .set_resources = pci_dev_set_resources,
22 .enable_resources = pci_dev_enable_resources,
23 .init = mainboard_gpio_i2c_init,
24};
25
26static const struct pci_driver gfx_driver __pci_driver = {
27 .ops = &device_ops,
28 .vendor = PCI_VENDOR_ID_INTEL,
29 .device = I2CGPIO_DEVID,
30};