Angel Pons | 230e4f9d | 2020-04-05 15:47:14 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Lee Leahy | ac690b1 | 2016-05-15 15:12:56 -0700 | [diff] [blame] | 3 | |
| 4 | #include <console/console.h> |
Lee Leahy | ac690b1 | 2016-05-15 15:12:56 -0700 | [diff] [blame] | 5 | #include <device/device.h> |
Nico Huber | 0f2dd1e | 2017-08-01 14:02:40 +0200 | [diff] [blame] | 6 | #include <device/i2c_simple.h> |
Lee Leahy | ac690b1 | 2016-05-15 15:12:56 -0700 | [diff] [blame] | 7 | #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 HAOUAS | 696545d | 2018-05-25 13:11:37 +0200 | [diff] [blame] | 13 | __weak void mainboard_gpio_i2c_init(struct device *dev) |
Lee Leahy | ac690b1 | 2016-05-15 15:12:56 -0700 | [diff] [blame] | 14 | { |
| 15 | /* Initialize any of the GPIOs or I2C devices */ |
| 16 | printk(BIOS_SPEW, "WEAK; mainboard_gpio_i2c_init\n"); |
| 17 | } |
| 18 | |
| 19 | static 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 | |
| 26 | static const struct pci_driver gfx_driver __pci_driver = { |
| 27 | .ops = &device_ops, |
| 28 | .vendor = PCI_VENDOR_ID_INTEL, |
| 29 | .device = I2CGPIO_DEVID, |
| 30 | }; |