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