blob: adb9c2f800427f5153cc97304301fcbcb3963f40 [file] [log] [blame]
Lee Leahyac690b12016-05-15 15:12:56 -07001/*
2 * This file is part of the coreboot project.
3 *
Lee Leahyac690b12016-05-15 15:12:56 -07004 *
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 Leahyac690b12016-05-15 15:12:56 -070016#include <device/device.h>
Nico Huber0f2dd1e2017-08-01 14:02:40 +020017#include <device/i2c_simple.h>
Lee Leahyac690b12016-05-15 15:12:56 -070018#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 HAOUAS696545d2018-05-25 13:11:37 +020024__weak void mainboard_gpio_i2c_init(struct device *dev)
Lee Leahyac690b12016-05-15 15:12:56 -070025{
26 /* Initialize any of the GPIOs or I2C devices */
27 printk(BIOS_SPEW, "WEAK; mainboard_gpio_i2c_init\n");
28}
29
30static 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
37static const struct pci_driver gfx_driver __pci_driver = {
38 .ops = &device_ops,
39 .vendor = PCI_VENDOR_ID_INTEL,
40 .device = I2CGPIO_DEVID,
41};