blob: d5543b803cfb9de58f1588616664fd2c4a0d28c2 [file] [log] [blame]
Lee Leahyac690b12016-05-15 15:12:56 -07001/*
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 Huber0f2dd1e2017-08-01 14:02:40 +020019#include <device/i2c_simple.h>
Lee Leahyac690b12016-05-15 15:12:56 -070020#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 Leahyac690b12016-05-15 15:12:56 -070026__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
32static 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
39static const struct pci_driver gfx_driver __pci_driver = {
40 .ops = &device_ops,
41 .vendor = PCI_VENDOR_ID_INTEL,
42 .device = I2CGPIO_DEVID,
43};