Lee Leahy | ac690b1 | 2016-05-15 15:12:56 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Lee Leahy | ac690b1 | 2016-05-15 15:12:56 -0700 | [diff] [blame] | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; version 2 of the License. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | */ |
| 14 | |
| 15 | #include <console/console.h> |
Lee Leahy | ac690b1 | 2016-05-15 15:12:56 -0700 | [diff] [blame] | 16 | #include <device/device.h> |
Nico Huber | 0f2dd1e | 2017-08-01 14:02:40 +0200 | [diff] [blame] | 17 | #include <device/i2c_simple.h> |
Lee Leahy | ac690b1 | 2016-05-15 15:12:56 -0700 | [diff] [blame] | 18 | #include <device/pci.h> |
| 19 | #include <device/pci_ids.h> |
| 20 | #include <soc/i2c.h> |
| 21 | #include <soc/ramstage.h> |
| 22 | #include <soc/reg_access.h> |
| 23 | |
Elyes HAOUAS | 696545d | 2018-05-25 13:11:37 +0200 | [diff] [blame] | 24 | __weak void mainboard_gpio_i2c_init(struct device *dev) |
Lee Leahy | ac690b1 | 2016-05-15 15:12:56 -0700 | [diff] [blame] | 25 | { |
| 26 | /* Initialize any of the GPIOs or I2C devices */ |
| 27 | printk(BIOS_SPEW, "WEAK; mainboard_gpio_i2c_init\n"); |
| 28 | } |
| 29 | |
| 30 | static struct device_operations device_ops = { |
| 31 | .read_resources = pci_dev_read_resources, |
| 32 | .set_resources = pci_dev_set_resources, |
| 33 | .enable_resources = pci_dev_enable_resources, |
| 34 | .init = mainboard_gpio_i2c_init, |
| 35 | }; |
| 36 | |
| 37 | static const struct pci_driver gfx_driver __pci_driver = { |
| 38 | .ops = &device_ops, |
| 39 | .vendor = PCI_VENDOR_ID_INTEL, |
| 40 | .device = I2CGPIO_DEVID, |
| 41 | }; |