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