blob: 4910f1b8c66366490a5bbb530e8f55bea5c478d4 [file] [log] [blame]
Angel Pons230e4f9d2020-04-05 15:47:14 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Lee Leahyac690b12016-05-15 15:12:56 -07002
3#include <console/console.h>
Lee Leahyac690b12016-05-15 15:12:56 -07004#include <device/device.h>
Nico Huber0f2dd1e2017-08-01 14:02:40 +02005#include <device/i2c_simple.h>
Lee Leahyac690b12016-05-15 15:12:56 -07006#include <device/pci.h>
7#include <device/pci_ids.h>
8#include <soc/i2c.h>
9#include <soc/ramstage.h>
10#include <soc/reg_access.h>
11
Elyes HAOUAS696545d2018-05-25 13:11:37 +020012__weak void mainboard_gpio_i2c_init(struct device *dev)
Lee Leahyac690b12016-05-15 15:12:56 -070013{
14 /* Initialize any of the GPIOs or I2C devices */
Elyes HAOUASd67cf182021-01-16 17:33:30 +010015 printk(BIOS_SPEW, "WEAK; %s\n", __func__);
Lee Leahyac690b12016-05-15 15:12:56 -070016}
17
18static struct device_operations device_ops = {
19 .read_resources = pci_dev_read_resources,
20 .set_resources = pci_dev_set_resources,
21 .enable_resources = pci_dev_enable_resources,
22 .init = mainboard_gpio_i2c_init,
23};
24
25static const struct pci_driver gfx_driver __pci_driver = {
26 .ops = &device_ops,
Felix Singer43b7f412022-03-07 04:34:52 +010027 .vendor = PCI_VID_INTEL,
Lee Leahyac690b12016-05-15 15:12:56 -070028 .device = I2CGPIO_DEVID,
29};